/* Minification failed. Returning unminified contents.
(6,1): run-time error CSS1019: Unexpected token, found '('
(6,2): run-time error CSS1019: Unexpected token, found 'function('
(6,16): run-time error CSS1031: Expected selector, found ')'
(6,16): run-time error CSS1025: Expected comma or open brace, found ')'
(191,268): run-time error CSS1019: Unexpected token, found ','
(191,271): run-time error CSS1031: Expected selector, found '='
(191,271): run-time error CSS1025: Expected comma or open brace, found '='
(192): Scanner error CSS1002: Unterminated string: ',?\n/,Ka=$.$interpolateMinErr=I("$interpolate");Ka.throwNoconcat=function(a){throw Ka("noconcat",a);};Ka.interr=function(a,c){return Ka("interr",a,c.toString())};var ng=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,Sf={http:80,https:443,
(193,364): run-time error CSS1019: Unexpected token, found 'n('
(193,369): run-time error CSS1033: Expected closing bracket, found ','
(193,375): run-time error CSS1031: Expected selector, found ']'
(193,375): run-time error CSS1025: Expected comma or open brace, found ']'
(194,39): run-time error CSS1019: Unexpected token, found ')'
(194,47): run-time error CSS1031: Expected selector, found '='
(194,47): run-time error CSS1025: Expected comma or open brace, found '='
(194,150): run-time error CSS1019: Unexpected token, found 'n('
(194,152): run-time error CSS1019: Unexpected token, found '"+ - * / % === !== == != < > <= >= && || ! = |"'
(194,200): run-time error CSS1030: Expected identifier, found 'split('
(194,200): run-time error CSS1019: Unexpected token, found 'split('
(194,206): run-time error CSS1019: Unexpected token, found '" "'
(194,209): run-time error CSS1019: Unexpected token, found ')'
(194,210): run-time error CSS1019: Unexpected token, found ','
(194,211): run-time error CSS1019: Unexpected token, found 'function('
(194,221): run-time error CSS1031: Expected selector, found ')'
(194,221): run-time error CSS1025: Expected comma or open brace, found ')'
(194,232): run-time error CSS1019: Unexpected token, found ')'
(194,240): run-time error CSS1031: Expected selector, found '='
(194,240): run-time error CSS1025: Expected comma or open brace, found '='
(194,293): run-time error CSS1019: Unexpected token, found ','
(194,296): run-time error CSS1031: Expected selector, found '='
(194,296): run-time error CSS1025: Expected comma or open brace, found '='
(194,337): run-time error CSS1031: Expected selector, found '='
(194,337): run-time error CSS1025: Expected comma or open brace, found '='
(199,302): run-time error CSS1031: Expected selector, found '='
(199,302): run-time error CSS1025: Expected comma or open brace, found '='
(199,355): run-time error CSS1031: Expected selector, found '='
(199,355): run-time error CSS1025: Expected comma or open brace, found '='
(199,387): run-time error CSS1031: Expected selector, found '='
(199,387): run-time error CSS1025: Expected comma or open brace, found '='
(199,432): run-time error CSS1031: Expected selector, found '='
(199,432): run-time error CSS1025: Expected comma or open brace, found '='
(199,479): run-time error CSS1031: Expected selector, found '='
(199,479): run-time error CSS1025: Expected comma or open brace, found '='
(200,20): run-time error CSS1031: Expected selector, found '='
(200,20): run-time error CSS1025: Expected comma or open brace, found '='
(200,59): run-time error CSS1031: Expected selector, found '='
(200,59): run-time error CSS1025: Expected comma or open brace, found '='
(200,96): run-time error CSS1031: Expected selector, found '='
(200,96): run-time error CSS1025: Expected comma or open brace, found '='
(200,131): run-time error CSS1031: Expected selector, found '='
(200,131): run-time error CSS1025: Expected comma or open brace, found '='
(200,167): run-time error CSS1031: Expected selector, found '='
(200,167): run-time error CSS1025: Expected comma or open brace, found '='
(200,199): run-time error CSS1031: Expected selector, found '='
(200,199): run-time error CSS1025: Expected comma or open brace, found '='
(200,222): run-time error CSS1031: Expected selector, found '='
(200,222): run-time error CSS1025: Expected comma or open brace, found '='
(200,250): run-time error CSS1031: Expected selector, found '='
(200,250): run-time error CSS1025: Expected comma or open brace, found '='
(200,279): run-time error CSS1031: Expected selector, found '='
(200,279): run-time error CSS1025: Expected comma or open brace, found '='
(200,309): run-time error CSS1031: Expected selector, found '='
(200,309): run-time error CSS1025: Expected comma or open brace, found '='
(200,345): run-time error CSS1031: Expected selector, found '='
(200,345): run-time error CSS1025: Expected comma or open brace, found '='
(200,381): run-time error CSS1031: Expected selector, found '='
(200,381): run-time error CSS1025: Expected comma or open brace, found '='
(200,412): run-time error CSS1031: Expected selector, found '='
(200,412): run-time error CSS1025: Expected comma or open brace, found '='
(210,93): run-time error CSS1031: Expected selector, found '='
(210,93): run-time error CSS1025: Expected comma or open brace, found '='
(225,13): run-time error CSS1031: Expected selector, found '='
(225,13): run-time error CSS1025: Expected comma or open brace, found '='
(235,462): run-time error CSS1031: Expected selector, found '='
(235,462): run-time error CSS1025: Expected comma or open brace, found '='
(236,119): run-time error CSS1031: Expected selector, found '='
(236,119): run-time error CSS1025: Expected comma or open brace, found '='
(236,220): run-time error CSS1019: Unexpected token, found 'ga('
(236,223): run-time error CSS1019: Unexpected token, found ')'
(236,225): run-time error CSS1019: Unexpected token, found 'ga('
(236,228): run-time error CSS1019: Unexpected token, found ')'
(236,236): run-time error CSS1031: Expected selector, found '='
(236,236): run-time error CSS1025: Expected comma or open brace, found '='
(236,346): run-time error CSS1019: Unexpected token, found ','
(236,349): run-time error CSS1031: Expected selector, found '='
(236,349): run-time error CSS1025: Expected comma or open brace, found '='
(236,413): run-time error CSS1030: Expected identifier, found '$'
(236,413): run-time error CSS1031: Expected selector, found '$'
(236,413): run-time error CSS1025: Expected comma or open brace, found '$'
(236,438): run-time error CSS1030: Expected identifier, found '$'
(236,438): run-time error CSS1031: Expected selector, found '$'
(236,438): run-time error CSS1025: Expected comma or open brace, found '$'
(236,462): run-time error CSS1030: Expected identifier, found '$'
(236,462): run-time error CSS1031: Expected selector, found '$'
(236,462): run-time error CSS1025: Expected comma or open brace, found '$'
(236,485): run-time error CSS1030: Expected identifier, found '$'
(236,485): run-time error CSS1031: Expected selector, found '$'
(236,485): run-time error CSS1025: Expected comma or open brace, found '$'
(237,7): run-time error CSS1031: Expected selector, found '='
(237,7): run-time error CSS1025: Expected comma or open brace, found '='
(238,150): run-time error CSS1019: Unexpected token, found ','
(238,153): run-time error CSS1031: Expected selector, found '='
(238,153): run-time error CSS1025: Expected comma or open brace, found '='
(244): Scanner error CSS1002: Unterminated string: '*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,sg=/^\s*(\-|\+)?(+|(*(\.*)))([eE][+-]?+)?\s*$/,Od=/^({4})-({2})-({2})$/,Pd=/^({4})-()-()T():()(?::()(\.{1,3})?)?$/,mc=/^({4})-W()$/,Qd=/^({4})-()$/,Rd=/^():()(?::()(\.{1,3})?)?$/,Sd={text:function(a,c,d,e,f,g){jb(a,c,d,e,f,g);kc(e)},date:kb("date",Od,Kb(Od,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":kb("datetimelocal",Pd,Kb(Pd,
(357): Scanner error CSS1002: Unterminated string: ");
(365): Scanner error CSS1002: Unterminated string: 't have an Unicode encoding");return this.unicodeEntry}})}(),v=r({parse:function(e){e.offset(this.offset),this.version=e.readShort(),this.averageCharWidth=e.readShort_(),this.weightClass=e.readShort(),this.widthClass=e.readShort(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort_(),this.ySubscriptYSize=e.readShort_(),this.ySubscriptXOffset=e.readShort_(),this.ySubscriptYOffset=e.readShort_(),this.ySuperscriptXSize=e.readShort_(),this.ySuperscriptYSize=e.readShort_(),this.ySuperscriptXOffset=e.readShort_(),this.ySuperscriptYOffset=e.readShort_(),this.yStrikeoutSize=e.readShort_(),this.yStrikeoutPosition=e.readShort_(),this.familyClass=e.readShort_(),this.panose=e.times(10,e.readByte),this.charRange=e.times(4,e.readLong),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=e.times(2,e.readLong),this.version>1&&(this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()))
(366): Scanner error CSS1002: Unterminated string: "},setup:t,step:t,play:function(){var t=this,n=t.options,i=e.easing[n.easing],a=n.duration,s=n.delay||0,l=r.now()+s,c=l+a;0===a?(t.step(1),t.abort()):setTimeout(function(){var e=function(){var n,s,d,u;
(367): Scanner error CSS1002: Unterminated string: '),o=i.children().eq(1),c=new n.TapCapture(i),p=new d(o),f=new h({element:o,container:i,forcedEnabled:b.options.zoom}),m=this.options.avoidScrolling,v=new n.UserEvents(i,{allowSelection:!0,preventDragEvent:!0,captureUpIfMoved:!0,multiTouch:b.options.zoom,start:function(t){f.refresh();var n=g(t.x.velocity),i=g(t.y.velocity),r=2*n>=i,o=e.contains(b.fixedContainer[0],t.event.target),a=2*i>=n;!o&&!m(t)&&b.enabled&&(f.x.enabled&&r||f.y.enabled&&a)?v.capture():v.cancel()}}),_=new u({movable:p,dimensions:f,userEvents:v,elastic:b.options.elastic}),w=new I({movable:p,dimensions:f,userEvents:v,tapCapture:c}),y=new M({moveTo:function(e){b.scrollTo(e.x,e.y)}}),p.bind(S,function(){b.scrollTop=-p.y,b.scrollLeft=-p.x,b.trigger(A,{scrollTop:b.scrollTop,scrollLeft:b.scrollLeft})}),b.options.mousewheelScrolling&&i.on("DOMMouseScroll mousewheel",a(this,"_wheelScroll")),s(b,{movable:p,dimensions:f,zoomSnapBack:w,animatedScroller:y,userEvents:v,pane:_,tapCapture:c,pulled:!1,enabled:!0,scrollElement:o,scrollTop:0,scrollLeft:0,fixedContainer:i.children().first()}),b._initAxis("x"),b._initAxis("y"),b._wheelEnd=function(){b._wheel=!1,b.userEvents.end(0,b._wheelY)},f.refresh(),b.options.pullToRefresh&&b._initPullToRefresh(),t)},_wheelScroll:function(e){this._wheel||(this._wheel=!0,this._wheelY=0,this.userEvents.press(0,this._wheelY)),clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(this._wheelEnd,50);var t=n.wheelDeltaY(e);t&&(this._wheelY+=t,this.userEvents.move(0,this._wheelY)),e.preventDefault()},makeVirtual:function(){this.dimensions.y.makeVirtual()},virtualSize:function(e,t){this.dimensions.y.virtualSize(e,t)},height:function(){return this.dimensions.y.size},scrollHeight:function(){return this.scrollElement[0].scrollHeight},scrollWidth:function(){return this.scrollElement[0].scrollWidth},options:{name:"Scroller",zoom:!1,pullOffset:140,visibleScrollHints:!1,elastic:!0,useNative:!1,mousewheelScrolling:!0,avoidScrolling:function(){return!1},pullToRefresh:!1,messages:{pullTemplate:"Pull to refresh",releaseTemplate:"Release to refresh",refreshTemplate:"Refreshing"}},events:[T,A,D],_resize:function(){this._native||this.contentResized()},setOptions:function(e){var t=this;l.fn.setOptions.call(t,e),e.pullToRefresh&&t._initPullToRefresh()},reset:function(){this._native?this.scrollElement.scrollTop(0):(this.movable.moveTo({x:0,y:0}),this._scale(1))},contentResized:function(){this.dimensions.refresh(),this.pane.x.outOfBounds()&&this.movable.moveAxis("x",this.dimensions.x.min),this.pane.y.outOfBounds()&&this.movable.moveAxis("y",this.dimensions.y.min)},zoomOut:function(){var e=this.dimensions;e.refresh(),this._scale(e.fitScale),this.movable.moveTo(e.centerCoordinates())},enable:function(){this.enabled=!0
(368): Scanner error CSS1002: Unterminated string: ',buttonCount:10,autoBind:!0,numeric:!0,info:!0,input:!1,previousNext:!0,pageSizes:!1,refresh:!1,messages:{display:"{0} - {1} of {2} items",empty:"No items to display",page:"Page",of:"of {0}",itemsPerPage:"items per page",first:"Go to the first page",previous:"Go to the previous page",next:"Go to the next page",last:"Go to the last page",refresh:"Refresh",morePages:"More pages"}},setDataSource:function(e){var t=this;
(369): Scanner error CSS1002: Unterminated string: '),i+=">",o!==t&&(i+=l(o)),i+="</option>",u+=i;c.html(u)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initial)})},t._form=r.on("reset",t._resetHandler))},_cascade:function(){var t,i,r,o,a,s=this,l=s.options,c=l.cascadeFrom;if(c){if(s._selectedValue=l.value||s._accessor(),i=e("#"+c),t=i.data("kendo"+l.name),t||(t=i.data("kendo"+A[l.name])),!t)return;l.autoBind=!1,o=l.cascadeFromField||t.options.dataValueField,a=function(){s.dataSource.unbind(h,a);var e=s._selectedValue||s.value();s._userTriggered?s._clearSelection(t,!0):e?(s.value(e),s.dataSource.view()[0]&&-1!==s.selectedIndex||s._clearSelection(t,!0)):s.select(l.index),s.enable(),s._triggerCascade(s._userTriggered),s._userTriggered=!1},r=function(){var e,i,r,l=t.dataItem(),c=l?t._value(l):null;c||0===c?(e=s.dataSource.filter()||{},n(e,o),i=e.filters||[],i.push({field:o,operator:"eq",value:c}),r=function(){s.unbind("dataBound",r),a.apply(s,arguments)
(371): Scanner error CSS1002: Unterminated string: '>Drag</a>":"")+"</div>"}function a(e){return function(t){return t+e}}function s(e){return function(){return e}}function l(e){return(e+"").replace(".",f.cultures.current.numberFormat["."])}function c(e){e=parseFloat(e,10);var t=k.pow(10,G||0);return k.round(e*t)/t}function d(e,n){var i=w(e.getAttribute(n));return null===i&&(i=t),i}function u(e){return typeof e!==Y}function h(e){return 1e4*e}var p,f=window.kendo,g=f.ui.Widget,m=f.ui.Draggable,v=e.extend,_=f.format,w=f.parseFloat,y=e.proxy,b=e.isArray,k=Math,x=f.support,C=x.pointers,T=x.msPointers,S="change",D="slide",A=".slider",E="touchstart"+A+" mousedown"+A,I=C?"pointerdown"+A:T?"MSPointerDown"+A:E,P="touchend"+A+" mouseup"+A,M=C?"pointerup":T?"MSPointerUp"+A:P,F="moveSelection",z="keydown"+A,R="click"+A,B="mouseover"+A,H="focus"+A,L="blur"+A,N=".k-draghandle",O=".k-slider-track",V=".k-tick",U="k-state-selected",W="k-state-focused",j="k-state-default",q="k-state-disabled",G=3,$="disabled",Y="undefined",Q="tabindex",K=f.getTouches,X=g.extend({init:function(e,t){var n,i=this;g.fn.init.call(i,e,t),t=i.options,i._distance=c(t.max-t.min),i._isHorizontal="horizontal"==t.orientation,i._isRtl=i._isHorizontal&&f.support.isRtl(e),i._position=i._isHorizontal?"left":"bottom",i._sizeFn=i._isHorizontal?"width":"height",i._outerSize=i._isHorizontal?"outerWidth":"outerHeight",t.tooltip.format=t.tooltip.enabled?t.tooltip.format||"{0}":"{0}",i._createHtml(),i.wrapper=i.element.closest(".k-slider"),i._trackDiv=i.wrapper.find(O),i._setTrackDivWidth(),i._maxSelection=i._trackDiv[i._sizeFn](),i._sliderItemsInit(),i._reset(),i._tabindex(i.wrapper.find(N)),i[t.enabled?"enable":"disable"](),n=f.support.isRtl(i.wrapper)?-1:1,i._keyMap={37:a(-1*n*t.smallStep),40:a(-t.smallStep),39:a(1*n*t.smallStep),38:a(+t.smallStep),35:s(t.max),36:s(t.min),33:a(+t.largeStep),34:a(-t.largeStep)},f.notify(i)
(374): Scanner error CSS1002: Unterminated string: ").length||this.toggleMaximization()
(378): Scanner error CSS1002: Unterminated string: ')).prependTo(i.find(".k-filter-row"))},_firstDataItem:function(e,t){return e&&t&&(e=e.hasSubgroups?this._firstDataItem(e.items[0],t):e.items[0]),e},_updateTablesWidth:function(){var t,n=this;n._isLocked()&&(t=e(">.k-grid-footer>.k-grid-footer-wrap>table",n.wrapper).add(n.thead.parent()).add(n.table),n._footerWidth=et(t.eq(0)),t.width(n._footerWidth),t=e(">.k-grid-footer>.k-grid-footer-locked>table",n.wrapper).add(n.lockedHeader.find(">table")).add(n.lockedTable),t.width(et(t.eq(0))))},hideColumn:function(n){var i,r,o,a,l,c,d,u,m,v,_=this,w=0,y=_.footer||_.wrapper.find(".k-grid-footer"),b=_.columns,k=_.lockedHeader?N(_.lockedHeader.find(">table>thead")).filter(p).length:0;if(n="number"==typeof n?b[n]:bt(n)?Ct(S(b),function(e){return e===n})[0]:Ct(S(b),function(e){return e.field===n})[0],n&&f(n)){if(n.columns&&n.columns.length){for(c=C(n,b),h(n,!1),Q(s(e(">table>thead",_.lockedHeader),_.thead,">tr:eq("+c.row+")>th"),c.cell,!1),o=0;n.columns.length>o;o++)this.hideColumn(n.columns[o]);return _.trigger(Yt,{column:n}),t}if(m=St(n,g(L(b))),h(n,!1),_._setParentsVisibility(n,!1),_._templates(),_._updateCols(),_._updateLockedCols(),v=_.thead,d=m,_.lockedHeader&&k>m?v=_.lockedHeader.find(">table>thead"):d-=k,i=N(v).filter(p).eq(d),i[0].style.display="none",Q(s(e(">table>thead",_.lockedHeader),_.thead,">tr.k-filter-row>th"),m,!1),y[0]&&(_._updateCols(y.find(">.k-grid-footer-wrap>table")),_._updateLockedCols(y.find(">.k-grid-footer-locked>table")),Q(y.find(".k-footer-template>td"),m,!1)),_.lockedTable&&k>m?K(_.lockedTable.find(">tbody>tr"),m):K(_.tbody.children(),m-k),_.lockedTable)_._updateTablesWidth(),_._applyLockedContainersWidth(),_._syncLockedContentHeight(),_._syncLockedHeaderHeight(),_._syncLockedFooterHeight();else{for(a=_.thead.prev().find("col"),o=0,u=a.length;u>o;o+=1){if(l=a[o].style.width,!l||-1!=l.indexOf("%")){w=0;break}w+=parseInt(l,10)}r=e(">.k-grid-header table:first,>.k-grid-footer table:first",_.wrapper).add(_.table),_._footerWidth=null,w&&(r.width(w),_._footerWidth=w),kn.msie&&8==kn.version&&(r.css("display","inline-table"),setTimeout(function(){r.css("display","table")},1))}_._updateFirstColumnClass(),_.trigger(Yt,{column:n})}},_setParentsVisibility:function(t,n){var i,r,o,a,l,c=this.columns,d=[],p=n?function(e){return g(e.columns).length&&e.hidden}:function(e){return!g(e.columns).length&&!e.hidden};if(u(t,c,d)&&d.length)for(i=d.length-1;i>=0;i--)r=d[i],o=k(r,c),a=s(e(">table>thead",this.lockedHeader),this.thead,">tr:eq("+o.row+")>th:not(.k-group-cell):not(.k-hierarchy-cell)").eq(o.cell),p(r)&&(h(r,n),a[0].style.display=n?"":"none"),a.filter("["+pt.attr("colspan")+"]").length&&(l=parseInt(a.attr(pt.attr("colspan")),10),a[0].colSpan=l-D(r.columns)||1)},showColumn:function(n){var i,r,o,a,l,c,d,u,p,g,m,v=this,_=v.columns,w=v.footer||v.wrapper.find(".k-grid-footer"),y=v.lockedHeader?N(v.lockedHeader.find(">table>thead")).length:0;if(n="number"==typeof n?_[n]:bt(n)?Ct(S(_),function(e){return e===n})[0]:Ct(S(_),function(e){return e.field===n})[0],n&&!f(n)){if(n.columns&&n.columns.length){for(d=C(n,_),h(n,!0),Q(s(e(">table>thead",v.lockedHeader),v.thead,">tr:eq("+d.row+")>th"),d.cell,!0),i=0;n.columns.length>i;i++)this.showColumn(n.columns[i]);return v.trigger(Qt,{column:n}),t}if(g=St(n,L(_)),h(n,!0),v._setParentsVisibility(n,!0),v._templates(),v._updateCols(),v._updateLockedCols(),m=v.thead,c=g,v.lockedHeader&&y>g?m=v.lockedHeader.find(">table>thead"):c-=y,o=N(m).eq(c),o[0].style.display="",Q(s(e(">table>thead",v.lockedHeader),v.thead,">tr.k-filter-row>th"),g,!0),w[0]&&(v._updateCols(w.find(">.k-grid-footer-wrap>table")),v._updateLockedCols(w.find(">.k-grid-footer-locked>table")),Q(w.find(".k-footer-template>td"),g,!0)),v.lockedTable&&y>g?Z(v.lockedTable.find(">tbody>tr"),g):Z(v.tbody.children(),g-y),v.lockedTable)v._updateTablesWidth(),v._applyLockedContainersWidth(),v._syncLockedContentHeight(),v._syncLockedHeaderHeight();else if(a=e(">.k-grid-header table:first,>.k-grid-footer table:first",v.wrapper).add(v.table),n.width){for(l=0,p=v.thead.prev().find("col"),i=0,r=p.length;r>i;i+=1){if(u=p[i].style.width,u.indexOf("%")>-1){l=0;break}l+=parseInt(u,10)}v._footerWidth=null,l&&(a.width(l),v._footerWidth=l)}else a.width("");v._updateFirstColumnClass(),v.trigger(Qt,{column:n})}},_progress:function(e){var t=this.element;this.lockedContent?t=this.wrapper:this.element.is("table")?t=this.element.parent():this.content&&this.content.length&&(t=this.content),pt.ui.progress(t,e)},_resize:function(){this.content&&(this._setContentHeight(),this._setContentWidth()),this.virtualScrollable&&this.virtualScrollable.repaintScrollbar()},_isActiveInTable:function(){var t=_t();return this.table[0]===t||e.contains(this.table[0],t)||this._isLocked()&&(this.lockedTable[0]===t||e.contains(this.lockedTable[0],t))},refresh:function(t){var n,i=this,r=i.dataSource.view(),o=i.options.navigatable,a=e(i.current()),s=!1,l=(i.dataSource.group()||[]).length,c=l+H(g(i.columns)).length;t&&"itemchange"===t.action&&i.editable||(t=t||{},i.trigger("dataBinding",{action:t.action||"rebind",index:t.index,items:t.items})||(i._angularItems("cleanup"),o&&(i._isActiveInTable()||i._editContainer&&i._editContainer.data("kendoWindow"))&&(s=a.is("th"),n=0,s&&(n=i.thead.find("th:not(.k-group-cell)").index(a))),i._destroyEditable(),i._progress(!1),i._hideResizeHandle(),i._data=[],i.columns.length||(i._autoColumns(i._firstDataItem(r[0],l)),c=l+i.columns.length),i._group=l>0||i._group,i._group&&(i._templates(),i._updateCols(),i._updateLockedCols(),i._updateHeader(l),i._group=l>0),i._renderContent(r,c,l),i._renderLockedContent(r,c,l),i._footer(),i._setContentHeight(),i._setContentWidth(),i.lockedTable&&(i.options.scrollable.virtual?i.content.find(">.k-virtual-scrollable-wrap").trigger("scroll"):i.content.trigger("scroll")),n>=0&&(i._removeCurrent(),i.current(s?i.thead.find("th:not(.k-group-cell)").eq(n):i.table.add(i.lockedTable).find(Lt).first()),i._current&&rt(i._current.closest("table")[0],!0)),i.touchScroller&&i.touchScroller.contentResized(),i.selectable&&i.selectable.resetTouchEvents(),i._angularItems("compile"),i.trigger(Xt)))},_angularItems:function(e){pt.ui.DataBoundWidget.fn._angularItems.call(this,e),this._angularGroupItems(e)},_angularGroupItems:function(t){var n=this;n._group&&n.angular(t,function(){return{elements:n.tbody.children(".k-grouping-row"),data:e.map(X(n.dataSource.view()),function(e){return{dataItem:e}})}})},_renderContent:function(e,t,n){var i,r,a=this,s="",l=null!=a.lockedContent,c={rowTemplate:a.rowTemplate,altRowTemplate:a.altRowTemplate,groupFooterTemplate:a.groupFooterTemplate};if(t=l?t-H(B(a.columns)).length:t,n>0)for(t=l?t-n:t,a.detailTemplate&&t++,a.groupFooterTemplate&&(a._groupAggregatesDefaultObject=o(a.dataSource.aggregate())),i=0,r=e.length;r>i;i++)s+=a._groupRowHtml(e[i],t,0,l?ht:ut,c,l);else s+=a._rowsHtml(e,c);a.tbody=U(a.tbody,a.table,s)},_renderLockedContent:function(e,t,n){var i,r,o,a="",s={rowTemplate:this.lockedRowTemplate,altRowTemplate:this.lockedAltRowTemplate,groupFooterTemplate:this.lockedGroupFooterTemplate};if(this.lockedContent){if(o=this.lockedTable,n>0)for(t-=g(L(z(this.columns))).length,i=0,r=e.length;r>i;i++)a+=this._groupRowHtml(e[i],t,0,ut,s);else a=this._rowsHtml(e,s);U(o.children("tbody"),o,a),this._syncLockedContentHeight()}},_adjustRowsHeight:function(e,t){var n,i,r,o,a=e[0].rows,s=a.length,l=t[0].rows,c=e.add(t),d=c.length,u=[];for(n=0;s>n&&l[n];n++)a[n].style.height&&(a[n].style.height=l[n].style.height=""),i=a[n].offsetHeight,r=l[n].offsetHeight,o=0,i>r?o=i:r>i&&(o=r),u.push(o);for(n=0;d>n;n++)c[n].style.display="none";for(n=0;s>n;n++)u[n]&&(a[n].style.height=l[n].style.height=u[n]+1+"px");for(n=0;d>n;n++)c[n].style.display=""}});pt.ExcelMixin&&pt.ExcelMixin.extend(Dn.prototype),pt.PDFMixin&&pt.PDFMixin.extend(Dn.prototype),ft.plugin(Dn),ft.plugin(Tn)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i="change",r="cancel",o="dataBound",a="dataBinding",s=n.ui.Widget,l=n.keys,c=">*",d="progress",u="error",h="k-state-focused",p="k-state-selected",f="k-edit-item",g="edit",m="remove",v="save",_="click",w=".kendoListView",y=e.proxy,b=n._activeElement,k=n.ui.progress,x=n.data.DataSource,C=n.ui.DataBoundWidget.extend({init:function(t,i){var r=this;i=e.isArray(i)?{dataSource:i}:i,s.fn.init.call(r,t,i),i=r.options,r.wrapper=t=r.element,t[0].id&&(r._itemId=t[0].id+"_lv_active"),r._element(),r._dataSource(),r._templates(),r._navigatable(),r._selectable(),r._pageable(),r._crudHandlers(),r.options.autoBind&&r.dataSource.fetch(),n.notify(r)},events:[i,r,a,o,g,m,v],options:{name:"ListView",autoBind:!0,selectable:!1,navigatable:!1,template:"",altTemplate:"",editTemplate:""},setOptions:function(e){s.fn.setOptions.call(this,e),this._templates()},_templates:function(){var e=this.options;this.template=n.template(e.template||""),this.altTemplate=n.template(e.altTemplate||e.template),this.editTemplate=n.template(e.editTemplate||"")
(381): Scanner error CSS1002: Unterminated string: ',r.collapsed)return;
(382): Scanner error CSS1002: Unterminated string: ',t):"<col />"}).join("")),o.is("colgroup")||(o=e("<colgroup/>").append(o)),o.prependTo(r))},convertHeaders:function(t){var n,i=t.cells,r=e.map(i,function(t){var n=e(t).children("p").children("strong")[0];return n&&"strong"==s.name(n)?n:void 0});if(r.length==i.length){for(n=0;r.length>n;n++)s.unwrap(r[n]);for(e(t).closest("table").find("colgroup").after("<thead></thead>").end().find("thead").append(t),n=0;i.length>n;n++)s.changeTag(i[n],"th")}},removeParagraphs:function(t){var n,i,r,o,a;for(n=0;t.length>n;n++)for(this.removeAttributes(t[n]),o=e(t[n]),a=o.children("p"),i=0,r=a.length;r>i;i++)r-1>i&&s.insertAfter(s.create(document,"br"),a[i]),s.unwrap(a[i])},removeDefaultColors:function(e){for(var t=0;e.length>t;t++)/^\s*color:\s*[^;]*;?$/i.test(e[t].style.cssText)&&s.unwrap(e[t])},tables:function(t){var n,i,r,o,a,s=e(t).find("table"),l=this;for(o=0;s.length>o;o++){for(n=s[o].rows,r=i=n[0],a=1;n.length>a;a++)n[a].cells.length>r.cells.length&&(r=n[a]);l.createColGroup(r),l.convertHeaders(i),l.removeAttributes(s[o]),l.removeParagraphs(s.eq(o).find("td,th")),l.removeDefaultColors(s.eq(o).find("span"))}},headers:function(t){var n,i=e(t).find("p.MsoTitle");for(n=0;i.length>n;n++)s.changeTag(i[n],"h1")},clean:function(e){var t,n=this;return e=x.fn.clean.call(n,e),e=n.stripEmptyAnchors(e),t=s.create(document,"div",{innerHTML:e}),n.headers(t),n.lists(t),n.tables(t),e=t.innerHTML.replace(/(<[^>]*)\s+class="?[^"\s>]*"?/gi,"$1")}}),S=x.extend({init:function(){this.replacements=[/\s+class="Apple-style-span[^"]*"/gi,"",/<(div|p|h[1-6])\s+style="[^"]*"/gi,"<$1",/^<div>(.*)<\/div>$/,"$1"]},applicable:function(e){return/class="?Apple-style-span|style="[^"]*-webkit-nbsp-mode/i.test(e)}});h(r,{Command:p,GenericCommand:f,InsertHtmlCommand:g,InsertHtmlTool:m,UndoRedoStack:v,TypingHandler:_,SystemHandler:y,BackspaceHandler:w,Keyboard:b,Clipboard:k,Cleaner:x,MSWordFormatCleaner:T,WebkitFormatCleaner:S}),a("insertHtml",new m({template:new c({template:o.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=t.ui.editor,r=t.ui.Editor.fn.options.formats,o=i.EditorUtils,a=i.Tool,s=i.ToolTemplate,l=i.FormatTool,c=i.Dom,d=i.RangeUtils,u=e.extend,h=i.EditorUtils.registerTool,p=i.EditorUtils.registerFormat,f="k-marker",g=n.extend({init:function(e){this.format=e},numberOfSiblings:function(e){var t,n=0,i=0,r=0,o=e.parentNode;for(t=o.firstChild;t;t=t.nextSibling)t!=e&&(t.className==f?r++:3==t.nodeType?n++:i++);return r>1&&o.firstChild.className==f&&o.lastChild.className==f?0:i+n},findSuitable:function(e,t){var n,i;if(!t&&this.numberOfSiblings(e)>0)return null;for(n=e.parentNode,i=this.format[0].tags;!c.ofType(n,i);){if(this.numberOfSiblings(n)>0)return null;n=n.parentNode}return n},findFormat:function(e){var t,n,i,r,o,a=this.format,s=c.attrEquals;for(t=0,n=a.length;n>t;t++){if(i=e,r=a[t].tags,o=a[t].attr,i&&c.ofType(i,r)&&s(i,o))return i;for(;i;)if(i=c.parentOfType(i,r),i&&s(i,o))return i}return null},isFormatted:function(e){var t,n;for(t=0,n=e.length;n>t;t++)if(this.findFormat(e[t]))return!0;return!1}}),m=n.extend({init:function(e,t){this.finder=new g(e),this.attributes=u({},e[0].attr,t),this.tag=e[0].tags[0]},wrap:function(e){return c.wrap(e,c.create(e.ownerDocument,this.tag,this.attributes))},activate:function(e,t){this.finder.isFormatted(t)?(this.split(e),this.remove(t)):this.apply(t)},toggle:function(e){var t=d.textNodes(e);t.length>0&&this.activate(e,t)},apply:function(e){var t,n,i,r,o=[];for(t=0,n=e.length;n>t;t++){if(i=e[t],r=this.finder.findSuitable(i))c.attr(r,this.attributes);else{for(;!c.isBlock(i.parentNode)&&1==i.parentNode.childNodes.length;)i=i.parentNode;r=this.wrap(i)}o.push(r)}this.consolidate(o)},remove:function(e){var t,n,i;for(t=0,n=e.length;n>t;t++)i=this.finder.findFormat(e[t]),i&&(this.attributes&&this.attributes.style?(c.unstyle(i,this.attributes.style),i.style.cssText||i.attributes["class"]||c.unwrap(i)):c.unwrap(i))},split:function(e){var t,n,i=d.textNodes(e),r=i.length;if(r>0)for(t=0;r>t;t++)n=this.finder.findFormat(i[t]),n&&d.split(e,n,!0)},consolidate:function(e){for(var t,n;e.length>1;)if(t=e.pop(),n=e[e.length-1],t.previousSibling&&t.previousSibling.className==f&&n.appendChild(t.previousSibling),t.tagName==n.tagName&&t.previousSibling==n&&t.style.cssText==n.style.cssText){for(;t.firstChild;)n.appendChild(t.firstChild);c.remove(t)}}}),v=g.extend({init:function(e,t){this.format=e,this.greedyProperty=t,g.fn.init.call(this,e)},getInlineCssValue:function(t){var n,i,r,o,a,s,l,d,u,h,p,f,g=t.attributes,m=e.trim;if(g)for(n=0,i=g.length;i>n;n++)if(r=g[n],o=r.nodeName,a=r.nodeValue,r.specified&&"style"==o)for(s=m(a||t.style.cssText).split(";"),d=0,u=s.length;u>d;d++)if(l=s[d],l.length){if(h=l.split(":"),p=m(h[0].toLowerCase()),f=m(h[1]),p!=this.greedyProperty)continue;return p.indexOf("color")>=0?c.toHex(f):f}},getFormatInner:function(t){var n,i,r,o=e(c.isDataNode(t)?t.parentNode:t),a=o.parentsUntil("[contentEditable]").addBack().toArray().reverse();for(n=0,i=a.length;i>n;n++)if(r="className"==this.greedyProperty?a[n].className:this.getInlineCssValue(a[n]))return r;return"inherit"},getFormat:function(e){var t,n,i=this.getFormatInner(e[0]);for(t=1,n=e.length;n>t;t++)if(i!=this.getFormatInner(e[t]))return"";return i},isFormatted:function(e){return""!==this.getFormat(e)}}),_=m.extend({init:function(e,n,i){m.fn.init.call(this,e,n),this.values=n,this.finder=new v(e,i),i&&(this.greedyProperty=t.toCamelCase(i))},activate:function(e,t){var n=this.greedyProperty,i="apply";this.split(e),n&&"inherit"==this.values.style[n]&&(i="remove"),this[i](t)}}),w=l.extend({init:function(e){l.fn.init.call(this,u(e,{finder:new g(e.format),formatter:function(){return new m(e.format)}}))}}),y=a.extend({update:function(e,t){var n=e.data(this.type);n.close(),n.value(this.finder.getFormat(t))}}),b=y.extend({init:function(e){a.fn.init.call(this,e),this.type=t.support.browser.msie||t.support.touch?"kendoDropDownList":"kendoComboBox",this.format=[{tags:["span"]}],this.finder=new v(this.format,e.cssAttr)},command:function(e){var t=this.options,n=this.format,r={};return new i.FormatCommand(u(e,{formatter:function(){return r[t.domAttr]=e.value,new _(n,{style:r},t.cssAttr)}}))},initialize:function(e,t){var n,i=t.editor,r=this.options,o=r.name,s=[];r.defaultValue&&(s=[{text:i.options.messages[r.defaultValue[0].text],value:r.defaultValue[0].value}]),n=s.concat(r.items?r.items:i.options[o]||[]),e[this.type]({dataTextField:"text",dataValueField:"value",dataSource:n,change:function(){a.exec(i,o,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+o).find("*").addBack().attr("unselectable","on"),e.data(this.type).value("inherit")}}),k=a.extend({init:function(e){a.fn.init.call(this,e),this.format=[{tags:["span"]}],this.finder=new v(this.format,e.cssAttr)},options:{palette:"websafe"},update:function(){this._widget.close()},command:function(e){var t=this.options,n=this.format,r={};return new i.FormatCommand(u(e,{formatter:function(){return r[t.domAttr]=e.value,new _(n,{style:r},t.cssAttr)}}))},initialize:function(n,i){var r=i.editor,o=this.name,s=u({},k.fn.options,this.options),l=s.palette;n=this._widget=new t.ui.ColorPicker(n,{value:e.isArray(l)?l[0]:"#000",toolIcon:"k-"+s.name,palette:l,change:function(){var e=n.value();e&&a.exec(r,o,e),r.focus()},activate:function(e){e.preventDefault(),n.trigger("change")}}),n.wrapper.attr({title:i.title,unselectable:"on"}).find("*").attr("unselectable","on")}});u(i,{InlineFormatFinder:g,InlineFormatter:m,DelayedExecutionTool:y,GreedyInlineFormatFinder:v,GreedyInlineFormatter:_,InlineFormatTool:w,FontTool:b,ColorTool:k}),p("bold",[{tags:["strong","b"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]),h("bold",new w({key:"B",ctrl:!0,format:r.bold,template:new s({template:o.buttonTemplate,title:"Bold"})})),p("italic",[{tags:["em","i"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]),h("italic",new w({key:"I",ctrl:!0,format:r.italic,template:new s({template:o.buttonTemplate,title:"Italic"})})),p("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}},{tags:["u"]}]),h("underline",new w({key:"U",ctrl:!0,format:r.underline,template:new s({template:o.buttonTemplate,title:"Underline"})})),p("strikethrough",[{tags:["del","strike"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]),h("strikethrough",new w({format:r.strikethrough,template:new s({template:o.buttonTemplate,title:"Strikethrough"})})),p("superscript",[{tags:["sup"]}]),h("superscript",new w({format:r.superscript,template:new s({template:o.buttonTemplate,title:"Superscript"})})),p("subscript",[{tags:["sub"]}]),h("subscript",new w({format:r.subscript,template:new s({template:o.buttonTemplate,title:"Subscript"})})),h("foreColor",new k({cssAttr:"color",domAttr:"color",name:"foreColor",template:new s({template:o.colorPickerTemplate,title:"Color"})})),h("backColor",new k({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new s({template:o.colorPickerTemplate,title:"Background Color"})})),h("fontName",new b({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new s({template:o.comboBoxTemplate,title:"Font Name"})})),h("fontSize",new b({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new s({template:o.comboBoxTemplate,title:"Font Size"})}))}(window.kendo.jQuery),function(e){var t,n=window.kendo,i=n.Class,r=e.extend,o=n.ui.editor,a=n.ui.Editor.fn.options.formats,s=o.Dom,l=o.Command,c=o.ToolTemplate,d=o.FormatTool,u=o.EditorUtils,h=u.registerTool,p=u.registerFormat,f=o.RangeUtils,g=i.extend({init:function(e){this.format=e},contains:function(e,t){var n,i,r;for(n=0,i=t.length;i>n;n++)if(r=t[n],!r||!s.isAncestorOrSelf(e,r))return!1;return!0},findSuitable:function(t){var n,i,r,o,a=this.format,l=[];for(n=0,i=t.length;i>n;n++){for(o=a.length-1;o>=0&&!(r=s.ofType(t[n],a[o].tags)?t[n]:s.parentOfType(t[n],a[o].tags));o--);if(!r||"true"===r.contentEditable)return[];e.inArray(r,l)<0&&l.push(r)}for(n=0,i=l.length;i>n;n++)if(this.contains(l[n],l))return[l[n]];return l},findFormat:function(e){var t,n,i,r,o,a=this.format,l=s.editableParent(e);for(t=0,n=a.length;n>t;t++)for(i=e,r=a[t].tags,o=a[t].attr;i&&s.isAncestorOf(l,i);){if(s.ofType(i,r)&&s.attrEquals(i,o))return i;i=i.parentNode}return null},getFormat:function(e){var t,n,i=this,r=function(e){return i.findFormat(s.isDataNode(e)?e.parentNode:e)},o=r(e[0]);if(!o)return"";for(t=1,n=e.length;n>t;t++)if(o!=r(e[t]))return"";return o.nodeName.toLowerCase()},isFormatted:function(e){for(var t=0,n=e.length;n>t;t++)if(!this.findFormat(e[t]))return!1;return!0}}),m=i.extend({init:function(e,t){this.format=e,this.values=t,this.finder=new g(e)},wrap:function(e,t,n){var i,r,o,a,l,c=1==n.length?s.blockParentOrBody(n[0]):s.commonAncestor.apply(null,n);for(s.isInline(c)&&(c=s.blockParentOrBody(c)),i=s.significantChildNodes(c),r=s.findNodeIndex(i[0]),o=s.create(c.ownerDocument,e,t),a=0;i.length>a;a++)l=i[a],s.isBlock(l)?(s.attr(l,t),o.childNodes.length&&(s.insertBefore(o,l),o=o.cloneNode(!1)),r=s.findNodeIndex(l)+1):o.appendChild(l);o.firstChild&&s.insertAt(c,o,r)},apply:function(t){function n(e){return r({},e&&e.attr,d)}var i,o,a,l,c,d=this.values,h=s.filter("img",t),p=u.formatByName("img",this.format),f=n(p);if(e.each(h,function(){s.attr(this,f)}),h.length!=t.length)if(o=s.filter("img",t,!0),a=this.finder.findSuitable(o),a.length)for(l=0,c=a.length;c>l;l++)i=u.formatByName(s.name(a[l]),this.format),s.attr(a[l],n(i));else i=this.format[0],this.wrap(i.tags[0],n(i),o)},remove:function(e){var t,n,i,r,o;for(t=0,n=e.length;n>t;t++)i=this.finder.findFormat(e[t]),i&&(o=s.name(i),"div"!=o||i.getAttribute("class")?(r=u.formatByName(o,this.format),r.attr.style&&s.unstyle(i,r.attr.style),r.attr.className&&s.removeClass(i,r.attr.className)):s.unwrap(i))},toggle:function(e){var t=this,n=f.nodes(e);t.finder.isFormatted(n)?t.remove(n):t.apply(n)}}),v=i.extend({init:function(e,t){var n=this;n.format=e,n.values=t,n.finder=new g(e)},apply:function(e){var t,n,i,r,a,l,c,d=this.format,u=s.blockParents(e),h=d[0].tags[0];if(u.length)for(t=0,n=u.length;n>t;t++)c=s.name(u[t]),"li"==c?(i=u[t].parentNode,r=new o.ListFormatter(i.nodeName.toLowerCase(),h),a=this.editor.createRange(),a.selectNode(u[t]),r.toggle(a)):h&&("td"==c||u[t].attributes.contentEditable)?new m(d,this.values).apply(u[t].childNodes):(l=s.changeTag(u[t],h),s.attr(l,d[0].attr));else new m(d,this.values).apply(e)},toggle:function(e){var t=f.textNodes(e);t.length||(e.selectNodeContents(e.commonAncestorContainer),t=f.textNodes(e),t.length||(t=s.significantChildNodes(e.commonAncestorContainer))),this.apply(t)}}),_=l.extend({init:function(e){e.formatter=e.formatter(),l.fn.init.call(this,e)}}),w=d.extend({init:function(e){d.fn.init.call(this,r(e,{finder:new g(e.format),formatter:function(){return new m(e.format)}}))}});r(o,{BlockFormatFinder:g,BlockFormatter:m,GreedyBlockFormatter:v,FormatCommand:_,BlockFormatTool:w}),t=["ul","ol","li"],p("justifyLeft",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left",display:"",marginLeft:"",marginRight:""}}},{tags:t,attr:{style:{textAlign:"left",listStylePosition:""}}}]),h("justifyLeft",new w({format:a.justifyLeft,template:new c({template:u.buttonTemplate,title:"Justify Left"})})),p("justifyCenter",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:t,attr:{style:{textAlign:"center",listStylePosition:"inside"}}}]),h("justifyCenter",new w({format:a.justifyCenter,template:new c({template:u.buttonTemplate,title:"Justify Center"})})),p("justifyRight",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right",display:"",marginLeft:"",marginRight:""}}},{tags:t,attr:{style:{textAlign:"right",listStylePosition:"inside"}}}]),h("justifyRight",new w({format:a.justifyRight,template:new c({template:u.buttonTemplate,title:"Justify Right"})})),p("justifyFull",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"justify"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:t,attr:{style:{textAlign:"justify",listStylePosition:""}}}]),h("justifyFull",new w({format:a.justifyFull,template:new c({template:u.buttonTemplate,title:"Justify Full"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,r=i.Dom,o=i.Command,a=i.Tool,s=i.BlockFormatter,l=r.normalize,c=i.RangeUtils,d=i.EditorUtils.registerTool,u=o.extend({init:function(e){this.options=e,o.fn.init.call(this,e)},_insertMarker:function(e,t){var n,i=r.create(e,"a");return i.className="k-marker",t.insertNode(i),i.parentNode||(n=t.commonAncestorContainer,n.innerHTML="",n.appendChild(i)),l(i.parentNode),i},_moveFocus:function(e,t){if(r.isEmpty(t))e.setStartBefore(t);else{e.selectNodeContents(t);var n=c.textNodes(e)[0];if(!n){for(;t.childNodes.length&&!r.is(t.firstChild,"br");)t=t.firstChild;n=t}r.isEmpty(n)?e.setStartBefore(n):e.selectNodeContents(n)}},shouldTrim:function(e){var t="p,h1,h2,h3,h4,h5,h6".split(","),n=r.parentOfType(e.startContainer,t),i=r.parentOfType(e.endContainer,t);return n&&!i||!n&&i},_blankAfter:function(e){for(;e&&(r.isMarker(e)||""===r.stripBom(e.nodeValue));)e=e.nextSibling;return!e},exec:function(){var e,t,n,o,a,d,u,h,p=this.getRange(),f=c.documentFromRange(p),g=i.emptyElementContent,m=this.shouldTrim(p);p.deleteContents(),a=this._insertMarker(f,p),d=r.closestEditableOfType(a,["li"]),u=r.closestEditableOfType(a,"h1,h2,h3,h4,h5,h6".split(",")),d?r.emptyNode(d)&&(o=r.create(f,"p"),d.nextSibling&&(h=p.cloneRange(),h.selectNode(d),c.split(h,d.parentNode)),r.insertAfter(o,d.parentNode),r.remove(1==d.parentNode.childNodes.length?d.parentNode:d),o.innerHTML=g,n=o):u&&this._blankAfter(a)&&(o=r.create(f,"p"),r.insertAfter(o,u),o.innerHTML=g,r.remove(a),n=o),n||(d||u||new s([{tags:["p"]}]).apply([a]),p.selectNode(a),e=r.parentOfType(a,[d?"li":u?r.name(u):"p"]),c.split(p,e,m),t=e.previousSibling,r.is(t,"li")&&t.firstChild&&!r.is(t.firstChild,"br")&&(t=t.firstChild),n=e.nextSibling,this.clean(t),this.clean(n,{links:!0}),r.is(n,"li")&&n.firstChild&&!r.is(n.firstChild,"br")&&(n=n.firstChild),r.remove(e),l(t)),l(n),this._moveFocus(p,n),p.collapse(!0),r.scrollTo(n),c.selectRange(p)},clean:function(e,t){var n=e;if(e.firstChild&&r.is(e.firstChild,"br")&&r.remove(e.firstChild),r.isDataNode(e)&&!e.nodeValue&&(e=e.parentNode),e){for(;e.firstChild&&1==e.firstChild.nodeType;)e=e.firstChild;if(!r.isEmpty(e)&&/^\s*$/.test(e.innerHTML)&&(e.innerHTML=i.emptyElementContent),t&&t.links)for(;e!=n;){if(r.is(e,"a")&&r.emptyNode(e)){r.unwrap(e);break}e=e.parentNode}}}}),h=o.extend({init:function(e){this.options=e,o.fn.init.call(this,e)},exec:function(){var e,n=this.getRange(),i=r.create(c.documentFromRange(n),"br"),o=t.support.browser,a=o.msie&&11>o.version;n.deleteContents(),n.insertNode(i),l(i.parentNode),a||i.nextSibling&&!r.isWhitespace(i.nextSibling)||(e=i.cloneNode(!0),e.className="k-br",r.insertAfter(e,i)),n.setStartAfter(i),n.collapse(!0),r.scrollTo(i.nextSibling||i),c.selectRange(n)}});n(i,{ParagraphCommand:u,NewLineCommand:h}),d("insertLineBreak",new a({key:13,shift:!0,command:h})),d("insertParagraph",new a({key:13,command:u}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,r=t.ui.editor,o=r.Dom,a=r.RangeUtils,s=r.EditorUtils,l=r.Command,c=r.ToolTemplate,d=r.FormatTool,u=r.BlockFormatFinder,h=a.textNodes,p=r.EditorUtils.registerTool,f=u.extend({init:function(e){this.tag=e;var t=this.tags=["ul"==e?"ol":"ul",e];u.fn.init.call(this,[{tags:t}])},isFormatted:function(e){var t,n,i=[];for(n=0;e.length>n;n++)(t=this.findFormat(e[n]))&&o.name(t)==this.tag&&i.push(t);if(1>i.length)return!1;if(i.length!=e.length)return!1;for(n=0;i.length>n&&i[n].parentNode==t.parentNode;n++)if(i[n]!=t)return!1;return!0},findSuitable:function(e){var t=o.parentOfType(e[0],this.tags);return t&&o.name(t)==this.tag?t:null}}),g=n.extend({init:function(e,t){var n=this;n.finder=new f(e),n.tag=e,n.unwrapTag=t},isList:function(e){var t=o.name(e);return"ul"==t||"ol"==t||"dl"==t},wrap:function(e,t){var n,i,r=o.create(e.ownerDocument,"li");for(n=0;t.length>n;n++)if(i=t[n],o.is(i,"li"))e.appendChild(i);else if(this.isList(i))for(;i.firstChild;)e.appendChild(i.firstChild);else if(o.is(i,"td")){for(;i.firstChild;)r.appendChild(i.firstChild);e.appendChild(r),i.appendChild(e),e=e.cloneNode(!1),r=r.cloneNode(!1)}else r.appendChild(i),o.isBlock(i)&&(e.appendChild(r),o.unwrap(i),r=r.cloneNode(!1));r.firstChild&&e.appendChild(r)},containsAny:function(e,t){for(var n=0;t.length>n;n++)if(o.isAncestorOrSelf(e,t[n]))return!0;return!1},suitable:function(e,t){if("k-marker"==e.className){var n=e.nextSibling;if(n&&o.isBlock(n))return!1;if(n=e.previousSibling,n&&o.isBlock(n))return!1}return this.containsAny(e,t)||o.isInline(e)||3==e.nodeType},split:function(t){var n,i,r,s,l,c,d=h(t);if(d.length)for(n=o.parentOfType(d[0],["li"]),i=o.parentOfType(d[d.length-1],["li"]),t.setStartBefore(n),t.setEndAfter(i),r=0,s=d.length;s>r;r++)l=this.finder.findFormat(d[r]),l&&(c=e(l).parents("ul,ol"),c[0]?a.split(t,c.last()[0],!0):a.split(t,l,!0))},merge:function(e,t){for(var n,i=t.previousSibling;i&&("k-marker"==i.className||3==i.nodeType&&o.isWhitespace(i));)i=i.previousSibling;if(i&&o.name(i)==e){for(;t.firstChild;)i.appendChild(t.firstChild);o.remove(t),t=i}for(n=t.nextSibling;n&&("k-marker"==n.className||3==n.nodeType&&o.isWhitespace(n));)n=n.nextSibling;if(n&&o.name(n)==e){for(;t.lastChild;)n.insertBefore(t.lastChild,n.firstChild);o.remove(t)}},breakable:function(e){return e!=e.ownerDocument.body&&!/table|tbody|tr|td/.test(o.name(e))&&!e.attributes.contentEditable},applyOnSection:function(t,n){function i(){u.push(this)}var r,a,s,l,c=this.tag,d=o.closestSplittableParent(n),u=[],h=this.finder.findSuitable(n);for(h||(h=new f("ul"==c?"ol":"ul").findSuitable(n)),/table|tbody/.test(o.name(d))?r=e.map(n,function(e){return o.parentOfType(e,["td"])}):(r=o.significantChildNodes(d),e.grep(r,o.isBlock).length&&(r=e.grep(r,e.proxy(function(e){return this.containsAny(e,n)},this))),r.length||(r=n)),a=0;r.length>a;a++)s=r[a],l=(!h||!o.isAncestorOrSelf(h,s))&&this.suitable(s,n),l&&(h&&this.isList(s)?(e.each(s.childNodes,i),o.remove(s)):u.push(s));u.length==r.length&&this.breakable(d)&&(u=[d]),h||(h=o.create(d.ownerDocument,c),o.insertBefore(h,u[0])),this.wrap(h,u),o.is(h,c)||o.changeTag(h,c),this.merge(c,h)},apply:function(e){var t,n,i,r=0,a=[];do i=o.closestEditable(e[r],["td","body"]),t&&i==t?n.push(e[r]):(t&&a.push({section:t,nodes:n}),n=[e[r]],t=i),r++;while(e.length>r);for(a.push({section:t,nodes:n}),r=0;a.length>r;r++)this.applyOnSection(a[r].section,a[r].nodes)},unwrap:function(t){var n,i,r,a,s=t.ownerDocument.createDocumentFragment(),l=this.unwrapTag;for(i=t.firstChild;i;i=i.nextSibling){for(r=o.create(t.ownerDocument,l||"p");i.firstChild;)a=i.firstChild,o.isBlock(a)?(r.firstChild&&(s.appendChild(r),r=o.create(t.ownerDocument,l||"p")),s.appendChild(a)):r.appendChild(a);r.firstChild&&s.appendChild(r)}n=e(t).parents("ul,ol"),n[0]?(o.insertAfter(s,n.last()[0]),n.last().remove()):o.insertAfter(s,t),o.remove(t)},remove:function(e){var t,n,i;for(n=0,i=e.length;i>n;n++)t=this.finder.findFormat(e[n]),t&&this.unwrap(t)},toggle:function(e){var t,n=this,i=h(e),r=e.commonAncestorContainer;i.length||(e.selectNodeContents(r),i=h(e),i.length||(t=r.ownerDocument.createTextNode(""),e.startContainer.appendChild(t),i=[t],e.selectNode(t.parentNode))),n.finder.isFormatted(i)?(n.split(e),n.remove(i)):n.apply(i)}}),m=l.extend({init:function(e){e.formatter=new g(e.tag),l.fn.init.call(this,e)}}),v=d.extend({init:function(e){this.options=e,d.fn.init.call(this,i(e,{finder:new f(e.tag)}))},command:function(e){return new m(i(e,{tag:this.options.tag}))}});i(r,{ListFormatFinder:f,ListFormatter:g,ListCommand:m,ListTool:v}),p("insertUnorderedList",new v({tag:"ul",template:new c({template:s.buttonTemplate,title:"Insert unordered list"})})),p("insertOrderedList",new v({tag:"ol",template:new c({template:s.buttonTemplate,title:"Insert ordered list"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,r=e.proxy,o=t.ui.editor,a=o.Dom,s=o.RangeUtils,l=o.EditorUtils,c=o.Command,d=o.Tool,u=o.ToolTemplate,h=o.InlineFormatter,p=o.InlineFormatFinder,f=s.textNodes,g=o.EditorUtils.registerTool,m=n.extend({findSuitable:function(e){return a.parentOfType(e,["a"])}}),v=n.extend({init:function(){this.finder=new m},apply:function(e,t){var n,i,r,o,l,c=f(e);t.innerHTML?(n=s.getMarkers(e),i=s.documentFromRange(e),e.deleteContents(),o=a.create(i,"a",t),e.insertNode(o),l=o.parentNode,"a"==a.name(l)&&a.insertAfter(o,l),a.emptyNode(l)&&a.remove(l),n.length>1&&(a.insertAfter(n[n.length-1],o),a.insertAfter(n[1],o),a[c.length>0?"insertBefore":"insertAfter"](n[0],o))):(r=new h([{tags:["a"]}],t),r.finder=this.finder,r.apply(c))
(383): Scanner error CSS1002: Unterminated string: '></div></div>"}))},_activate:function(){function n(t){var n=e(window);return{row:Math.floor((t.clientY+n.scrollTop()-u.top)/r)+1,col:Math.floor((t.clientX+n.scrollLeft()-u.left)/i)+1}}var i,r,o=this,a=o._popup.element,s=a.find(".k-ct-cell"),l=s.eq(0),d=s.eq(s.length-1),u=t.getOffset(l),h=t.getOffset(d),p=o.cols,f=o.rows;a.find("*").addBack().attr("unselectable","on"),h.left+=d[0].offsetWidth,h.top+=d[0].offsetHeight,i=(h.left-u.left)/p,r=(h.top-u.top)/f,a.on("mousemove"+c,function(e){o._setTableSize(n(e))}).on("mouseleave"+c,function(){o._setTableSize()}).on("mouseup"+c,function(e){o._exec(n(e))})},_valid:function(e){return e&&e.row>0&&e.col>0&&this.rows>=e.row&&this.cols>=e.col},_exec:function(e){this._valid(e)&&(this._editor.exec("createTable",{rows:e.row,columns:e.col}),this._popup.close())},_setTableSize:function(n){var i=this._popup.element,r=i.find(".k-status"),o=i.find(".k-ct-cell"),a=this.cols,s=this._editor.options.messages;this._valid(n)?(r.text(t.format(s.createTableHint,n.row,n.col)),o.each(function(t){e(this).toggleClass(u,n.col>t%a&&n.row>t/a)})):(r.text(s.dialogCancel),o.removeClass(u))},_keydown:function(e){var n,i,r,o,a,s,l,c;y.fn._keydown.call(this,e),n=t.keys,i=e.keyCode,r=this._popup.element.find(".k-ct-cell"),o=Math.max(r.filter(".k-state-selected").last().index(),0),a=Math.floor(o/this.cols),s=o%this.cols,l=!1,i!=n.DOWN||e.altKey?i==n.UP?(l=!0,a--):i==n.RIGHT?(l=!0,s++):i==n.LEFT&&(l=!0,s--):(l=!0,a++),c={row:Math.max(1,Math.min(this.rows,a+1)),col:Math.max(1,Math.min(this.cols,s+1))},i==n.ENTER?this._exec(c):this._setTableSize(c),l&&(e.preventDefault(),e.stopImmediatePropagation())},_open:function(){var e=this._editor.options.messages;y.fn._open.call(this),this.popup().element.find(".k-status").text(e.dialogCancel).end().find(".k-ct-cell").removeClass(u)},_close:function(){y.fn._close.call(this),this.popup().element.off(c)},update:function(e,t){var n;y.fn.update.call(this,e),n=_.isFormatted(t),e.toggleClass("k-state-disabled",n)}}),k=l.extend({exec:function(){for(var e,t,n,i,a=this.lockRange(!0),s=a.endContainer;"td"!=o.name(s);)s=s.parentNode;for(t=s.parentNode,e=t.children.length,n=t.cloneNode(!0),i=0;t.cells.length>i;i++)n.cells[i].innerHTML=r.emptyElementContent;"before"==this.options.position?o.insertBefore(n,t):o.insertAfter(n,t),this.releaseRange(a)}}),x=l.extend({exec:function(){var e,t,n,i,a=this.lockRange(!0),s=o.closest(a.endContainer,"td"),l=o.closest(s,"table"),c=l.rows,d=this.options.position;for(e=o.findNodeIndex(s),t=0;c.length>t;t++)n=c[t].cells[e],i=n.cloneNode(),i.innerHTML=r.emptyElementContent,"before"==d?o.insertBefore(i,n):o.insertAfter(i,n);this.releaseRange(a)}}),C=l.extend({exec:function(){var t,n,i,r=this.lockRange(),a=s.mapAll(r,function(t){return e(t).closest("tr")[0]}),l=o.closest(a[0],"table");
 */
/*
 AngularJS v1.4.1
 (c) 2010-2015 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(O,W,s){'use strict';function I(b){return function(){var a=arguments[0],c;c="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.4.1/"+(b?b+"/":"")+a;for(a=1;a<arguments.length;a++){c=c+(1==a?"?":"&")+"p"+(a-1)+"=";var d=encodeURIComponent,e;e=arguments[a];e="function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?JSON.stringify(e):e;c+=d(e)}return Error(c)}}function Da(b){if(null==b||Va(b))return!1;var a="length"in Object(b)&&b.length;
return b.nodeType===qa&&a?!0:L(b)||K(b)||0===a||"number"===typeof a&&0<a&&a-1 in b}function n(b,a,c){var d,e;if(b)if(E(b))for(d in b)"prototype"==d||"length"==d||"name"==d||b.hasOwnProperty&&!b.hasOwnProperty(d)||a.call(c,b[d],d,b);else if(K(b)||Da(b)){var f="object"!==typeof b;d=0;for(e=b.length;d<e;d++)(f||d in b)&&a.call(c,b[d],d,b)}else if(b.forEach&&b.forEach!==n)b.forEach(a,c,b);else if(nc(b))for(d in b)a.call(c,b[d],d,b);else if("function"===typeof b.hasOwnProperty)for(d in b)b.hasOwnProperty(d)&&
a.call(c,b[d],d,b);else for(d in b)Wa.call(b,d)&&a.call(c,b[d],d,b);return b}function oc(b,a,c){for(var d=Object.keys(b).sort(),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function pc(b){return function(a,c){b(c,a)}}function Td(){return++mb}function qc(b,a){a?b.$$hashKey=a:delete b.$$hashKey}function Nb(b,a,c){for(var d=b.$$hashKey,e=0,f=a.length;e<f;++e){var g=a[e];if(F(g)||E(g))for(var h=Object.keys(g),l=0,k=h.length;l<k;l++){var m=h[l],q=g[m];c&&F(q)?(F(b[m])||(b[m]=K(q)?[]:{}),Nb(b[m],
[q],!0)):b[m]=q}}qc(b,d);return b}function Q(b){return Nb(b,sa.call(arguments,1),!1)}function Ud(b){return Nb(b,sa.call(arguments,1),!0)}function X(b){return parseInt(b,10)}function Ob(b,a){return Q(Object.create(b),a)}function v(){}function Xa(b){return b}function ra(b){return function(){return b}}function w(b){return"undefined"===typeof b}function z(b){return"undefined"!==typeof b}function F(b){return null!==b&&"object"===typeof b}function nc(b){return null!==b&&"object"===typeof b&&!rc(b)}function L(b){return"string"===
typeof b}function V(b){return"number"===typeof b}function da(b){return"[object Date]"===ta.call(b)}function E(b){return"function"===typeof b}function Ya(b){return"[object RegExp]"===ta.call(b)}function Va(b){return b&&b.window===b}function Za(b){return b&&b.$evalAsync&&b.$watch}function $a(b){return"boolean"===typeof b}function sc(b){return!(!b||!(b.nodeName||b.prop&&b.attr&&b.find))}function Vd(b){var a={};b=b.split(",");var c;for(c=0;c<b.length;c++)a[b[c]]=!0;return a}function ua(b){return G(b.nodeName||
b[0]&&b[0].nodeName)}function ab(b,a){var c=b.indexOf(a);0<=c&&b.splice(c,1);return c}function fa(b,a,c,d){if(Va(b)||Za(b))throw Ea("cpws");if(tc.test(ta.call(a)))throw Ea("cpta");if(a){if(b===a)throw Ea("cpi");c=c||[];d=d||[];F(b)&&(c.push(b),d.push(a));var e;if(K(b))for(e=a.length=0;e<b.length;e++)a.push(fa(b[e],null,c,d));else{var f=a.$$hashKey;K(a)?a.length=0:n(a,function(b,c){delete a[c]});if(nc(b))for(e in b)a[e]=fa(b[e],null,c,d);else if(b&&"function"===typeof b.hasOwnProperty)for(e in b)b.hasOwnProperty(e)&&
(a[e]=fa(b[e],null,c,d));else for(e in b)Wa.call(b,e)&&(a[e]=fa(b[e],null,c,d));qc(a,f)}}else if(a=b,F(b)){if(c&&-1!==(f=c.indexOf(b)))return d[f];if(K(b))return fa(b,[],c,d);if(tc.test(ta.call(b)))a=new b.constructor(b);else if(da(b))a=new Date(b.getTime());else if(Ya(b))a=new RegExp(b.source,b.toString().match(/[^\/]*$/)[0]),a.lastIndex=b.lastIndex;else return e=Object.create(rc(b)),fa(b,e,c,d);d&&(c.push(b),d.push(a))}return a}function ia(b,a){if(K(b)){a=a||[];for(var c=0,d=b.length;c<d;c++)a[c]=
b[c]}else if(F(b))for(c in a=a||{},b)if("$"!==c.charAt(0)||"$"!==c.charAt(1))a[c]=b[c];return a||b}function ka(b,a){if(b===a)return!0;if(null===b||null===a)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&"object"==c)if(K(b)){if(!K(a))return!1;if((c=b.length)==a.length){for(d=0;d<c;d++)if(!ka(b[d],a[d]))return!1;return!0}}else{if(da(b))return da(a)?ka(b.getTime(),a.getTime()):!1;if(Ya(b))return Ya(a)?b.toString()==a.toString():!1;if(Za(b)||Za(a)||Va(b)||Va(a)||K(a)||da(a)||Ya(a))return!1;
c=ga();for(d in b)if("$"!==d.charAt(0)&&!E(b[d])){if(!ka(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!(d in c||"$"===d.charAt(0)||a[d]===s||E(a[d])))return!1;return!0}return!1}function bb(b,a,c){return b.concat(sa.call(a,c))}function uc(b,a){var c=2<arguments.length?sa.call(arguments,2):[];return!E(a)||a instanceof RegExp?a:c.length?function(){return arguments.length?a.apply(b,bb(c,arguments,0)):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}}function Wd(b,a){var c=
a;"string"===typeof b&&"$"===b.charAt(0)&&"$"===b.charAt(1)?c=s:Va(a)?c="$WINDOW":a&&W===a?c="$DOCUMENT":Za(a)&&(c="$SCOPE");return c}function cb(b,a){if("undefined"===typeof b)return s;V(a)||(a=a?2:null);return JSON.stringify(b,Wd,a)}function vc(b){return L(b)?JSON.parse(b):b}function wc(b,a){var c=Date.parse("Jan 01, 1970 00:00:00 "+b)/6E4;return isNaN(c)?a:c}function Pb(b,a,c){c=c?-1:1;var d=wc(a,b.getTimezoneOffset());a=b;b=c*(d-b.getTimezoneOffset());a=new Date(a.getTime());a.setMinutes(a.getMinutes()+
b);return a}function va(b){b=A(b).clone();try{b.empty()}catch(a){}var c=A("<div>").append(b).html();try{return b[0].nodeType===Na?G(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+G(b)})}catch(d){return G(c)}}function xc(b){try{return decodeURIComponent(b)}catch(a){}}function yc(b){var a={},c,d;n((b||"").split("&"),function(b){b&&(c=b.replace(/\+/g,"%20").split("="),d=xc(c[0]),z(d)&&(b=z(c[1])?xc(c[1]):!0,Wa.call(a,d)?K(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}
function Qb(b){var a=[];n(b,function(b,d){K(b)?n(b,function(b){a.push(ma(d,!0)+(!0===b?"":"="+ma(b,!0)))}):a.push(ma(d,!0)+(!0===b?"":"="+ma(b,!0)))});return a.length?a.join("&"):""}function nb(b){return ma(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ma(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,a?"%20":"+")}function Xd(b,a){var c,d,e=Oa.length;for(d=0;d<
e;++d)if(c=Oa[d]+a,L(c=b.getAttribute(c)))return c;return null}function Yd(b,a){var c,d,e={};n(Oa,function(a){a+="app";!c&&b.hasAttribute&&b.hasAttribute(a)&&(c=b,d=b.getAttribute(a))});n(Oa,function(a){a+="app";var e;!c&&(e=b.querySelector("["+a.replace(":","\\:")+"]"))&&(c=e,d=e.getAttribute(a))});c&&(e.strictDi=null!==Xd(c,"strict-di"),a(c,d?[d]:[],e))}function zc(b,a,c){F(c)||(c={});c=Q({strictDi:!1},c);var d=function(){b=A(b);if(b.injector()){var d=b[0]===W?"document":va(b);throw Ea("btstrpd",
d.replace(/</,"&lt;").replace(/>/,"&gt;"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);c.debugInfoEnabled&&a.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);a.unshift("ng");d=db(a,c.strictDi);d.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return d},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;O&&e.test(O.name)&&(c.debugInfoEnabled=!0,O.name=O.name.replace(e,""));
if(O&&!f.test(O.name))return d();O.name=O.name.replace(f,"");$.resumeBootstrap=function(b){n(b,function(b){a.push(b)});return d()};E($.resumeDeferredBootstrap)&&$.resumeDeferredBootstrap()}function Zd(){O.name="NG_ENABLE_DEBUG_INFO!"+O.name;O.location.reload()}function $d(b){b=$.element(b).injector();if(!b)throw Ea("test");return b.get("$$testability")}function Ac(b,a){a=a||"_";return b.replace(ae,function(b,d){return(d?a:"")+b.toLowerCase()})}function be(){var b;if(!Bc){var a=ob();la=O.jQuery;z(a)&&
(la=null===a?s:O[a]);la&&la.fn.on?(A=la,Q(la.fn,{scope:Pa.scope,isolateScope:Pa.isolateScope,controller:Pa.controller,injector:Pa.injector,inheritedData:Pa.inheritedData}),b=la.cleanData,la.cleanData=function(a){var d;if(Rb)Rb=!1;else for(var e=0,f;null!=(f=a[e]);e++)(d=la._data(f,"events"))&&d.$destroy&&la(f).triggerHandler("$destroy");b(a)}):A=R;$.element=A;Bc=!0}}function Sb(b,a,c){if(!b)throw Ea("areq",a||"?",c||"required");return b}function Qa(b,a,c){c&&K(b)&&(b=b[b.length-1]);Sb(E(b),a,"not a function, got "+
(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function Ra(b,a){if("hasOwnProperty"===b)throw Ea("badname",a);}function Cc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,g=0;g<f;g++)d=a[g],b&&(b=(e=b)[d]);return!c&&E(b)?uc(e,b):b}function pb(b){var a=b[0];b=b[b.length-1];var c=[a];do{a=a.nextSibling;if(!a)break;c.push(a)}while(a!==b);return A(c)}function ga(){return Object.create(null)}function ce(b){function a(a,b,c){return a[b]||(a[b]=c())}var c=I("$injector"),
d=I("ng");b=a(b,"angular",Object);b.$$minErr=b.$$minErr||I;return a(b,"module",function(){var b={};return function(f,g,h){if("hasOwnProperty"===f)throw d("badname","module");g&&b.hasOwnProperty(f)&&(b[f]=null);return a(b,f,function(){function a(b,c,e,f){f||(f=d);return function(){f[e||"push"]([b,c,arguments]);return C}}function b(a,c){return function(b,e){e&&E(e)&&(e.$$moduleName=f);d.push([a,c,arguments]);return C}}if(!g)throw c("nomod",f);var d=[],e=[],t=[],y=a("$injector","invoke","push",e),C=
{_invokeQueue:d,_configBlocks:e,_runBlocks:t,requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide","decorator"),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),config:y,run:function(a){t.push(a);return this}};h&&y(h);return C})}})}
function de(b){Q(b,{bootstrap:zc,copy:fa,extend:Q,merge:Ud,equals:ka,element:A,forEach:n,injector:db,noop:v,bind:uc,toJson:cb,fromJson:vc,identity:Xa,isUndefined:w,isDefined:z,isString:L,isFunction:E,isObject:F,isNumber:V,isElement:sc,isArray:K,version:ee,isDate:da,lowercase:G,uppercase:qb,callbacks:{counter:0},getTestability:$d,$$minErr:I,$$csp:eb,reloadWithDebugInfo:Zd});fb=ce(O);try{fb("ngLocale")}catch(a){fb("ngLocale",[]).provider("$locale",fe)}fb("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:ge});
a.provider("$compile",Dc).directive({a:he,input:Ec,textarea:Ec,form:ie,script:je,select:ke,style:le,option:me,ngBind:ne,ngBindHtml:oe,ngBindTemplate:pe,ngClass:qe,ngClassEven:re,ngClassOdd:se,ngCloak:te,ngController:ue,ngForm:ve,ngHide:we,ngIf:xe,ngInclude:ye,ngInit:ze,ngNonBindable:Ae,ngPluralize:Be,ngRepeat:Ce,ngShow:De,ngStyle:Ee,ngSwitch:Fe,ngSwitchWhen:Ge,ngSwitchDefault:He,ngOptions:Ie,ngTransclude:Je,ngModel:Ke,ngList:Le,ngChange:Me,pattern:Fc,ngPattern:Fc,required:Gc,ngRequired:Gc,minlength:Hc,
ngMinlength:Hc,maxlength:Ic,ngMaxlength:Ic,ngValue:Ne,ngModelOptions:Oe}).directive({ngInclude:Pe}).directive(rb).directive(Jc);a.provider({$anchorScroll:Qe,$animate:Re,$$animateQueue:Se,$$AnimateRunner:Te,$browser:Ue,$cacheFactory:Ve,$controller:We,$document:Xe,$exceptionHandler:Ye,$filter:Kc,$interpolate:Ze,$interval:$e,$http:af,$httpParamSerializer:bf,$httpParamSerializerJQLike:cf,$httpBackend:df,$location:ef,$log:ff,$parse:gf,$rootScope:hf,$q:jf,$$q:kf,$sce:lf,$sceDelegate:mf,$sniffer:nf,$templateCache:of,
$templateRequest:pf,$$testability:qf,$timeout:rf,$window:sf,$$rAF:tf,$$asyncCallback:uf,$$jqLite:vf,$$HashMap:wf,$$cookieReader:xf})}])}function gb(b){return b.replace(yf,function(a,b,d,e){return e?d.toUpperCase():d}).replace(zf,"Moz$1")}function Lc(b){b=b.nodeType;return b===qa||!b||9===b}function Mc(b,a){var c,d,e=a.createDocumentFragment(),f=[];if(Tb.test(b)){c=c||e.appendChild(a.createElement("div"));d=(Af.exec(b)||["",""])[1].toLowerCase();d=na[d]||na._default;c.innerHTML=d[1]+b.replace(Bf,"<$1></$2>")+
d[2];for(d=d[0];d--;)c=c.lastChild;f=bb(f,c.childNodes);c=e.firstChild;c.textContent=""}else f.push(a.createTextNode(b));e.textContent="";e.innerHTML="";n(f,function(a){e.appendChild(a)});return e}function R(b){if(b instanceof R)return b;var a;L(b)&&(b=T(b),a=!0);if(!(this instanceof R)){if(a&&"<"!=b.charAt(0))throw Ub("nosel");return new R(b)}if(a){a=W;var c;b=(c=Cf.exec(b))?[a.createElement(c[1])]:(c=Mc(b,a))?c.childNodes:[]}Nc(this,b)}function Vb(b){return b.cloneNode(!0)}function sb(b,a){a||tb(b);
if(b.querySelectorAll)for(var c=b.querySelectorAll("*"),d=0,e=c.length;d<e;d++)tb(c[d])}function Oc(b,a,c,d){if(z(d))throw Ub("offargs");var e=(d=ub(b))&&d.events,f=d&&d.handle;if(f)if(a)n(a.split(" "),function(a){if(z(c)){var d=e[a];ab(d||[],c);if(d&&0<d.length)return}b.removeEventListener(a,f,!1);delete e[a]});else for(a in e)"$destroy"!==a&&b.removeEventListener(a,f,!1),delete e[a]}function tb(b,a){var c=b.ng339,d=c&&hb[c];d&&(a?delete d.data[a]:(d.handle&&(d.events.$destroy&&d.handle({},"$destroy"),
Oc(b)),delete hb[c],b.ng339=s))}function ub(b,a){var c=b.ng339,c=c&&hb[c];a&&!c&&(b.ng339=c=++Df,c=hb[c]={events:{},data:{},handle:s});return c}function Wb(b,a,c){if(Lc(b)){var d=z(c),e=!d&&a&&!F(a),f=!a;b=(b=ub(b,!e))&&b.data;if(d)b[a]=c;else{if(f)return b;if(e)return b&&b[a];Q(b,a)}}}function vb(b,a){return b.getAttribute?-1<(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" "):!1}function wb(b,a){a&&b.setAttribute&&n(a.split(" "),function(a){b.setAttribute("class",T((" "+
(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+T(a)+" "," ")))})}function xb(b,a){if(a&&b.setAttribute){var c=(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");n(a.split(" "),function(a){a=T(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});b.setAttribute("class",T(c))}}function Nc(b,a){if(a)if(a.nodeType)b[b.length++]=a;else{var c=a.length;if("number"===typeof c&&a.window!==a){if(c)for(var d=0;d<c;d++)b[b.length++]=a[d]}else b[b.length++]=a}}function Pc(b,a){return yb(b,
"$"+(a||"ngController")+"Controller")}function yb(b,a,c){9==b.nodeType&&(b=b.documentElement);for(a=K(a)?a:[a];b;){for(var d=0,e=a.length;d<e;d++)if((c=A.data(b,a[d]))!==s)return c;b=b.parentNode||11===b.nodeType&&b.host}}function Qc(b){for(sb(b,!0);b.firstChild;)b.removeChild(b.firstChild)}function Xb(b,a){a||sb(b);var c=b.parentNode;c&&c.removeChild(b)}function Ef(b,a){a=a||O;if("complete"===a.document.readyState)a.setTimeout(b);else A(a).on("load",b)}function Rc(b,a){var c=zb[a.toLowerCase()];
return c&&Sc[ua(b)]&&c}function Ff(b,a){var c=b.nodeName;return("INPUT"===c||"TEXTAREA"===c)&&Tc[a]}function Gf(b,a){var c=function(c,e){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=a[e||c.type],g=f?f.length:0;if(g){if(w(c.immediatePropagationStopped)){var h=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();h&&h.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};
1<g&&(f=ia(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||f[l].call(b,c)}};c.elem=b;return c}function vf(){this.$get=function(){return Q(R,{hasClass:function(b,a){b.attr&&(b=b[0]);return vb(b,a)},addClass:function(b,a){b.attr&&(b=b[0]);return xb(b,a)},removeClass:function(b,a){b.attr&&(b=b[0]);return wb(b,a)}})}}function Fa(b,a){var c=b&&b.$$hashKey;if(c)return"function"===typeof c&&(c=b.$$hashKey()),c;c=typeof b;return c="function"==c||"object"==c&&null!==b?b.$$hashKey=c+":"+(a||Td)():
c+":"+b}function Sa(b,a){if(a){var c=0;this.nextUid=function(){return++c}}n(b,this.put,this)}function Hf(b){return(b=b.toString().replace(Uc,"").match(Vc))?"function("+(b[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function db(b,a){function c(a){return function(b,c){if(F(b))n(b,pc(a));else return a(b,c)}}function d(a,b){Ra(a,"service");if(E(b)||K(b))b=t.instantiate(b);if(!b.$get)throw Ga("pget",a);return q[a+"Provider"]=b}function e(a,b){return function(){var c=C.invoke(b,this);if(w(c))throw Ga("undef",
a);return c}}function f(a,b,c){return d(a,{$get:!1!==c?e(a,b):b})}function g(a){var b=[],c;n(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=t.get(e[0]);f[e[1]].apply(f,e[2])}}if(!m.get(a)){m.put(a,!0);try{L(a)?(c=fb(a),b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):E(a)?b.push(t.invoke(a)):K(a)?b.push(t.invoke(a)):Qa(a,"module")}catch(e){throw K(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+
"\n"+e.stack),Ga("modulerr",a,e.stack||e.message||e);}}});return b}function h(b,c){function d(a,e){if(b.hasOwnProperty(a)){if(b[a]===l)throw Ga("cdep",a+" <- "+k.join(" <- "));return b[a]}try{return k.unshift(a),b[a]=l,b[a]=c(a,e)}catch(f){throw b[a]===l&&delete b[a],f;}finally{k.shift()}}function e(b,c,f,g){"string"===typeof f&&(g=f,f=null);var k=[],h=db.$$annotate(b,a,g),l,t,m;t=0;for(l=h.length;t<l;t++){m=h[t];if("string"!==typeof m)throw Ga("itkn",m);k.push(f&&f.hasOwnProperty(m)?f[m]:d(m,g))}K(b)&&
(b=b[l]);return b.apply(c,k)}return{invoke:e,instantiate:function(a,b,c){var d=Object.create((K(a)?a[a.length-1]:a).prototype||null);a=e(a,d,b,c);return F(a)||E(a)?a:d},get:d,annotate:db.$$annotate,has:function(a){return q.hasOwnProperty(a+"Provider")||b.hasOwnProperty(a)}}}a=!0===a;var l={},k=[],m=new Sa([],!0),q={$provide:{provider:c(d),factory:c(f),service:c(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:c(function(a,b){return f(a,ra(b),!1)}),constant:c(function(a,
b){Ra(a,"constant");q[a]=b;y[a]=b}),decorator:function(a,b){var c=t.get(a+"Provider"),d=c.$get;c.$get=function(){var a=C.invoke(d,c);return C.invoke(b,null,{$delegate:a})}}}},t=q.$injector=h(q,function(a,b){$.isString(b)&&k.push(b);throw Ga("unpr",k.join(" <- "));}),y={},C=y.$injector=h(y,function(a,b){var c=t.get(a+"Provider",b);return C.invoke(c.$get,c,s,a)});n(g(b),function(a){a&&C.invoke(a)});return C}function Qe(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location",
"$rootScope",function(a,c,d){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===ua(a))return b=a,!0});return b}function f(b){if(b){b.scrollIntoView();var c;c=g.yOffset;E(c)?c=c():sc(c)?(c=c[0],c="fixed"!==a.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):V(c)||(c=0);c&&(b=b.getBoundingClientRect().top,a.scrollBy(0,b-c))}else a.scrollTo(0,0)}function g(a){a=L(a)?a:c.hash();var b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))?f(b):"top"===a&&f(null):
f(null)}var h=a.document;b&&d.$watch(function(){return c.hash()},function(a,b){a===b&&""===a||Ef(function(){d.$evalAsync(g)})});return g}]}function ib(b,a){if(!b&&!a)return"";if(!b)return a;if(!a)return b;K(b)&&(b=b.join(" "));K(a)&&(a=a.join(" "));return b+" "+a}function If(b){L(b)&&(b=b.split(" "));var a=ga();n(b,function(b){b.length&&(a[b]=!0)});return a}function Ha(b){return F(b)?b:{}}function uf(){this.$get=["$$rAF","$timeout",function(b,a){return b.supported?function(a){return b(a)}:function(b){return a(b,
0,!1)}}]}function Jf(b,a,c,d){function e(a){try{a.apply(null,sa.call(arguments,1))}finally{if(C--,0===C)for(;N.length;)try{N.pop()()}catch(b){c.error(b)}}}function f(){g();h()}function g(){a:{try{u=m.state;break a}catch(a){}u=void 0}u=w(u)?null:u;ka(u,D)&&(u=D);D=u}function h(){if(x!==l.url()||p!==u)x=l.url(),p=u,n(B,function(a){a(l.url(),u)})}var l=this,k=b.location,m=b.history,q=b.setTimeout,t=b.clearTimeout,y={};l.isMock=!1;var C=0,N=[];l.$$completeOutstandingRequest=e;l.$$incOutstandingRequestCount=
function(){C++};l.notifyWhenNoOutstandingRequests=function(a){0===C?a():N.push(a)};var u,p,x=k.href,r=a.find("base"),H=null;g();p=u;l.url=function(a,c,e){w(e)&&(e=null);k!==b.location&&(k=b.location);m!==b.history&&(m=b.history);if(a){var f=p===e;if(x===a&&(!d.history||f))return l;var h=x&&Ia(x)===Ia(a);x=a;p=e;if(!d.history||h&&f){if(!h||H)H=a;c?k.replace(a):h?(c=k,e=a.indexOf("#"),a=-1===e?"":a.substr(e+1),c.hash=a):k.href=a}else m[c?"replaceState":"pushState"](e,"",a),g(),p=u;return l}return H||
k.href.replace(/%27/g,"'")};l.state=function(){return u};var B=[],M=!1,D=null;l.onUrlChange=function(a){if(!M){if(d.history)A(b).on("popstate",f);A(b).on("hashchange",f);M=!0}B.push(a);return a};l.$$applicationDestroyed=function(){A(b).off("hashchange popstate",f)};l.$$checkUrlChange=h;l.baseHref=function(){var a=r.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};l.defer=function(a,b){var c;C++;c=q(function(){delete y[c];e(a)},b||0);y[c]=!0;return c};l.defer.cancel=function(a){return y[a]?
(delete y[a],t(a),e(v),!0):!1}}function Ue(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new Jf(b,d,a,c)}]}function Ve(){this.$get=function(){function b(b,d){function e(a){a!=q&&(t?t==a&&(t=a.n):t=a,f(a.n,a.p),f(a,q),q=a,q.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(b in a)throw I("$cacheFactory")("iid",b);var g=0,h=Q({},d,{id:b}),l={},k=d&&d.capacity||Number.MAX_VALUE,m={},q=null,t=null;return a[b]={put:function(a,b){if(!w(b)){if(k<Number.MAX_VALUE){var c=
m[a]||(m[a]={key:a});e(c)}a in l||g++;l[a]=b;g>k&&this.remove(t.key);return b}},get:function(a){if(k<Number.MAX_VALUE){var b=m[a];if(!b)return;e(b)}return l[a]},remove:function(a){if(k<Number.MAX_VALUE){var b=m[a];if(!b)return;b==q&&(q=b.p);b==t&&(t=b.n);f(b.n,b.p);delete m[a]}delete l[a];g--},removeAll:function(){l={};g=0;m={};q=t=null},destroy:function(){m=h=l=null;delete a[b]},info:function(){return Q({},h,{size:g})}}}var a={};b.info=function(){var b={};n(a,function(a,e){b[e]=a.info()});return b};
b.get=function(b){return a[b]};return b}}function of(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Dc(b,a){function c(a,b,c){var d=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,e={};n(a,function(a,f){var g=a.match(d);if(!g)throw ea("iscp",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f}});return e}function d(a){var b=a.charAt(0);if(!b||b!==G(b))throw ea("baddir",a);if(a!==a.trim())throw ea("baddir",
a);}var e={},f=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,g=/(([\w\-]+)(?:\:([^;]+))?;?)/,h=Vd("ngSrc,ngSrcset,src,srcset"),l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,k=/^(on[a-z]+|formaction)$/;this.directive=function t(a,f){Ra(a,"directive");L(a)?(d(a),Sb(f,"directiveFactory"),e.hasOwnProperty(a)||(e[a]=[],b.factory(a+"Directive",["$injector","$exceptionHandler",function(b,d){var f=[];n(e[a],function(e,g){try{var h=b.invoke(e);E(h)?h={compile:ra(h)}:!h.compile&&h.link&&(h.compile=ra(h.link));h.priority=h.priority||
0;h.index=g;h.name=h.name||a;h.require=h.require||h.controller&&h.name;h.restrict=h.restrict||"EA";var k=h,l=h,t=h.name,m={isolateScope:null,bindToController:null};F(l.scope)&&(!0===l.bindToController?(m.bindToController=c(l.scope,t,!0),m.isolateScope={}):m.isolateScope=c(l.scope,t,!1));F(l.bindToController)&&(m.bindToController=c(l.bindToController,t,!0));if(F(m.bindToController)){var C=l.controller,ba=l.controllerAs;if(!C)throw ea("noctrl",t);var ha;a:if(ba&&L(ba))ha=ba;else{if(L(C)){var n=Wc.exec(C);
if(n){ha=n[3];break a}}ha=void 0}if(!ha)throw ea("noident",t);}var r=k.$$bindings=m;F(r.isolateScope)&&(h.$$isolateBindings=r.isolateScope);h.$$moduleName=e.$$moduleName;f.push(h)}catch(s){d(s)}});return f}])),e[a].push(f)):n(a,pc(t));return this};this.aHrefSanitizationWhitelist=function(b){return z(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(b){return z(b)?(a.imgSrcSanitizationWhitelist(b),this):a.imgSrcSanitizationWhitelist()};
var m=!0;this.debugInfoEnabled=function(a){return z(a)?(m=a,this):m};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,c,d,u,p,x,r,H,B,M){function D(a,b){try{a.addClass(b)}catch(c){}}function S(a,b,c,d,e){a instanceof A||(a=A(a));n(a,function(b,c){b.nodeType==Na&&b.nodeValue.match(/\S+/)&&(a[c]=A(b).wrap("<span></span>").parent()[0])});var f=P(a,b,a,c,d,e);S.$$addScopeClass(a);
var g=null;return function(b,c,d){Sb(b,"scope");d=d||{};var e=d.parentBoundTranscludeFn,h=d.transcludeControllers;d=d.futureParentElement;e&&e.$$boundTransclude&&(e=e.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==ua(d)&&d.toString().match(/SVG/)?"svg":"html":"html");d="html"!==g?A(Yb(g,A("<div>").append(a).html())):c?Pa.clone.call(a):a;if(h)for(var l in h)d.data("$"+l+"Controller",h[l].instance);S.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,e);return d}}function P(a,b,c,d,e,f){function g(a,
c,d,e){var f,l,k,m,t,B,y;if(p)for(y=Array(c.length),m=0;m<h.length;m+=3)f=h[m],y[f]=c[f];else y=c;m=0;for(t=h.length;m<t;)if(l=y[h[m++]],c=h[m++],f=h[m++],c){if(c.scope){if(k=a.$new(),S.$$addScopeInfo(A(l),k),B=c.$$destroyBindings)c.$$destroyBindings=null,k.$on("$destroyed",B)}else k=a;B=c.transcludeOnThisElement?ba(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ba(a,b):null;c(f,k,l,d,B,c)}else f&&f(a,l.childNodes,s,e)}for(var h=[],l,k,m,t,p,B=0;B<a.length;B++){l=new $;k=ha(a[B],[],l,0===B?
d:s,e);(f=k.length?J(k,a[B],l,b,c,null,[],[],f):null)&&f.scope&&S.$$addScopeClass(l.$$element);l=f&&f.terminal||!(m=a[B].childNodes)||!m.length?null:P(m,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||l)h.push(B,f,l),t=!0,p=p||f;f=null}return t?g:null}function ba(a,b,c){return function(d,e,f,g,h){d||(d=a.$new(!1,h),d.$$transcluded=!0);return b(d,e,{parentBoundTranscludeFn:c,transcludeControllers:f,futureParentElement:g})}}function ha(a,b,c,d,e){var h=c.$attr,l;switch(a.nodeType){case qa:w(b,
xa(ua(a)),"E",d,e);for(var k,m,t,p=a.attributes,B=0,y=p&&p.length;B<y;B++){var C=!1,N=!1;k=p[B];l=k.name;m=T(k.value);k=xa(l);if(t=ia.test(k))l=l.replace(Yc,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()});var P=k.replace(/(Start|End)$/,"");I(P)&&k===P+"Start"&&(C=l,N=l.substr(0,l.length-5)+"end",l=l.substr(0,l.length-6));k=xa(l.toLowerCase());h[k]=l;if(t||!c.hasOwnProperty(k))c[k]=m,Rc(a,k)&&(c[k]=!0);V(a,b,m,k,t);w(b,k,"A",d,e,C,N)}a=a.className;F(a)&&(a=a.animVal);if(L(a)&&
""!==a)for(;l=g.exec(a);)k=xa(l[2]),w(b,k,"C",d,e)&&(c[k]=T(l[3])),a=a.substr(l.index+l[0].length);break;case Na:if(11===Ta)for(;a.parentNode&&a.nextSibling&&a.nextSibling.nodeType===Na;)a.nodeValue+=a.nextSibling.nodeValue,a.parentNode.removeChild(a.nextSibling);za(b,a.nodeValue);break;case 8:try{if(l=f.exec(a.nodeValue))k=xa(l[1]),w(b,k,"M",d,e)&&(c[k]=T(l[2]))}catch(ba){}}b.sort(Ja);return b}function wa(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ea("uterdir",b,
c);a.nodeType==qa&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return A(d)}function Xc(a,b,c){return function(d,e,f,g,h){e=wa(e[0],b,c);return a(d,e,f,g,h)}}function J(a,b,d,e,f,g,h,k,m){function t(a,b,c,d){if(a){c&&(a=Xc(a,c,d));a.require=J.require;a.directiveName=v;if(u===J||J.$$isolateScope)a=Y(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=Xc(b,c,d));b.require=J.require;b.directiveName=v;if(u===J||J.$$isolateScope)b=Y(b,{isolateScope:!0});k.push(b)}}
function B(a,b,c,d){var e;if(L(b)){var f=b.match(l);b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;e||(d="$"+b+"Controller",e=g?c.inheritedData(d):c.data(d));if(!e&&!f)throw ea("ctreq",b,a);}else if(K(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=B(a,b[g],c,d);return e||null}function y(a,b,c,d,e,f){var g=ga(),h;for(h in d){var l=d[h],k={$scope:l===u||l.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},m=l.controller;"@"==m&&(m=b[l.name]);k=p(m,
k,!0,l.controllerAs);g[l.name]=k;r||a.data("$"+l.name+"Controller",k.instance)}return g}function N(a,c,e,f,g,l){function m(a,b,c){var d;Za(a)||(c=b,b=a,a=s);r&&(d=n);c||(c=r?ja.parent():ja);return g(a,b,d,c,J)}var t,p,C,P,n,ha,ja;b===e?(f=d,ja=d.$$element):(ja=A(e),f=new $(ja,d));u&&(P=c.$new(!0));g&&(ha=m,ha.$$boundTransclude=g);M&&(n=y(ja,f,ha,M,P,c));u&&(S.$$addScopeInfo(ja,P,!0,!(D&&(D===u||D===u.$$originalDirective))),S.$$addScopeClass(ja,!0),P.$$isolateBindings=u.$$isolateBindings,X(c,f,P,P.$$isolateBindings,
u,P));if(n){var x=u||ba,H;x&&n[x.name]&&(p=x.$$bindings.bindToController,(C=n[x.name])&&C.identifier&&p&&(H=C,l.$$destroyBindings=X(c,f,C.instance,p,x)));for(t in n){C=n[t];var wa=C();wa!==C.instance&&(C.instance=wa,ja.data("$"+t+"Controller",wa),C===H&&(l.$$destroyBindings(),l.$$destroyBindings=X(c,f,wa,p,x)))}}t=0;for(l=h.length;t<l;t++)p=h[t],Z(p,p.isolateScope?P:c,ja,f,p.require&&B(p.directiveName,p.require,ja,n),ha);var J=c;u&&(u.template||null===u.templateUrl)&&(J=P);a&&a(J,e.childNodes,s,g);
for(t=k.length-1;0<=t;t--)p=k[t],Z(p,p.isolateScope?P:c,ja,f,p.require&&B(p.directiveName,p.require,ja,n),ha)}m=m||{};for(var P=-Number.MAX_VALUE,ba,M=m.controllerDirectives,u=m.newIsolateScopeDirective,D=m.templateDirective,n=m.nonTlbTranscludeDirective,x=!1,H=!1,r=m.hasElementTranscludeDirective,aa=d.$$element=A(b),J,v,w,Ja=e,za,I=0,G=a.length;I<G;I++){J=a[I];var Ab=J.$$start,Q=J.$$end;Ab&&(aa=wa(b,Ab,Q));w=s;if(P>J.priority)break;if(w=J.scope)J.templateUrl||(F(w)?(O("new/isolated scope",u||ba,
J,aa),u=J):O("new/isolated scope",u,J,aa)),ba=ba||J;v=J.name;!J.templateUrl&&J.controller&&(w=J.controller,M=M||ga(),O("'"+v+"' controller",M[v],J,aa),M[v]=J);if(w=J.transclude)x=!0,J.$$tlb||(O("transclusion",n,J,aa),n=J),"element"==w?(r=!0,P=J.priority,w=aa,aa=d.$$element=A(W.createComment(" "+v+": "+d[v]+" ")),b=aa[0],U(f,sa.call(w,0),b),Ja=S(w,e,P,g&&g.name,{nonTlbTranscludeDirective:n})):(w=A(Vb(b)).contents(),aa.empty(),Ja=S(w,e));if(J.template)if(H=!0,O("template",D,J,aa),D=J,w=E(J.template)?
J.template(aa,d):J.template,w=fa(w),J.replace){g=J;w=Tb.test(w)?Zc(Yb(J.templateNamespace,T(w))):[];b=w[0];if(1!=w.length||b.nodeType!==qa)throw ea("tplrt",v,"");U(f,aa,b);G={$attr:{}};w=ha(b,[],G);var R=a.splice(I+1,a.length-(I+1));u&&z(w);a=a.concat(w).concat(R);$c(d,G);G=a.length}else aa.html(w);if(J.templateUrl)H=!0,O("template",D,J,aa),D=J,J.replace&&(g=J),N=Kf(a.splice(I,a.length-I),aa,d,f,x&&Ja,h,k,{controllerDirectives:M,newIsolateScopeDirective:u,templateDirective:D,nonTlbTranscludeDirective:n}),
G=a.length;else if(J.compile)try{za=J.compile(aa,d,Ja),E(za)?t(null,za,Ab,Q):za&&t(za.pre,za.post,Ab,Q)}catch(V){c(V,va(aa))}J.terminal&&(N.terminal=!0,P=Math.max(P,J.priority))}N.scope=ba&&!0===ba.scope;N.transcludeOnThisElement=x;N.templateOnThisElement=H;N.transclude=Ja;m.hasElementTranscludeDirective=r;return N}function z(a){for(var b=0,c=a.length;b<c;b++)a[b]=Ob(a[b],{$$isolateScope:!0})}function w(b,d,f,g,h,l,k){if(d===h)return null;h=null;if(e.hasOwnProperty(d)){var m;d=a.get(d+"Directive");
for(var p=0,B=d.length;p<B;p++)try{m=d[p],(g===s||g>m.priority)&&-1!=m.restrict.indexOf(f)&&(l&&(m=Ob(m,{$$start:l,$$end:k})),b.push(m),h=m)}catch(y){c(y)}}return h}function I(b){if(e.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,f=c.length;d<f;d++)if(b=c[d],b.multiElement)return!0;return!1}function $c(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;n(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});n(b,function(b,f){"class"==f?(D(e,b),a["class"]=
(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function Kf(a,b,c,e,f,g,h,l){var k=[],m,t,p=b[0],B=a.shift(),y=Ob(B,{templateUrl:null,transclude:null,replace:null,$$originalDirective:B}),C=E(B.templateUrl)?B.templateUrl(b,c):B.templateUrl,M=B.templateNamespace;b.empty();d(H.getTrustedResourceUrl(C)).then(function(d){var N,u;d=fa(d);if(B.replace){d=Tb.test(d)?Zc(Yb(M,
T(d))):[];N=d[0];if(1!=d.length||N.nodeType!==qa)throw ea("tplrt",B.name,C);d={$attr:{}};U(e,b,N);var x=ha(N,[],d);F(B.scope)&&z(x);a=x.concat(a);$c(c,d)}else N=p,b.html(d);a.unshift(y);m=J(a,N,c,f,b,B,g,h,l);n(e,function(a,c){a==N&&(e[c]=b[0])});for(t=P(b[0].childNodes,f);k.length;){d=k.shift();u=k.shift();var S=k.shift(),H=k.shift(),x=b[0];if(!d.$$destroyed){if(u!==p){var wa=u.className;l.hasElementTranscludeDirective&&B.replace||(x=Vb(N));U(S,A(u),x);D(A(x),wa)}u=m.transcludeOnThisElement?ba(d,
m.transclude,H):H;m(t,d,x,e,u,m)}}k=null});return function(a,b,c,d,e){a=e;b.$$destroyed||(k?k.push(b,c,d,a):(m.transcludeOnThisElement&&(a=ba(b,m.transclude,e)),m(t,b,c,d,a,m)))}}function Ja(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function O(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw ea("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,va(d));}function za(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=
a.parent();var b=!!a.length;b&&S.$$addBindingClass(a);return function(a,c){var e=c.parent();b||S.$$addBindingClass(e);S.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function Yb(a,b){a=G(a||"html");switch(a){case "svg":case "math":var c=W.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function R(a,b){if("srcdoc"==b)return H.HTML;var c=ua(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||
"ngSrc"==b))return H.RESOURCE_URL}function V(a,c,d,e,f){var g=R(a,e);f=h[e]||f;var l=b(d,!0,g,f);if(l){if("multiple"===e&&"select"===ua(a))throw ea("selmulti",va(a));c.push({priority:100,compile:function(){return{pre:function(a,c,h){c=h.$$observers||(h.$$observers={});if(k.test(e))throw ea("nodomevents");var m=h[e];m!==d&&(l=m&&b(m,!0,g,f),d=m);l&&(h[e]=l(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(l,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e,
a)}))}}}})}}function U(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]==d){a[g++]=c;h=g+e-1;for(var l=a.length;g<l;g++,h++)h<l?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=c);break}f&&f.replaceChild(c,d);a=W.createDocumentFragment();a.appendChild(d);A.hasData(d)&&(A(c).data(A(d).data()),la?(Rb=!0,la.cleanData([d])):delete A.cache[d[A.expando]]);d=1;for(e=b.length;d<e;d++)f=b[d],A(f).remove(),a.appendChild(f),delete b[d];b[0]=c;b.length=1}function Y(a,
b){return Q(function(){return a.apply(null,arguments)},a,b)}function Z(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,va(d))}}function X(a,c,d,e,f,g){var h;n(e,function(e,g){var l=e.attrName,k=e.optional,m=e.mode,t,p,B,C;Wa.call(c,l)||(c[l]=s);switch(m){case "@":c[l]||k||(d[g]=s);c.$observe(l,function(a){d[g]=a});c.$$observers[l].$$scope=a;c[l]&&(d[g]=b(c[l])(a));break;case "=":if(k&&!c[l])break;p=u(c[l]);C=p.literal?ka:function(a,b){return a===b||a!==a&&b!==b};B=p.assign||function(){t=d[g]=p(a);throw ea("nonassign",
c[l],f.name);};t=d[g]=p(a);k=function(b){C(b,d[g])||(C(b,t)?B(a,b=d[g]):d[g]=b);return t=b};k.$stateful=!0;k=e.collection?a.$watchCollection(c[l],k):a.$watch(u(c[l],k),null,p.literal);h=h||[];h.push(k);break;case "&":p=u(c[l]);if(p===v&&k)break;d[g]=function(b){return p(a,b)}}});e=h?function(){for(var a=0,b=h.length;a<b;++a)h[a]()}:v;return g&&e!==v?(g.$on("$destroy",e),v):e}var $=function(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=
a};$.prototype={$normalize:xa,$addClass:function(a){a&&0<a.length&&B.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&B.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=ad(a,b);c&&c.length&&B.addClass(this.$$element,c);(c=ad(b,a))&&c.length&&B.removeClass(this.$$element,c)},$set:function(a,b,d,e){var f=this.$$element[0],g=Rc(f,a),h=Ff(f,a),f=a;g?(this.$$element.prop(a,b),e=g):h&&(this[h]=b,f=h);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=Ac(a,
"-"));g=ua(this.$$element);if("a"===g&&"href"===a||"img"===g&&"src"===a)this[a]=b=M(b,"src"===a);else if("img"===g&&"srcset"===a){for(var g="",h=T(b),l=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,l=/\s/.test(h)?l:/(,)/,h=h.split(l),l=Math.floor(h.length/2),k=0;k<l;k++)var m=2*k,g=g+M(T(h[m]),!0),g=g+(" "+T(h[m+1]));h=T(h[2*k]).split(/\s/);g+=M(T(h[0]),!0);2===h.length&&(g+=" "+T(h[1]));this[a]=b=g}!1!==d&&(null===b||b===s?this.$$element.removeAttr(e):this.$$element.attr(e,b));(a=this.$$observers)&&n(a[f],
function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=ga()),e=d[a]||(d[a]=[]);e.push(b);x.$evalAsync(function(){!e.$$inter&&c.hasOwnProperty(a)&&b(c[a])});return function(){ab(e,b)}}};var ca=b.startSymbol(),da=b.endSymbol(),fa="{{"==ca||"}}"==da?Xa:function(a){return a.replace(/\{\{/g,ca).replace(/}}/g,da)},ia=/^ngAttr[A-Z]/;S.$$addBindingInfo=m?function(a,b){var c=a.data("$binding")||[];K(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:v;S.$$addBindingClass=
m?function(a){D(a,"ng-binding")}:v;S.$$addScopeInfo=m?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:v;S.$$addScopeClass=m?function(a,b){D(a,b?"ng-isolate-scope":"ng-scope")}:v;return S}]}function xa(b){return gb(b.replace(Yc,""))}function ad(b,a){var c="",d=b.split(/\s+/),e=a.split(/\s+/),f=0;a:for(;f<d.length;f++){for(var g=d[f],h=0;h<e.length;h++)if(g==e[h])continue a;c+=(0<c.length?" ":"")+g}return c}function Zc(b){b=A(b);var a=b.length;if(1>=a)return b;for(;a--;)8===
b[a].nodeType&&Lf.call(b,a,1);return b}function We(){var b={},a=!1;this.register=function(a,d){Ra(a,"controller");F(a)?Q(b,a):b[a]=d};this.allowGlobals=function(){a=!0};this.$get=["$injector","$window",function(c,d){function e(a,b,c,d){if(!a||!F(a.$scope))throw I("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,l){var k,m,q;h=!0===h;l&&L(l)&&(q=l);if(L(f)){l=f.match(Wc);if(!l)throw Mf("ctrlfmt",f);m=l[1];q=q||l[3];f=b.hasOwnProperty(m)?b[m]:Cc(g.$scope,m,!0)||(a?Cc(d,m,!0):s);Qa(f,
m,!0)}if(h)return h=(K(f)?f[f.length-1]:f).prototype,k=Object.create(h||null),q&&e(g,q,k,m||f.name),Q(function(){var a=c.invoke(f,k,g,m);a!==k&&(F(a)||E(a))&&(k=a,q&&e(g,q,k,m||f.name));return k},{instance:k,identifier:q});k=c.instantiate(f,g,m);q&&e(g,q,k,m||f.name);return k}}]}function Xe(){this.$get=["$window",function(b){return A(b.document)}]}function Ye(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Zb(b){return F(b)?da(b)?b.toISOString():cb(b):b}
function bf(){this.$get=function(){return function(b){if(!b)return"";var a=[];oc(b,function(b,d){null===b||w(b)||(K(b)?n(b,function(b,c){a.push(ma(d)+"="+ma(Zb(b)))}):a.push(ma(d)+"="+ma(Zb(b))))});return a.join("&")}}}function cf(){this.$get=function(){return function(b){function a(b,e,f){null===b||w(b)||(K(b)?n(b,function(b){a(b,e+"[]")}):F(b)&&!da(b)?oc(b,function(b,c){a(b,e+(f?"":"[")+c+(f?"":"]"))}):c.push(ma(e)+"="+ma(Zb(b))))}if(!b)return"";var c=[];a(b,"",!0);return c.join("&")}}}function $b(b,
a){if(L(b)){var c=b.replace(Nf,"").trim();if(c){var d=a("Content-Type");(d=d&&0===d.indexOf(bd))||(d=(d=c.match(Of))&&Pf[d[0]].test(c));d&&(b=vc(c))}}return b}function cd(b){var a=ga(),c;L(b)?n(b.split("\n"),function(b){c=b.indexOf(":");var e=G(T(b.substr(0,c)));b=T(b.substr(c+1));e&&(a[e]=a[e]?a[e]+", "+b:b)}):F(b)&&n(b,function(b,c){var f=G(c),g=T(b);f&&(a[f]=a[f]?a[f]+", "+g:g)});return a}function dd(b){var a;return function(c){a||(a=cd(b));return c?(c=a[G(c)],void 0===c&&(c=null),c):a}}function ed(b,
a,c,d){if(E(d))return d(b,a,c);n(d,function(d){b=d(b,a,c)});return b}function af(){var b=this.defaults={transformResponse:[$b],transformRequest:[function(a){return F(a)&&"[object File]"!==ta.call(a)&&"[object Blob]"!==ta.call(a)&&"[object FormData]"!==ta.call(a)?cb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ia(ac),put:ia(ac),patch:ia(ac)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},a=!1;this.useApplyAsync=function(b){return z(b)?
(a=!!b,this):a};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(d,e,f,g,h,l){function k(a){function c(a){var b=Q({},a);b.data=a.data?ed(a.data,a.headers,a.status,e.transformResponse):a.data;a=a.status;return 200<=a&&300>a?b:h.reject(b)}function d(a,b){var c,e={};n(a,function(a,d){E(a)?(c=a(b),null!=c&&(e[d]=c)):e[d]=a});return e}if(!$.isObject(a))throw I("$http")("badreq",a);var e=Q({method:"get",transformRequest:b.transformRequest,
transformResponse:b.transformResponse,paramSerializer:b.paramSerializer},a);e.headers=function(a){var c=b.headers,e=Q({},a.headers),f,g,h,c=Q({},c.common,c[G(a.method)]);a:for(f in c){g=G(f);for(h in e)if(G(h)===g)continue a;e[f]=c[f]}return d(e,ia(a))}(a);e.method=qb(e.method);e.paramSerializer=L(e.paramSerializer)?l.get(e.paramSerializer):e.paramSerializer;var f=[function(a){var d=a.headers,e=ed(a.data,dd(d),s,a.transformRequest);w(e)&&n(d,function(a,b){"content-type"===G(b)&&delete d[b]});w(a.withCredentials)&&
!w(b.withCredentials)&&(a.withCredentials=b.withCredentials);return m(a,e).then(c,c)},s],g=h.when(e);for(n(y,function(a){(a.request||a.requestError)&&f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;){a=f.shift();var k=f.shift(),g=g.then(a,k)}g.success=function(a){Qa(a,"fn");g.then(function(b){a(b.data,b.status,b.headers,e)});return g};g.error=function(a){Qa(a,"fn");g.then(null,function(b){a(b.data,b.status,b.headers,e)});return g};return g}
function m(c,f){function l(b,c,d,e){function f(){m(c,b,d,e)}M&&(200<=b&&300>b?M.put(P,[b,c,cd(d),e]):M.remove(P));a?g.$applyAsync(f):(f(),g.$$phase||g.$apply())}function m(a,b,d,e){b=Math.max(b,0);(200<=b&&300>b?H.resolve:H.reject)({data:a,status:b,headers:dd(d),config:c,statusText:e})}function y(a){m(a.data,a.status,ia(a.headers()),a.statusText)}function n(){var a=k.pendingRequests.indexOf(c);-1!==a&&k.pendingRequests.splice(a,1)}var H=h.defer(),B=H.promise,M,D,S=c.headers,P=q(c.url,c.paramSerializer(c.params));
k.pendingRequests.push(c);B.then(n,n);!c.cache&&!b.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(M=F(c.cache)?c.cache:F(b.cache)?b.cache:t);M&&(D=M.get(P),z(D)?D&&E(D.then)?D.then(y,y):K(D)?m(D[1],D[0],ia(D[2]),D[3]):m(D,200,{},"OK"):M.put(P,B));w(D)&&((D=fd(c.url)?e()[c.xsrfCookieName||b.xsrfCookieName]:s)&&(S[c.xsrfHeaderName||b.xsrfHeaderName]=D),d(c.method,P,f,l,S,c.timeout,c.withCredentials,c.responseType));return B}function q(a,b){0<b.length&&(a+=(-1==a.indexOf("?")?"?":"&")+b);
return a}var t=f("$http");b.paramSerializer=L(b.paramSerializer)?l.get(b.paramSerializer):b.paramSerializer;var y=[];n(c,function(a){y.unshift(L(a)?l.get(a):l.invoke(a))});k.pendingRequests=[];(function(a){n(arguments,function(a){k[a]=function(b,c){return k(Q({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){n(arguments,function(a){k[a]=function(b,c,d){return k(Q({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");k.defaults=b;return k}]}function Qf(){return new O.XMLHttpRequest}
function df(){this.$get=["$browser","$window","$document",function(b,a,c){return Rf(b,Qf,b.defer,a.angular.callbacks,c[0])}]}function Rf(b,a,c,d,e){function f(a,b,c){var f=e.createElement("script"),m=null;f.type="text/javascript";f.src=a;f.async=!0;m=function(a){f.removeEventListener("load",m,!1);f.removeEventListener("error",m,!1);e.body.removeChild(f);f=null;var g=-1,y="unknown";a&&("load"!==a.type||d[b].called||(a={type:"error"}),y=a.type,g="error"===a.type?404:200);c&&c(g,y)};f.addEventListener("load",
m,!1);f.addEventListener("error",m,!1);e.body.appendChild(f);return m}return function(e,h,l,k,m,q,t,y){function C(){p&&p();x&&x.abort()}function N(a,d,e,f,g){H!==s&&c.cancel(H);p=x=null;a(d,e,f,g);b.$$completeOutstandingRequest(v)}b.$$incOutstandingRequestCount();h=h||b.url();if("jsonp"==G(e)){var u="_"+(d.counter++).toString(36);d[u]=function(a){d[u].data=a;d[u].called=!0};var p=f(h.replace("JSON_CALLBACK","angular.callbacks."+u),u,function(a,b){N(k,a,d[u].data,"",b);d[u]=v})}else{var x=a();x.open(e,
h,!0);n(m,function(a,b){z(a)&&x.setRequestHeader(b,a)});x.onload=function(){var a=x.statusText||"",b="response"in x?x.response:x.responseText,c=1223===x.status?204:x.status;0===c&&(c=b?200:"file"==Aa(h).protocol?404:0);N(k,c,b,x.getAllResponseHeaders(),a)};e=function(){N(k,-1,null,null,"")};x.onerror=e;x.onabort=e;t&&(x.withCredentials=!0);if(y)try{x.responseType=y}catch(r){if("json"!==y)throw r;}x.send(l)}if(0<q)var H=c(C,q);else q&&E(q.then)&&q.then(C)}}function Ze(){var b="{{",a="}}";this.startSymbol=
function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(m,b).replace(q,a)}function h(f,h,m,q){function u(a){try{var b=a;a=m?e.getTrusted(m,b):e.valueOf(b);var c;if(q&&!z(a))c=a;else if(null==a)c="";else{switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=cb(a)}c=a}return c}catch(g){d(Ka.interr(f,g))}}q=!!q;for(var p,n,r=0,H=
[],B=[],M=f.length,D=[],S=[];r<M;)if(-1!=(p=f.indexOf(b,r))&&-1!=(n=f.indexOf(a,p+l)))r!==p&&D.push(g(f.substring(r,p))),r=f.substring(p+l,n),H.push(r),B.push(c(r,u)),r=n+k,S.push(D.length),D.push("");else{r!==M&&D.push(g(f.substring(r)));break}m&&1<D.length&&Ka.throwNoconcat(f);if(!h||H.length){var P=function(a){for(var b=0,c=H.length;b<c;b++){if(q&&w(a[b]))return;D[S[b]]=a[b]}return D.join("")};return Q(function(a){var b=0,c=H.length,e=Array(c);try{for(;b<c;b++)e[b]=B[b](a);return P(e)}catch(g){d(Ka.interr(f,
g))}},{exp:f,expressions:H,$$watchDelegate:function(a,b){var c;return a.$watchGroup(B,function(d,e){var f=P(d);E(b)&&b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=b.length,k=a.length,m=new RegExp(b.replace(/./g,f),"g"),q=new RegExp(a.replace(/./g,f),"g");h.startSymbol=function(){return b};h.endSymbol=function(){return a};return h}]}function $e(){this.$get=["$rootScope","$window","$q","$$q",function(b,a,c,d){function e(e,h,l,k){var m=4<arguments.length,q=m?sa.call(arguments,4):[],t=a.setInterval,y=a.clearInterval,
C=0,N=z(k)&&!k,u=(N?d:c).defer(),p=u.promise;l=z(l)?l:0;p.then(null,null,m?function(){e.apply(null,q)}:e);p.$$intervalId=t(function(){u.notify(C++);0<l&&C>=l&&(u.resolve(C),y(p.$$intervalId),delete f[p.$$intervalId]);N||b.$apply()},h);f[p.$$intervalId]=u;return p}var f={};e.cancel=function(b){return b&&b.$$intervalId in f?(f[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId),delete f[b.$$intervalId],!0):!1};return e}]}function fe(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",
GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January February March April May June July August September October November December".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a",ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"]},pluralCat:function(b){return 1===b?"one":"other"}}}}function bc(b){b=b.split("/");for(var a=b.length;a--;)b[a]=nb(b[a]);return b.join("/")}function gd(b,a){var c=Aa(b);a.$$protocol=c.protocol;
a.$$host=c.hostname;a.$$port=X(c.port)||Sf[c.protocol]||null}function hd(b,a){var c="/"!==b.charAt(0);c&&(b="/"+b);var d=Aa(b);a.$$path=decodeURIComponent(c&&"/"===d.pathname.charAt(0)?d.pathname.substring(1):d.pathname);a.$$search=yc(d.search);a.$$hash=decodeURIComponent(d.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function ya(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function Ia(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function Bb(b){return b.replace(/(#.+)|#$/,
"$1")}function cc(b){return b.substr(0,Ia(b).lastIndexOf("/")+1)}function dc(b,a){this.$$html5=!0;a=a||"";var c=cc(b);gd(b,this);this.$$parse=function(a){var b=ya(c,a);if(!L(b))throw Cb("ipthprfx",a,c);hd(b,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Qb(this.$$search),b=this.$$hash?"#"+nb(this.$$hash):"";this.$$url=bc(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),
!0;var f,g;(f=ya(b,d))!==s?(g=f,g=(f=ya(a,f))!==s?c+(ya("/",f)||f):b+g):(f=ya(c,d))!==s?g=c+f:c==d+"/"&&(g=c);g&&this.$$parse(g);return!!g}}function ec(b,a){var c=cc(b);gd(b,this);this.$$parse=function(d){d=ya(b,d)||ya(c,d);var e;"#"===d.charAt(0)?(e=ya(a,d),w(e)&&(e=d)):e=this.$$html5?d:"";hd(e,this);d=this.$$path;var f=/^\/[A-Z]:(\/.*)/;0===e.indexOf(b)&&(e=e.replace(b,""));f.exec(e)||(d=(e=f.exec(d))?e[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var c=Qb(this.$$search),e=this.$$hash?
"#"+nb(this.$$hash):"";this.$$url=bc(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+(this.$$url?a+this.$$url:"")};this.$$parseLinkUrl=function(a,c){return Ia(b)==Ia(a)?(this.$$parse(a),!0):!1}}function id(b,a){this.$$html5=!0;ec.apply(this,arguments);var c=cc(b);this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;b==Ia(d)?f=d:(g=ya(c,d))?f=b+a+g:c===d+"/"&&(f=c);f&&this.$$parse(f);return!!f};this.$$compose=function(){var c=Qb(this.$$search),e=this.$$hash?"#"+nb(this.$$hash):
"";this.$$url=bc(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+a+this.$$url}}function Db(b){return function(){return this[b]}}function jd(b,a){return function(c){if(w(c))return this[b];this[b]=a(c);this.$$compose();return this}}function ef(){var b="",a={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(a){return z(a)?(b=a,this):b};this.html5Mode=function(b){return $a(b)?(a.enabled=b,this):F(b)?($a(b.enabled)&&(a.enabled=b.enabled),$a(b.requireBase)&&(a.requireBase=b.requireBase),$a(b.rewriteLinks)&&
(a.rewriteLinks=b.rewriteLinks),this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(c,d,e,f,g){function h(a,b,c){var e=k.url(),f=k.$$state;try{d.url(a,b,c),k.$$state=d.state()}catch(g){throw k.url(e),k.$$state=f,g;}}function l(a,b){c.$broadcast("$locationChangeSuccess",k.absUrl(),a,k.$$state,b)}var k,m;m=d.baseHref();var q=d.url(),t;if(a.enabled){if(!m&&a.requireBase)throw Cb("nobase");t=q.substring(0,q.indexOf("/",q.indexOf("//")+2))+(m||"/");m=e.history?dc:id}else t=
Ia(q),m=ec;k=new m(t,"#"+b);k.$$parseLinkUrl(q,q);k.$$state=d.state();var y=/^\s*(javascript|mailto):/i;f.on("click",function(b){if(a.rewriteLinks&&!b.ctrlKey&&!b.metaKey&&!b.shiftKey&&2!=b.which&&2!=b.button){for(var e=A(b.target);"a"!==ua(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),l=e.attr("href")||e.attr("xlink:href");F(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=Aa(h.animVal).href);y.test(h)||!h||e.attr("target")||b.isDefaultPrevented()||!k.$$parseLinkUrl(h,
l)||(b.preventDefault(),k.absUrl()!=d.url()&&(c.$apply(),g.angular["ff-684208-preventDefault"]=!0))}});Bb(k.absUrl())!=Bb(q)&&d.url(k.absUrl(),!0);var C=!0;d.onUrlChange(function(a,b){c.$evalAsync(function(){var d=k.absUrl(),e=k.$$state,f;k.$$parse(a);k.$$state=b;f=c.$broadcast("$locationChangeStart",a,d,b,e).defaultPrevented;k.absUrl()===a&&(f?(k.$$parse(d),k.$$state=e,h(d,!1,e)):(C=!1,l(d,e)))});c.$$phase||c.$digest()});c.$watch(function(){var a=Bb(d.url()),b=Bb(k.absUrl()),f=d.state(),g=k.$$replace,
m=a!==b||k.$$html5&&e.history&&f!==k.$$state;if(C||m)C=!1,c.$evalAsync(function(){var b=k.absUrl(),d=c.$broadcast("$locationChangeStart",b,a,k.$$state,f).defaultPrevented;k.absUrl()===b&&(d?(k.$$parse(a),k.$$state=f):(m&&h(b,g,f===k.$$state?null:k.$$state),l(a,f)))});k.$$replace=!1});return k}]}function ff(){var b=!0,a=this;this.debugEnabled=function(a){return z(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?
"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||v;a=!1;try{a=!!e.apply}catch(l){}return a?function(){var a=[];n(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function Ba(b,a){if("__defineGetter__"===
b||"__defineSetter__"===b||"__lookupGetter__"===b||"__lookupSetter__"===b||"__proto__"===b)throw ca("isecfld",a);return b}function oa(b,a){if(b){if(b.constructor===b)throw ca("isecfn",a);if(b.window===b)throw ca("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw ca("isecdom",a);if(b===Object)throw ca("isecobj",a);}return b}function kd(b,a){if(b){if(b.constructor===b)throw ca("isecfn",a);if(b===Tf||b===Uf||b===Vf)throw ca("isecff",a);}}function Wf(b,a){return"undefined"!==typeof b?
b:a}function ld(b,a){return"undefined"===typeof b?a:"undefined"===typeof a?b:b+a}function U(b,a){var c,d;switch(b.type){case r.Program:c=!0;n(b.body,function(b){U(b.expression,a);c=c&&b.expression.constant});b.constant=c;break;case r.Literal:b.constant=!0;b.toWatch=[];break;case r.UnaryExpression:U(b.argument,a);b.constant=b.argument.constant;b.toWatch=b.argument.toWatch;break;case r.BinaryExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=b.left.toWatch.concat(b.right.toWatch);
break;case r.LogicalExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=b.constant?[]:[b];break;case r.ConditionalExpression:U(b.test,a);U(b.alternate,a);U(b.consequent,a);b.constant=b.test.constant&&b.alternate.constant&&b.consequent.constant;b.toWatch=b.constant?[]:[b];break;case r.Identifier:b.constant=!1;b.toWatch=[b];break;case r.MemberExpression:U(b.object,a);b.computed&&U(b.property,a);b.constant=b.object.constant&&(!b.computed||b.property.constant);b.toWatch=
[b];break;case r.CallExpression:c=b.filter?!a(b.callee.name).$stateful:!1;d=[];n(b.arguments,function(b){U(b,a);c=c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=b.filter&&!a(b.callee.name).$stateful?d:[b];break;case r.AssignmentExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=[b];break;case r.ArrayExpression:c=!0;d=[];n(b.elements,function(b){U(b,a);c=c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=
d;break;case r.ObjectExpression:c=!0;d=[];n(b.properties,function(b){U(b.value,a);c=c&&b.value.constant;b.value.constant||d.push.apply(d,b.value.toWatch)});b.constant=c;b.toWatch=d;break;case r.ThisExpression:b.constant=!1,b.toWatch=[]}}function md(b){if(1==b.length){b=b[0].expression;var a=b.toWatch;return 1!==a.length?a:a[0]!==b?a:s}}function nd(b){return b.type===r.Identifier||b.type===r.MemberExpression}function od(b){if(1===b.body.length&&nd(b.body[0].expression))return{type:r.AssignmentExpression,
left:b.body[0].expression,right:{type:r.NGValueParameter},operator:"="}}function pd(b){return 0===b.body.length||1===b.body.length&&(b.body[0].expression.type===r.Literal||b.body[0].expression.type===r.ArrayExpression||b.body[0].expression.type===r.ObjectExpression)}function qd(b,a){this.astBuilder=b;this.$filter=a}function rd(b,a){this.astBuilder=b;this.$filter=a}function Eb(b,a,c,d){oa(b,d);a=a.split(".");for(var e,f=0;1<a.length;f++){e=Ba(a.shift(),d);var g=oa(b[e],d);g||(g={},b[e]=g);b=g}e=Ba(a.shift(),
d);oa(b[e],d);return b[e]=c}function Fb(b){return"constructor"==b}function fc(b){return E(b.valueOf)?b.valueOf():Xf.call(b)}function gf(){var b=ga(),a=ga();this.$get=["$filter","$sniffer",function(c,d){function e(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=fc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function f(a,b,c,d,f){var g=d.inputs,h;if(1===g.length){var l=e,g=g[0];return a.$watch(function(a){var b=g(a);e(b,l)||(h=d(a,s,s,[b]),l=b&&fc(b));return h},b,c,f)}for(var k=[],m=[],
q=0,n=g.length;q<n;q++)k[q]=e,m[q]=null;return a.$watch(function(a){for(var b=!1,c=0,f=g.length;c<f;c++){var l=g[c](a);if(b||(b=!e(l,k[c])))m[c]=l,k[c]=l&&fc(l)}b&&(h=d(a,s,s,m));return h},b,c,f)}function g(a,b,c,d){var e,f;return e=a.$watch(function(a){return d(a)},function(a,c,d){f=a;E(b)&&b.apply(this,arguments);z(a)&&d.$$postDigest(function(){z(f)&&e()})},c)}function h(a,b,c,d){function e(a){var b=!0;n(a,function(a){z(a)||(b=!1)});return b}var f,g;return f=a.$watch(function(a){return d(a)},function(a,
c,d){g=a;E(b)&&b.call(this,a,c,d);e(a)&&d.$$postDigest(function(){e(g)&&f()})},c)}function l(a,b,c,d){var e;return e=a.$watch(function(a){return d(a)},function(a,c,d){E(b)&&b.apply(this,arguments);e()},c)}function k(a,b){if(!b)return a;var c=a.$$watchDelegate,c=c!==h&&c!==g?function(c,d,e,f){e=a(c,d,e,f);return b(e,c,d)}:function(c,d,e,f){e=a(c,d,e,f);c=b(e,c,d);return z(e)?c:e};a.$$watchDelegate&&a.$$watchDelegate!==f?c.$$watchDelegate=a.$$watchDelegate:b.$stateful||(c.$$watchDelegate=f,c.inputs=
a.inputs?a.inputs:[a]);return c}var m={csp:d.csp,expensiveChecks:!1},q={csp:d.csp,expensiveChecks:!0};return function(d,e,C){var n,u,p;switch(typeof d){case "string":p=d=d.trim();var r=C?a:b;n=r[p];n||(":"===d.charAt(0)&&":"===d.charAt(1)&&(u=!0,d=d.substring(2)),C=C?q:m,n=new gc(C),n=(new hc(n,c,C)).parse(d),n.constant?n.$$watchDelegate=l:u?n.$$watchDelegate=n.literal?h:g:n.inputs&&(n.$$watchDelegate=f),r[p]=n);return k(n,e);case "function":return k(d,e);default:return v}}}]}function jf(){this.$get=
["$rootScope","$exceptionHandler",function(b,a){return sd(function(a){b.$evalAsync(a)},a)}]}function kf(){this.$get=["$browser","$exceptionHandler",function(b,a){return sd(function(a){b.defer(a)},a)}]}function sd(b,a){function c(a,b,c){function d(b){return function(c){e||(e=!0,b.call(a,c))}}var e=!1;return[d(b),d(c)]}function d(){this.$$state={status:0}}function e(a,b){return function(c){b.call(a,c)}}function f(c){!c.processScheduled&&c.pending&&(c.processScheduled=!0,b(function(){var b,d,e;e=c.pending;
c.processScheduled=!1;c.pending=s;for(var f=0,g=e.length;f<g;++f){d=e[f][0];b=e[f][c.status];try{E(b)?d.resolve(b(c.value)):1===c.status?d.resolve(c.value):d.reject(c.value)}catch(h){d.reject(h),a(h)}}}))}function g(){this.promise=new d;this.resolve=e(this,this.resolve);this.reject=e(this,this.reject);this.notify=e(this,this.notify)}var h=I("$q",TypeError);d.prototype={then:function(a,b,c){var d=new g;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,a,b,c]);0<this.$$state.status&&
f(this.$$state);return d.promise},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return k(b,!0,a)},function(b){return k(b,!1,a)},b)}};g.prototype={resolve:function(a){this.promise.$$state.status||(a===this.promise?this.$$reject(h("qcycle",a)):this.$$resolve(a))},$$resolve:function(b){var d,e;e=c(this,this.$$resolve,this.$$reject);try{if(F(b)||E(b))d=b&&b.then;E(d)?(this.promise.$$state.status=-1,d.call(b,e[0],e[1],this.notify)):(this.promise.$$state.value=
b,this.promise.$$state.status=1,f(this.promise.$$state))}catch(g){e[1](g),a(g)}},reject:function(a){this.promise.$$state.status||this.$$reject(a)},$$reject:function(a){this.promise.$$state.value=a;this.promise.$$state.status=2;f(this.promise.$$state)},notify:function(c){var d=this.promise.$$state.pending;0>=this.promise.$$state.status&&d&&d.length&&b(function(){for(var b,e,f=0,g=d.length;f<g;f++){e=d[f][0];b=d[f][3];try{e.notify(E(b)?b(c):c)}catch(h){a(h)}}})}};var l=function(a,b){var c=new g;b?c.resolve(a):
c.reject(a);return c.promise},k=function(a,b,c){var d=null;try{E(c)&&(d=c())}catch(e){return l(e,!1)}return d&&E(d.then)?d.then(function(){return l(a,b)},function(a){return l(a,!1)}):l(a,b)},m=function(a,b,c,d){var e=new g;e.resolve(a);return e.promise.then(b,c,d)},q=function y(a){if(!E(a))throw h("norslvr",a);if(!(this instanceof y))return new y(a);var b=new g;a(function(a){b.resolve(a)},function(a){b.reject(a)});return b.promise};q.defer=function(){return new g};q.reject=function(a){var b=new g;
b.reject(a);return b.promise};q.when=m;q.resolve=m;q.all=function(a){var b=new g,c=0,d=K(a)?[]:{};n(a,function(a,e){c++;m(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise};return q}function tf(){this.$get=["$window","$timeout",function(b,a){function c(){for(var a=0;a<m.length;a++){var b=m[a];b&&(m[a]=null,b())}k=m.length=0}function d(a){var b=m.length;k++;m.push(a);0===b&&(l=h(c));return function(){0<=
b&&(b=m[b]=null,0===--k&&l&&(l(),l=null,m.length=0))}}var e=b.requestAnimationFrame||b.webkitRequestAnimationFrame,f=b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.webkitCancelRequestAnimationFrame,g=!!e,h=g?function(a){var b=e(a);return function(){f(b)}}:function(b){var c=a(b,16.66,!1);return function(){a.cancel(c)}};d.supported=g;var l,k=0,m=[];return d}]}function hf(){function b(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners=
{};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++mb;this.$$ChildScope=null}b.prototype=a;return b}var a=10,c=I("$rootScope"),d=null,e=null;this.digestTtl=function(b){arguments.length&&(a=b);return a};this.$get=["$injector","$exceptionHandler","$parse","$browser",function(f,g,h,l){function k(a){a.currentScope.$$destroyed=!0}function m(){this.$id=++mb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=
!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function q(a){if(p.$$phase)throw c("inprog",p.$$phase);p.$$phase=a}function t(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function y(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function r(){}function s(){for(;H.length;)try{H.shift()()}catch(a){g(a)}e=null}function u(){null===e&&(e=l.defer(function(){p.$apply(s)}))}m.prototype={constructor:m,
$new:function(a,c){var d;c=c||this;a?(d=new m,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=b(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(a||c!=this)&&d.$on("$destroy",k);return d},$watch:function(a,b,c,e){var f=h(a);if(f.$$watchDelegate)return f.$$watchDelegate(this,b,c,f,a);var g=this,l=g.$$watchers,k={fn:b,last:r,get:f,exp:e||a,eq:!!c};d=null;E(b)||(k.fn=v);l||
(l=g.$$watchers=[]);l.unshift(k);t(this,1);return function(){0<=ab(l,k)&&t(g,-1);d=null}},$watchGroup:function(a,b){function c(){h=!1;l?(l=!1,b(e,e,g)):b(e,d,g)}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,l=!0;if(!a.length){var k=!0;g.$evalAsync(function(){k&&b(e,e,g)});return function(){k=!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});n(a,function(a,b){var l=g.$watch(a,function(a,f){e[b]=a;d[b]=f;h||(h=!0,g.$evalAsync(c))});f.push(l)});return function(){for(;f.length;)f.shift()()}},
$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!w(e)){if(F(e))if(Da(e))for(f!==q&&(f=q,n=f.length=0,k++),a=e.length,n!==a&&(k++,f.length=n=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(k++,f[b]=g);else{f!==t&&(f=t={},n=0,k++);a=0;for(b in e)e.hasOwnProperty(b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(k++,f[b]=g)):(n++,f[b]=g,k++));if(n>a)for(b in k++,f)e.hasOwnProperty(b)||(n--,delete f[b])}else f!==e&&(f=e,k++);return k}}c.$stateful=!0;var d=this,e,f,g,l=1<
b.length,k=0,m=h(a,c),q=[],t={},p=!0,n=0;return this.$watch(m,function(){p?(p=!1,b(e,e,d)):b(e,g,d);if(l)if(F(e))if(Da(e)){g=Array(e.length);for(var a=0;a<e.length;a++)g[a]=e[a]}else for(a in g={},e)Wa.call(e,a)&&(g[a]=e[a]);else g=e})},$digest:function(){var b,f,h,k,m,t,n=a,y,u=[],H,w;q("$digest");l.$$checkUrlChange();this===p&&null!==e&&(l.defer.cancel(e),s());d=null;do{t=!1;for(y=this;x.length;){try{w=x.shift(),w.scope.$eval(w.expression,w.locals)}catch(v){g(v)}d=null}a:do{if(k=y.$$watchers)for(m=
k.length;m--;)try{if(b=k[m])if((f=b.get(y))!==(h=b.last)&&!(b.eq?ka(f,h):"number"===typeof f&&"number"===typeof h&&isNaN(f)&&isNaN(h)))t=!0,d=b,b.last=b.eq?fa(f,null):f,b.fn(f,h===r?f:h,y),5>n&&(H=4-n,u[H]||(u[H]=[]),u[H].push({msg:E(b.exp)?"fn: "+(b.exp.name||b.exp.toString()):b.exp,newVal:f,oldVal:h}));else if(b===d){t=!1;break a}}catch(A){g(A)}if(!(k=y.$$watchersCount&&y.$$childHead||y!==this&&y.$$nextSibling))for(;y!==this&&!(k=y.$$nextSibling);)y=y.$parent}while(y=k);if((t||x.length)&&!n--)throw p.$$phase=
null,c("infdig",a,u);}while(t||x.length);for(p.$$phase=null;z.length;)try{z.shift()()}catch(F){g(F)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===p&&l.$$applicationDestroyed();t(this,-this.$$watchersCount);for(var b in this.$$listenerCount)y(this,this.$$listenerCount[b],b);a&&a.$$childHead==this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=
this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=v;this.$on=this.$watch=this.$watchGroup=function(){return v};this.$$listeners={};this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}},$eval:function(a,b){return h(a)(this,b)},$evalAsync:function(a,b){p.$$phase||x.length||l.defer(function(){x.length&&p.$digest()});x.push({scope:this,
expression:a,locals:b})},$$postDigest:function(a){z.push(a)},$apply:function(a){try{return q("$apply"),this.$eval(a)}catch(b){g(b)}finally{p.$$phase=null;try{p.$digest()}catch(c){throw g(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&H.push(b);u()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);
-1!==d&&(c[d]=null,y(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,f=!1,h={name:a,targetScope:e,stopPropagation:function(){f=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},l=bb([h],arguments,1),k,m;do{d=e.$$listeners[a]||c;h.currentScope=e;k=0;for(m=d.length;k<m;k++)if(d[k])try{d[k].apply(null,l)}catch(q){g(q)}else d.splice(k,1),k--,m--;if(f)return h.currentScope=null,h;e=e.$parent}while(e);h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,
targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var f=bb([e],arguments,1),h,l;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(l=d.length;h<l;h++)if(d[h])try{d[h].apply(null,f)}catch(k){g(k)}else d.splice(h,1),h--,l--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var p=new m,x=p.$$asyncQueue=[],z=p.$$postDigestQueue=
[],H=p.$$applyAsyncQueue=[];return p}]}function ge(){var b=/^\s*(https?|ftp|mailto|tel|file):/,a=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(a){return z(a)?(b=a,this):b};this.imgSrcSanitizationWhitelist=function(b){return z(b)?(a=b,this):a};this.$get=function(){return function(c,d){var e=d?a:b,f;f=Aa(c).href;return""===f||f.match(e)?c:"unsafe:"+f}}}function Yf(b){if("self"===b)return b;if(L(b)){if(-1<b.indexOf("***"))throw Ca("iwcard",b);b=td(b).replace("\\*\\*",
".*").replace("\\*","[^:/.?&;]*");return new RegExp("^"+b+"$")}if(Ya(b))return new RegExp("^"+b.source+"$");throw Ca("imatcher");}function ud(b){var a=[];z(b)&&n(b,function(b){a.push(Yf(b))});return a}function mf(){this.SCE_CONTEXTS=pa;var b=["self"],a=[];this.resourceUrlWhitelist=function(a){arguments.length&&(b=ud(a));return b};this.resourceUrlBlacklist=function(b){arguments.length&&(a=ud(b));return a};this.$get=["$injector",function(c){function d(a,b){return"self"===a?fd(b):!!a.exec(b.href)}function e(a){var b=
function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var f=function(a){throw Ca("unsafe");};c.has("$sanitize")&&(f=c.get("$sanitize"));var g=e(),h={};h[pa.HTML]=e(g);h[pa.CSS]=e(g);h[pa.URL]=e(g);h[pa.JS]=e(g);h[pa.RESOURCE_URL]=e(h[pa.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw Ca("icontext",
a,b);if(null===b||b===s||""===b)return b;if("string"!==typeof b)throw Ca("itype",a);return new c(b)},getTrusted:function(c,e){if(null===e||e===s||""===e)return e;var g=h.hasOwnProperty(c)?h[c]:null;if(g&&e instanceof g)return e.$$unwrapTrustedValue();if(c===pa.RESOURCE_URL){var g=Aa(e.toString()),q,t,n=!1;q=0;for(t=b.length;q<t;q++)if(d(b[q],g)){n=!0;break}if(n)for(q=0,t=a.length;q<t;q++)if(d(a[q],g)){n=!1;break}if(n)return e;throw Ca("insecurl",e.toString());}if(c===pa.HTML)return f(e);throw Ca("unsafe");
},valueOf:function(a){return a instanceof g?a.$$unwrapTrustedValue():a}}}]}function lf(){var b=!0;this.enabled=function(a){arguments.length&&(b=!!a);return b};this.$get=["$parse","$sceDelegate",function(a,c){if(b&&8>Ta)throw Ca("iequirks");var d=ia(pa);d.isEnabled=function(){return b};d.trustAs=c.trustAs;d.getTrusted=c.getTrusted;d.valueOf=c.valueOf;b||(d.trustAs=d.getTrusted=function(a,b){return b},d.valueOf=Xa);d.parseAs=function(b,c){var e=a(c);return e.literal&&e.constant?e:a(c,function(a){return d.getTrusted(b,
a)})};var e=d.parseAs,f=d.getTrusted,g=d.trustAs;n(pa,function(a,b){var c=G(b);d[gb("parse_as_"+c)]=function(b){return e(a,b)};d[gb("get_trusted_"+c)]=function(b){return f(a,b)};d[gb("trust_as_"+c)]=function(b){return g(a,b)}});return d}]}function nf(){this.$get=["$window","$document",function(b,a){var c={},d=X((/android (\d+)/.exec(G((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),f=a[0]||{},g,h=/^(Moz|webkit|ms)(?=[A-Z])/,l=f.body&&f.body.style,k=!1,m=!1;if(l){for(var q in l)if(k=
h.exec(q)){g=k[0];g=g.substr(0,1).toUpperCase()+g.substr(1);break}g||(g="WebkitOpacity"in l&&"webkit");k=!!("transition"in l||g+"Transition"in l);m=!!("animation"in l||g+"Animation"in l);!d||k&&m||(k=L(l.webkitTransition),m=L(l.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hasEvent:function(a){if("input"===a&&11>=Ta)return!1;if(w(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:eb(),vendorPrefix:g,transitions:k,animations:m,android:d}}]}function pf(){this.$get=
["$templateCache","$http","$q",function(b,a,c){function d(e,f){d.totalPendingRequests++;var g=a.defaults&&a.defaults.transformResponse;K(g)?g=g.filter(function(a){return a!==$b}):g===$b&&(g=null);return a.get(e,{cache:b,transformResponse:g})["finally"](function(){d.totalPendingRequests--}).then(function(a){b.put(e,a.data);return a.data},function(a){if(!f)throw ea("tpload",e,a.status,a.statusText);return c.reject(a)})}d.totalPendingRequests=0;return d}]}function qf(){this.$get=["$rootScope","$browser",
"$location",function(b,a,c){return{findBindings:function(a,b,c){a=a.getElementsByClassName("ng-binding");var g=[];n(a,function(a){var d=$.element(a).data("$binding");d&&n(d,function(d){c?(new RegExp("(^|\\s)"+td(b)+"(\\s|\\||$)")).test(d)&&g.push(a):-1!=d.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,c){for(var g=["ng-","data-ng-","ng\\:"],h=0;h<g.length;++h){var l=a.querySelectorAll("["+g[h]+"model"+(c?"=":"*=")+'"'+b+'"]');if(l.length)return l}},getLocation:function(){return c.url()},
setLocation:function(a){a!==c.url()&&(c.url(a),b.$digest())},whenStable:function(b){a.notifyWhenNoOutstandingRequests(b)}}}]}function rf(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(b,a,c,d,e){function f(f,l,k){E(f)||(k=l,l=f,f=v);var m=sa.call(arguments,3),q=z(k)&&!k,t=(q?d:c).defer(),n=t.promise,r;r=a.defer(function(){try{t.resolve(f.apply(null,m))}catch(a){t.reject(a),e(a)}finally{delete g[n.$$timeoutId]}q||b.$apply()},l);n.$$timeoutId=r;g[r]=t;return n}var g={};
f.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),delete g[b.$$timeoutId],a.defer.cancel(b.$$timeoutId)):!1};return f}]}function Aa(b){Ta&&(Y.setAttribute("href",b),b=Y.href);Y.setAttribute("href",b);return{href:Y.href,protocol:Y.protocol?Y.protocol.replace(/:$/,""):"",host:Y.host,search:Y.search?Y.search.replace(/^\?/,""):"",hash:Y.hash?Y.hash.replace(/^#/,""):"",hostname:Y.hostname,port:Y.port,pathname:"/"===Y.pathname.charAt(0)?Y.pathname:"/"+Y.pathname}}function fd(b){b=
L(b)?Aa(b):b;return b.protocol===vd.protocol&&b.host===vd.host}function sf(){this.$get=ra(O)}function wd(b){function a(a){try{return decodeURIComponent(a)}catch(b){return a}}var c=b[0]||{},d={},e="";return function(){var b,g,h,l,k;b=c.cookie||"";if(b!==e)for(e=b,b=e.split("; "),d={},h=0;h<b.length;h++)g=b[h],l=g.indexOf("="),0<l&&(k=a(g.substring(0,l)),d[k]===s&&(d[k]=a(g.substring(l+1))));return d}}function xf(){this.$get=wd}function Kc(b){function a(c,d){if(F(c)){var e={};n(c,function(b,c){e[c]=
a(c,b)});return e}return b.factory(c+"Filter",d)}this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];a("currency",xd);a("date",yd);a("filter",Zf);a("json",$f);a("limitTo",ag);a("lowercase",bg);a("number",zd);a("orderBy",Ad);a("uppercase",cg)}function Zf(){return function(b,a,c){if(!Da(b)){if(null==b)return b;throw I("filter")("notarray",b);}var d;switch(ic(a)){case "function":break;case "boolean":case "null":case "number":case "string":d=!0;case "object":a=
dg(a,c,d);break;default:return b}return Array.prototype.filter.call(b,a)}}function dg(b,a,c){var d=F(b)&&"$"in b;!0===a?a=ka:E(a)||(a=function(a,b){if(w(a))return!1;if(null===a||null===b)return a===b;var c;!(c=F(b))&&(c=F(a))&&(c=a,c=!(E(c.toString)&&c.toString!==Object.prototype.toString));if(c)return!1;a=G(""+a);b=G(""+b);return-1!==a.indexOf(b)});return function(e){return d&&!F(e)?La(e,b.$,a,!1):La(e,b,a,c)}}function La(b,a,c,d,e){var f=ic(b),g=ic(a);if("string"===g&&"!"===a.charAt(0))return!La(b,
a.substring(1),c,d);if(K(b))return b.some(function(b){return La(b,a,c,d)});switch(f){case "object":var h;if(d){for(h in b)if("$"!==h.charAt(0)&&La(b[h],a,c,!0))return!0;return e?!1:La(b,a,c,!1)}if("object"===g){for(h in a)if(e=a[h],!E(e)&&!w(e)&&(f="$"===h,!La(f?b:b[h],e,c,f,f)))return!1;return!0}return c(b,a);case "function":return!1;default:return c(b,a)}}function ic(b){return null===b?"null":typeof b}function xd(b){var a=b.NUMBER_FORMATS;return function(b,d,e){w(d)&&(d=a.CURRENCY_SYM);w(e)&&(e=
a.PATTERNS[1].maxFrac);return null==b?b:Bd(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,e).replace(/\u00A4/g,d)}}function zd(b){var a=b.NUMBER_FORMATS;return function(b,d){return null==b?b:Bd(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Bd(b,a,c,d,e){if(F(b))return"";var f=0>b;b=Math.abs(b);var g=Infinity===b;if(!g&&!isFinite(b))return"";var h=b+"",l="",k=!1,m=[];g&&(l="\u221e");if(!g&&-1!==h.indexOf("e")){var q=h.match(/([\d\.]+)e(-?)(\d+)/);q&&"-"==q[2]&&q[3]>e+1?b=0:(l=h,k=!0)}if(g||k)0<
e&&1>b&&(l=b.toFixed(e),b=parseFloat(l));else{g=(h.split(Cd)[1]||"").length;w(e)&&(e=Math.min(Math.max(a.minFrac,g),a.maxFrac));b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);var g=(""+b).split(Cd),h=g[0],g=g[1]||"",q=0,t=a.lgSize,n=a.gSize;if(h.length>=t+n)for(q=h.length-t,k=0;k<q;k++)0===(q-k)%n&&0!==k&&(l+=c),l+=h.charAt(k);for(k=q;k<h.length;k++)0===(h.length-k)%t&&0!==k&&(l+=c),l+=h.charAt(k);for(;g.length<e;)g+="0";e&&"0"!==e&&(l+=d+g.substr(0,e))}0===b&&(f=!1);m.push(f?a.negPre:a.posPre,
l,f?a.negSuf:a.posSuf);return m.join("")}function Gb(b,a,c){var d="";0>b&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function Z(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(0<c||e>-c)e+=c;0===e&&-12==c&&(e=12);return Gb(e,a,d)}}function Hb(b,a){return function(c,d){var e=c["get"+b](),f=qb(a?"SHORT"+b:b);return d[f][e]}}function Dd(b){var a=(new Date(b,0,1)).getDay();return new Date(b,0,(4>=a?5:12)-a)}function Ed(b){return function(a){var c=Dd(a.getFullYear());
a=+new Date(a.getFullYear(),a.getMonth(),a.getDate()+(4-a.getDay()))-+c;a=1+Math.round(a/6048E5);return Gb(a,b)}}function jc(b,a){return 0>=b.getFullYear()?a.ERAS[0]:a.ERAS[1]}function yd(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,l=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=X(b[9]+b[10]),g=X(b[9]+b[11]));h.call(a,X(b[1]),X(b[2])-1,X(b[3]));f=X(b[4]||0)-f;g=X(b[5]||0)-g;h=X(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));l.call(a,f,g,
h,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e,f){var g="",h=[],l,k;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;L(c)&&(c=eg.test(c)?X(c):a(c));V(c)&&(c=new Date(c));if(!da(c)||!isFinite(c.getTime()))return c;for(;e;)(k=fg.exec(e))?(h=bb(h,k,1),e=h.pop()):(h.push(e),e=null);var m=c.getTimezoneOffset();f&&(m=wc(f,c.getTimezoneOffset()),c=Pb(c,f,!0));n(h,function(a){l=gg[a];g+=l?l(c,b.DATETIME_FORMATS,m):
a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function $f(){return function(b,a){w(a)&&(a=2);return cb(b,a)}}function ag(){return function(b,a,c){a=Infinity===Math.abs(Number(a))?Number(a):X(a);if(isNaN(a))return b;V(b)&&(b=b.toString());if(!K(b)&&!L(b))return b;c=!c||isNaN(c)?0:X(c);c=0>c&&c>=-b.length?b.length+c:c;return 0<=a?b.slice(c,c+a):0===c?b.slice(a,b.length):b.slice(Math.max(0,c+a),c)}}function Ad(b){return function(a,c,d){function e(a,b){return b?function(b,c){return a(c,b)}:
a}function f(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}function g(a){return null===a?"null":"function"===typeof a.valueOf&&(a=a.valueOf(),f(a))||"function"===typeof a.toString&&(a=a.toString(),f(a))?a:""}function h(a,b){var c=typeof a,d=typeof b;c===d&&"object"===c&&(a=g(a),b=g(b));return c===d?("string"===c&&(a=a.toLowerCase(),b=b.toLowerCase()),a===b?0:a<b?-1:1):c<d?-1:1}if(!Da(a))return a;c=K(c)?c:[c];0===c.length&&(c=["+"]);c=c.map(function(a){var c=
!1,d=a||Xa;if(L(a)){if("+"==a.charAt(0)||"-"==a.charAt(0))c="-"==a.charAt(0),a=a.substring(1);if(""===a)return e(h,c);d=b(a);if(d.constant){var f=d();return e(function(a,b){return h(a[f],b[f])},c)}}return e(function(a,b){return h(d(a),d(b))},c)});return sa.call(a).sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=c[d](a,b);if(0!==e)return e}return 0},d))}}function Ma(b){E(b)&&(b={link:b});b.restrict=b.restrict||"AC";return ra(b)}function Fd(b,a,c,d,e){var f=this,g=[],h=f.$$parentForm=b.parent().controller("form")||
Ib;f.$error={};f.$$success={};f.$pending=s;f.$name=e(a.name||a.ngForm||"")(c);f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;f.$submitted=!1;h.$addControl(f);f.$rollbackViewValue=function(){n(g,function(a){a.$rollbackViewValue()})};f.$commitViewValue=function(){n(g,function(a){a.$commitViewValue()})};f.$addControl=function(a){Ra(a.$name,"input");g.push(a);a.$name&&(f[a.$name]=a)};f.$$renameControl=function(a,b){var c=a.$name;f[c]===a&&delete f[c];f[b]=a;a.$name=b};f.$removeControl=function(a){a.$name&&
f[a.$name]===a&&delete f[a.$name];n(f.$pending,function(b,c){f.$setValidity(c,null,a)});n(f.$error,function(b,c){f.$setValidity(c,null,a)});n(f.$$success,function(b,c){f.$setValidity(c,null,a)});ab(g,a)};Gd({ctrl:this,$element:b,set:function(a,b,c){var d=a[b];d?-1===d.indexOf(c)&&d.push(c):a[b]=[c]},unset:function(a,b,c){var d=a[b];d&&(ab(d,c),0===d.length&&delete a[b])},parentForm:h,$animate:d});f.$setDirty=function(){d.removeClass(b,Ua);d.addClass(b,Jb);f.$dirty=!0;f.$pristine=!1;h.$setDirty()};
f.$setPristine=function(){d.setClass(b,Ua,Jb+" ng-submitted");f.$dirty=!1;f.$pristine=!0;f.$submitted=!1;n(g,function(a){a.$setPristine()})};f.$setUntouched=function(){n(g,function(a){a.$setUntouched()})};f.$setSubmitted=function(){d.addClass(b,"ng-submitted");f.$submitted=!0;h.$setSubmitted()}}function kc(b){b.$formatters.push(function(a){return b.$isEmpty(a)?a:a.toString()})}function jb(b,a,c,d,e,f){var g=G(a[0].type);if(!e.android){var h=!1;a.on("compositionstart",function(a){h=!0});a.on("compositionend",
function(){h=!1;l()})}var l=function(b){k&&(f.defer.cancel(k),k=null);if(!h){var e=a.val();b=b&&b.type;"password"===g||c.ngTrim&&"false"===c.ngTrim||(e=T(e));(d.$viewValue!==e||""===e&&d.$$hasNativeValidators)&&d.$setViewValue(e,b)}};if(e.hasEvent("input"))a.on("input",l);else{var k,m=function(a,b,c){k||(k=f.defer(function(){k=null;b&&b.value===c||l(a)}))};a.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||m(a,this,this.value)});if(e.hasEvent("paste"))a.on("paste cut",m)}a.on("change",
l);d.$render=function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)}}function Kb(b,a){return function(c,d){var e,f;if(da(c))return c;if(L(c)){'"'==c.charAt(0)&&'"'==c.charAt(c.length-1)&&(c=c.substring(1,c.length-1));if(hg.test(c))return new Date(c);b.lastIndex=0;if(e=b.exec(c))return e.shift(),f=d?{yyyy:d.getFullYear(),MM:d.getMonth()+1,dd:d.getDate(),HH:d.getHours(),mm:d.getMinutes(),ss:d.getSeconds(),sss:d.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},n(e,function(b,c){c<
a.length&&(f[a[c]]=+b)}),new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function kb(b,a,c,d){return function(e,f,g,h,l,k,m){function q(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function t(a){return z(a)?da(a)?a:c(a):s}Hd(e,f,g,h);jb(e,f,g,h,l,k);var n=h&&h.$options&&h.$options.timezone,r;h.$$parserName=b;h.$parsers.push(function(b){return h.$isEmpty(b)?null:a.test(b)?(b=c(b,r),n&&(b=Pb(b,n)),b):s});h.$formatters.push(function(a){if(a&&!da(a))throw Lb("datefmt",
a);if(q(a))return(r=a)&&n&&(r=Pb(r,n,!0)),m("date")(a,d,n);r=null;return""});if(z(g.min)||g.ngMin){var N;h.$validators.min=function(a){return!q(a)||w(N)||c(a)>=N};g.$observe("min",function(a){N=t(a);h.$validate()})}if(z(g.max)||g.ngMax){var u;h.$validators.max=function(a){return!q(a)||w(u)||c(a)<=u};g.$observe("max",function(a){u=t(a);h.$validate()})}}}function Hd(b,a,c,d){(d.$$hasNativeValidators=F(a[0].validity))&&d.$parsers.push(function(b){var c=a.prop("validity")||{};return c.badInput&&!c.typeMismatch?
s:b})}function Id(b,a,c,d,e){if(z(d)){b=b(d);if(!b.constant)throw I("ngModel")("constexpr",c,d);return b(a)}return e}function lc(b,a){b="ngClass"+b;return["$animate",function(c){function d(a,b){var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],m=0;m<b.length;m++)if(e==b[m])continue a;c.push(e)}return c}function e(a){var b=[];return K(a)?(n(a,function(a){b=b.concat(e(a))}),b):L(a)?a.split(" "):F(a)?(n(a,function(a,c){a&&(b=b.concat(c.split(" ")))}),b):a}return{restrict:"AC",link:function(f,g,h){function l(a,
b){var c=g.data("$classCounts")||ga(),d=[];n(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<b)&&d.push(a)});g.data("$classCounts",c);return d.join(" ")}function k(b){if(!0===a||f.$index%2===a){var k=e(b||[]);if(!m){var n=l(k,1);h.$addClass(n)}else if(!ka(b,m)){var r=e(m),n=d(k,r),k=d(r,k),n=l(n,1),k=l(k,-1);n&&n.length&&c.addClass(g,n);k&&k.length&&c.removeClass(g,k)}}m=ia(b)}var m;f.$watch(h[b],k,!0);h.$observe("class",function(a){k(f.$eval(h[b]))});"ngClass"!==b&&f.$watch("$index",function(c,
d){var g=c&1;if(g!==(d&1)){var k=e(f.$eval(h[b]));g===a?(g=l(k,1),h.$addClass(g)):(g=l(k,-1),h.$removeClass(g))}})}}}]}function Gd(b){function a(a,b){b&&!f[a]?(k.addClass(e,a),f[a]=!0):!b&&f[a]&&(k.removeClass(e,a),f[a]=!1)}function c(b,c){b=b?"-"+Ac(b,"-"):"";a(lb+b,!0===c);a(Jd+b,!1===c)}var d=b.ctrl,e=b.$element,f={},g=b.set,h=b.unset,l=b.parentForm,k=b.$animate;f[Jd]=!(f[lb]=e.hasClass(lb));d.$setValidity=function(b,e,f){e===s?(d.$pending||(d.$pending={}),g(d.$pending,b,f)):(d.$pending&&h(d.$pending,
b,f),Kd(d.$pending)&&(d.$pending=s));$a(e)?e?(h(d.$error,b,f),g(d.$$success,b,f)):(g(d.$error,b,f),h(d.$$success,b,f)):(h(d.$error,b,f),h(d.$$success,b,f));d.$pending?(a(Ld,!0),d.$valid=d.$invalid=s,c("",null)):(a(Ld,!1),d.$valid=Kd(d.$error),d.$invalid=!d.$valid,c("",d.$valid));e=d.$pending&&d.$pending[b]?s:d.$error[b]?!1:d.$$success[b]?!0:null;c(b,e);l.$setValidity(b,e,d)}}function Kd(b){if(b)for(var a in b)if(b.hasOwnProperty(a))return!1;return!0}var ig=/^\/(.+)\/([a-z]*)$/,G=function(b){return L(b)?
b.toLowerCase():b},Wa=Object.prototype.hasOwnProperty,qb=function(b){return L(b)?b.toUpperCase():b},Ta,A,la,sa=[].slice,Lf=[].splice,jg=[].push,ta=Object.prototype.toString,rc=Object.getPrototypeOf,Ea=I("ng"),$=O.angular||(O.angular={}),fb,mb=0;Ta=W.documentMode;v.$inject=[];Xa.$inject=[];var K=Array.isArray,tc=/^\[object (Uint8(Clamped)?)|(Uint16)|(Uint32)|(Int8)|(Int16)|(Int32)|(Float(32)|(64))Array\]$/,T=function(b){return L(b)?b.trim():b},td=function(b){return b.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,
"\\$1").replace(/\x08/g,"\\x08")},eb=function(){if(z(eb.isActive_))return eb.isActive_;var b=!(!W.querySelector("[ng-csp]")&&!W.querySelector("[data-ng-csp]"));if(!b)try{new Function("")}catch(a){b=!0}return eb.isActive_=b},ob=function(){if(z(ob.name_))return ob.name_;var b,a,c=Oa.length,d,e;for(a=0;a<c;++a)if(d=Oa[a],b=W.querySelector("["+d.replace(":","\\:")+"jq]")){e=b.getAttribute(d+"jq");break}return ob.name_=e},Oa=["ng-","data-ng-","ng:","x-ng-"],ae=/[A-Z]/g,Bc=!1,Rb,qa=1,Na=3,ee={full:"1.4.1",
major:1,minor:4,dot:1,codeName:"hyperionic-illumination"};R.expando="ng339";var hb=R.cache={},Df=1;R._data=function(b){return this.cache[b[this.expando]]||{}};var yf=/([\:\-\_]+(.))/g,zf=/^moz([A-Z])/,kg={mouseleave:"mouseout",mouseenter:"mouseover"},Ub=I("jqLite"),Cf=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Tb=/<|&#?\w+;/,Af=/<([\w:]+)/,Bf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,na={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,
"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};na.optgroup=na.option;na.tbody=na.tfoot=na.colgroup=na.caption=na.thead;na.th=na.td;var Pa=R.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===W.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),R(O).on("load",a))},toString:function(){var b=[];n(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=
b?A(this[b]):A(this[this.length+b])},length:0,push:jg,sort:[].sort,splice:[].splice},zb={};n("multiple selected checked disabled readOnly required open".split(" "),function(b){zb[G(b)]=b});var Sc={};n("input select option textarea button form details".split(" "),function(b){Sc[b]=!0});var Tc={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};n({data:Wb,removeData:tb,hasData:function(b){for(var a in hb[b.ng339])return!0;return!1}},function(b,a){R[a]=b});n({data:Wb,
inheritedData:yb,scope:function(b){return A.data(b,"$scope")||yb(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return A.data(b,"$isolateScope")||A.data(b,"$isolateScopeNoTemplate")},controller:Pc,injector:function(b){return yb(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:vb,css:function(b,a,c){a=gb(a);if(z(c))b.style[a]=c;else return b.style[a]},attr:function(b,a,c){var d=b.nodeType;if(d!==Na&&2!==d&&8!==d)if(d=G(a),zb[d])if(z(c))c?(b[a]=!0,b.setAttribute(a,
d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||v).specified?d:s;else if(z(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?s:b},prop:function(b,a,c){if(z(c))b[a]=c;else return b[a]},text:function(){function b(a,b){if(w(b)){var d=a.nodeType;return d===qa||d===Na?a.textContent:""}a.textContent=b}b.$dv="";return b}(),val:function(b,a){if(w(a)){if(b.multiple&&"select"===ua(b)){var c=[];n(b.options,function(a){a.selected&&c.push(a.value||
a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(w(a))return b.innerHTML;sb(b,!0);b.innerHTML=a},empty:Qc},function(b,a){R.prototype[a]=function(a,d){var e,f,g=this.length;if(b!==Qc&&(2==b.length&&b!==vb&&b!==Pc?a:d)===s){if(F(a)){for(e=0;e<g;e++)if(b===Wb)b(this[e],a);else for(f in a)b(this[e],f,a[f]);return this}e=b.$dv;g=e===s?Math.min(g,1):g;for(f=0;f<g;f++){var h=b(this[f],a,d);e=e?e+h:h}return e}for(e=0;e<g;e++)b(this[e],a,d);return this}});n({removeData:tb,
on:function a(c,d,e,f){if(z(f))throw Ub("onargs");if(Lc(c)){var g=ub(c,!0);f=g.events;var h=g.handle;h||(h=g.handle=Gf(c,f));for(var g=0<=d.indexOf(" ")?d.split(" "):[d],l=g.length;l--;){d=g[l];var k=f[d];k||(f[d]=[],"mouseenter"===d||"mouseleave"===d?a(c,kg[d],function(a){var c=a.relatedTarget;c&&(c===this||this.contains(c))||h(a,d)}):"$destroy"!==d&&c.addEventListener(d,h,!1),k=f[d]);k.push(e)}}},off:Oc,one:function(a,c,d){a=A(a);a.on(c,function f(){a.off(c,d);a.off(c,f)});a.on(c,d)},replaceWith:function(a,
c){var d,e=a.parentNode;sb(a);n(new R(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];n(a.childNodes,function(a){a.nodeType===qa&&c.push(a)});return c},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,c){var d=a.nodeType;if(d===qa||11===d){c=new R(c);for(var d=0,e=c.length;d<e;d++)a.appendChild(c[d])}},prepend:function(a,c){if(a.nodeType===qa){var d=a.firstChild;n(new R(c),function(c){a.insertBefore(c,d)})}},
wrap:function(a,c){c=A(c).eq(0).clone()[0];var d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:Xb,detach:function(a){Xb(a,!0)},after:function(a,c){var d=a,e=a.parentNode;c=new R(c);for(var f=0,g=c.length;f<g;f++){var h=c[f];e.insertBefore(h,d.nextSibling);d=h}},addClass:xb,removeClass:wb,toggleClass:function(a,c,d){c&&n(c.split(" "),function(c){var f=d;w(f)&&(f=!vb(a,c));(f?xb:wb)(a,c)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},
find:function(a,c){return a.getElementsByTagName?a.getElementsByTagName(c):[]},clone:Vb,triggerHandler:function(a,c,d){var e,f,g=c.type||c,h=ub(a);if(h=(h=h&&h.events)&&h[g])e={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:v,type:g,target:a},c.type&&(e=Q(e,
c)),c=ia(h),f=d?[e].concat(d):[e],n(c,function(c){e.isImmediatePropagationStopped()||c.apply(a,f)})}},function(a,c){R.prototype[c]=function(c,e,f){for(var g,h=0,l=this.length;h<l;h++)w(g)?(g=a(this[h],c,e,f),z(g)&&(g=A(g))):Nc(g,a(this[h],c,e,f));return z(g)?g:this};R.prototype.bind=R.prototype.on;R.prototype.unbind=R.prototype.off});Sa.prototype={put:function(a,c){this[Fa(a,this.nextUid)]=c},get:function(a){return this[Fa(a,this.nextUid)]},remove:function(a){var c=this[a=Fa(a,this.nextUid)];delete this[a];
return c}};var wf=[function(){this.$get=[function(){return Sa}]}],Vc=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,lg=/,/,mg=/^\s*(_?)(\S+?)\1\s*$/,Uc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ga=I("$injector");db.$$annotate=function(a,c,d){var e;if("function"===typeof a){if(!(e=a.$inject)){e=[];if(a.length){if(c)throw L(d)&&d||(d=a.name||Hf(a)),Ga("strictdi",d);c=a.toString().replace(Uc,"");c=c.match(Vc);n(c[1].split(lg),function(a){a.replace(mg,function(a,c,d){e.push(d)})})}a.$inject=e}}else K(a)?(c=a.length-1,
Qa(a[c],"fn"),e=a.slice(0,c)):Qa(a,"fn",!0);return e};var Md=I("$animate"),Te=function(){this.$get=["$q","$$rAF",function(a,c){function d(){}d.all=v;d.chain=v;d.prototype={end:v,cancel:v,resume:v,pause:v,complete:v,then:function(d,f){return a(function(a){c(function(){a()})}).then(d,f)}};return d}]},Se=function(){var a=new Sa,c=[];this.$get=["$$AnimateRunner","$rootScope",function(d,e){function f(d,f,l){var k=a.get(d);k||(a.put(d,k={}),c.push(d));f&&n(f.split(" "),function(a){a&&(k[a]=!0)});l&&n(l.split(" "),
function(a){a&&(k[a]=!1)});1<c.length||e.$$postDigest(function(){n(c,function(c){var d=a.get(c);if(d){var e=If(c.attr("class")),f="",g="";n(d,function(a,c){a!==!!e[c]&&(a?f+=(f.length?" ":"")+c:g+=(g.length?" ":"")+c)});n(c,function(a){f&&xb(a,f);g&&wb(a,g)});a.remove(c)}});c.length=0})}return{enabled:v,on:v,off:v,pin:v,push:function(a,c,e,k){k&&k();e=e||{};e.from&&a.css(e.from);e.to&&a.css(e.to);(e.addClass||e.removeClass)&&f(a,e.addClass,e.removeClass);return new d}}}]},Re=["$provide",function(a){var c=
this;this.$$registeredAnimations=Object.create(null);this.register=function(d,e){if(d&&"."!==d.charAt(0))throw Md("notcsel",d);var f=d+"-animation";c.$$registeredAnimations[d.substr(1)]=f;a.factory(f,e)};this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Md("nongcls","ng-animate");return this.$$classNameFilter};this.$get=["$$animateQueue",function(a){function c(a,
d,e){if(e){var l;a:{for(l=0;l<e.length;l++){var k=e[l];if(1===k.nodeType){l=k;break a}}l=void 0}!l||l.parentNode||l.previousElementSibling||(e=null)}e?e.after(a):d.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.end&&a.end()},enter:function(f,g,h,l){g=g&&A(g);h=h&&A(h);g=g||h.parent();c(f,g,h);return a.push(f,"enter",Ha(l))},move:function(f,g,h,l){g=g&&A(g);h=h&&A(h);g=g||h.parent();c(f,g,h);return a.push(f,"move",Ha(l))},leave:function(c,e){return a.push(c,"leave",
Ha(e),function(){c.remove()})},addClass:function(c,e,h){h=Ha(h);h.addClass=ib(h.addclass,e);return a.push(c,"addClass",h)},removeClass:function(c,e,h){h=Ha(h);h.removeClass=ib(h.removeClass,e);return a.push(c,"removeClass",h)},setClass:function(c,e,h,l){l=Ha(l);l.addClass=ib(l.addClass,e);l.removeClass=ib(l.removeClass,h);return a.push(c,"setClass",l)},animate:function(c,e,h,l,k){k=Ha(k);k.from=k.from?Q(k.from,e):e;k.to=k.to?Q(k.to,h):h;k.tempClasses=ib(k.tempClasses,l||"ng-inline-animate");return a.push(c,
"animate",k)}}}]}],ea=I("$compile");Dc.$inject=["$provide","$$sanitizeUriProvider"];var Yc=/^((?:x|data)[\:\-_])/i,Mf=I("$controller"),Wc=/^(\S+)(\s+as\s+(\w+))?$/,bd="application/json",ac={"Content-Type":bd+";charset=utf-8"},Of=/^\[|^\{(?!\{)/,Pf={"[":/]$/,"{":/}$/},Nf=/^\)\]\}',?\n/,Ka=$.$interpolateMinErr=I("$interpolate");Ka.throwNoconcat=function(a){throw Ka("noconcat",a);};Ka.interr=function(a,c){return Ka("interr",a,c.toString())};var ng=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,Sf={http:80,https:443,
ftp:21},Cb=I("$location"),og={$$html5:!1,$$replace:!1,absUrl:Db("$$absUrl"),url:function(a){if(w(a))return this.$$url;var c=ng.exec(a);(c[1]||""===a)&&this.path(decodeURIComponent(c[1]));(c[2]||c[1]||""===a)&&this.search(c[3]||"");this.hash(c[5]||"");return this},protocol:Db("$$protocol"),host:Db("$$host"),port:Db("$$port"),path:jd("$$path",function(a){a=null!==a?a.toString():"";return"/"==a.charAt(0)?a:"/"+a}),search:function(a,c){switch(arguments.length){case 0:return this.$$search;case 1:if(L(a)||
V(a))a=a.toString(),this.$$search=yc(a);else if(F(a))a=fa(a,{}),n(a,function(c,e){null==c&&delete a[e]}),this.$$search=a;else throw Cb("isrcharg");break;default:w(c)||null===c?delete this.$$search[a]:this.$$search[a]=c}this.$$compose();return this},hash:jd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};n([id,ec,dc],function(a){a.prototype=Object.create(og);a.prototype.state=function(c){if(!arguments.length)return this.$$state;if(a!==dc||!this.$$html5)throw Cb("nostate");
this.$$state=w(c)?null:c;return this}});var ca=I("$parse"),Tf=Function.prototype.call,Uf=Function.prototype.apply,Vf=Function.prototype.bind,Mb=ga();n("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Mb[a]=!0});var pg={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},gc=function(a){this.options=a};gc.prototype={constructor:gc,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);
else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(a))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var c=a+this.peek(),d=c+this.peek(2),e=Mb[c],f=Mb[d];Mb[a]||e||f?(a=f?d:e?c:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},
is:function(a,c){return-1!==c.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=z(c)?"s "+c+"-"+
this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw ca("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index<this.text.length;){var d=G(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var e=this.peek();if("e"==d&&this.isExpOperator(e))a+=d;else if(this.isExpOperator(d)&&e&&this.isNumber(e)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||e&&this.isNumber(e)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:c,
text:a,constant:!0,value:Number(a)})},readIdent:function(){for(var a=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index);if(!this.isIdent(c)&&!this.isNumber(c))break;this.index++}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var c=this.index;this.index++;for(var d="",e=a,f=!1;this.index<this.text.length;){var g=this.text.charAt(this.index),e=e+g;if(f)"u"===g?(f=this.text.substring(this.index+1,this.index+5),f.match(/[\da-f]{4}/i)||
this.throwError("Invalid unicode escape [\\u"+f+"]"),this.index+=4,d+=String.fromCharCode(parseInt(f,16))):d+=pg[g]||g,f=!1;else if("\\"===g)f=!0;else{if(g===a){this.index++;this.tokens.push({index:c,text:e,constant:!0,value:d});return}d+=g}this.index++}this.throwError("Unterminated quote",c)}};var r=function(a,c){this.lexer=a;this.options=c};r.Program="Program";r.ExpressionStatement="ExpressionStatement";r.AssignmentExpression="AssignmentExpression";r.ConditionalExpression="ConditionalExpression";
r.LogicalExpression="LogicalExpression";r.BinaryExpression="BinaryExpression";r.UnaryExpression="UnaryExpression";r.CallExpression="CallExpression";r.MemberExpression="MemberExpression";r.Identifier="Identifier";r.Literal="Literal";r.ArrayExpression="ArrayExpression";r.Property="Property";r.ObjectExpression="ObjectExpression";r.ThisExpression="ThisExpression";r.NGValueParameter="NGValueParameter";r.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.program();0!==this.tokens.length&&
this.throwError("is an unexpected token",this.tokens[0]);return a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:r.Program,body:a}},expressionStatement:function(){return{type:r.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=
this.ternary();this.expect("=")&&(a={type:r.AssignmentExpression,left:a,right:this.assignment(),operator:"="});return a},ternary:function(){var a=this.logicalOR(),c,d;return this.expect("?")&&(c=this.expression(),this.consume(":"))?(d=this.expression(),{type:r.ConditionalExpression,test:a,alternate:c,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:r.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=
this.equality();this.expect("&&");)a={type:r.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),c;c=this.expect("==","!=","===","!==");)a={type:r.BinaryExpression,operator:c.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),c;c=this.expect("<",">","<=",">=");)a={type:r.BinaryExpression,operator:c.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),
c;c=this.expect("+","-");)a={type:r.BinaryExpression,operator:c.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a={type:r.BinaryExpression,operator:c.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:r.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):
this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.constants.hasOwnProperty(this.peek().text)?a=fa(this.constants[this.consume().text]):this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var c;c=this.expect("(","[",".");)"("===c.text?(a={type:r.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===c.text?(a={type:r.MemberExpression,object:a,property:this.expression(),
computed:!0},this.consume("]")):"."===c.text?a={type:r.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var c={type:r.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return c},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.expression());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||
this.throwError("is not a valid identifier",a);return{type:r.Identifier,name:a.text}},constant:function(){return{type:r.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:r.ArrayExpression,elements:a}},object:function(){var a=[],c;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;c={type:r.Property,kind:"init"};this.peek().constant?
c.key=this.constant():this.peek().identifier?c.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");c.value=this.expression();a.push(c)}while(this.expect(","))}this.consume("}");return{type:r.ObjectExpression,properties:a}},throwError:function(a,c){throw ca("syntax",c.text,a,c.index+1,this.text,this.text.substring(c.index));},consume:function(a){if(0===this.tokens.length)throw ca("ueoe",this.text);var c=this.expect(a);c||this.throwError("is unexpected, expecting ["+a+
"]",this.peek());return c},peekToken:function(){if(0===this.tokens.length)throw ca("ueoe",this.text);return this.tokens[0]},peek:function(a,c,d,e){return this.peekAhead(0,a,c,d,e)},peekAhead:function(a,c,d,e,f){if(this.tokens.length>a){a=this.tokens[a];var g=a.text;if(g===c||g===d||g===e||g===f||!(c||d||e||f))return a}return!1},expect:function(a,c,d,e){return(a=this.peek(a,c,d,e))?(this.tokens.shift(),a):!1},constants:{"true":{type:r.Literal,value:!0},"false":{type:r.Literal,value:!1},"null":{type:r.Literal,
value:null},undefined:{type:r.Literal,value:s},"this":{type:r.ThisExpression}}};qd.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:c,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};U(e,d.$filter);var f="",g;this.stage="assign";if(g=od(e))this.state.computing="assign",f=this.nextId(),this.recurse(g,f),f="fn.assign="+this.generateFunction("assign","s,v,l");g=md(e.body);d.stage="inputs";n(g,function(a,c){var e=
"fn"+c;d.state[e]={vars:[],body:[],own:{}};d.state.computing=e;var f=d.nextId();d.recurse(a,f);d.return_(f);d.state.inputs.push(e);a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(e);f='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+f+this.watchFns()+"return fn;";f=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","ifDefined","plus","text",f))(this.$filter,Ba,oa,kd,Wf,ld,a);this.state=
this.stage=s;f.literal=pd(e);f.constant=e.constant;return f},USE:"use",STRICT:"strict",watchFns:function(){var a=[],c=this.state.inputs,d=this;n(c,function(c){a.push("var "+c+"="+d.generateFunction(c,"s"))});c.length&&a.push("fn.inputs=["+c.join(",")+"];");return a.join("")},generateFunction:function(a,c){return"function("+c+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],c=this;n(this.state.filters,function(d,e){a.push(d+"=$filter("+c.escape(e)+")")});return a.length?
"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,c,d,e,f,g){var h,l,k=this,m,q;e=e||v;if(!g&&z(a.watchId))c=c||this.nextId(),this.if_("i",this.lazyAssign(c,this.computedMember("i",a.watchId)),this.lazyRecurse(a,c,d,e,f,!0));else switch(a.type){case r.Program:n(a.body,function(c,d){k.recurse(c.expression,s,s,function(a){l=a});d!==a.body.length-1?k.current().body.push(l,
";"):k.return_(l)});break;case r.Literal:q=this.escape(a.value);this.assign(c,q);e(q);break;case r.UnaryExpression:this.recurse(a.argument,s,s,function(a){l=a});q=a.operator+"("+this.ifDefined(l,0)+")";this.assign(c,q);e(q);break;case r.BinaryExpression:this.recurse(a.left,s,s,function(a){h=a});this.recurse(a.right,s,s,function(a){l=a});q="+"===a.operator?this.plus(h,l):"-"===a.operator?this.ifDefined(h,0)+a.operator+this.ifDefined(l,0):"("+h+")"+a.operator+"("+l+")";this.assign(c,q);e(q);break;case r.LogicalExpression:c=
c||this.nextId();k.recurse(a.left,c);k.if_("&&"===a.operator?c:k.not(c),k.lazyRecurse(a.right,c));e(c);break;case r.ConditionalExpression:c=c||this.nextId();k.recurse(a.test,c);k.if_(c,k.lazyRecurse(a.alternate,c),k.lazyRecurse(a.consequent,c));e(c);break;case r.Identifier:c=c||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);Ba(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),
function(){k.if_("inputs"===k.stage||"s",function(){f&&1!==f&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(c,k.nonComputedMember("s",a.name))})},c&&k.lazyAssign(c,k.nonComputedMember("l",a.name)));(k.state.expensiveChecks||Fb(a.name))&&k.addEnsureSafeObject(c);e(c);break;case r.MemberExpression:h=d&&(d.context=this.nextId())||this.nextId();c=c||this.nextId();k.recurse(a.object,h,s,function(){k.if_(k.notNull(h),function(){if(a.computed)l=
k.nextId(),k.recurse(a.property,l),k.addEnsureSafeMemberName(l),f&&1!==f&&k.if_(k.not(k.computedMember(h,l)),k.lazyAssign(k.computedMember(h,l),"{}")),q=k.ensureSafeObject(k.computedMember(h,l)),k.assign(c,q),d&&(d.computed=!0,d.name=l);else{Ba(a.property.name);f&&1!==f&&k.if_(k.not(k.nonComputedMember(h,a.property.name)),k.lazyAssign(k.nonComputedMember(h,a.property.name),"{}"));q=k.nonComputedMember(h,a.property.name);if(k.state.expensiveChecks||Fb(a.property.name))q=k.ensureSafeObject(q);k.assign(c,
q);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(c,"undefined")});e(c)},!!f);break;case r.CallExpression:c=c||this.nextId();a.filter?(l=k.filter(a.callee.name),m=[],n(a.arguments,function(a){var c=k.nextId();k.recurse(a,c);m.push(c)}),q=l+"("+m.join(",")+")",k.assign(c,q),e(c)):(l=k.nextId(),h={},m=[],k.recurse(a.callee,l,h,function(){k.if_(k.notNull(l),function(){k.addEnsureSafeFunction(l);n(a.arguments,function(a){k.recurse(a,k.nextId(),s,function(a){m.push(k.ensureSafeObject(a))})});
h.name?(k.state.expensiveChecks||k.addEnsureSafeObject(h.context),q=k.member(h.context,h.name,h.computed)+"("+m.join(",")+")"):q=l+"("+m.join(",")+")";q=k.ensureSafeObject(q);k.assign(c,q)},function(){k.assign(c,"undefined")});e(c)}));break;case r.AssignmentExpression:l=this.nextId();h={};if(!nd(a.left))throw ca("lval");this.recurse(a.left,s,h,function(){k.if_(k.notNull(h.context),function(){k.recurse(a.right,l);k.addEnsureSafeObject(k.member(h.context,h.name,h.computed));q=k.member(h.context,h.name,
h.computed)+a.operator+l;k.assign(c,q);e(c||q)})},1);break;case r.ArrayExpression:m=[];n(a.elements,function(a){k.recurse(a,k.nextId(),s,function(a){m.push(a)})});q="["+m.join(",")+"]";this.assign(c,q);e(q);break;case r.ObjectExpression:m=[];n(a.properties,function(a){k.recurse(a.value,k.nextId(),s,function(c){m.push(k.escape(a.key.type===r.Identifier?a.key.name:""+a.key.value)+":"+c)})});q="{"+m.join(",")+"}";this.assign(c,q);e(q);break;case r.ThisExpression:this.assign(c,"s");e("s");break;case r.NGValueParameter:this.assign(c,
"v"),e("v")}},getHasOwnProperty:function(a,c){var d=a+"."+c,e=this.current().own;e.hasOwnProperty(d)||(e[d]=this.nextId(!1,a+"&&("+this.escape(c)+" in "+a+")"));return e[d]},assign:function(a,c){if(a)return this.current().body.push(a,"=",c,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,c){return"ifDefined("+a+","+this.escape(c)+")"},plus:function(a,c){return"plus("+a+","+c+")"},return_:function(a){this.current().body.push("return ",
a,";")},if_:function(a,c,d){if(!0===a)c();else{var e=this.current().body;e.push("if(",a,"){");c();e.push("}");d&&(e.push("else{"),d(),e.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,c){return a+"."+c},computedMember:function(a,c){return a+"["+c+"]"},member:function(a,c,d){return d?this.computedMember(a,c):this.nonComputedMember(a,c)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),
";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},lazyRecurse:function(a,c,d,e,f,g){var h=this;return function(){h.recurse(a,c,d,e,f,g)}},lazyAssign:function(a,c){var d=this;return function(){d.assign(a,c)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,
stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(L(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(V(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw ca("esc");},nextId:function(a,c){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(c?"="+c:""));return d},current:function(){return this.state[this.state.computing]}};
rd.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=c;U(e,d.$filter);var f,g;if(f=od(e))g=this.recurse(f);f=md(e.body);var h;f&&(h=[],n(f,function(a,c){var e=d.recurse(a);a.input=e;h.push(e);a.watchId=c}));var l=[];n(e.body,function(a){l.push(d.recurse(a.expression))});f=0===e.body.length?function(){}:1===e.body.length?l[0]:function(a,c){var d;n(l,function(e){d=e(a,c)});return d};g&&(f.assign=function(a,c,d){return g(a,d,c)});h&&(f.inputs=
h);f.literal=pd(e);f.constant=e.constant;return f},recurse:function(a,c,d){var e,f,g=this,h;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case r.Literal:return this.value(a.value,c);case r.UnaryExpression:return f=this.recurse(a.argument),this["unary"+a.operator](f,c);case r.BinaryExpression:return e=this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,f,c);case r.LogicalExpression:return e=this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,
f,c);case r.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),c);case r.Identifier:return Ba(a.name,g.expression),g.identifier(a.name,g.expensiveChecks||Fb(a.name),c,d,g.expression);case r.MemberExpression:return e=this.recurse(a.object,!1,!!d),a.computed||(Ba(a.property.name,g.expression),f=a.property.name),a.computed&&(f=this.recurse(a.property)),a.computed?this.computedMember(e,f,c,d,g.expression):this.nonComputedMember(e,f,
g.expensiveChecks,c,d,g.expression);case r.CallExpression:return h=[],n(a.arguments,function(a){h.push(g.recurse(a))}),a.filter&&(f=this.$filter(a.callee.name)),a.filter||(f=this.recurse(a.callee,!0)),a.filter?function(a,d,e,g){for(var n=[],r=0;r<h.length;++r)n.push(h[r](a,d,e,g));a=f.apply(s,n,g);return c?{context:s,name:s,value:a}:a}:function(a,d,e,q){var n=f(a,d,e,q),r;if(null!=n.value){oa(n.context,g.expression);kd(n.value,g.expression);r=[];for(var s=0;s<h.length;++s)r.push(oa(h[s](a,d,e,q),
g.expression));r=oa(n.value.apply(n.context,r),g.expression)}return c?{value:r}:r};case r.AssignmentExpression:return e=this.recurse(a.left,!0,1),f=this.recurse(a.right),function(a,d,h,q){var n=e(a,d,h,q);a=f(a,d,h,q);oa(n.value,g.expression);n.context[n.name]=a;return c?{value:a}:a};case r.ArrayExpression:return h=[],n(a.elements,function(a){h.push(g.recurse(a))}),function(a,d,e,f){for(var g=[],n=0;n<h.length;++n)g.push(h[n](a,d,e,f));return c?{value:g}:g};case r.ObjectExpression:return h=[],n(a.properties,
function(a){h.push({key:a.key.type===r.Identifier?a.key.name:""+a.key.value,value:g.recurse(a.value)})}),function(a,d,e,f){for(var g={},n=0;n<h.length;++n)g[h[n].key]=h[n].value(a,d,e,f);return c?{value:g}:g};case r.ThisExpression:return function(a){return c?{value:a}:a};case r.NGValueParameter:return function(a,d,e,f){return c?{value:e}:e}}},"unary+":function(a,c){return function(d,e,f,g){d=a(d,e,f,g);d=z(d)?+d:0;return c?{value:d}:d}},"unary-":function(a,c){return function(d,e,f,g){d=a(d,e,f,g);
d=z(d)?-d:0;return c?{value:d}:d}},"unary!":function(a,c){return function(d,e,f,g){d=!a(d,e,f,g);return c?{value:d}:d}},"binary+":function(a,c,d){return function(e,f,g,h){var l=a(e,f,g,h);e=c(e,f,g,h);l=ld(l,e);return d?{value:l}:l}},"binary-":function(a,c,d){return function(e,f,g,h){var l=a(e,f,g,h);e=c(e,f,g,h);l=(z(l)?l:0)-(z(e)?e:0);return d?{value:l}:l}},"binary*":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)*c(e,f,g,h);return d?{value:e}:e}},"binary/":function(a,c,d){return function(e,
f,g,h){e=a(e,f,g,h)/c(e,f,g,h);return d?{value:e}:e}},"binary%":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)%c(e,f,g,h);return d?{value:e}:e}},"binary===":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)===c(e,f,g,h);return d?{value:e}:e}},"binary!==":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)!==c(e,f,g,h);return d?{value:e}:e}},"binary==":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)==c(e,f,g,h);return d?{value:e}:e}},"binary!=":function(a,c,d){return function(e,
f,g,h){e=a(e,f,g,h)!=c(e,f,g,h);return d?{value:e}:e}},"binary<":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)<c(e,f,g,h);return d?{value:e}:e}},"binary>":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)>c(e,f,g,h);return d?{value:e}:e}},"binary<=":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)<=c(e,f,g,h);return d?{value:e}:e}},"binary>=":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)>=c(e,f,g,h);return d?{value:e}:e}},"binary&&":function(a,c,d){return function(e,f,g,h){e=
a(e,f,g,h)&&c(e,f,g,h);return d?{value:e}:e}},"binary||":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)||c(e,f,g,h);return d?{value:e}:e}},"ternary?:":function(a,c,d,e){return function(f,g,h,l){f=a(f,g,h,l)?c(f,g,h,l):d(f,g,h,l);return e?{value:f}:f}},value:function(a,c){return function(){return c?{context:s,name:s,value:a}:a}},identifier:function(a,c,d,e,f){return function(g,h,l,k){g=h&&a in h?h:g;e&&1!==e&&g&&!g[a]&&(g[a]={});h=g?g[a]:s;c&&oa(h,f);return d?{context:g,name:a,value:h}:h}},
computedMember:function(a,c,d,e,f){return function(g,h,l,k){var m=a(g,h,l,k),n,t;null!=m&&(n=c(g,h,l,k),Ba(n,f),e&&1!==e&&m&&!m[n]&&(m[n]={}),t=m[n],oa(t,f));return d?{context:m,name:n,value:t}:t}},nonComputedMember:function(a,c,d,e,f,g){return function(h,l,k,m){h=a(h,l,k,m);f&&1!==f&&h&&!h[c]&&(h[c]={});l=null!=h?h[c]:s;(d||Fb(c))&&oa(l,g);return e?{context:h,name:c,value:l}:l}},inputs:function(a,c){return function(d,e,f,g){return g?g[c]:a(d,e,f)}}};var hc=function(a,c,d){this.lexer=a;this.$filter=
c;this.options=d;this.ast=new r(this.lexer);this.astCompiler=d.csp?new rd(this.ast,c):new qd(this.ast,c)};hc.prototype={constructor:hc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};ga();ga();var Xf=Object.prototype.valueOf,Ca=I("$sce"),pa={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},ea=I("$compile"),Y=W.createElement("a"),vd=Aa(O.location.href);wd.$inject=["$document"];Kc.$inject=["$provide"];xd.$inject=["$locale"];zd.$inject=["$locale"];
var Cd=".",gg={yyyy:Z("FullYear",4),yy:Z("FullYear",2,0,!0),y:Z("FullYear",1),MMMM:Hb("Month"),MMM:Hb("Month",!0),MM:Z("Month",2,1),M:Z("Month",1,1),dd:Z("Date",2),d:Z("Date",1),HH:Z("Hours",2),H:Z("Hours",1),hh:Z("Hours",2,-12),h:Z("Hours",1,-12),mm:Z("Minutes",2),m:Z("Minutes",1),ss:Z("Seconds",2),s:Z("Seconds",1),sss:Z("Milliseconds",3),EEEE:Hb("Day"),EEE:Hb("Day",!0),a:function(a,c){return 12>a.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a,c,d){a=-1*d;return a=(0<=a?"+":"")+(Gb(Math[0<a?"floor":
"ceil"](a/60),2)+Gb(Math.abs(a%60),2))},ww:Ed(2),w:Ed(1),G:jc,GG:jc,GGG:jc,GGGG:function(a,c){return 0>=a.getFullYear()?c.ERANAMES[0]:c.ERANAMES[1]}},fg=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,eg=/^\-?\d+$/;yd.$inject=["$locale"];var bg=ra(G),cg=ra(qb);Ad.$inject=["$parse"];var he=ra({restrict:"E",compile:function(a,c){if(!c.href&&!c.xlinkHref)return function(a,c){if("a"===c[0].nodeName.toLowerCase()){var f="[object SVGAnimatedString]"===ta.call(c.prop("href"))?
"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}}),rb={};n(zb,function(a,c){function d(a,d,f){a.$watch(f[e],function(a){f.$set(c,!!a)})}if("multiple"!=a){var e=xa("ng-"+c),f=d;"checked"===a&&(f=function(a,c,f){f.ngModel!==f[e]&&d(a,c,f)});rb[e]=function(){return{restrict:"A",priority:100,link:f}}}});n(Tc,function(a,c){rb[c]=function(){return{priority:100,link:function(a,e,f){if("ngPattern"===c&&"/"==f.ngPattern.charAt(0)&&(e=f.ngPattern.match(ig))){f.$set("ngPattern",
new RegExp(e[1],e[2]));return}a.$watch(f[c],function(a){f.$set(c,a)})}}}});n(["src","srcset","href"],function(a){var c=xa("ng-"+a);rb[c]=function(){return{priority:99,link:function(d,e,f){var g=a,h=a;"href"===a&&"[object SVGAnimatedString]"===ta.call(e.prop("href"))&&(h="xlinkHref",f.$attr[h]="xlink:href",g=null);f.$observe(c,function(c){c?(f.$set(h,c),Ta&&g&&e.prop(g,f[h])):"href"===a&&f.$set(h,null)})}}}});var Ib={$addControl:v,$$renameControl:function(a,c){a.$name=c},$removeControl:v,$setValidity:v,
$setDirty:v,$setPristine:v,$setSubmitted:v};Fd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Nd=function(a){return["$timeout",function(c){return{name:"form",restrict:a?"EAC":"E",controller:Fd,compile:function(d,e){d.addClass(Ua).addClass(lb);var f=e.name?"name":a&&e.ngForm?"ngForm":!1;return{pre:function(a,d,e,k){if(!("action"in e)){var m=function(c){a.$apply(function(){k.$commitViewValue();k.$setSubmitted()});c.preventDefault()};d[0].addEventListener("submit",m,!1);d.on("$destroy",
function(){c(function(){d[0].removeEventListener("submit",m,!1)},0,!1)})}var n=k.$$parentForm;f&&(Eb(a,k.$name,k,k.$name),e.$observe(f,function(c){k.$name!==c&&(Eb(a,k.$name,s,k.$name),n.$$renameControl(k,c),Eb(a,k.$name,k,k.$name))}));d.on("$destroy",function(){n.$removeControl(k);f&&Eb(a,e[f],s,k.$name);Q(k,Ib)})}}}}}]},ie=Nd(),ve=Nd(!0),hg=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,qg=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,
rg=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,sg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Od=/^(\d{4})-(\d{2})-(\d{2})$/,Pd=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,mc=/^(\d{4})-W(\d\d)$/,Qd=/^(\d{4})-(\d\d)$/,Rd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Sd={text:function(a,c,d,e,f,g){jb(a,c,d,e,f,g);kc(e)},date:kb("date",Od,Kb(Od,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":kb("datetimelocal",Pd,Kb(Pd,
"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:kb("time",Rd,Kb(Rd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:kb("week",mc,function(a,c){if(da(a))return a;if(L(a)){mc.lastIndex=0;var d=mc.exec(a);if(d){var e=+d[1],f=+d[2],g=d=0,h=0,l=0,k=Dd(e),f=7*(f-1);c&&(d=c.getHours(),g=c.getMinutes(),h=c.getSeconds(),l=c.getMilliseconds());return new Date(e,0,k.getDate()+f,d,g,h,l)}}return NaN},"yyyy-Www"),month:kb("month",Qd,Kb(Qd,["yyyy","MM"]),"yyyy-MM"),number:function(a,c,d,e,f,g){Hd(a,
c,d,e);jb(a,c,d,e,f,g);e.$$parserName="number";e.$parsers.push(function(a){return e.$isEmpty(a)?null:sg.test(a)?parseFloat(a):s});e.$formatters.push(function(a){if(!e.$isEmpty(a)){if(!V(a))throw Lb("numfmt",a);a=a.toString()}return a});if(z(d.min)||d.ngMin){var h;e.$validators.min=function(a){return e.$isEmpty(a)||w(h)||a>=h};d.$observe("min",function(a){z(a)&&!V(a)&&(a=parseFloat(a,10));h=V(a)&&!isNaN(a)?a:s;e.$validate()})}if(z(d.max)||d.ngMax){var l;e.$validators.max=function(a){return e.$isEmpty(a)||
w(l)||a<=l};d.$observe("max",function(a){z(a)&&!V(a)&&(a=parseFloat(a,10));l=V(a)&&!isNaN(a)?a:s;e.$validate()})}},url:function(a,c,d,e,f,g){jb(a,c,d,e,f,g);kc(e);e.$$parserName="url";e.$validators.url=function(a,c){var d=a||c;return e.$isEmpty(d)||qg.test(d)}},email:function(a,c,d,e,f,g){jb(a,c,d,e,f,g);kc(e);e.$$parserName="email";e.$validators.email=function(a,c){var d=a||c;return e.$isEmpty(d)||rg.test(d)}},radio:function(a,c,d,e){w(d.name)&&c.attr("name",++mb);c.on("click",function(a){c[0].checked&&
e.$setViewValue(d.value,a&&a.type)});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e,f,g,h,l){var k=Id(l,a,"ngTrueValue",d.ngTrueValue,!0),m=Id(l,a,"ngFalseValue",d.ngFalseValue,!1);c.on("click",function(a){e.$setViewValue(c[0].checked,a&&a.type)});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return!1===a};e.$formatters.push(function(a){return ka(a,k)});e.$parsers.push(function(a){return a?k:m})},hidden:v,
button:v,submit:v,reset:v,file:v},Ec=["$browser","$sniffer","$filter","$parse",function(a,c,d,e){return{restrict:"E",require:["?ngModel"],link:{pre:function(f,g,h,l){l[0]&&(Sd[G(h.type)]||Sd.text)(f,g,h,l[0],c,a,d,e)}}}}],tg=/^(true|false|\d+)$/,Ne=function(){return{restrict:"A",priority:100,compile:function(a,c){return tg.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",a)})}}}},ne=["$compile",function(a){return{restrict:"AC",
compile:function(c){a.$$addBindingClass(c);return function(c,e,f){a.$$addBindingInfo(e,f.ngBind);e=e[0];c.$watch(f.ngBind,function(a){e.textContent=a===s?"":a})}}}}],pe=["$interpolate","$compile",function(a,c){return{compile:function(d){c.$$addBindingClass(d);return function(d,f,g){d=a(f.attr(g.$attr.ngBindTemplate));c.$$addBindingInfo(f,d.expressions);f=f[0];g.$observe("ngBindTemplate",function(a){f.textContent=a===s?"":a})}}}}],oe=["$sce","$parse","$compile",function(a,c,d){return{restrict:"A",
compile:function(e,f){var g=c(f.ngBindHtml),h=c(f.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(e);return function(c,e,f){d.$$addBindingInfo(e,f.ngBindHtml);c.$watch(h,function(){e.html(a.getTrustedHtml(g(c))||"")})}}}}],Me=ra({restrict:"A",require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),qe=lc("",!0),se=lc("Odd",0),re=lc("Even",1),te=Ma({compile:function(a,c){c.$set("ngCloak",s);a.removeClass("ng-cloak")}}),ue=[function(){return{restrict:"A",
scope:!0,controller:"@",priority:500}}],Jc={},ug={blur:!0,focus:!0};n("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=xa("ng-"+a);Jc[c]=["$parse","$rootScope",function(d,e){return{restrict:"A",compile:function(f,g){var h=d(g[c],null,!0);return function(c,d){d.on(a,function(d){var f=function(){h(c,{$event:d})};ug[a]&&e.$$phase?c.$evalAsync(f):c.$apply(f)})}}}}]});var xe=["$animate",
function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var h,l,k;c.$watch(e.ngIf,function(c){c?l||g(function(c,f){l=f;c[c.length++]=W.createComment(" end ngIf: "+e.ngIf+" ");h={clone:c};a.enter(c,d.parent(),d)}):(k&&(k.remove(),k=null),l&&(l.$destroy(),l=null),h&&(k=pb(h.clone),a.leave(k).then(function(){k=null}),h=null))})}}}],ye=["$templateRequest","$anchorScroll","$animate","$sce",function(a,c,d,e){return{restrict:"ECA",priority:400,
terminal:!0,transclude:"element",controller:$.noop,compile:function(f,g){var h=g.ngInclude||g.src,l=g.onload||"",k=g.autoscroll;return function(f,g,n,r,s){var w=0,u,p,x,v=function(){p&&(p.remove(),p=null);u&&(u.$destroy(),u=null);x&&(d.leave(x).then(function(){p=null}),p=x,x=null)};f.$watch(e.parseAsResourceUrl(h),function(e){var h=function(){!z(k)||k&&!f.$eval(k)||c()},n=++w;e?(a(e,!0).then(function(a){if(n===w){var c=f.$new();r.template=a;a=s(c,function(a){v();d.enter(a,null,g).then(h)});u=c;x=
a;u.$emit("$includeContentLoaded",e);f.$eval(l)}},function(){n===w&&(v(),f.$emit("$includeContentError",e))}),f.$emit("$includeContentRequested",e)):(v(),r.template=null)})}}}}],Pe=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){/SVG/.test(d[0].toString())?(d.empty(),a(Mc(f.template,W).childNodes)(c,function(a){d.append(a)},{futureParentElement:d})):(d.html(f.template),a(d.contents())(c))}}}],ze=Ma({priority:450,compile:function(){return{pre:function(a,
c,d){a.$eval(d.ngInit)}}}}),Le=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,c,d,e){var f=c.attr(d.$attr.ngList)||", ",g="false"!==d.ngTrim,h=g?T(f):f;e.$parsers.push(function(a){if(!w(a)){var c=[];a&&n(a.split(h),function(a){a&&c.push(g?T(a):a)});return c}});e.$formatters.push(function(a){return K(a)?a.join(f):s});e.$isEmpty=function(a){return!a||!a.length}}}},lb="ng-valid",Jd="ng-invalid",Ua="ng-pristine",Jb="ng-dirty",Ld="ng-pending",Lb=new I("ngModel"),vg=["$scope",
"$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,c,d,e,f,g,h,l,k,m){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=s;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=s;this.$name=m(d.name||"",!1)(a);var q=f(d.ngModel),
r=q.assign,y=q,C=r,N=null,u,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var c=f(d.ngModel+"()"),g=f(d.ngModel+"($$$p)");y=function(a){var d=q(a);E(d)&&(d=c(a));return d};C=function(a,c){E(q(a))?g(a,{$$$p:p.$modelValue}):r(a,p.$modelValue)}}else if(!q.assign)throw Lb("nonassign",d.ngModel,va(e));};this.$render=v;this.$isEmpty=function(a){return w(a)||""===a||null===a||a!==a};var x=e.inheritedData("$formController")||Ib,A=0;Gd({ctrl:this,$element:e,set:function(a,c){a[c]=
!0},unset:function(a,c){delete a[c]},parentForm:x,$animate:g});this.$setPristine=function(){p.$dirty=!1;p.$pristine=!0;g.removeClass(e,Jb);g.addClass(e,Ua)};this.$setDirty=function(){p.$dirty=!0;p.$pristine=!1;g.removeClass(e,Ua);g.addClass(e,Jb);x.$setDirty()};this.$setUntouched=function(){p.$touched=!1;p.$untouched=!0;g.setClass(e,"ng-untouched","ng-touched")};this.$setTouched=function(){p.$touched=!0;p.$untouched=!1;g.setClass(e,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){h.cancel(N);
p.$viewValue=p.$$lastCommittedViewValue;p.$render()};this.$validate=function(){if(!V(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,c=p.$valid,d=p.$modelValue,e=p.$options&&p.$options.allowInvalid;p.$$runValidators(a,p.$$lastCommittedViewValue,function(f){e||c===f||(p.$modelValue=f?a:s,p.$modelValue!==d&&p.$$writeModelToScope())})}};this.$$runValidators=function(a,c,d){function e(){var d=!0;n(p.$validators,function(e,f){var h=e(a,c);d=d&&h;g(f,h)});return d?!0:(n(p.$asyncValidators,
function(a,c){g(c,null)}),!1)}function f(){var d=[],e=!0;n(p.$asyncValidators,function(f,h){var k=f(a,c);if(!k||!E(k.then))throw Lb("$asyncValidators",k);g(h,s);d.push(k.then(function(){g(h,!0)},function(a){e=!1;g(h,!1)}))});d.length?k.all(d).then(function(){h(e)},v):h(!0)}function g(a,c){l===A&&p.$setValidity(a,c)}function h(a){l===A&&d(a)}A++;var l=A;(function(){var a=p.$$parserName||"parse";if(u===s)g(a,null);else return u||(n(p.$validators,function(a,c){g(c,null)}),n(p.$asyncValidators,function(a,
c){g(c,null)})),g(a,u),u;return!0})()?e()?f():h(!1):h(!1)};this.$commitViewValue=function(){var a=p.$viewValue;h.cancel(N);if(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var c=p.$$lastCommittedViewValue;if(u=w(c)?s:!0)for(var d=0;d<p.$parsers.length;d++)if(c=p.$parsers[d](c),w(c)){u=!1;break}V(p.$modelValue)&&isNaN(p.$modelValue)&&(p.$modelValue=y(a));var e=
p.$modelValue,f=p.$options&&p.$options.allowInvalid;p.$$rawModelValue=c;f&&(p.$modelValue=c,p.$modelValue!==e&&p.$$writeModelToScope());p.$$runValidators(c,p.$$lastCommittedViewValue,function(a){f||(p.$modelValue=a?c:s,p.$modelValue!==e&&p.$$writeModelToScope())})};this.$$writeModelToScope=function(){C(a,p.$modelValue);n(p.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};this.$setViewValue=function(a,c){p.$viewValue=a;p.$options&&!p.$options.updateOnDefault||p.$$debounceViewValueCommit(c)};
this.$$debounceViewValueCommit=function(c){var d=0,e=p.$options;e&&z(e.debounce)&&(e=e.debounce,V(e)?d=e:V(e[c])?d=e[c]:V(e["default"])&&(d=e["default"]));h.cancel(N);d?N=h(function(){p.$commitViewValue()},d):l.$$phase?p.$commitViewValue():a.$apply(function(){p.$commitViewValue()})};a.$watch(function(){var c=y(a);if(c!==p.$modelValue&&(p.$modelValue===p.$modelValue||c===c)){p.$modelValue=p.$$rawModelValue=c;u=s;for(var d=p.$formatters,e=d.length,f=c;e--;)f=d[e](f);p.$viewValue!==f&&(p.$viewValue=
p.$$lastCommittedViewValue=f,p.$render(),p.$$runValidators(c,f,v))}return c})}],Ke=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:vg,priority:1,compile:function(c){c.addClass(Ua).addClass("ng-untouched").addClass(lb);return{pre:function(a,c,f,g){var h=g[0],l=g[1]||Ib;h.$$setOptions(g[2]&&g[2].$options);l.$addControl(h);f.$observe("name",function(a){h.$name!==a&&l.$$renameControl(h,a)});a.$on("$destroy",function(){l.$removeControl(h)})},post:function(c,
e,f,g){var h=g[0];if(h.$options&&h.$options.updateOn)e.on(h.$options.updateOn,function(a){h.$$debounceViewValueCommit(a&&a.type)});e.on("blur",function(e){h.$touched||(a.$$phase?c.$evalAsync(h.$setTouched):c.$apply(h.$setTouched))})}}}}}],wg=/(\s+|^)default(\s+|$)/,Oe=function(){return{restrict:"A",controller:["$scope","$attrs",function(a,c){var d=this;this.$options=fa(a.$eval(c.ngModelOptions));this.$options.updateOn!==s?(this.$options.updateOnDefault=!1,this.$options.updateOn=T(this.$options.updateOn.replace(wg,
function(){d.$options.updateOnDefault=!0;return" "}))):this.$options.updateOnDefault=!0}]}},Ae=Ma({terminal:!0,priority:1E3}),xg=I("ngOptions"),yg=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,Ie=["$compile","$parse",function(a,c){function d(a,d,e){function f(a,c,d,e,g){this.selectValue=a;this.viewValue=c;this.label=
d;this.group=e;this.disabled=g}var m=a.match(yg);if(!m)throw xg("iexp",a,va(d));var n=m[5]||m[7],r=m[6];a=/ as /.test(m[0])&&m[1];var s=m[9];d=c(m[2]?m[1]:n);var w=a&&c(a)||d,v=s&&c(s),u=s?function(a,c){return v(e,c)}:function(a){return Fa(a)},p=function(a,c){return u(a,D(a,c))},x=c(m[2]||m[1]),A=c(m[3]||""),z=c(m[4]||""),B=c(m[8]),M={},D=r?function(a,c){M[r]=c;M[n]=a;return M}:function(a){M[n]=a;return M};return{trackBy:s,getTrackByValue:p,getWatchables:c(B,function(a){var c=[];a=a||[];Object.keys(a).forEach(function(d){if("$"!==
d.charAt(0)){var f=D(a[d],d);d=u(a[d],f);c.push(d);if(m[2]||m[1])d=x(e,f),c.push(d);m[4]&&(f=z(e,f),c.push(f))}});return c}),getOptions:function(){var a=[],c={},d=B(e)||[],g;if(!r&&Da(d))g=d;else{g=[];for(var h in d)d.hasOwnProperty(h)&&"$"!==h.charAt(0)&&g.push(h)}h=g.length;for(var m=0;m<h;m++){var n=d===g?m:g[m],q=D(d[n],n),v=w(e,q),n=u(v,q),N=x(e,q),M=A(e,q),q=z(e,q),v=new f(n,v,N,M,q);a.push(v);c[n]=v}return{items:a,selectValueMap:c,getOptionFromViewValue:function(a){return c[p(a)]},getViewValueFromOption:function(a){return s?
$.copy(a.viewValue):a.viewValue}}}}}var e=W.createElement("option"),f=W.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","?ngModel"],link:function(c,h,l,k){function m(a,c){a.element=c;c.disabled=a.disabled;a.value!==c.value&&(c.value=a.selectValue);a.label!==c.label&&(c.label=a.label,c.textContent=a.label)}function q(a,c,d,e){c&&G(c.nodeName)===d?d=c:(d=e.cloneNode(!1),c?a.insertBefore(d,c):a.appendChild(d));return d}function r(a){for(var c;a;)c=a.nextSibling,Xb(a),a=c}
function s(a){var c=p&&p[0],d=M&&M[0];if(c||d)for(;a&&(a===c||a===d);)a=a.nextSibling;return a}function w(){var a=D&&u.readValue();D=E.getOptions();var c={},d=h[0].firstChild;B&&h.prepend(p);d=s(d);D.items.forEach(function(a){var g,k;a.group?(g=c[a.group],g||(g=q(h[0],d,"optgroup",f),d=g.nextSibling,g.label=a.group,g=c[a.group]={groupElement:g,currentOptionElement:g.firstChild}),k=q(g.groupElement,g.currentOptionElement,"option",e),m(a,k),g.currentOptionElement=k.nextSibling):(k=q(h[0],d,"option",
e),m(a,k),d=k.nextSibling)});Object.keys(c).forEach(function(a){r(c[a].currentOptionElement)});r(d);v.$render();if(!v.$isEmpty(a)){var g=u.readValue();(E.trackBy?ka(a,g):a===g)||(v.$setViewValue(g),v.$render())}}var v=k[1];if(v){var u=k[0];k=l.multiple;for(var p,x=0,z=h.children(),H=z.length;x<H;x++)if(""===z[x].value){p=z.eq(x);break}var B=!!p,M=A(e.cloneNode(!1));M.val("?");var D,E=d(l.ngOptions,h,c);k?(v.$isEmpty=function(a){return!a||0===a.length},u.writeValue=function(a){D.items.forEach(function(a){a.element.selected=
!1});a&&a.forEach(function(a){(a=D.getOptionFromViewValue(a))&&!a.disabled&&(a.element.selected=!0)})},u.readValue=function(){var a=h.val()||[],c=[];n(a,function(a){a=D.selectValueMap[a];a.disabled||c.push(D.getViewValueFromOption(a))});return c},E.trackBy&&c.$watchCollection(function(){if(K(v.$viewValue))return v.$viewValue.map(function(a){return E.getTrackByValue(a)})},function(){v.$render()})):(u.writeValue=function(a){var c=D.getOptionFromViewValue(a);c&&!c.disabled?h[0].value!==c.selectValue&&
(M.remove(),B||p.remove(),h[0].value=c.selectValue,c.element.selected=!0,c.element.setAttribute("selected","selected")):null===a||B?(M.remove(),B||h.prepend(p),h.val(""),p.prop("selected",!0),p.attr("selected",!0)):(B||p.remove(),h.prepend(M),h.val("?"),M.prop("selected",!0),M.attr("selected",!0))},u.readValue=function(){var a=D.selectValueMap[h.val()];return a&&!a.disabled?(B||p.remove(),M.remove(),D.getViewValueFromOption(a)):null},E.trackBy&&c.$watch(function(){return E.getTrackByValue(v.$viewValue)},
function(){v.$render()}));B?(p.remove(),a(p)(c),p.removeClass("ng-scope")):p=A(e.cloneNode(!1));w();c.$watchCollection(E.getWatchables,w)}}}}],Be=["$locale","$interpolate","$log",function(a,c,d){var e=/{}/g,f=/^when(Minus)?(.+)$/;return{link:function(g,h,l){function k(a){h.text(a||"")}var m=l.count,q=l.$attr.when&&h.attr(l.$attr.when),r=l.offset||0,s=g.$eval(q)||{},C={},z=c.startSymbol(),u=c.endSymbol(),p=z+m+"-"+r+u,x=$.noop,A;n(l,function(a,c){var d=f.exec(c);d&&(d=(d[1]?"-":"")+G(d[2]),s[d]=h.attr(l.$attr[c]))});
n(s,function(a,d){C[d]=c(a.replace(e,p))});g.$watch(m,function(c){var e=parseFloat(c),f=isNaN(e);f||e in s||(e=a.pluralCat(e-r));e===A||f&&V(A)&&isNaN(A)||(x(),f=C[e],w(f)?(null!=c&&d.debug("ngPluralize: no rule defined for '"+e+"' in "+q),x=v,k()):x=g.$watch(f,k),A=e)})}}}],Ce=["$parse","$animate",function(a,c){var d=I("ngRepeat"),e=function(a,c,d,e,k,m,n){a[d]=e;k&&(a[k]=m);a.$index=c;a.$first=0===c;a.$last=c===n-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(c&1))};return{restrict:"A",
multiElement:!0,transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,compile:function(f,g){var h=g.ngRepeat,l=W.createComment(" end ngRepeat: "+h+" "),k=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!k)throw d("iexp",h);var m=k[1],q=k[2],r=k[3],v=k[4],k=m.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);if(!k)throw d("iidexp",m);var w=k[3]||k[1],z=k[2];if(r&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(r)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(r)))throw d("badident",
r);var u,p,x,E,H={$id:Fa};v?u=a(v):(x=function(a,c){return Fa(c)},E=function(a){return a});return function(a,f,g,k,m){u&&(p=function(c,d,e){z&&(H[z]=c);H[w]=d;H.$index=e;return u(a,H)});var v=ga();a.$watchCollection(q,function(g){var k,q,u=f[0],y,D=ga(),H,F,L,I,K,G,O;r&&(a[r]=g);if(Da(g))K=g,q=p||x;else for(O in q=p||E,K=[],g)g.hasOwnProperty(O)&&"$"!==O.charAt(0)&&K.push(O);H=K.length;O=Array(H);for(k=0;k<H;k++)if(F=g===K?k:K[k],L=g[F],I=q(F,L,k),v[I])G=v[I],delete v[I],D[I]=G,O[k]=G;else{if(D[I])throw n(O,
function(a){a&&a.scope&&(v[a.id]=a)}),d("dupes",h,I,L);O[k]={id:I,scope:s,clone:s};D[I]=!0}for(y in v){G=v[y];I=pb(G.clone);c.leave(I);if(I[0].parentNode)for(k=0,q=I.length;k<q;k++)I[k].$$NG_REMOVED=!0;G.scope.$destroy()}for(k=0;k<H;k++)if(F=g===K?k:K[k],L=g[F],G=O[k],G.scope){y=u;do y=y.nextSibling;while(y&&y.$$NG_REMOVED);G.clone[0]!=y&&c.move(pb(G.clone),null,A(u));u=G.clone[G.clone.length-1];e(G.scope,k,w,L,z,F,H)}else m(function(a,d){G.scope=d;var f=l.cloneNode(!1);a[a.length++]=f;c.enter(a,
null,A(u));u=f;G.clone=a;D[G.id]=G;e(G.scope,k,w,L,z,F,H)});v=D})}}}}],De=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngShow,function(c){a[c?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],we=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngHide,function(c){a[c?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ee=Ma(function(a,c,d){a.$watch(d.ngStyle,
function(a,d){d&&a!==d&&n(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Fe=["$animate",function(a){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,f){var g=[],h=[],l=[],k=[],m=function(a,c){return function(){a.splice(c,1)}};c.$watch(e.ngSwitch||e.on,function(c){var d,e;d=0;for(e=l.length;d<e;++d)a.cancel(l[d]);d=l.length=0;for(e=k.length;d<e;++d){var r=pb(h[d].clone);k[d].$destroy();(l[d]=a.leave(r)).then(m(l,d))}h.length=0;k.length=0;(g=f.cases["!"+
c]||f.cases["?"])&&n(g,function(c){c.transclude(function(d,e){k.push(e);var f=c.element;d[d.length++]=W.createComment(" end ngSwitchWhen: ");h.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],Ge=Ma({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,c,d,e,f){e.cases["!"+d.ngSwitchWhen]=e.cases["!"+d.ngSwitchWhen]||[];e.cases["!"+d.ngSwitchWhen].push({transclude:f,element:c})}}),He=Ma({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,
c,d,e,f){e.cases["?"]=e.cases["?"]||[];e.cases["?"].push({transclude:f,element:c})}}),Je=Ma({restrict:"EAC",link:function(a,c,d,e,f){if(!f)throw I("ngTransclude")("orphan",va(c));f(function(a){c.empty();c.append(a)})}}),je=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){"text/ng-template"==d.type&&a.put(d.id,c[0].text)}}}],zg={$setViewValue:v,$render:v},Ag=["$element","$scope","$attrs",function(a,c,d){var e=this,f=new Sa;e.ngModelCtrl=zg;e.unknownOption=A(W.createElement("option"));
e.renderUnknownOption=function(c){c="? "+Fa(c)+" ?";e.unknownOption.val(c);a.prepend(e.unknownOption);a.val(c)};c.$on("$destroy",function(){e.renderUnknownOption=v});e.removeUnknownOption=function(){e.unknownOption.parent()&&e.unknownOption.remove()};e.readValue=function(){e.removeUnknownOption();return a.val()};e.writeValue=function(c){e.hasOption(c)?(e.removeUnknownOption(),a.val(c),""===c&&e.emptyOption.prop("selected",!0)):null==c&&e.emptyOption?(e.removeUnknownOption(),a.val("")):e.renderUnknownOption(c)};
e.addOption=function(a,c){Ra(a,'"option value"');""===a&&(e.emptyOption=c);var d=f.get(a)||0;f.put(a,d+1)};e.removeOption=function(a){var c=f.get(a);c&&(1===c?(f.remove(a),""===a&&(e.emptyOption=s)):f.put(a,c-1))};e.hasOption=function(a){return!!f.get(a)}}],ke=function(){return{restrict:"E",require:["select","?ngModel"],controller:Ag,link:function(a,c,d,e){var f=e[1];if(f){var g=e[0];g.ngModelCtrl=f;f.$render=function(){g.writeValue(f.$viewValue)};c.on("change",function(){a.$apply(function(){f.$setViewValue(g.readValue())})});
if(d.multiple){g.readValue=function(){var a=[];n(c.find("option"),function(c){c.selected&&a.push(c.value)});return a};g.writeValue=function(a){var d=new Sa(a);n(c.find("option"),function(a){a.selected=z(d.get(a.value))})};var h,l=NaN;a.$watch(function(){l!==f.$viewValue||ka(h,f.$viewValue)||(h=ia(f.$viewValue),f.$render());l=f.$viewValue});f.$isEmpty=function(a){return!a||0===a.length}}}}}},me=["$interpolate",function(a){function c(a){a[0].hasAttribute("selected")&&(a[0].selected=!0)}return{restrict:"E",
priority:100,compile:function(d,e){if(w(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,d,e){var k=d.parent(),m=k.data("$selectController")||k.parent().data("$selectController");m&&m.ngModelCtrl&&(f?a.$watch(f,function(a,f){e.$set("value",a);f!==a&&m.removeOption(f);m.addOption(a,d);m.ngModelCtrl.$render();c(d)}):(m.addOption(e.value,d),m.ngModelCtrl.$render(),c(d)),d.on("$destroy",function(){m.removeOption(e.value);m.ngModelCtrl.$render()}))}}}}],le=ra({restrict:"E",
terminal:!1}),Gc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){e&&(d.required=!0,e.$validators.required=function(a,c){return!d.required||!e.$isEmpty(c)},d.$observe("required",function(){e.$validate()}))}}},Fc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f,g=d.ngPattern||d.pattern;d.$observe("pattern",function(a){L(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw I("ngPattern")("noregexp",g,a,va(c));f=a||s;e.$validate()});
e.$validators.pattern=function(a){return e.$isEmpty(a)||w(f)||f.test(a)}}}}},Ic=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=-1;d.$observe("maxlength",function(a){a=X(a);f=isNaN(a)?-1:a;e.$validate()});e.$validators.maxlength=function(a,c){return 0>f||e.$isEmpty(c)||c.length<=f}}}}},Hc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=0;d.$observe("minlength",function(a){f=X(a)||0;e.$validate()});e.$validators.minlength=function(a,
c){return e.$isEmpty(c)||c.length>=f}}}}};O.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(be(),de($),A(W).ready(function(){Yd(W,zc)}))})(window,document);!window.angular.$$csp()&&window.angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
//# sourceMappingURL=angular.min.js.map

/*
 AngularJS v1.4.1
 (c) 2010-2015 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(I,d,B){'use strict';function D(f,q){q=q||{};d.forEach(q,function(d,h){delete q[h]});for(var h in f)!f.hasOwnProperty(h)||"$"===h.charAt(0)&&"$"===h.charAt(1)||(q[h]=f[h]);return q}var x=d.$$minErr("$resource"),C=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;d.module("ngResource",["ng"]).provider("$resource",function(){var f=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};
this.$get=["$http","$q",function(q,h){function u(d,g){this.template=d;this.defaults=s({},f.defaults,g);this.urlParams={}}function w(y,g,l,m){function c(b,k){var c={};k=s({},g,k);r(k,function(a,k){v(a)&&(a=a());var d;if(a&&a.charAt&&"@"==a.charAt(0)){d=b;var e=a.substr(1);if(null==e||""===e||"hasOwnProperty"===e||!C.test("."+e))throw x("badmember",e);for(var e=e.split("."),n=0,g=e.length;n<g&&d!==B;n++){var h=e[n];d=null!==d?d[h]:B}}else d=a;c[k]=d});return c}function F(b){return b.resource}function e(b){D(b||
{},this)}var G=new u(y,m);l=s({},f.defaults.actions,l);e.prototype.toJSON=function(){var b=s({},this);delete b.$promise;delete b.$resolved;return b};r(l,function(b,k){var g=/^(POST|PUT|PATCH)$/i.test(b.method);e[k]=function(a,z,m,y){var n={},f,l,A;switch(arguments.length){case 4:A=y,l=m;case 3:case 2:if(v(z)){if(v(a)){l=a;A=z;break}l=z;A=m}else{n=a;f=z;l=m;break}case 1:v(a)?l=a:g?f=a:n=a;break;case 0:break;default:throw x("badargs",arguments.length);}var u=this instanceof e,p=u?f:b.isArray?[]:new e(f),
t={},w=b.interceptor&&b.interceptor.response||F,C=b.interceptor&&b.interceptor.responseError||B;r(b,function(b,a){"params"!=a&&"isArray"!=a&&"interceptor"!=a&&(t[a]=H(b))});g&&(t.data=f);G.setUrlParams(t,s({},c(f,b.params||{}),n),b.url);n=q(t).then(function(a){var c=a.data,g=p.$promise;if(c){if(d.isArray(c)!==!!b.isArray)throw x("badcfg",k,b.isArray?"array":"object",d.isArray(c)?"array":"object",t.method,t.url);b.isArray?(p.length=0,r(c,function(a){"object"===typeof a?p.push(new e(a)):p.push(a)})):
(D(c,p),p.$promise=g)}p.$resolved=!0;a.resource=p;return a},function(a){p.$resolved=!0;(A||E)(a);return h.reject(a)});n=n.then(function(a){var b=w(a);(l||E)(b,a.headers);return b},C);return u?n:(p.$promise=n,p.$resolved=!1,p)};e.prototype["$"+k]=function(a,b,c){v(a)&&(c=b,b=a,a={});a=e[k].call(this,a,this,b,c);return a.$promise||a}});e.bind=function(b){return w(y,s({},g,b),l)};return e}var E=d.noop,r=d.forEach,s=d.extend,H=d.copy,v=d.isFunction;u.prototype={setUrlParams:function(f,g,l){var m=this,
c=l||m.template,h,e,q=m.urlParams={};r(c.split(/\W/),function(b){if("hasOwnProperty"===b)throw x("badname");!/^\d+$/.test(b)&&b&&(new RegExp("(^|[^\\\\]):"+b+"(\\W|$)")).test(c)&&(q[b]=!0)});c=c.replace(/\\:/g,":");g=g||{};r(m.urlParams,function(b,k){h=g.hasOwnProperty(k)?g[k]:m.defaults[k];d.isDefined(h)&&null!==h?(e=encodeURIComponent(h).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,
"+"),c=c.replace(new RegExp(":"+k+"(\\W|$)","g"),function(b,a){return e+a})):c=c.replace(new RegExp("(/?):"+k+"(\\W|$)","g"),function(b,a,c){return"/"==c.charAt(0)?c:a+c})});m.defaults.stripTrailingSlashes&&(c=c.replace(/\/+$/,"")||"/");c=c.replace(/\/\.(?=\w+($|\?))/,".");f.url=c.replace(/\/\\\./,"/.");r(g,function(b,c){m.urlParams[c]||(f.params=f.params||{},f.params[c]=b)})}};return w}]})})(window,window.angular);
//# sourceMappingURL=angular-resource.min.js.map

/*
 AngularJS v1.4.1
 (c) 2010-2015 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(q,d,C){'use strict';function v(r,k,h){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,f,b,c,y){function z(){l&&(h.cancel(l),l=null);m&&(m.$destroy(),m=null);n&&(l=h.leave(n),l.then(function(){l=null}),n=null)}function x(){var b=r.current&&r.current.locals;if(d.isDefined(b&&b.$template)){var b=a.$new(),c=r.current;n=y(b,function(b){h.enter(b,null,n||f).then(function(){!d.isDefined(t)||t&&!a.$eval(t)||k()});z()});m=c.scope=b;m.$emit("$viewContentLoaded");
m.$eval(w)}else z()}var m,n,l,t=b.autoscroll,w=b.onload||"";a.$on("$routeChangeSuccess",x);x()}}}function A(d,k,h){return{restrict:"ECA",priority:-400,link:function(a,f){var b=h.current,c=b.locals;f.html(c.$template);var y=d(f.contents());b.controller&&(c.$scope=a,c=k(b.controller,c),b.controllerAs&&(a[b.controllerAs]=c),f.data("$ngControllerController",c),f.children().data("$ngControllerController",c));y(a)}}}q=d.module("ngRoute",["ng"]).provider("$route",function(){function r(a,f){return d.extend(Object.create(a),
f)}function k(a,d){var b=d.caseInsensitiveMatch,c={originalPath:a,regexp:a},h=c.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(a,d,b,c){a="?"===c?c:null;c="*"===c?c:null;h.push({name:b,optional:!!a});d=d||"";return""+(a?"":d)+"(?:"+(a?d:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");c.regexp=new RegExp("^"+a+"$",b?"i":"");return c}var h={};this.when=function(a,f){var b=d.copy(f);d.isUndefined(b.reloadOnSearch)&&(b.reloadOnSearch=!0);
d.isUndefined(b.caseInsensitiveMatch)&&(b.caseInsensitiveMatch=this.caseInsensitiveMatch);h[a]=d.extend(b,a&&k(a,b));if(a){var c="/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";h[c]=d.extend({redirectTo:a},k(c,b))}return this};this.caseInsensitiveMatch=!1;this.otherwise=function(a){"string"===typeof a&&(a={redirectTo:a});this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function(a,f,b,c,k,q,x){function m(b){var e=s.current;
(v=(p=l())&&e&&p.$$route===e.$$route&&d.equals(p.pathParams,e.pathParams)&&!p.reloadOnSearch&&!w)||!e&&!p||a.$broadcast("$routeChangeStart",p,e).defaultPrevented&&b&&b.preventDefault()}function n(){var u=s.current,e=p;if(v)u.params=e.params,d.copy(u.params,b),a.$broadcast("$routeUpdate",u);else if(e||u)w=!1,(s.current=e)&&e.redirectTo&&(d.isString(e.redirectTo)?f.path(t(e.redirectTo,e.params)).search(e.params).replace():f.url(e.redirectTo(e.pathParams,f.path(),f.search())).replace()),c.when(e).then(function(){if(e){var a=
d.extend({},e.resolve),b,g;d.forEach(a,function(b,e){a[e]=d.isString(b)?k.get(b):k.invoke(b,null,null,e)});d.isDefined(b=e.template)?d.isFunction(b)&&(b=b(e.params)):d.isDefined(g=e.templateUrl)&&(d.isFunction(g)&&(g=g(e.params)),g=x.getTrustedResourceUrl(g),d.isDefined(g)&&(e.loadedTemplateUrl=g,b=q(g)));d.isDefined(b)&&(a.$template=b);return c.all(a)}}).then(function(c){e==s.current&&(e&&(e.locals=c,d.copy(e.params,b)),a.$broadcast("$routeChangeSuccess",e,u))},function(b){e==s.current&&a.$broadcast("$routeChangeError",
e,u,b)})}function l(){var a,b;d.forEach(h,function(c,h){var g;if(g=!b){var k=f.path();g=c.keys;var m={};if(c.regexp)if(k=c.regexp.exec(k)){for(var l=1,n=k.length;l<n;++l){var p=g[l-1],q=k[l];p&&q&&(m[p.name]=q)}g=m}else g=null;else g=null;g=a=g}g&&(b=r(c,{params:d.extend({},f.search(),a),pathParams:a}),b.$$route=c)});return b||h[null]&&r(h[null],{params:{},pathParams:{}})}function t(a,b){var c=[];d.forEach((a||"").split(":"),function(a,d){if(0===d)c.push(a);else{var f=a.match(/(\w+)(?:[?*])?(.*)/),
h=f[1];c.push(b[h]);c.push(f[2]||"");delete b[h]}});return c.join("")}var w=!1,p,v,s={routes:h,reload:function(){w=!0;a.$evalAsync(function(){m();n()})},updateParams:function(a){if(this.current&&this.current.$$route)a=d.extend({},this.current.params,a),f.path(t(this.current.$$route.originalPath,a)),f.search(a);else throw B("norout");}};a.$on("$locationChangeStart",m);a.$on("$locationChangeSuccess",n);return s}]});var B=d.$$minErr("ngRoute");q.provider("$routeParams",function(){this.$get=function(){return{}}});
q.directive("ngView",v);q.directive("ngView",A);v.$inject=["$route","$anchorScroll","$animate"];A.$inject=["$compile","$controller","$route"]})(window,window.angular);
//# sourceMappingURL=angular-route.min.js.map

/*!
 * Bootstrap v3.3.1 (http://getbootstrap.com)
 * Copyright 2011-2014 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.1",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.1",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.1",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c="prev"==a?-1:1,d=this.getItemIndex(b),e=(d+c)%this.$items.length;return this.$items.eq(e)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i="next"==b?"first":"last",j=this;if(!f.length){if(!this.options.wrap)return;f=this.$element.find(".item")[i]()}if(f.hasClass("active"))return this.sliding=!1;var k=f[0],l=a.Event("slide.bs.carousel",{relatedTarget:k,direction:h});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var m=a(this.$indicators.children()[this.getItemIndex(f)]);m&&m.addClass("active")}var n=a.Event("slid.bs.carousel",{relatedTarget:k,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),j.sliding=!1,setTimeout(function(){j.$element.trigger(n)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(n)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a(this.options.trigger).filter('[href="#'+b.id+'"], [data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.1",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0,trigger:'[data-toggle="collapse"]'},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.find("> .panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":a.extend({},e.data(),{trigger:this});c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.1",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.divider):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.1",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.options.backdrop&&d.adjustBackdrop(),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in").attr("aria-hidden",!1),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$element.find(".modal-dialog").one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a('<div class="modal-backdrop '+e+'" />').prependTo(this.$element).on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.options.backdrop&&this.adjustBackdrop(),this.adjustDialog()},c.prototype.adjustBackdrop=function(){this.$backdrop.css("height",0).css("height",this.$element[0].scrollHeight)},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){this.bodyIsOverflowing=document.body.scrollHeight>document.documentElement.clientHeight,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b,g=f&&f.selector;(e||"destroy"!=b)&&(g?(e||d.data("bs.tooltip",e={}),e[g]||(e[g]=new c(this,f))):e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.3.1",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-m<p.top?"bottom":"right"==h&&k.right+l>p.width?"left":"left"==h&&k.left-l<p.left?"right":h,f.removeClass(n).addClass(h)}var q=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(q,h);var r=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",r).emulateTransitionEnd(c.TRANSITION_DURATION):r()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=this.tip(),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b,g=f&&f.selector;(e||"destroy"!=b)&&(g?(e||d.data("bs.popover",e={}),e[g]||(e[g]=new c(this,f))):e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.1",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},c.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){var e=a.proxy(this.process,this);this.$body=a("body"),this.$scrollElement=a(a(c).is("body")?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.1",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b="offset",c=0;a.isWindow(this.$scrollElement[0])||(b="position",c=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var d=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+c,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){d.offsets.push(this[0]),d.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.1",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})
})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.1",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=i?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a("body").height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
/*
 * angular-ui-bootstrap
 * http://angular-ui.github.io/bootstrap/

 * Version: 0.13.0 - 2015-05-02
 * License: MIT
 */
angular.module("ui.bootstrap",["ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.transition","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.collapse",[]).directive("collapse",["$animate",function(a){return{link:function(b,c,d){function e(){c.removeClass("collapse").addClass("collapsing"),a.addClass(c,"in",{to:{height:c[0].scrollHeight+"px"}}).then(f)}function f(){c.removeClass("collapsing"),c.css({height:"auto"})}function g(){c.css({height:c[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing"),a.removeClass(c,"in",{to:{height:"0"}}).then(h)}function h(){c.css({height:"0"}),c.removeClass("collapsing"),c.addClass("collapse")}b.$watch(d.collapse,function(a){a?g():e()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.$watch("isOpen",function(b){b&&d.closeOthers(a)}),a.toggleOpen=function(){a.isDisabled||(a.isOpen=!a.isOpen)}}}}).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,angular.noop))}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.accordionTransclude]},function(a){a&&(b.html(""),b.append(a))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(a,b){a.closeable="close"in b,this.close=a.close}]).directive("alert",function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}).directive("dismissOnTimeout",["$timeout",function(a){return{require:"alert",link:function(b,c,d,e){a(function(){e.close()},parseInt(d.dismissOnTimeout,10))}}}]),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",function(){return function(a,b,c){b.addClass("ng-binding").data("$binding",c.bindHtmlUnsafe),a.$watch(c.bindHtmlUnsafe,function(a){b.html(a||"")})}}),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){var e=d[0],f=d[1];f.$render=function(){b.toggleClass(e.activeClass,angular.equals(f.$modelValue,a.$eval(c.btnRadio)))},b.bind(e.toggleEvent,function(){var d=b.hasClass(e.activeClass);(!d||angular.isDefined(c.uncheckable))&&a.$apply(function(){f.$setViewValue(d?null:a.$eval(c.btnRadio)),f.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){var d=a.$eval(b);return angular.isDefined(d)?d:c}var h=d[0],i=d[1];i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.bind(h.toggleEvent,function(){a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("CarouselController",["$scope","$interval","$animate",function(a,b,c){function d(a){if(angular.isUndefined(k[a].index))return k[a];{var b;k.length}for(b=0;b<k.length;++b)if(k[b].index==a)return k[b]}function e(){f();var c=+a.interval;!isNaN(c)&&c>0&&(h=b(g,c))}function f(){h&&(b.cancel(h),h=null)}function g(){var b=+a.interval;i&&!isNaN(b)&&b>0?a.next():a.pause()}var h,i,j=this,k=j.slides=a.slides=[],l=-1;j.currentSlide=null;var m=!1;j.select=a.select=function(b,d){function f(){m||(angular.extend(b,{direction:d,active:!0}),angular.extend(j.currentSlide||{},{direction:d,active:!1}),c.enabled()&&!a.noTransition&&b.$element&&(a.$currentTransition=!0,b.$element.one("$animate:close",function(){a.$currentTransition=null})),j.currentSlide=b,l=g,e())}var g=j.indexOfSlide(b);void 0===d&&(d=g>j.getCurrentIndex()?"next":"prev"),b&&b!==j.currentSlide&&f()},a.$on("$destroy",function(){m=!0}),j.getCurrentIndex=function(){return j.currentSlide&&angular.isDefined(j.currentSlide.index)?+j.currentSlide.index:l},j.indexOfSlide=function(a){return angular.isDefined(a.index)?+a.index:k.indexOf(a)},a.next=function(){var b=(j.getCurrentIndex()+1)%k.length;return a.$currentTransition?void 0:j.select(d(b),"next")},a.prev=function(){var b=j.getCurrentIndex()-1<0?k.length-1:j.getCurrentIndex()-1;return a.$currentTransition?void 0:j.select(d(b),"prev")},a.isActive=function(a){return j.currentSlide===a},a.$watch("interval",e),a.$on("$destroy",f),a.play=function(){i||(i=!0,e())},a.pause=function(){a.noPause||(i=!1,f())},j.addSlide=function(b,c){b.$element=c,k.push(b),1===k.length||b.active?(j.select(k[k.length-1]),1==k.length&&a.play()):b.active=!1},j.removeSlide=function(a){angular.isDefined(a.index)&&k.sort(function(a,b){return+a.index>+b.index});var b=k.indexOf(a);k.splice(b,1),k.length>0&&a.active?j.select(b>=k.length?k[b-1]:k[b]):l>b&&l--}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"="}}}]).directive("slide",function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?",index:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)}),a.$watch("active",function(b){b&&d.select(a)})}}}).animation(".item",["$animate",function(a){return{beforeAddClass:function(b,c,d){if("active"==c&&b.parent()&&!b.parent().scope().noTransition){var e=!1,f=b.isolateScope().direction,g="next"==f?"left":"right";return b.addClass(f),a.addClass(b,g).then(function(){e||b.removeClass(g+" "+f),d()}),function(){e=!0}}d()},beforeRemoveClass:function(b,c,d){if("active"==c&&b.parent()&&!b.parent().scope().noTransition){var e=!1,f=b.isolateScope().direction,g="next"==f?"left":"right";return a.addClass(b,g).then(function(){e||b.removeClass(g),d()}),function(){e=!0}}d()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(a,b){function c(a){var c=[],d=a.split("");return angular.forEach(f,function(b,e){var f=a.indexOf(e);if(f>-1){a=a.split(""),d[f]="("+b.regex+")",a[f]="$";for(var g=f+1,h=f+e.length;h>g;g++)d[g]="",a[g]="$";a=a.join(""),c.push({index:f,apply:b.apply})}}),{regex:new RegExp("^"+d.join("")+"$"),map:b(c,"index")}}function d(a,b,c){return 1>c?!1:1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}var e=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.parsers={};var f={yyyy:{regex:"\\d{4}",apply:function(a){this.year=+a}},yy:{regex:"\\d{2}",apply:function(a){this.year=+a+2e3}},y:{regex:"\\d{1,4}",apply:function(a){this.year=+a}},MMMM:{regex:a.DATETIME_FORMATS.MONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.MONTH.indexOf(b)}},MMM:{regex:a.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.SHORTMONTH.indexOf(b)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1}},M:{regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},EEEE:{regex:a.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:a.DATETIME_FORMATS.SHORTDAY.join("|")},HH:{regex:"(?:0|1)[0-9]|2[0-3]",apply:function(a){this.hours=+a}},H:{regex:"1?[0-9]|2[0-3]",apply:function(a){this.hours=+a}},mm:{regex:"[0-5][0-9]",apply:function(a){this.minutes=+a}},m:{regex:"[0-9]|[1-5][0-9]",apply:function(a){this.minutes=+a}},sss:{regex:"[0-9][0-9][0-9]",apply:function(a){this.milliseconds=+a}},ss:{regex:"[0-5][0-9]",apply:function(a){this.seconds=+a}},s:{regex:"[0-9]|[1-5][0-9]",apply:function(a){this.seconds=+a}}};this.parse=function(b,f,g){if(!angular.isString(b)||!f)return b;f=a.DATETIME_FORMATS[f]||f,f=f.replace(e,"\\$&"),this.parsers[f]||(this.parsers[f]=c(f));var h=this.parsers[f],i=h.regex,j=h.map,k=b.match(i);if(k&&k.length){var l,m;l=g?{year:g.getFullYear(),month:g.getMonth(),date:g.getDate(),hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds(),milliseconds:g.getMilliseconds()}:{year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0};for(var n=1,o=k.length;o>n;n++){var p=j[n-1];p.apply&&p.apply.call(l,k[n])}return d(l.year,l.month,l.date)&&(m=new Date(l.year,l.month,l.date,l.hours,l.minutes,l.seconds,l.milliseconds||0)),m}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(a,b){function c(a,c){return a.currentStyle?a.currentStyle[c]:b.getComputedStyle?b.getComputedStyle(a)[c]:a.style[c]}function d(a){return"static"===(c(a,"position")||"static")}var e=function(b){for(var c=a[0],e=b.offsetParent||c;e&&e!==c&&d(e);)e=e.offsetParent;return e||c};return{position:function(b){var c=this.offset(b),d={top:0,left:0},f=e(b[0]);f!=a[0]&&(d=this.offset(angular.element(f)),d.top+=f.clientTop-f.scrollTop,d.left+=f.clientLeft-f.scrollLeft);var g=b[0].getBoundingClientRect();return{width:g.width||b.prop("offsetWidth"),height:g.height||b.prop("offsetHeight"),top:c.top-d.top,left:c.left-d.left}},offset:function(c){var d=c[0].getBoundingClientRect();return{width:d.width||c.prop("offsetWidth"),height:d.height||c.prop("offsetHeight"),top:d.top+(b.pageYOffset||a[0].documentElement.scrollTop),left:d.left+(b.pageXOffset||a[0].documentElement.scrollLeft)}},positionElements:function(a,b,c,d){var e,f,g,h,i=c.split("-"),j=i[0],k=i[1]||"center";e=d?this.offset(a):this.position(a),f=b.prop("offsetWidth"),g=b.prop("offsetHeight");var l={center:function(){return e.left+e.width/2-f/2},left:function(){return e.left},right:function(){return e.left+e.width}},m={center:function(){return e.top+e.height/2-g/2},top:function(){return e.top},bottom:function(){return e.top+e.height}};switch(j){case"right":h={top:m[k](),left:l[j]()};break;case"left":h={top:m[k](),left:e.left-f};break;case"bottom":h={top:m[j](),left:l[k]()};break;default:h={top:e.top-g,left:l[k]()}}return h}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null,shortcutPropagation:!1}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(a,b,c,d,e,f,g,h){var i=this,j={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange","shortcutPropagation"],function(c,e){i[c]=angular.isDefined(b[c])?8>e?d(b[c])(a.$parent):a.$parent.$eval(b[c]):h[c]}),angular.forEach(["minDate","maxDate"],function(d){b[d]?a.$parent.$watch(c(b[d]),function(a){i[d]=a?new Date(a):null,i.refreshView()}):i[d]=h[d]?new Date(h[d]):null}),a.datepickerMode=a.datepickerMode||h.datepickerMode,a.maxMode=i.maxMode,a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),angular.isDefined(b.initDate)?(this.activeDate=a.$parent.$eval(b.initDate)||new Date,a.$parent.$watch(b.initDate,function(a){a&&(j.$isEmpty(j.$modelValue)||j.$invalid)&&(i.activeDate=a,i.refreshView())})):this.activeDate=new Date,a.isActive=function(b){return 0===i.compare(b.date,i.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(a){j=a,j.$render=function(){i.render()}},this.render=function(){if(j.$viewValue){var a=new Date(j.$viewValue),b=!isNaN(a);b?this.activeDate=a:f.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),j.$setValidity("date",b)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var a=j.$viewValue?new Date(j.$viewValue):null;j.$setValidity("date-disabled",!a||this.element&&!this.isDisabled(a))}},this.createDateObject=function(a,b){var c=j.$viewValue?new Date(j.$viewValue):null;return{date:a,label:g(a,b),selected:c&&0===this.compare(a,c),disabled:this.isDisabled(a),current:0===this.compare(a,new Date),customClass:this.customClass(a)}},this.isDisabled=function(c){return this.minDate&&this.compare(c,this.minDate)<0||this.maxDate&&this.compare(c,this.maxDate)>0||b.dateDisabled&&a.dateDisabled({date:c,mode:a.datepickerMode})},this.customClass=function(b){return a.customClass({date:b,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===i.minMode){var c=j.$viewValue?new Date(j.$viewValue):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),j.$setViewValue(c),j.$render()}else i.activeDate=b,a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)-1]},a.move=function(a){var b=i.activeDate.getFullYear()+a*(i.step.years||0),c=i.activeDate.getMonth()+a*(i.step.months||0);i.activeDate.setFullYear(b,c,1),i.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===i.maxMode&&1===b||a.datepickerMode===i.minMode&&-1===b||(a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)+b])},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var k=function(){e(function(){i.element[0].focus()},0,!1)};a.$on("datepicker.focus",k),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey)if(b.preventDefault(),i.shortcutPropagation||b.stopPropagation(),"enter"===c||"space"===c){if(i.isDisabled(i.activeDate))return;a.select(i.activeDate),k()}else!b.ctrlKey||"up"!==c&&"down"!==c?(i.handleKeyDown(c,b),i.refreshView()):(a.toggleMode("up"===c?1:-1),k())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&",customClass:"&",shortcutPropagation:"&?"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}).directive("daypicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(b,c,d,e){function f(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?i[b]:29}function g(a,b){var c=new Array(b),d=new Date(a),e=0;for(d.setHours(12);b>e;)c[e++]=new Date(d),d.setDate(d.getDate()+1);return c}function h(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}b.showWeeks=e.showWeeks,e.step={months:1},e.element=c;var i=[31,28,31,30,31,30,31,31,30,31,30,31];e._refreshView=function(){var c=e.activeDate.getFullYear(),d=e.activeDate.getMonth(),f=new Date(c,d,1),i=e.startingDay-f.getDay(),j=i>0?7-i:-i,k=new Date(f);j>0&&k.setDate(-j+1);for(var l=g(k,42),m=0;42>m;m++)l[m]=angular.extend(e.createDateObject(l[m],e.formatDay),{secondary:l[m].getMonth()!==d,uid:b.uniqueId+"-"+m});b.labels=new Array(7);for(var n=0;7>n;n++)b.labels[n]={abbr:a(l[n].date,e.formatDayHeader),full:a(l[n].date,"EEEE")};if(b.title=a(e.activeDate,e.formatDayTitle),b.rows=e.split(l,7),b.showWeeks){b.weekNumbers=[];for(var o=(11-e.startingDay)%7,p=b.rows.length,q=0;p>q;q++)b.weekNumbers.push(h(b.rows[q][o].date))}},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},e.handleKeyDown=function(a){var b=e.activeDate.getDate();if("left"===a)b-=1;else if("up"===a)b-=7;else if("right"===a)b+=1;else if("down"===a)b+=7;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getMonth()+("pageup"===a?-1:1);e.activeDate.setMonth(c,1),b=Math.min(f(e.activeDate.getFullYear(),e.activeDate.getMonth()),b)}else"home"===a?b=1:"end"===a&&(b=f(e.activeDate.getFullYear(),e.activeDate.getMonth()));e.activeDate.setDate(b)},e.refreshView()}}}]).directive("monthpicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(b,c,d,e){e.step={years:1},e.element=c,e._refreshView=function(){for(var c=new Array(12),d=e.activeDate.getFullYear(),f=0;12>f;f++)c[f]=angular.extend(e.createDateObject(new Date(d,f,1),e.formatMonth),{uid:b.uniqueId+"-"+f});b.title=a(e.activeDate,e.formatMonthTitle),b.rows=e.split(c,3)},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth())-new Date(b.getFullYear(),b.getMonth())},e.handleKeyDown=function(a){var b=e.activeDate.getMonth();if("left"===a)b-=1;else if("up"===a)b-=3;else if("right"===a)b+=1;else if("down"===a)b+=3;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getFullYear()+("pageup"===a?-1:1);e.activeDate.setFullYear(c)}else"home"===a?b=0:"end"===a&&(b=11);e.activeDate.setMonth(b)},e.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(a,b,c,d){function e(a){return parseInt((a-1)/f,10)*f+1}var f=d.yearRange;d.step={years:f},d.element=b,d._refreshView=function(){for(var b=new Array(f),c=0,g=e(d.activeDate.getFullYear());f>c;c++)b[c]=angular.extend(d.createDateObject(new Date(g+c,0,1),d.formatYear),{uid:a.uniqueId+"-"+c});a.title=[b[0].label,b[f-1].label].join(" - "),a.rows=d.split(b,5)},d.compare=function(a,b){return a.getFullYear()-b.getFullYear()},d.handleKeyDown=function(a){var b=d.activeDate.getFullYear();"left"===a?b-=1:"up"===a?b-=5:"right"===a?b+=1:"down"===a?b+=5:"pageup"===a||"pagedown"===a?b+=("pageup"===a?-1:1)*d.step.years:"home"===a?b=e(d.activeDate.getFullYear()):"end"===a&&(b=e(d.activeDate.getFullYear())+f-1),d.activeDate.setFullYear(b)},d.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(a,b,c,d,e,f,g){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&",customClass:"&"},link:function(h,i,j,k){function l(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function m(a){if(angular.isNumber(a)&&(a=new Date(a)),a){if(angular.isDate(a)&&!isNaN(a))return a;if(angular.isString(a)){var b=f.parse(a,o,h.date)||new Date(a);return isNaN(b)?void 0:b}return void 0}return null}function n(a,b){var c=a||b;if(angular.isNumber(c)&&(c=new Date(c)),c){if(angular.isDate(c)&&!isNaN(c))return!0;if(angular.isString(c)){var d=f.parse(c,o)||new Date(c);return!isNaN(d)}return!1}return!0}var o,p=angular.isDefined(j.closeOnDateSelection)?h.$parent.$eval(j.closeOnDateSelection):g.closeOnDateSelection,q=angular.isDefined(j.datepickerAppendToBody)?h.$parent.$eval(j.datepickerAppendToBody):g.appendToBody;h.showButtonBar=angular.isDefined(j.showButtonBar)?h.$parent.$eval(j.showButtonBar):g.showButtonBar,h.getText=function(a){return h[a+"Text"]||g[a+"Text"]};var r=!1;if(g.html5Types[j.type]?(o=g.html5Types[j.type],r=!0):(o=j.datepickerPopup||g.datepickerPopup,j.$observe("datepickerPopup",function(a){var b=a||g.datepickerPopup;if(b!==o&&(o=b,k.$modelValue=null,!o))throw new Error("datepickerPopup must have a date format specified.")})),!o)throw new Error("datepickerPopup must have a date format specified.");if(r&&j.datepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");var s=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");s.attr({"ng-model":"date","ng-change":"dateSelection()"});var t=angular.element(s.children()[0]);if(r&&"month"==j.type&&(t.attr("datepicker-mode",'"month"'),t.attr("min-mode","month")),j.datepickerOptions){var u=h.$parent.$eval(j.datepickerOptions);u.initDate&&(h.initDate=u.initDate,t.attr("init-date","initDate"),delete u.initDate),angular.forEach(u,function(a,b){t.attr(l(b),a)})}h.watchData={},angular.forEach(["minDate","maxDate","datepickerMode","initDate","shortcutPropagation"],function(a){if(j[a]){var c=b(j[a]);if(h.$parent.$watch(c,function(b){h.watchData[a]=b}),t.attr(l(a),"watchData."+a),"datepickerMode"===a){var d=c.assign;h.$watch("watchData."+a,function(a,b){a!==b&&d(h.$parent,a)})}}}),j.dateDisabled&&t.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),j.showWeeks&&t.attr("show-weeks",j.showWeeks),j.customClass&&t.attr("custom-class","customClass({ date: date, mode: mode })"),r?k.$formatters.push(function(a){return h.date=a,a}):(k.$$parserName="date",k.$validators.date=n,k.$parsers.unshift(m),k.$formatters.push(function(a){return h.date=a,k.$isEmpty(a)?a:e(a,o)})),h.dateSelection=function(a){angular.isDefined(a)&&(h.date=a);var b=h.date?e(h.date,o):"";i.val(b),k.$setViewValue(b),p&&(h.isOpen=!1,i[0].focus())},k.$viewChangeListeners.push(function(){h.date=f.parse(k.$viewValue,o,h.date)||new Date(k.$viewValue)});var v=function(a){h.isOpen&&a.target!==i[0]&&h.$apply(function(){h.isOpen=!1})},w=function(a){h.keydown(a)};i.bind("keydown",w),h.keydown=function(a){27===a.which?(a.preventDefault(),h.isOpen&&a.stopPropagation(),h.close()):40!==a.which||h.isOpen||(h.isOpen=!0)},h.$watch("isOpen",function(a){a?(h.$broadcast("datepicker.focus"),h.position=q?d.offset(i):d.position(i),h.position.top=h.position.top+i.prop("offsetHeight"),c.bind("click",v)):c.unbind("click",v)}),h.select=function(a){if("today"===a){var b=new Date;angular.isDate(h.date)?(a=new Date(h.date),a.setFullYear(b.getFullYear(),b.getMonth(),b.getDate())):a=new Date(b.setHours(0,0,0,0))}h.dateSelection(a)},h.close=function(){h.isOpen=!1,i[0].focus()};var x=a(s)(h);s.remove(),q?c.find("body").append(x):i.after(x),h.$on("$destroy",function(){x.remove(),i.unbind("keydown",w),c.unbind("click",v)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(a,b){b.bind("click",function(a){a.preventDefault(),a.stopPropagation()})}}}),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document","$rootScope",function(a,b){var c=null;this.open=function(b){c||(a.bind("click",d),a.bind("keydown",e)),c&&c!==b&&(c.isOpen=!1),c=b},this.close=function(b){c===b&&(c=null,a.unbind("click",d),a.unbind("keydown",e))};var d=function(a){if(c&&(!a||"disabled"!==c.getAutoClose())){var d=c.getToggleElement();if(!(a&&d&&d[0].contains(a.target))){var e=c.getElement();a&&"outsideClick"===c.getAutoClose()&&e&&e[0].contains(a.target)||(c.isOpen=!1,b.$$phase||c.$apply())}}},e=function(a){27===a.which&&(c.focusToggleElement(),d())}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate","$position","$document",function(a,b,c,d,e,f,g,h){var i,j=this,k=a.$new(),l=d.openClass,m=angular.noop,n=b.onToggle?c(b.onToggle):angular.noop,o=!1;this.init=function(d){j.$element=d,b.isOpen&&(i=c(b.isOpen),m=i.assign,a.$watch(i,function(a){k.isOpen=!!a})),o=angular.isDefined(b.dropdownAppendToBody),o&&j.dropdownMenu&&(h.find("body").append(j.dropdownMenu),d.on("$destroy",function(){j.dropdownMenu.remove()}))},this.toggle=function(a){return k.isOpen=arguments.length?!!a:!k.isOpen},this.isOpen=function(){return k.isOpen},k.getToggleElement=function(){return j.toggleElement},k.getAutoClose=function(){return b.autoClose||"always"},k.getElement=function(){return j.$element},k.focusToggleElement=function(){j.toggleElement&&j.toggleElement[0].focus()},k.$watch("isOpen",function(b,c){if(o&&j.dropdownMenu){var d=g.positionElements(j.$element,j.dropdownMenu,"bottom-left",!0);j.dropdownMenu.css({top:d.top+"px",left:d.left+"px",display:b?"block":"none"})}f[b?"addClass":"removeClass"](j.$element,l),b?(k.focusToggleElement(),e.open(k)):e.close(k),m(a,b),angular.isDefined(b)&&b!==c&&n(a,{open:!!b})}),a.$on("$locationChangeSuccess",function(){k.isOpen=!1}),a.$on("$destroy",function(){k.$destroy()})}]).directive("dropdown",function(){return{controller:"DropdownController",link:function(a,b,c,d){d.init(b)}}}).directive("dropdownMenu",function(){return{restrict:"AC",require:"?^dropdown",link:function(a,b,c,d){d&&(d.dropdownMenu=b)}}}).directive("dropdownToggle",function(){return{require:"?^dropdown",link:function(a,b,c,d){if(d){d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.modal",[]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b==a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b==a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}).directive("modalBackdrop",["$timeout",function(a){function b(b){b.animate=!1,a(function(){b.animate=!0})}return{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",compile:function(a,c){return a.addClass(c.backdropClass),b}}}]).directive("modalWindow",["$modalStack","$q",function(a,b){return{restrict:"EA",scope:{index:"@",animate:"="},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"template/modal/window.html"},link:function(c,d,e){d.addClass(e.windowClass||""),c.size=e.size,c.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!=c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))},c.$isRendered=!0;var f=b.defer();e.$observe("modalRender",function(a){"true"==a&&f.resolve()}),f.promise.then(function(){c.animate=!0;var b=d[0].querySelectorAll("[autofocus]");b.length?b[0].focus():d[0].focus();var e=a.getTop();e&&a.modalRendered(e.key)})}}}]).directive("modalAnimationClass",[function(){return{compile:function(a,b){b.modalAnimation&&a.addClass(b.modalAnimationClass)}}}]).directive("modalTransclude",function(){return{link:function(a,b,c,d,e){e(a.$parent,function(a){b.empty(),b.append(a)})}}}).factory("$modalStack",["$animate","$timeout","$document","$compile","$rootScope","$$stackedMap",function(a,b,c,d,e,f){function g(){for(var a=-1,b=o.keys(),c=0;c<b.length;c++)o.get(b[c]).value.backdrop&&(a=c);return a}function h(a){var b=c.find("body").eq(0),d=o.get(a).value;o.remove(a),j(d.modalDomEl,d.modalScope,function(){b.toggleClass(n,o.length()>0),i()})}function i(){if(l&&-1==g()){var a=m;j(l,m,function(){a=null}),l=void 0,m=void 0}}function j(c,d,f){function g(){g.done||(g.done=!0,c.remove(),d.$destroy(),f&&f())}d.animate=!1,c.attr("modal-animation")&&a.enabled()?c.one("$animate:close",function(){e.$evalAsync(g)}):b(g)}function k(a,b,c){return!a.value.modalScope.$broadcast("modal.closing",b,c).defaultPrevented}var l,m,n="modal-open",o=f.createNew(),p={};return e.$watch(g,function(a){m&&(m.index=a)}),c.bind("keydown",function(a){var b;27===a.which&&(b=o.top(),b&&b.value.keyboard&&(a.preventDefault(),e.$apply(function(){p.dismiss(b.key,"escape key press")})))}),p.open=function(a,b){var f=c[0].activeElement;o.add(a,{deferred:b.deferred,renderDeferred:b.renderDeferred,modalScope:b.scope,backdrop:b.backdrop,keyboard:b.keyboard});var h=c.find("body").eq(0),i=g();if(i>=0&&!l){m=e.$new(!0),m.index=i;var j=angular.element('<div modal-backdrop="modal-backdrop"></div>');j.attr("backdrop-class",b.backdropClass),b.animation&&j.attr("modal-animation","true"),l=d(j)(m),h.append(l)}var k=angular.element('<div modal-window="modal-window"></div>');k.attr({"template-url":b.windowTemplateUrl,"window-class":b.windowClass,size:b.size,index:o.length()-1,animate:"animate"}).html(b.content),b.animation&&k.attr("modal-animation","true");var p=d(k)(b.scope);o.top().value.modalDomEl=p,o.top().value.modalOpener=f,h.append(p),h.addClass(n)},p.close=function(a,b){var c=o.get(a);return c&&k(c,b,!0)?(c.value.deferred.resolve(b),h(a),c.value.modalOpener.focus(),!0):!c},p.dismiss=function(a,b){var c=o.get(a);return c&&k(c,b,!1)?(c.value.deferred.reject(b),h(a),c.value.modalOpener.focus(),!0):!c},p.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},p.getTop=function(){return o.top()},p.modalRendered=function(a){var b=o.get(a);b&&b.value.renderDeferred.resolve()},p}]).provider("$modal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$templateRequest","$controller","$modalStack",function(b,c,d,e,f,g){function h(a){return a.template?d.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}function i(a){var c=[];return angular.forEach(a,function(a){(angular.isFunction(a)||angular.isArray(a))&&c.push(d.when(b.invoke(a)))}),c}var j={};return j.open=function(b){var e=d.defer(),j=d.defer(),k=d.defer(),l={result:e.promise,opened:j.promise,rendered:k.promise,close:function(a){return g.close(l,a)},dismiss:function(a){return g.dismiss(l,a)}};if(b=angular.extend({},a.options,b),b.resolve=b.resolve||{},!b.template&&!b.templateUrl)throw new Error("One of template or templateUrl options is required.");var m=d.all([h(b)].concat(i(b.resolve)));return m.then(function(a){var d=(b.scope||c).$new();d.$close=l.close,d.$dismiss=l.dismiss;var h,i={},j=1;b.controller&&(i.$scope=d,i.$modalInstance=l,angular.forEach(b.resolve,function(b,c){i[c]=a[j++]}),h=f(b.controller,i),b.controllerAs&&(d[b.controllerAs]=h)),g.open(l,{scope:d,deferred:e,renderDeferred:k,content:a[0],animation:b.animation,backdrop:b.backdrop,keyboard:b.keyboard,backdropClass:b.backdropClass,windowClass:b.windowClass,windowTemplateUrl:b.windowTemplateUrl,size:b.size})},function(a){e.reject(a)}),m.then(function(){j.resolve(!0)},function(a){j.reject(a)}),l},j}]};return a}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(a,b,c){var d=this,e={$setViewValue:angular.noop},f=b.numPages?c(b.numPages).assign:angular.noop;
this.init=function(g,h){e=g,this.config=h,e.$render=function(){d.render()},b.itemsPerPage?a.$parent.$watch(c(b.itemsPerPage),function(b){d.itemsPerPage=parseInt(b,10),a.totalPages=d.calculateTotalPages()}):this.itemsPerPage=h.itemsPerPage,a.$watch("totalItems",function(){a.totalPages=d.calculateTotalPages()}),a.$watch("totalPages",function(b){f(a.$parent,b),a.page>b?a.selectPage(b):e.$render()})},this.calculateTotalPages=function(){var b=this.itemsPerPage<1?1:Math.ceil(a.totalItems/this.itemsPerPage);return Math.max(b||0,1)},this.render=function(){a.page=parseInt(e.$viewValue,10)||1},a.selectPage=function(b,c){a.page!==b&&b>0&&b<=a.totalPages&&(c&&c.target&&c.target.blur(),e.$setViewValue(b),e.$render())},a.getText=function(b){return a[b+"Text"]||d.config[b+"Text"]},a.noPrevious=function(){return 1===a.page},a.noNext=function(){return a.page===a.totalPages}}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(a,b){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},require:["pagination","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(c,d,e,f){function g(a,b,c){return{number:a,text:b,active:c}}function h(a,b){var c=[],d=1,e=b,f=angular.isDefined(k)&&b>k;f&&(l?(d=Math.max(a-Math.floor(k/2),1),e=d+k-1,e>b&&(e=b,d=e-k+1)):(d=(Math.ceil(a/k)-1)*k+1,e=Math.min(d+k-1,b)));for(var h=d;e>=h;h++){var i=g(h,h,h===a);c.push(i)}if(f&&!l){if(d>1){var j=g(d-1,"...",!1);c.unshift(j)}if(b>e){var m=g(e+1,"...",!1);c.push(m)}}return c}var i=f[0],j=f[1];if(j){var k=angular.isDefined(e.maxSize)?c.$parent.$eval(e.maxSize):b.maxSize,l=angular.isDefined(e.rotate)?c.$parent.$eval(e.rotate):b.rotate;c.boundaryLinks=angular.isDefined(e.boundaryLinks)?c.$parent.$eval(e.boundaryLinks):b.boundaryLinks,c.directionLinks=angular.isDefined(e.directionLinks)?c.$parent.$eval(e.directionLinks):b.directionLinks,i.init(j,b),e.maxSize&&c.$parent.$watch(a(e.maxSize),function(a){k=parseInt(a,10),i.render()});var m=i.render;i.render=function(){m(),c.page>0&&c.page<=c.totalPages&&(c.pages=h(c.page,c.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(a){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@"},require:["pager","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&(b.align=angular.isDefined(d.align)?b.$parent.$eval(d.align):a.align,f.init(g,a))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",animation:!0,popupDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",focus:"blur"},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$position","$interpolate",function(e,f,g,h,i,j){return function(e,k,l,m){function n(a){var b=a||m.trigger||l,d=c[b]||b;return{show:b,hide:d}}m=angular.extend({},b,d,m);var o=a(e),p=j.startSymbol(),q=j.endSymbol(),r="<div "+o+'-popup title="'+p+"title"+q+'" '+(m.useContentExp?'content-exp="contentExp()" ':'content="'+p+"content"+q+'" ')+'placement="'+p+"placement"+q+'" popup-class="'+p+"popupClass"+q+'" animation="animation" is-open="isOpen"origin-scope="origScope" ></div>';return{restrict:"EA",compile:function(){var a=f(r);return function(b,c,d){function f(){E.isOpen?l():j()}function j(){(!D||b.$eval(d[k+"Enable"]))&&(s(),E.popupDelay?A||(A=g(o,E.popupDelay,!1),A.then(function(a){a()})):o()())}function l(){b.$apply(function(){p()})}function o(){return A=null,z&&(g.cancel(z),z=null),(m.useContentExp?E.contentExp():E.content)?(q(),x.css({top:0,left:0,display:"block"}),E.$digest(),F(),E.isOpen=!0,E.$apply(),F):angular.noop}function p(){E.isOpen=!1,g.cancel(A),A=null,E.animation?z||(z=g(r,500)):r()}function q(){x&&r(),y=E.$new(),x=a(y,function(a){B?h.find("body").append(a):c.after(a)}),y.$watch(function(){g(F,0,!1)}),m.useContentExp&&y.$watch("contentExp()",function(a){!a&&E.isOpen&&p()})}function r(){z=null,x&&(x.remove(),x=null),y&&(y.$destroy(),y=null)}function s(){t(),u(),v()}function t(){E.popupClass=d[k+"Class"]}function u(){var a=d[k+"Placement"];E.placement=angular.isDefined(a)?a:m.placement}function v(){var a=d[k+"PopupDelay"],b=parseInt(a,10);E.popupDelay=isNaN(b)?m.popupDelay:b}function w(){var a=d[k+"Trigger"];G(),C=n(a),C.show===C.hide?c.bind(C.show,f):(c.bind(C.show,j),c.bind(C.hide,l))}var x,y,z,A,B=angular.isDefined(m.appendToBody)?m.appendToBody:!1,C=n(void 0),D=angular.isDefined(d[k+"Enable"]),E=b.$new(!0),F=function(){if(x){var a=i.positionElements(c,x,E.placement,B);a.top+="px",a.left+="px",x.css(a)}};E.origScope=b,E.isOpen=!1,E.contentExp=function(){return b.$eval(d[e])},m.useContentExp||d.$observe(e,function(a){E.content=a,!a&&E.isOpen&&p()}),d.$observe("disabled",function(a){a&&E.isOpen&&p()}),d.$observe(k+"Title",function(a){E.title=a});var G=function(){c.unbind(C.show,j),c.unbind(C.hide,l)};w();var H=b.$eval(d[k+"Animation"]);E.animation=angular.isDefined(H)?!!H:m.animation;var I=b.$eval(d[k+"AppendToBody"]);B=angular.isDefined(I)?I:B,B&&b.$on("$locationChangeSuccess",function(){E.isOpen&&p()}),b.$on("$destroy",function(){g.cancel(z),g.cancel(A),G(),r(),E=null})}}}}}]}).directive("tooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.tooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("tooltipClasses",function(){return{restrict:"A",link:function(a,b,c){a.placement&&b.addClass(a.placement),a.popupClass&&b.addClass(a.popupClass),a.animation()&&b.addClass(c.tooltipAnimationClass)}}}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(a){return a("tooltip","tooltip","mouseenter")}]).directive("tooltipTemplatePopup",function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/tooltip/tooltip-template-popup.html"}}).directive("tooltipTemplate",["$tooltip",function(a){return a("tooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlPopup",function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-popup.html"}}).directive("tooltipHtml",["$tooltip",function(a){return a("tooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).value("tooltipHtmlUnsafeSuppressDeprecated",!1).directive("tooltipHtmlUnsafe",["$tooltip","tooltipHtmlUnsafeSuppressDeprecated","$log",function(a,b,c){return b||c.warn("tooltip-html-unsafe is now deprecated. Use tooltip-html or tooltip-template instead."),a("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverTemplatePopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/popover/popover-template.html"}}).directive("popoverTemplate",["$tooltip",function(a){return a("popoverTemplate","popover","click",{useContentExp:!0})}]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$tooltip",function(a){return a("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig",function(a,b,c){var d=this,e=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=angular.isDefined(a.max)?a.max:c.max,this.addBar=function(b,c){e||c.css({transition:"none"}),this.bars.push(b),b.$watch("value",function(c){b.percent=+(100*c/a.max).toFixed(2)}),b.$on("$destroy",function(){c=null,d.removeBar(b)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1)}}]).directive("progress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},templateUrl:"template/progressbar/progress.html"}}).directive("bar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",max:"=?",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b)}}}).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",max:"=?",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(a,b,c){var d={$setViewValue:angular.noop};this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff;var f=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(f)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff},a[b]);return a},a.rate=function(b){!a.readonly&&b>=0&&b<=a.range.length&&(d.$setViewValue(b),d.$render())},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue}}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(a){var b=this,c=b.tabs=a.tabs=[];b.select=function(a){angular.forEach(c,function(b){b.active&&b!==a&&(b.active=!1,b.onDeselect())}),a.active=!0,a.onSelect()},b.addTab=function(a){c.push(a),1===c.length&&a.active!==!1?a.active=!0:a.active?b.select(a):a.active=!1},b.removeTab=function(a){var e=c.indexOf(a);if(a.active&&c.length>1&&!d){var f=e==c.length-1?e-1:e+1;b.select(c[f])}c.splice(e,1)};var d;a.$on("$destroy",function(){d=!0})}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1}}}).directive("tab",["$parse","$log",function(a,b){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(c,d,e){return function(c,d,f,g){c.$watch("active",function(a){a&&g.select(c)}),c.disabled=!1,f.disable&&c.$parent.$watch(a(f.disable),function(a){c.disabled=!!a}),f.disabled&&(b.warn('Use of "disabled" attribute has been deprecated, please use "disable"'),c.$parent.$watch(a(f.disabled),function(a){c.disabled=!!a})),c.select=function(){c.disabled||(c.active=!0)},g.addTab(c),c.$on("$destroy",function(){g.removeTab(c)}),c.$transcludeFn=e}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}]).directive("tabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("tab-heading")||a.hasAttribute("data-tab-heading")||"tab-heading"===a.tagName.toLowerCase()||"data-tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^tabset",link:function(b,c,d){var e=b.$eval(d.tabContentTransclude);e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(a,b,c,d,e,f){function g(){var b=parseInt(a.hours,10),c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c?(a.showMeridian&&(12===b&&(b=0),a.meridian===p[1]&&(b+=12)),b):void 0}function h(){var b=parseInt(a.minutes,10);return b>=0&&60>b?b:void 0}function i(a){return angular.isDefined(a)&&a.toString().length<2?"0"+a:a.toString()}function j(a){k(),o.$setViewValue(new Date(n)),l(a)}function k(){o.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1}function l(b){var c=n.getHours(),d=n.getMinutes();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:i(c),"m"!==b&&(a.minutes=i(d)),a.meridian=n.getHours()<12?p[0]:p[1]}function m(a){var b=new Date(n.getTime()+6e4*a);n.setHours(b.getHours(),b.getMinutes()),j()}var n=new Date,o={$setViewValue:angular.noop},p=angular.isDefined(b.meridians)?a.$parent.$eval(b.meridians):f.meridians||e.DATETIME_FORMATS.AMPMS;this.init=function(c,d){o=c,o.$render=this.render,o.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),g=d.eq(1),h=angular.isDefined(b.mousewheel)?a.$parent.$eval(b.mousewheel):f.mousewheel;h&&this.setupMousewheelEvents(e,g);var i=angular.isDefined(b.arrowkeys)?a.$parent.$eval(b.arrowkeys):f.arrowkeys;i&&this.setupArrowkeyEvents(e,g),a.readonlyInput=angular.isDefined(b.readonlyInput)?a.$parent.$eval(b.readonlyInput):f.readonlyInput,this.setupInputEvents(e,g)};var q=f.hourStep;b.hourStep&&a.$parent.$watch(c(b.hourStep),function(a){q=parseInt(a,10)});var r=f.minuteStep;b.minuteStep&&a.$parent.$watch(c(b.minuteStep),function(a){r=parseInt(a,10)}),a.showMeridian=f.showMeridian,b.showMeridian&&a.$parent.$watch(c(b.showMeridian),function(b){if(a.showMeridian=!!b,o.$error.time){var c=g(),d=h();angular.isDefined(c)&&angular.isDefined(d)&&(n.setHours(c),j())}else l()}),this.setupMousewheelEvents=function(b,c){var d=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c){b.bind("keydown",function(b){38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply())}),c.bind("keydown",function(b){38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply())})},this.setupInputEvents=function(b,c){if(a.readonlyInput)return a.updateHours=angular.noop,void(a.updateMinutes=angular.noop);var d=function(b,c){o.$setViewValue(null),o.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c)};a.updateHours=function(){var a=g();angular.isDefined(a)?(n.setHours(a),j("h")):d(!0)},b.bind("blur",function(){!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=i(a.hours)})}),a.updateMinutes=function(){var a=h();angular.isDefined(a)?(n.setMinutes(a),j("m")):d(void 0,!0)},c.bind("blur",function(){!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=i(a.minutes)})})},this.render=function(){var a=o.$viewValue;isNaN(a)?(o.$setValidity("time",!1),d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(a&&(n=a),k(),l())},a.incrementHours=function(){m(60*q)},a.decrementHours=function(){m(60*-q)},a.incrementMinutes=function(){m(r)},a.decrementMinutes=function(){m(-r)},a.toggleMeridian=function(){m(720*(n.getHours()<12?1:-1))}}]).directive("timepicker",function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}),angular.module("ui.bootstrap.transition",[]).value("$transitionSuppressDeprecated",!1).factory("$transition",["$q","$timeout","$rootScope","$log","$transitionSuppressDeprecated",function(a,b,c,d,e){function f(a){for(var b in a)if(void 0!==h.style[b])return a[b]}e||d.warn("$transition is now deprecated. Use $animate from ngAnimate instead.");var g=function(d,e,f){f=f||{};var h=a.defer(),i=g[f.animation?"animationEndEventName":"transitionEndEventName"],j=function(){c.$apply(function(){d.unbind(i,j),h.resolve(d)})};return i&&d.bind(i,j),b(function(){angular.isString(e)?d.addClass(e):angular.isFunction(e)?e(d):angular.isObject(e)&&d.css(e),i||h.resolve(d)}),h.promise.cancel=function(){i&&d.unbind(i,j),h.reject("Transition cancelled")},h.promise},h=document.createElement("trans"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},j={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return g.transitionEndEventName=f(i),g.animationEndEventName=f(j),g}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(a,b,c,d,e,f,g){var h=[9,13,27,38,40];return{require:"ngModel",link:function(i,j,k,l){var m,n=i.$eval(k.typeaheadMinLength)||1,o=i.$eval(k.typeaheadWaitMs)||0,p=i.$eval(k.typeaheadEditable)!==!1,q=b(k.typeaheadLoading).assign||angular.noop,r=b(k.typeaheadOnSelect),s=k.typeaheadInputFormatter?b(k.typeaheadInputFormatter):void 0,t=k.typeaheadAppendToBody?i.$eval(k.typeaheadAppendToBody):!1,u=i.$eval(k.typeaheadFocusFirst)!==!1,v=b(k.ngModel).assign,w=g.parse(k.typeahead),x=i.$new();i.$on("$destroy",function(){x.$destroy()});var y="typeahead-"+x.$id+"-"+Math.floor(1e4*Math.random());j.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":y});var z=angular.element("<div typeahead-popup></div>");z.attr({id:y,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(k.typeaheadTemplateUrl)&&z.attr("template-url",k.typeaheadTemplateUrl);var A=function(){x.matches=[],x.activeIdx=-1,j.attr("aria-expanded",!1)},B=function(a){return y+"-option-"+a};x.$watch("activeIdx",function(a){0>a?j.removeAttr("aria-activedescendant"):j.attr("aria-activedescendant",B(a))});var C=function(a){var b={$viewValue:a};q(i,!0),c.when(w.source(i,b)).then(function(c){var d=a===l.$viewValue;if(d&&m)if(c&&c.length>0){x.activeIdx=u?0:-1,x.matches.length=0;for(var e=0;e<c.length;e++)b[w.itemName]=c[e],x.matches.push({id:B(e),label:w.viewMapper(x,b),model:c[e]});x.query=a,x.position=t?f.offset(j):f.position(j),x.position.top=x.position.top+j.prop("offsetHeight"),j.attr("aria-expanded",!0)}else A();d&&q(i,!1)},function(){A(),q(i,!1)})};A(),x.query=void 0;var D,E=function(a){D=d(function(){C(a)},o)},F=function(){D&&d.cancel(D)};l.$parsers.unshift(function(a){return m=!0,a&&a.length>=n?o>0?(F(),E(a)):C(a):(q(i,!1),F(),A()),p?a:a?void l.$setValidity("editable",!1):(l.$setValidity("editable",!0),a)}),l.$formatters.push(function(a){var b,c,d={};return p||l.$setValidity("editable",!0),s?(d.$model=a,s(i,d)):(d[w.itemName]=a,b=w.viewMapper(i,d),d[w.itemName]=void 0,c=w.viewMapper(i,d),b!==c?b:a)}),x.select=function(a){var b,c,e={};e[w.itemName]=c=x.matches[a].model,b=w.modelMapper(i,e),v(i,b),l.$setValidity("editable",!0),l.$setValidity("parse",!0),r(i,{$item:c,$model:b,$label:w.viewMapper(i,e)}),A(),d(function(){j[0].focus()},0,!1)},j.bind("keydown",function(a){0!==x.matches.length&&-1!==h.indexOf(a.which)&&(-1!=x.activeIdx||13!==a.which&&9!==a.which)&&(a.preventDefault(),40===a.which?(x.activeIdx=(x.activeIdx+1)%x.matches.length,x.$digest()):38===a.which?(x.activeIdx=(x.activeIdx>0?x.activeIdx:x.matches.length)-1,x.$digest()):13===a.which||9===a.which?x.$apply(function(){x.select(x.activeIdx)}):27===a.which&&(a.stopPropagation(),A(),x.$digest()))}),j.bind("blur",function(){m=!1});var G=function(a){j[0]!==a.target&&(A(),x.$digest())};e.bind("click",G),i.$on("$destroy",function(){e.unbind("click",G),t&&H.remove(),z.remove()});var H=a(z)(x);t?e.find("body").append(H):j.after(H)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(a,b,c){a.templateUrl=c.templateUrl,a.isOpen=function(){return a.matches.length>0},a.isActive=function(b){return a.active==b},a.selectActive=function(b){a.active=b},a.selectMatch=function(b){a.select({activeIdx:b})}}}}).directive("typeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"template/typeahead/typeahead-match.html";a(g).then(function(a){b(a.trim())(d,function(a){e.replaceWith(a)})})}}}]).filter("typeaheadHighlight",function(){function a(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(b,c){return c?(""+b).replace(new RegExp(a(c),"gi"),"<strong>$&</strong>"):b}}),!angular.$$csp()&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>');
/*
 * angular-ui-bootstrap
 * http://angular-ui.github.io/bootstrap/

 * Version: 0.13.0 - 2015-05-02
 * License: MIT
 */
angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.transition","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/day.html","template/datepicker/month.html","template/datepicker/popup.html","template/datepicker/year.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-popup.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/tooltip/tooltip-template-popup.html","template/popover/popover-template.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/progressbar/progressbar.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.collapse",[]).directive("collapse",["$animate",function(a){return{link:function(b,c,d){function e(){c.removeClass("collapse").addClass("collapsing"),a.addClass(c,"in",{to:{height:c[0].scrollHeight+"px"}}).then(f)}function f(){c.removeClass("collapsing"),c.css({height:"auto"})}function g(){c.css({height:c[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing"),a.removeClass(c,"in",{to:{height:"0"}}).then(h)}function h(){c.css({height:"0"}),c.removeClass("collapsing"),c.addClass("collapse")}b.$watch(d.collapse,function(a){a?g():e()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.$watch("isOpen",function(b){b&&d.closeOthers(a)}),a.toggleOpen=function(){a.isDisabled||(a.isOpen=!a.isOpen)}}}}).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,angular.noop))}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.accordionTransclude]},function(a){a&&(b.html(""),b.append(a))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(a,b){a.closeable="close"in b,this.close=a.close}]).directive("alert",function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}).directive("dismissOnTimeout",["$timeout",function(a){return{require:"alert",link:function(b,c,d,e){a(function(){e.close()},parseInt(d.dismissOnTimeout,10))}}}]),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",function(){return function(a,b,c){b.addClass("ng-binding").data("$binding",c.bindHtmlUnsafe),a.$watch(c.bindHtmlUnsafe,function(a){b.html(a||"")})}}),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){var e=d[0],f=d[1];f.$render=function(){b.toggleClass(e.activeClass,angular.equals(f.$modelValue,a.$eval(c.btnRadio)))},b.bind(e.toggleEvent,function(){var d=b.hasClass(e.activeClass);(!d||angular.isDefined(c.uncheckable))&&a.$apply(function(){f.$setViewValue(d?null:a.$eval(c.btnRadio)),f.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){var d=a.$eval(b);return angular.isDefined(d)?d:c}var h=d[0],i=d[1];i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.bind(h.toggleEvent,function(){a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("CarouselController",["$scope","$interval","$animate",function(a,b,c){function d(a){if(angular.isUndefined(k[a].index))return k[a];{var b;k.length}for(b=0;b<k.length;++b)if(k[b].index==a)return k[b]}function e(){f();var c=+a.interval;!isNaN(c)&&c>0&&(h=b(g,c))}function f(){h&&(b.cancel(h),h=null)}function g(){var b=+a.interval;i&&!isNaN(b)&&b>0?a.next():a.pause()}var h,i,j=this,k=j.slides=a.slides=[],l=-1;j.currentSlide=null;var m=!1;j.select=a.select=function(b,d){function f(){m||(angular.extend(b,{direction:d,active:!0}),angular.extend(j.currentSlide||{},{direction:d,active:!1}),c.enabled()&&!a.noTransition&&b.$element&&(a.$currentTransition=!0,b.$element.one("$animate:close",function(){a.$currentTransition=null})),j.currentSlide=b,l=g,e())}var g=j.indexOfSlide(b);void 0===d&&(d=g>j.getCurrentIndex()?"next":"prev"),b&&b!==j.currentSlide&&f()},a.$on("$destroy",function(){m=!0}),j.getCurrentIndex=function(){return j.currentSlide&&angular.isDefined(j.currentSlide.index)?+j.currentSlide.index:l},j.indexOfSlide=function(a){return angular.isDefined(a.index)?+a.index:k.indexOf(a)},a.next=function(){var b=(j.getCurrentIndex()+1)%k.length;return a.$currentTransition?void 0:j.select(d(b),"next")},a.prev=function(){var b=j.getCurrentIndex()-1<0?k.length-1:j.getCurrentIndex()-1;return a.$currentTransition?void 0:j.select(d(b),"prev")},a.isActive=function(a){return j.currentSlide===a},a.$watch("interval",e),a.$on("$destroy",f),a.play=function(){i||(i=!0,e())},a.pause=function(){a.noPause||(i=!1,f())},j.addSlide=function(b,c){b.$element=c,k.push(b),1===k.length||b.active?(j.select(k[k.length-1]),1==k.length&&a.play()):b.active=!1},j.removeSlide=function(a){angular.isDefined(a.index)&&k.sort(function(a,b){return+a.index>+b.index});var b=k.indexOf(a);k.splice(b,1),k.length>0&&a.active?j.select(b>=k.length?k[b-1]:k[b]):l>b&&l--}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"="}}}]).directive("slide",function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?",index:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)}),a.$watch("active",function(b){b&&d.select(a)})}}}).animation(".item",["$animate",function(a){return{beforeAddClass:function(b,c,d){if("active"==c&&b.parent()&&!b.parent().scope().noTransition){var e=!1,f=b.isolateScope().direction,g="next"==f?"left":"right";return b.addClass(f),a.addClass(b,g).then(function(){e||b.removeClass(g+" "+f),d()}),function(){e=!0}}d()},beforeRemoveClass:function(b,c,d){if("active"==c&&b.parent()&&!b.parent().scope().noTransition){var e=!1,f=b.isolateScope().direction,g="next"==f?"left":"right";return a.addClass(b,g).then(function(){e||b.removeClass(g),d()}),function(){e=!0}}d()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(a,b){function c(a){var c=[],d=a.split("");return angular.forEach(f,function(b,e){var f=a.indexOf(e);if(f>-1){a=a.split(""),d[f]="("+b.regex+")",a[f]="$";for(var g=f+1,h=f+e.length;h>g;g++)d[g]="",a[g]="$";a=a.join(""),c.push({index:f,apply:b.apply})}}),{regex:new RegExp("^"+d.join("")+"$"),map:b(c,"index")}}function d(a,b,c){return 1>c?!1:1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}var e=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.parsers={};var f={yyyy:{regex:"\\d{4}",apply:function(a){this.year=+a}},yy:{regex:"\\d{2}",apply:function(a){this.year=+a+2e3}},y:{regex:"\\d{1,4}",apply:function(a){this.year=+a}},MMMM:{regex:a.DATETIME_FORMATS.MONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.MONTH.indexOf(b)}},MMM:{regex:a.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.SHORTMONTH.indexOf(b)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1}},M:{regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},EEEE:{regex:a.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:a.DATETIME_FORMATS.SHORTDAY.join("|")},HH:{regex:"(?:0|1)[0-9]|2[0-3]",apply:function(a){this.hours=+a}},H:{regex:"1?[0-9]|2[0-3]",apply:function(a){this.hours=+a}},mm:{regex:"[0-5][0-9]",apply:function(a){this.minutes=+a}},m:{regex:"[0-9]|[1-5][0-9]",apply:function(a){this.minutes=+a}},sss:{regex:"[0-9][0-9][0-9]",apply:function(a){this.milliseconds=+a}},ss:{regex:"[0-5][0-9]",apply:function(a){this.seconds=+a}},s:{regex:"[0-9]|[1-5][0-9]",apply:function(a){this.seconds=+a}}};this.parse=function(b,f,g){if(!angular.isString(b)||!f)return b;f=a.DATETIME_FORMATS[f]||f,f=f.replace(e,"\\$&"),this.parsers[f]||(this.parsers[f]=c(f));var h=this.parsers[f],i=h.regex,j=h.map,k=b.match(i);if(k&&k.length){var l,m;l=g?{year:g.getFullYear(),month:g.getMonth(),date:g.getDate(),hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds(),milliseconds:g.getMilliseconds()}:{year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0};for(var n=1,o=k.length;o>n;n++){var p=j[n-1];p.apply&&p.apply.call(l,k[n])}return d(l.year,l.month,l.date)&&(m=new Date(l.year,l.month,l.date,l.hours,l.minutes,l.seconds,l.milliseconds||0)),m}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(a,b){function c(a,c){return a.currentStyle?a.currentStyle[c]:b.getComputedStyle?b.getComputedStyle(a)[c]:a.style[c]}function d(a){return"static"===(c(a,"position")||"static")}var e=function(b){for(var c=a[0],e=b.offsetParent||c;e&&e!==c&&d(e);)e=e.offsetParent;return e||c};return{position:function(b){var c=this.offset(b),d={top:0,left:0},f=e(b[0]);f!=a[0]&&(d=this.offset(angular.element(f)),d.top+=f.clientTop-f.scrollTop,d.left+=f.clientLeft-f.scrollLeft);var g=b[0].getBoundingClientRect();return{width:g.width||b.prop("offsetWidth"),height:g.height||b.prop("offsetHeight"),top:c.top-d.top,left:c.left-d.left}},offset:function(c){var d=c[0].getBoundingClientRect();return{width:d.width||c.prop("offsetWidth"),height:d.height||c.prop("offsetHeight"),top:d.top+(b.pageYOffset||a[0].documentElement.scrollTop),left:d.left+(b.pageXOffset||a[0].documentElement.scrollLeft)}},positionElements:function(a,b,c,d){var e,f,g,h,i=c.split("-"),j=i[0],k=i[1]||"center";e=d?this.offset(a):this.position(a),f=b.prop("offsetWidth"),g=b.prop("offsetHeight");var l={center:function(){return e.left+e.width/2-f/2},left:function(){return e.left},right:function(){return e.left+e.width}},m={center:function(){return e.top+e.height/2-g/2},top:function(){return e.top},bottom:function(){return e.top+e.height}};switch(j){case"right":h={top:m[k](),left:l[j]()};break;case"left":h={top:m[k](),left:e.left-f};break;case"bottom":h={top:m[j](),left:l[k]()};break;default:h={top:e.top-g,left:l[k]()}}return h}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null,shortcutPropagation:!1}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(a,b,c,d,e,f,g,h){var i=this,j={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange","shortcutPropagation"],function(c,e){i[c]=angular.isDefined(b[c])?8>e?d(b[c])(a.$parent):a.$parent.$eval(b[c]):h[c]}),angular.forEach(["minDate","maxDate"],function(d){b[d]?a.$parent.$watch(c(b[d]),function(a){i[d]=a?new Date(a):null,i.refreshView()}):i[d]=h[d]?new Date(h[d]):null}),a.datepickerMode=a.datepickerMode||h.datepickerMode,a.maxMode=i.maxMode,a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),angular.isDefined(b.initDate)?(this.activeDate=a.$parent.$eval(b.initDate)||new Date,a.$parent.$watch(b.initDate,function(a){a&&(j.$isEmpty(j.$modelValue)||j.$invalid)&&(i.activeDate=a,i.refreshView())})):this.activeDate=new Date,a.isActive=function(b){return 0===i.compare(b.date,i.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(a){j=a,j.$render=function(){i.render()}},this.render=function(){if(j.$viewValue){var a=new Date(j.$viewValue),b=!isNaN(a);b?this.activeDate=a:f.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),j.$setValidity("date",b)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var a=j.$viewValue?new Date(j.$viewValue):null;j.$setValidity("date-disabled",!a||this.element&&!this.isDisabled(a))}},this.createDateObject=function(a,b){var c=j.$viewValue?new Date(j.$viewValue):null;return{date:a,label:g(a,b),selected:c&&0===this.compare(a,c),disabled:this.isDisabled(a),current:0===this.compare(a,new Date),customClass:this.customClass(a)}},this.isDisabled=function(c){return this.minDate&&this.compare(c,this.minDate)<0||this.maxDate&&this.compare(c,this.maxDate)>0||b.dateDisabled&&a.dateDisabled({date:c,mode:a.datepickerMode})},this.customClass=function(b){return a.customClass({date:b,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===i.minMode){var c=j.$viewValue?new Date(j.$viewValue):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),j.$setViewValue(c),j.$render()}else i.activeDate=b,a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)-1]},a.move=function(a){var b=i.activeDate.getFullYear()+a*(i.step.years||0),c=i.activeDate.getMonth()+a*(i.step.months||0);i.activeDate.setFullYear(b,c,1),i.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===i.maxMode&&1===b||a.datepickerMode===i.minMode&&-1===b||(a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)+b])},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var k=function(){e(function(){i.element[0].focus()},0,!1)};a.$on("datepicker.focus",k),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey)if(b.preventDefault(),i.shortcutPropagation||b.stopPropagation(),"enter"===c||"space"===c){if(i.isDisabled(i.activeDate))return;a.select(i.activeDate),k()}else!b.ctrlKey||"up"!==c&&"down"!==c?(i.handleKeyDown(c,b),i.refreshView()):(a.toggleMode("up"===c?1:-1),k())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&",customClass:"&",shortcutPropagation:"&?"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}).directive("daypicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(b,c,d,e){function f(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?i[b]:29}function g(a,b){var c=new Array(b),d=new Date(a),e=0;for(d.setHours(12);b>e;)c[e++]=new Date(d),d.setDate(d.getDate()+1);return c}function h(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}b.showWeeks=e.showWeeks,e.step={months:1},e.element=c;var i=[31,28,31,30,31,30,31,31,30,31,30,31];e._refreshView=function(){var c=e.activeDate.getFullYear(),d=e.activeDate.getMonth(),f=new Date(c,d,1),i=e.startingDay-f.getDay(),j=i>0?7-i:-i,k=new Date(f);j>0&&k.setDate(-j+1);for(var l=g(k,42),m=0;42>m;m++)l[m]=angular.extend(e.createDateObject(l[m],e.formatDay),{secondary:l[m].getMonth()!==d,uid:b.uniqueId+"-"+m});b.labels=new Array(7);for(var n=0;7>n;n++)b.labels[n]={abbr:a(l[n].date,e.formatDayHeader),full:a(l[n].date,"EEEE")};if(b.title=a(e.activeDate,e.formatDayTitle),b.rows=e.split(l,7),b.showWeeks){b.weekNumbers=[];for(var o=(11-e.startingDay)%7,p=b.rows.length,q=0;p>q;q++)b.weekNumbers.push(h(b.rows[q][o].date))}},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},e.handleKeyDown=function(a){var b=e.activeDate.getDate();if("left"===a)b-=1;else if("up"===a)b-=7;else if("right"===a)b+=1;else if("down"===a)b+=7;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getMonth()+("pageup"===a?-1:1);e.activeDate.setMonth(c,1),b=Math.min(f(e.activeDate.getFullYear(),e.activeDate.getMonth()),b)}else"home"===a?b=1:"end"===a&&(b=f(e.activeDate.getFullYear(),e.activeDate.getMonth()));e.activeDate.setDate(b)},e.refreshView()}}}]).directive("monthpicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(b,c,d,e){e.step={years:1},e.element=c,e._refreshView=function(){for(var c=new Array(12),d=e.activeDate.getFullYear(),f=0;12>f;f++)c[f]=angular.extend(e.createDateObject(new Date(d,f,1),e.formatMonth),{uid:b.uniqueId+"-"+f});b.title=a(e.activeDate,e.formatMonthTitle),b.rows=e.split(c,3)},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth())-new Date(b.getFullYear(),b.getMonth())},e.handleKeyDown=function(a){var b=e.activeDate.getMonth();if("left"===a)b-=1;else if("up"===a)b-=3;else if("right"===a)b+=1;else if("down"===a)b+=3;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getFullYear()+("pageup"===a?-1:1);e.activeDate.setFullYear(c)}else"home"===a?b=0:"end"===a&&(b=11);e.activeDate.setMonth(b)},e.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(a,b,c,d){function e(a){return parseInt((a-1)/f,10)*f+1}var f=d.yearRange;d.step={years:f},d.element=b,d._refreshView=function(){for(var b=new Array(f),c=0,g=e(d.activeDate.getFullYear());f>c;c++)b[c]=angular.extend(d.createDateObject(new Date(g+c,0,1),d.formatYear),{uid:a.uniqueId+"-"+c});a.title=[b[0].label,b[f-1].label].join(" - "),a.rows=d.split(b,5)},d.compare=function(a,b){return a.getFullYear()-b.getFullYear()},d.handleKeyDown=function(a){var b=d.activeDate.getFullYear();"left"===a?b-=1:"up"===a?b-=5:"right"===a?b+=1:"down"===a?b+=5:"pageup"===a||"pagedown"===a?b+=("pageup"===a?-1:1)*d.step.years:"home"===a?b=e(d.activeDate.getFullYear()):"end"===a&&(b=e(d.activeDate.getFullYear())+f-1),d.activeDate.setFullYear(b)},d.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(a,b,c,d,e,f,g){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&",customClass:"&"},link:function(h,i,j,k){function l(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function m(a){if(angular.isNumber(a)&&(a=new Date(a)),a){if(angular.isDate(a)&&!isNaN(a))return a;if(angular.isString(a)){var b=f.parse(a,o,h.date)||new Date(a);return isNaN(b)?void 0:b}return void 0}return null}function n(a,b){var c=a||b;if(angular.isNumber(c)&&(c=new Date(c)),c){if(angular.isDate(c)&&!isNaN(c))return!0;if(angular.isString(c)){var d=f.parse(c,o)||new Date(c);return!isNaN(d)}return!1}return!0}var o,p=angular.isDefined(j.closeOnDateSelection)?h.$parent.$eval(j.closeOnDateSelection):g.closeOnDateSelection,q=angular.isDefined(j.datepickerAppendToBody)?h.$parent.$eval(j.datepickerAppendToBody):g.appendToBody;h.showButtonBar=angular.isDefined(j.showButtonBar)?h.$parent.$eval(j.showButtonBar):g.showButtonBar,h.getText=function(a){return h[a+"Text"]||g[a+"Text"]};var r=!1;if(g.html5Types[j.type]?(o=g.html5Types[j.type],r=!0):(o=j.datepickerPopup||g.datepickerPopup,j.$observe("datepickerPopup",function(a){var b=a||g.datepickerPopup;if(b!==o&&(o=b,k.$modelValue=null,!o))throw new Error("datepickerPopup must have a date format specified.")})),!o)throw new Error("datepickerPopup must have a date format specified.");if(r&&j.datepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");var s=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");s.attr({"ng-model":"date","ng-change":"dateSelection()"});var t=angular.element(s.children()[0]);if(r&&"month"==j.type&&(t.attr("datepicker-mode",'"month"'),t.attr("min-mode","month")),j.datepickerOptions){var u=h.$parent.$eval(j.datepickerOptions);u.initDate&&(h.initDate=u.initDate,t.attr("init-date","initDate"),delete u.initDate),angular.forEach(u,function(a,b){t.attr(l(b),a)})}h.watchData={},angular.forEach(["minDate","maxDate","datepickerMode","initDate","shortcutPropagation"],function(a){if(j[a]){var c=b(j[a]);if(h.$parent.$watch(c,function(b){h.watchData[a]=b}),t.attr(l(a),"watchData."+a),"datepickerMode"===a){var d=c.assign;h.$watch("watchData."+a,function(a,b){a!==b&&d(h.$parent,a)})}}}),j.dateDisabled&&t.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),j.showWeeks&&t.attr("show-weeks",j.showWeeks),j.customClass&&t.attr("custom-class","customClass({ date: date, mode: mode })"),r?k.$formatters.push(function(a){return h.date=a,a}):(k.$$parserName="date",k.$validators.date=n,k.$parsers.unshift(m),k.$formatters.push(function(a){return h.date=a,k.$isEmpty(a)?a:e(a,o)})),h.dateSelection=function(a){angular.isDefined(a)&&(h.date=a);var b=h.date?e(h.date,o):"";i.val(b),k.$setViewValue(b),p&&(h.isOpen=!1,i[0].focus())},k.$viewChangeListeners.push(function(){h.date=f.parse(k.$viewValue,o,h.date)||new Date(k.$viewValue)});var v=function(a){h.isOpen&&a.target!==i[0]&&h.$apply(function(){h.isOpen=!1})},w=function(a){h.keydown(a)};i.bind("keydown",w),h.keydown=function(a){27===a.which?(a.preventDefault(),h.isOpen&&a.stopPropagation(),h.close()):40!==a.which||h.isOpen||(h.isOpen=!0)},h.$watch("isOpen",function(a){a?(h.$broadcast("datepicker.focus"),h.position=q?d.offset(i):d.position(i),h.position.top=h.position.top+i.prop("offsetHeight"),c.bind("click",v)):c.unbind("click",v)}),h.select=function(a){if("today"===a){var b=new Date;angular.isDate(h.date)?(a=new Date(h.date),a.setFullYear(b.getFullYear(),b.getMonth(),b.getDate())):a=new Date(b.setHours(0,0,0,0))}h.dateSelection(a)},h.close=function(){h.isOpen=!1,i[0].focus()};var x=a(s)(h);s.remove(),q?c.find("body").append(x):i.after(x),h.$on("$destroy",function(){x.remove(),i.unbind("keydown",w),c.unbind("click",v)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(a,b){b.bind("click",function(a){a.preventDefault(),a.stopPropagation()})}}}),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document","$rootScope",function(a,b){var c=null;this.open=function(b){c||(a.bind("click",d),a.bind("keydown",e)),c&&c!==b&&(c.isOpen=!1),c=b},this.close=function(b){c===b&&(c=null,a.unbind("click",d),a.unbind("keydown",e))};var d=function(a){if(c&&(!a||"disabled"!==c.getAutoClose())){var d=c.getToggleElement();if(!(a&&d&&d[0].contains(a.target))){var e=c.getElement();a&&"outsideClick"===c.getAutoClose()&&e&&e[0].contains(a.target)||(c.isOpen=!1,b.$$phase||c.$apply())}}},e=function(a){27===a.which&&(c.focusToggleElement(),d())}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate","$position","$document",function(a,b,c,d,e,f,g,h){var i,j=this,k=a.$new(),l=d.openClass,m=angular.noop,n=b.onToggle?c(b.onToggle):angular.noop,o=!1;this.init=function(d){j.$element=d,b.isOpen&&(i=c(b.isOpen),m=i.assign,a.$watch(i,function(a){k.isOpen=!!a})),o=angular.isDefined(b.dropdownAppendToBody),o&&j.dropdownMenu&&(h.find("body").append(j.dropdownMenu),d.on("$destroy",function(){j.dropdownMenu.remove()}))},this.toggle=function(a){return k.isOpen=arguments.length?!!a:!k.isOpen},this.isOpen=function(){return k.isOpen},k.getToggleElement=function(){return j.toggleElement},k.getAutoClose=function(){return b.autoClose||"always"},k.getElement=function(){return j.$element},k.focusToggleElement=function(){j.toggleElement&&j.toggleElement[0].focus()},k.$watch("isOpen",function(b,c){if(o&&j.dropdownMenu){var d=g.positionElements(j.$element,j.dropdownMenu,"bottom-left",!0);j.dropdownMenu.css({top:d.top+"px",left:d.left+"px",display:b?"block":"none"})}f[b?"addClass":"removeClass"](j.$element,l),b?(k.focusToggleElement(),e.open(k)):e.close(k),m(a,b),angular.isDefined(b)&&b!==c&&n(a,{open:!!b})}),a.$on("$locationChangeSuccess",function(){k.isOpen=!1}),a.$on("$destroy",function(){k.$destroy()})}]).directive("dropdown",function(){return{controller:"DropdownController",link:function(a,b,c,d){d.init(b)}}}).directive("dropdownMenu",function(){return{restrict:"AC",require:"?^dropdown",link:function(a,b,c,d){d&&(d.dropdownMenu=b)}}}).directive("dropdownToggle",function(){return{require:"?^dropdown",link:function(a,b,c,d){if(d){d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.modal",[]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b==a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b==a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}).directive("modalBackdrop",["$timeout",function(a){function b(b){b.animate=!1,a(function(){b.animate=!0})}return{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",compile:function(a,c){return a.addClass(c.backdropClass),b}}}]).directive("modalWindow",["$modalStack","$q",function(a,b){return{restrict:"EA",scope:{index:"@",animate:"="},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"template/modal/window.html"},link:function(c,d,e){d.addClass(e.windowClass||""),c.size=e.size,c.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!=c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))},c.$isRendered=!0;var f=b.defer();e.$observe("modalRender",function(a){"true"==a&&f.resolve()}),f.promise.then(function(){c.animate=!0;var b=d[0].querySelectorAll("[autofocus]");b.length?b[0].focus():d[0].focus();var e=a.getTop();e&&a.modalRendered(e.key)})}}}]).directive("modalAnimationClass",[function(){return{compile:function(a,b){b.modalAnimation&&a.addClass(b.modalAnimationClass)}}}]).directive("modalTransclude",function(){return{link:function(a,b,c,d,e){e(a.$parent,function(a){b.empty(),b.append(a)})}}}).factory("$modalStack",["$animate","$timeout","$document","$compile","$rootScope","$$stackedMap",function(a,b,c,d,e,f){function g(){for(var a=-1,b=o.keys(),c=0;c<b.length;c++)o.get(b[c]).value.backdrop&&(a=c);return a}function h(a){var b=c.find("body").eq(0),d=o.get(a).value;o.remove(a),j(d.modalDomEl,d.modalScope,function(){b.toggleClass(n,o.length()>0),i()})}function i(){if(l&&-1==g()){var a=m;j(l,m,function(){a=null}),l=void 0,m=void 0}}function j(c,d,f){function g(){g.done||(g.done=!0,c.remove(),d.$destroy(),f&&f())}d.animate=!1,c.attr("modal-animation")&&a.enabled()?c.one("$animate:close",function(){e.$evalAsync(g)}):b(g)}function k(a,b,c){return!a.value.modalScope.$broadcast("modal.closing",b,c).defaultPrevented}var l,m,n="modal-open",o=f.createNew(),p={};return e.$watch(g,function(a){m&&(m.index=a)}),c.bind("keydown",function(a){var b;27===a.which&&(b=o.top(),b&&b.value.keyboard&&(a.preventDefault(),e.$apply(function(){p.dismiss(b.key,"escape key press")})))}),p.open=function(a,b){var f=c[0].activeElement;o.add(a,{deferred:b.deferred,renderDeferred:b.renderDeferred,modalScope:b.scope,backdrop:b.backdrop,keyboard:b.keyboard});var h=c.find("body").eq(0),i=g();if(i>=0&&!l){m=e.$new(!0),m.index=i;var j=angular.element('<div modal-backdrop="modal-backdrop"></div>');j.attr("backdrop-class",b.backdropClass),b.animation&&j.attr("modal-animation","true"),l=d(j)(m),h.append(l)}var k=angular.element('<div modal-window="modal-window"></div>');k.attr({"template-url":b.windowTemplateUrl,"window-class":b.windowClass,size:b.size,index:o.length()-1,animate:"animate"}).html(b.content),b.animation&&k.attr("modal-animation","true");var p=d(k)(b.scope);o.top().value.modalDomEl=p,o.top().value.modalOpener=f,h.append(p),h.addClass(n)},p.close=function(a,b){var c=o.get(a);return c&&k(c,b,!0)?(c.value.deferred.resolve(b),h(a),c.value.modalOpener.focus(),!0):!c},p.dismiss=function(a,b){var c=o.get(a);return c&&k(c,b,!1)?(c.value.deferred.reject(b),h(a),c.value.modalOpener.focus(),!0):!c},p.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},p.getTop=function(){return o.top()},p.modalRendered=function(a){var b=o.get(a);b&&b.value.renderDeferred.resolve()},p}]).provider("$modal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$templateRequest","$controller","$modalStack",function(b,c,d,e,f,g){function h(a){return a.template?d.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}function i(a){var c=[];return angular.forEach(a,function(a){(angular.isFunction(a)||angular.isArray(a))&&c.push(d.when(b.invoke(a)))
}),c}var j={};return j.open=function(b){var e=d.defer(),j=d.defer(),k=d.defer(),l={result:e.promise,opened:j.promise,rendered:k.promise,close:function(a){return g.close(l,a)},dismiss:function(a){return g.dismiss(l,a)}};if(b=angular.extend({},a.options,b),b.resolve=b.resolve||{},!b.template&&!b.templateUrl)throw new Error("One of template or templateUrl options is required.");var m=d.all([h(b)].concat(i(b.resolve)));return m.then(function(a){var d=(b.scope||c).$new();d.$close=l.close,d.$dismiss=l.dismiss;var h,i={},j=1;b.controller&&(i.$scope=d,i.$modalInstance=l,angular.forEach(b.resolve,function(b,c){i[c]=a[j++]}),h=f(b.controller,i),b.controllerAs&&(d[b.controllerAs]=h)),g.open(l,{scope:d,deferred:e,renderDeferred:k,content:a[0],animation:b.animation,backdrop:b.backdrop,keyboard:b.keyboard,backdropClass:b.backdropClass,windowClass:b.windowClass,windowTemplateUrl:b.windowTemplateUrl,size:b.size})},function(a){e.reject(a)}),m.then(function(){j.resolve(!0)},function(a){j.reject(a)}),l},j}]};return a}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(a,b,c){var d=this,e={$setViewValue:angular.noop},f=b.numPages?c(b.numPages).assign:angular.noop;this.init=function(g,h){e=g,this.config=h,e.$render=function(){d.render()},b.itemsPerPage?a.$parent.$watch(c(b.itemsPerPage),function(b){d.itemsPerPage=parseInt(b,10),a.totalPages=d.calculateTotalPages()}):this.itemsPerPage=h.itemsPerPage,a.$watch("totalItems",function(){a.totalPages=d.calculateTotalPages()}),a.$watch("totalPages",function(b){f(a.$parent,b),a.page>b?a.selectPage(b):e.$render()})},this.calculateTotalPages=function(){var b=this.itemsPerPage<1?1:Math.ceil(a.totalItems/this.itemsPerPage);return Math.max(b||0,1)},this.render=function(){a.page=parseInt(e.$viewValue,10)||1},a.selectPage=function(b,c){a.page!==b&&b>0&&b<=a.totalPages&&(c&&c.target&&c.target.blur(),e.$setViewValue(b),e.$render())},a.getText=function(b){return a[b+"Text"]||d.config[b+"Text"]},a.noPrevious=function(){return 1===a.page},a.noNext=function(){return a.page===a.totalPages}}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(a,b){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},require:["pagination","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(c,d,e,f){function g(a,b,c){return{number:a,text:b,active:c}}function h(a,b){var c=[],d=1,e=b,f=angular.isDefined(k)&&b>k;f&&(l?(d=Math.max(a-Math.floor(k/2),1),e=d+k-1,e>b&&(e=b,d=e-k+1)):(d=(Math.ceil(a/k)-1)*k+1,e=Math.min(d+k-1,b)));for(var h=d;e>=h;h++){var i=g(h,h,h===a);c.push(i)}if(f&&!l){if(d>1){var j=g(d-1,"...",!1);c.unshift(j)}if(b>e){var m=g(e+1,"...",!1);c.push(m)}}return c}var i=f[0],j=f[1];if(j){var k=angular.isDefined(e.maxSize)?c.$parent.$eval(e.maxSize):b.maxSize,l=angular.isDefined(e.rotate)?c.$parent.$eval(e.rotate):b.rotate;c.boundaryLinks=angular.isDefined(e.boundaryLinks)?c.$parent.$eval(e.boundaryLinks):b.boundaryLinks,c.directionLinks=angular.isDefined(e.directionLinks)?c.$parent.$eval(e.directionLinks):b.directionLinks,i.init(j,b),e.maxSize&&c.$parent.$watch(a(e.maxSize),function(a){k=parseInt(a,10),i.render()});var m=i.render;i.render=function(){m(),c.page>0&&c.page<=c.totalPages&&(c.pages=h(c.page,c.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(a){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@"},require:["pager","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&(b.align=angular.isDefined(d.align)?b.$parent.$eval(d.align):a.align,f.init(g,a))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",animation:!0,popupDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",focus:"blur"},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$position","$interpolate",function(e,f,g,h,i,j){return function(e,k,l,m){function n(a){var b=a||m.trigger||l,d=c[b]||b;return{show:b,hide:d}}m=angular.extend({},b,d,m);var o=a(e),p=j.startSymbol(),q=j.endSymbol(),r="<div "+o+'-popup title="'+p+"title"+q+'" '+(m.useContentExp?'content-exp="contentExp()" ':'content="'+p+"content"+q+'" ')+'placement="'+p+"placement"+q+'" popup-class="'+p+"popupClass"+q+'" animation="animation" is-open="isOpen"origin-scope="origScope" ></div>';return{restrict:"EA",compile:function(){var a=f(r);return function(b,c,d){function f(){E.isOpen?l():j()}function j(){(!D||b.$eval(d[k+"Enable"]))&&(s(),E.popupDelay?A||(A=g(o,E.popupDelay,!1),A.then(function(a){a()})):o()())}function l(){b.$apply(function(){p()})}function o(){return A=null,z&&(g.cancel(z),z=null),(m.useContentExp?E.contentExp():E.content)?(q(),x.css({top:0,left:0,display:"block"}),E.$digest(),F(),E.isOpen=!0,E.$apply(),F):angular.noop}function p(){E.isOpen=!1,g.cancel(A),A=null,E.animation?z||(z=g(r,500)):r()}function q(){x&&r(),y=E.$new(),x=a(y,function(a){B?h.find("body").append(a):c.after(a)}),y.$watch(function(){g(F,0,!1)}),m.useContentExp&&y.$watch("contentExp()",function(a){!a&&E.isOpen&&p()})}function r(){z=null,x&&(x.remove(),x=null),y&&(y.$destroy(),y=null)}function s(){t(),u(),v()}function t(){E.popupClass=d[k+"Class"]}function u(){var a=d[k+"Placement"];E.placement=angular.isDefined(a)?a:m.placement}function v(){var a=d[k+"PopupDelay"],b=parseInt(a,10);E.popupDelay=isNaN(b)?m.popupDelay:b}function w(){var a=d[k+"Trigger"];G(),C=n(a),C.show===C.hide?c.bind(C.show,f):(c.bind(C.show,j),c.bind(C.hide,l))}var x,y,z,A,B=angular.isDefined(m.appendToBody)?m.appendToBody:!1,C=n(void 0),D=angular.isDefined(d[k+"Enable"]),E=b.$new(!0),F=function(){if(x){var a=i.positionElements(c,x,E.placement,B);a.top+="px",a.left+="px",x.css(a)}};E.origScope=b,E.isOpen=!1,E.contentExp=function(){return b.$eval(d[e])},m.useContentExp||d.$observe(e,function(a){E.content=a,!a&&E.isOpen&&p()}),d.$observe("disabled",function(a){a&&E.isOpen&&p()}),d.$observe(k+"Title",function(a){E.title=a});var G=function(){c.unbind(C.show,j),c.unbind(C.hide,l)};w();var H=b.$eval(d[k+"Animation"]);E.animation=angular.isDefined(H)?!!H:m.animation;var I=b.$eval(d[k+"AppendToBody"]);B=angular.isDefined(I)?I:B,B&&b.$on("$locationChangeSuccess",function(){E.isOpen&&p()}),b.$on("$destroy",function(){g.cancel(z),g.cancel(A),G(),r(),E=null})}}}}}]}).directive("tooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.tooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("tooltipClasses",function(){return{restrict:"A",link:function(a,b,c){a.placement&&b.addClass(a.placement),a.popupClass&&b.addClass(a.popupClass),a.animation()&&b.addClass(c.tooltipAnimationClass)}}}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(a){return a("tooltip","tooltip","mouseenter")}]).directive("tooltipTemplatePopup",function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/tooltip/tooltip-template-popup.html"}}).directive("tooltipTemplate",["$tooltip",function(a){return a("tooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlPopup",function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-popup.html"}}).directive("tooltipHtml",["$tooltip",function(a){return a("tooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).value("tooltipHtmlUnsafeSuppressDeprecated",!1).directive("tooltipHtmlUnsafe",["$tooltip","tooltipHtmlUnsafeSuppressDeprecated","$log",function(a,b,c){return b||c.warn("tooltip-html-unsafe is now deprecated. Use tooltip-html or tooltip-template instead."),a("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverTemplatePopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/popover/popover-template.html"}}).directive("popoverTemplate",["$tooltip",function(a){return a("popoverTemplate","popover","click",{useContentExp:!0})}]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$tooltip",function(a){return a("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig",function(a,b,c){var d=this,e=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=angular.isDefined(a.max)?a.max:c.max,this.addBar=function(b,c){e||c.css({transition:"none"}),this.bars.push(b),b.$watch("value",function(c){b.percent=+(100*c/a.max).toFixed(2)}),b.$on("$destroy",function(){c=null,d.removeBar(b)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1)}}]).directive("progress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},templateUrl:"template/progressbar/progress.html"}}).directive("bar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",max:"=?",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b)}}}).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",max:"=?",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(a,b,c){var d={$setViewValue:angular.noop};this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff;var f=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(f)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff},a[b]);return a},a.rate=function(b){!a.readonly&&b>=0&&b<=a.range.length&&(d.$setViewValue(b),d.$render())},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue}}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(a){var b=this,c=b.tabs=a.tabs=[];b.select=function(a){angular.forEach(c,function(b){b.active&&b!==a&&(b.active=!1,b.onDeselect())}),a.active=!0,a.onSelect()},b.addTab=function(a){c.push(a),1===c.length&&a.active!==!1?a.active=!0:a.active?b.select(a):a.active=!1},b.removeTab=function(a){var e=c.indexOf(a);if(a.active&&c.length>1&&!d){var f=e==c.length-1?e-1:e+1;b.select(c[f])}c.splice(e,1)};var d;a.$on("$destroy",function(){d=!0})}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1}}}).directive("tab",["$parse","$log",function(a,b){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(c,d,e){return function(c,d,f,g){c.$watch("active",function(a){a&&g.select(c)}),c.disabled=!1,f.disable&&c.$parent.$watch(a(f.disable),function(a){c.disabled=!!a}),f.disabled&&(b.warn('Use of "disabled" attribute has been deprecated, please use "disable"'),c.$parent.$watch(a(f.disabled),function(a){c.disabled=!!a})),c.select=function(){c.disabled||(c.active=!0)},g.addTab(c),c.$on("$destroy",function(){g.removeTab(c)}),c.$transcludeFn=e}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}]).directive("tabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("tab-heading")||a.hasAttribute("data-tab-heading")||"tab-heading"===a.tagName.toLowerCase()||"data-tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^tabset",link:function(b,c,d){var e=b.$eval(d.tabContentTransclude);e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(a,b,c,d,e,f){function g(){var b=parseInt(a.hours,10),c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c?(a.showMeridian&&(12===b&&(b=0),a.meridian===p[1]&&(b+=12)),b):void 0}function h(){var b=parseInt(a.minutes,10);return b>=0&&60>b?b:void 0}function i(a){return angular.isDefined(a)&&a.toString().length<2?"0"+a:a.toString()}function j(a){k(),o.$setViewValue(new Date(n)),l(a)}function k(){o.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1}function l(b){var c=n.getHours(),d=n.getMinutes();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:i(c),"m"!==b&&(a.minutes=i(d)),a.meridian=n.getHours()<12?p[0]:p[1]}function m(a){var b=new Date(n.getTime()+6e4*a);n.setHours(b.getHours(),b.getMinutes()),j()}var n=new Date,o={$setViewValue:angular.noop},p=angular.isDefined(b.meridians)?a.$parent.$eval(b.meridians):f.meridians||e.DATETIME_FORMATS.AMPMS;this.init=function(c,d){o=c,o.$render=this.render,o.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),g=d.eq(1),h=angular.isDefined(b.mousewheel)?a.$parent.$eval(b.mousewheel):f.mousewheel;h&&this.setupMousewheelEvents(e,g);var i=angular.isDefined(b.arrowkeys)?a.$parent.$eval(b.arrowkeys):f.arrowkeys;i&&this.setupArrowkeyEvents(e,g),a.readonlyInput=angular.isDefined(b.readonlyInput)?a.$parent.$eval(b.readonlyInput):f.readonlyInput,this.setupInputEvents(e,g)};var q=f.hourStep;b.hourStep&&a.$parent.$watch(c(b.hourStep),function(a){q=parseInt(a,10)});var r=f.minuteStep;b.minuteStep&&a.$parent.$watch(c(b.minuteStep),function(a){r=parseInt(a,10)}),a.showMeridian=f.showMeridian,b.showMeridian&&a.$parent.$watch(c(b.showMeridian),function(b){if(a.showMeridian=!!b,o.$error.time){var c=g(),d=h();angular.isDefined(c)&&angular.isDefined(d)&&(n.setHours(c),j())}else l()}),this.setupMousewheelEvents=function(b,c){var d=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c){b.bind("keydown",function(b){38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply())}),c.bind("keydown",function(b){38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply())})},this.setupInputEvents=function(b,c){if(a.readonlyInput)return a.updateHours=angular.noop,void(a.updateMinutes=angular.noop);var d=function(b,c){o.$setViewValue(null),o.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c)};a.updateHours=function(){var a=g();angular.isDefined(a)?(n.setHours(a),j("h")):d(!0)},b.bind("blur",function(){!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=i(a.hours)})}),a.updateMinutes=function(){var a=h();angular.isDefined(a)?(n.setMinutes(a),j("m")):d(void 0,!0)},c.bind("blur",function(){!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=i(a.minutes)})})},this.render=function(){var a=o.$viewValue;isNaN(a)?(o.$setValidity("time",!1),d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(a&&(n=a),k(),l())},a.incrementHours=function(){m(60*q)},a.decrementHours=function(){m(60*-q)},a.incrementMinutes=function(){m(r)},a.decrementMinutes=function(){m(-r)},a.toggleMeridian=function(){m(720*(n.getHours()<12?1:-1))}}]).directive("timepicker",function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}),angular.module("ui.bootstrap.transition",[]).value("$transitionSuppressDeprecated",!1).factory("$transition",["$q","$timeout","$rootScope","$log","$transitionSuppressDeprecated",function(a,b,c,d,e){function f(a){for(var b in a)if(void 0!==h.style[b])return a[b]}e||d.warn("$transition is now deprecated. Use $animate from ngAnimate instead.");var g=function(d,e,f){f=f||{};var h=a.defer(),i=g[f.animation?"animationEndEventName":"transitionEndEventName"],j=function(){c.$apply(function(){d.unbind(i,j),h.resolve(d)})};return i&&d.bind(i,j),b(function(){angular.isString(e)?d.addClass(e):angular.isFunction(e)?e(d):angular.isObject(e)&&d.css(e),i||h.resolve(d)}),h.promise.cancel=function(){i&&d.unbind(i,j),h.reject("Transition cancelled")},h.promise},h=document.createElement("trans"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},j={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return g.transitionEndEventName=f(i),g.animationEndEventName=f(j),g}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(a,b,c,d,e,f,g){var h=[9,13,27,38,40];return{require:"ngModel",link:function(i,j,k,l){var m,n=i.$eval(k.typeaheadMinLength)||1,o=i.$eval(k.typeaheadWaitMs)||0,p=i.$eval(k.typeaheadEditable)!==!1,q=b(k.typeaheadLoading).assign||angular.noop,r=b(k.typeaheadOnSelect),s=k.typeaheadInputFormatter?b(k.typeaheadInputFormatter):void 0,t=k.typeaheadAppendToBody?i.$eval(k.typeaheadAppendToBody):!1,u=i.$eval(k.typeaheadFocusFirst)!==!1,v=b(k.ngModel).assign,w=g.parse(k.typeahead),x=i.$new();i.$on("$destroy",function(){x.$destroy()});var y="typeahead-"+x.$id+"-"+Math.floor(1e4*Math.random());j.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":y});var z=angular.element("<div typeahead-popup></div>");z.attr({id:y,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(k.typeaheadTemplateUrl)&&z.attr("template-url",k.typeaheadTemplateUrl);var A=function(){x.matches=[],x.activeIdx=-1,j.attr("aria-expanded",!1)},B=function(a){return y+"-option-"+a};x.$watch("activeIdx",function(a){0>a?j.removeAttr("aria-activedescendant"):j.attr("aria-activedescendant",B(a))});var C=function(a){var b={$viewValue:a};q(i,!0),c.when(w.source(i,b)).then(function(c){var d=a===l.$viewValue;if(d&&m)if(c&&c.length>0){x.activeIdx=u?0:-1,x.matches.length=0;for(var e=0;e<c.length;e++)b[w.itemName]=c[e],x.matches.push({id:B(e),label:w.viewMapper(x,b),model:c[e]});x.query=a,x.position=t?f.offset(j):f.position(j),x.position.top=x.position.top+j.prop("offsetHeight"),j.attr("aria-expanded",!0)}else A();d&&q(i,!1)},function(){A(),q(i,!1)})};A(),x.query=void 0;var D,E=function(a){D=d(function(){C(a)},o)},F=function(){D&&d.cancel(D)};l.$parsers.unshift(function(a){return m=!0,a&&a.length>=n?o>0?(F(),E(a)):C(a):(q(i,!1),F(),A()),p?a:a?void l.$setValidity("editable",!1):(l.$setValidity("editable",!0),a)}),l.$formatters.push(function(a){var b,c,d={};return p||l.$setValidity("editable",!0),s?(d.$model=a,s(i,d)):(d[w.itemName]=a,b=w.viewMapper(i,d),d[w.itemName]=void 0,c=w.viewMapper(i,d),b!==c?b:a)}),x.select=function(a){var b,c,e={};e[w.itemName]=c=x.matches[a].model,b=w.modelMapper(i,e),v(i,b),l.$setValidity("editable",!0),l.$setValidity("parse",!0),r(i,{$item:c,$model:b,$label:w.viewMapper(i,e)}),A(),d(function(){j[0].focus()},0,!1)},j.bind("keydown",function(a){0!==x.matches.length&&-1!==h.indexOf(a.which)&&(-1!=x.activeIdx||13!==a.which&&9!==a.which)&&(a.preventDefault(),40===a.which?(x.activeIdx=(x.activeIdx+1)%x.matches.length,x.$digest()):38===a.which?(x.activeIdx=(x.activeIdx>0?x.activeIdx:x.matches.length)-1,x.$digest()):13===a.which||9===a.which?x.$apply(function(){x.select(x.activeIdx)}):27===a.which&&(a.stopPropagation(),A(),x.$digest()))}),j.bind("blur",function(){m=!1});var G=function(a){j[0]!==a.target&&(A(),x.$digest())};e.bind("click",G),i.$on("$destroy",function(){e.unbind("click",G),t&&H.remove(),z.remove()});var H=a(z)(x);t?e.find("body").append(H):j.after(H)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(a,b,c){a.templateUrl=c.templateUrl,a.isOpen=function(){return a.matches.length>0},a.isActive=function(b){return a.active==b},a.selectActive=function(b){a.active=b},a.selectMatch=function(b){a.select({activeIdx:b})}}}}).directive("typeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"template/typeahead/typeahead-match.html";a(g).then(function(a){b(a.trim())(d,function(a){e.replaceWith(a)})})}}}]).filter("typeaheadHighlight",function(){function a(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(b,c){return c?(""+b).replace(new RegExp(a(c),"gi"),"<strong>$&</strong>"):b}}),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion-group.html",'<div class="panel panel-default">\n  <div class="panel-heading">\n    <h4 class="panel-title">\n      <a href="javascript:void(0)" tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n    </h4>\n  </div>\n  <div class="panel-collapse collapse" collapse="!isOpen">\n	  <div class="panel-body" ng-transclude></div>\n  </div>\n</div>\n')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion.html",'<div class="panel-group" ng-transclude></div>')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function(a){a.put("template/alert/alert.html",'<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissable\' : null]" role="alert">\n    <button ng-show="closeable" type="button" class="close" ng-click="close()">\n        <span aria-hidden="true">&times;</span>\n        <span class="sr-only">Close</span>\n    </button>\n    <div ng-transclude></div>\n</div>\n')}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(a){a.put("template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n    <ol class="carousel-indicators" ng-show="slides.length > 1">\n        <li ng-repeat="slide in slides | orderBy:\'index\' track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n    </ol>\n    <div class="carousel-inner" ng-transclude></div>\n    <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n    <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(a){a.put("template/carousel/slide.html",'<div ng-class="{\n    \'active\': active\n  }" class="item text-center" ng-transclude></div>\n')}]),angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/datepicker.html",'<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n  <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n  <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n  <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>')}]),angular.module("template/datepicker/day.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/day.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n  <thead>\n    <tr>\n      <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n      <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n      <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n    </tr>\n    <tr>\n      <th ng-show="showWeeks" class="text-center"></th>\n      <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr ng-repeat="row in rows track by $index">\n      <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n      <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}" ng-class="dt.customClass">\n        <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n      </td>\n    </tr>\n  </tbody>\n</table>\n')}]),angular.module("template/datepicker/month.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/month.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n  <thead>\n    <tr>\n      <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n      <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n      <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr ng-repeat="row in rows track by $index">\n      <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n        <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n      </td>\n    </tr>\n  </tbody>\n</table>\n')}]),angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/popup.html",'<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n	<li ng-transclude></li>\n	<li ng-if="showButtonBar" style="padding:10px 9px 2px">\n		<span class="btn-group pull-left">\n			<button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n			<button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n		</span>\n		<button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n	</li>\n</ul>\n')}]),angular.module("template/datepicker/year.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/year.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n  <thead>\n    <tr>\n      <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n      <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n      <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr ng-repeat="row in rows track by $index">\n      <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n        <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n      </td>\n    </tr>\n  </tbody>\n</table>\n')
}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(a){a.put("template/modal/backdrop.html",'<div class="modal-backdrop"\n     modal-animation-class="fade"\n     ng-class="{in: animate}"\n     ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(a){a.put("template/modal/window.html",'<div modal-render="{{$isRendered}}" tabindex="-1" role="dialog" class="modal"\n    modal-animation-class="fade"\n	ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n    <div class="modal-dialog" ng-class="size ? \'modal-\' + size : \'\'"><div class="modal-content" modal-transclude></div></div>\n</div>\n')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pager.html",'<ul class="pager">\n  <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n  <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n</ul>')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pagination.html",'<ul class="pagination">\n  <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1, $event)">{{getText(\'first\')}}</a></li>\n  <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n  <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number, $event)">{{page.text}}</a></li>\n  <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n  <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages, $event)">{{getText(\'last\')}}</a></li>\n</ul>')}]),angular.module("template/tooltip/tooltip-html-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-html-popup.html",'<div class="tooltip"\n  tooltip-animation-class="fade"\n  tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="tooltip-arrow"></div>\n  <div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-html-unsafe-popup.html",'<div class="tooltip"\n  tooltip-animation-class="fade"\n  tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="tooltip-arrow"></div>\n  <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-popup.html",'<div class="tooltip"\n  tooltip-animation-class="fade"\n  tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="tooltip-arrow"></div>\n  <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-template-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-template-popup.html",'<div class="tooltip"\n  tooltip-animation-class="fade"\n  tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="tooltip-arrow"></div>\n  <div class="tooltip-inner"\n    tooltip-template-transclude="contentExp()"\n    tooltip-template-transclude-scope="originScope()"></div>\n</div>\n')}]),angular.module("template/popover/popover-template.html",[]).run(["$templateCache",function(a){a.put("template/popover/popover-template.html",'<div class="popover"\n  tooltip-animation-class="fade"\n  tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="arrow"></div>\n\n  <div class="popover-inner">\n      <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n      <div class="popover-content"\n        tooltip-template-transclude="contentExp()"\n        tooltip-template-transclude-scope="originScope()"></div>\n  </div>\n</div>\n')}]),angular.module("template/popover/popover-window.html",[]).run(["$templateCache",function(a){a.put("template/popover/popover-window.html",'<div class="popover {{placement}}" ng-class="{ in: isOpen, fade: animation }">\n  <div class="arrow"></div>\n\n  <div class="popover-inner">\n      <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n      <div class="popover-content" tooltip-template-transclude></div>\n  </div>\n</div>\n')}]),angular.module("template/popover/popover.html",[]).run(["$templateCache",function(a){a.put("template/popover/popover.html",'<div class="popover"\n  tooltip-animation-class="fade"\n  tooltip-classes\n  ng-class="{ in: isOpen() }">\n  <div class="arrow"></div>\n\n  <div class="popover-inner">\n      <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n      <div class="popover-content" ng-bind="content"></div>\n  </div>\n</div>\n')}]),angular.module("template/progressbar/bar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n')}]),angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progress.html",'<div class="progress" ng-transclude></div>')}]),angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progressbar.html",'<div class="progress">\n  <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>\n')}]),angular.module("template/rating/rating.html",[]).run(["$templateCache",function(a){a.put("template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n    <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n        <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n    </i>\n</span>')}]),angular.module("template/tabs/tab.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tab.html",'<li ng-class="{active: active, disabled: disabled}">\n  <a href ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("template/tabs/tabset.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tabset.html",'<div>\n  <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n  <div class="tab-content">\n    <div class="tab-pane" \n         ng-repeat="tab in tabs" \n         ng-class="{active: tab.active}"\n         tab-content-transclude="tab">\n    </div>\n  </div>\n</div>\n')}]),angular.module("template/timepicker/timepicker.html",[]).run(["$templateCache",function(a){a.put("template/timepicker/timepicker.html",'<table>\n	<tbody>\n		<tr class="text-center">\n			<td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n			<td>&nbsp;</td>\n			<td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n			<td ng-show="showMeridian"></td>\n		</tr>\n		<tr>\n			<td class="form-group" ng-class="{\'has-error\': invalidHours}">\n				<input style="width:50px;" type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n			</td>\n			<td>:</td>\n			<td class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n				<input style="width:50px;" type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n			</td>\n			<td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n		</tr>\n		<tr class="text-center">\n			<td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n			<td>&nbsp;</td>\n			<td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n			<td ng-show="showMeridian"></td>\n		</tr>\n	</tbody>\n</table>\n')}]),angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-match.html",'<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>')}]),angular.module("template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n    <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n        <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n    </li>\n</ul>\n')}]),!angular.$$csp()&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>');
/*
* Kendo UI v2014.3.1316 (http://www.telerik.com/kendo-ui)
* Copyright 2015 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
(function(f,define){define([],f)})(function(){"bundle all";!function(e,t,n){function i(){}function r(e,t){if(t)return"'"+e.split("'").join("\\'").split('\\"').join('\\\\\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")+"'";var n=e.charAt(0),i=e.substring(1);return"="===n?"+("+i+")+":":"===n?"+e("+i+")+":";"+e+";o+="}function o(e,t,n){return e+="",t=t||2,n=t-e.length,n?O[t].substring(0,n)+e:e}function a(e){var t=e.css(gt.support.transitions.css+"box-shadow")||e.css("box-shadow"),n=t?t.match(St)||[0,0,0,0,0]:[0,0,0,0,0],i=bt.max(+n[3],+(n[4]||0));return{left:-n[1]+i,right:+n[1]+i,bottom:+n[2]+i}}function s(t,n){var i,r,o,s,l,c,d,u,h=xt.browser,p="rtl"==t.css("direction");return t.parent().hasClass("k-animation-container")?(d=t.parent(".k-animation-container"),u=d[0].style,d.is(":hidden")&&d.show(),i=Ct.test(u.width)||Ct.test(u.height),i||d.css({width:t.outerWidth(),height:t.outerHeight(),boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"})):(r=a(t),o=t[0].style.width,s=t[0].style.height,l=Ct.test(o),c=Ct.test(s),h.opera&&(r.left=r.right=r.bottom=5),i=l||c,!l&&(!n||n&&o)&&(o=t.outerWidth()),!c&&(!n||n&&s)&&(s=t.outerHeight()),t.wrap(e("<div/>").addClass("k-animation-container").css({width:o,height:s,marginLeft:r.left*(p?1:-1),paddingLeft:r.left,paddingRight:r.right,paddingBottom:r.bottom})),i&&t.css({width:"100%",height:"100%",boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"})),h.msie&&bt.floor(h.version)<=7&&(t.css({zoom:1}),t.children(".k-menu").width(t.width())),t.parent()}function l(e){var t=1,n=arguments.length;for(t=1;n>t;t++)c(e,arguments[t]);return e}function c(e,t){var n,i,r,o,a,s=gt.data.ObservableArray,l=gt.data.LazyObservableArray,d=gt.data.DataSource,u=gt.data.HierarchicalDataSource;for(n in t)i=t[n],r=typeof i,o=r===Pt&&null!==i?i.constructor:null,o&&o!==Array&&o!==s&&o!==l&&o!==d&&o!==u?i instanceof Date?e[n]=new Date(i.getTime()):I(i.clone)?e[n]=i.clone():(a=e[n],e[n]=typeof a===Pt?a||{}:{},c(e[n],i)):r!==zt&&(e[n]=i);return e}function d(e,t,i){for(var r in t)if(t.hasOwnProperty(r)&&t[r].test(e))return r;return i!==n?i:e}function u(e){return e.replace(/([a-z][A-Z])/g,function(e){return e.charAt(0)+"-"+e.charAt(1).toLowerCase()})}function h(e){return e.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()})}function p(t,n){var i,r={};return document.defaultView&&document.defaultView.getComputedStyle?(i=document.defaultView.getComputedStyle(t,""),n&&e.each(n,function(e,t){r[t]=i.getPropertyValue(t)})):(i=t.currentStyle,n&&e.each(n,function(e,t){r[t]=i[h(t)]})),gt.size(r)||(r=i),r}function f(e){var t,n=0;for(t in e)e.hasOwnProperty(t)&&"toJSON"!=t&&n++;return n}function g(e,n,i){n||(n="offset");var r=e[n]();return xt.browser.msie&&(xt.pointers||xt.msPointers)&&!i&&(r.top-=t.pageYOffset-document.documentElement.scrollTop,r.left-=t.pageXOffset-document.documentElement.scrollLeft),r}function m(e){var t={};return vt("string"==typeof e?e.split(" "):e,function(e){t[e]=this}),t}function v(e){return new gt.effects.Element(e)}function _(e,t,n,i){return typeof e===Et&&(I(t)&&(i=t,t=400,n=!1),I(n)&&(i=n,n=!1),typeof t===Ft&&(n=t,t=400),e={effects:e,duration:t,reverse:n,complete:i}),mt({effects:{},duration:400,reverse:!1,init:yt,teardown:yt,hide:!1},e,{completeCallback:e.complete,complete:yt})}function w(t,n,i,r,o){for(var a,s=0,l=t.length;l>s;s++)a=e(t[s]),a.queue(function(){U.promise(a,_(n,i,r,o))});return t}function y(e,t,n,i){return t&&(t=t.split(" "),vt(t,function(t,n){e.toggleClass(n,i)})),e}function b(e){return(""+e).replace(W,"&amp;").replace(j,"&lt;").replace($,"&gt;").replace(q,"&quot;").replace(G,"&#39;")}function k(e,t){var i;return 0===t.indexOf("data")&&(t=t.substring(4),t=t.charAt(0).toLowerCase()+t.substring(1)),t=t.replace(nt,"-$1"),i=e.getAttribute("data-"+gt.ns+t),null===i?i=n:"null"===i?i=null:"true"===i?i=!0:"false"===i?i=!1:Dt.test(i)?i=parseFloat(i):et.test(i)&&!tt.test(i)&&(i=Function("return ("+i+")")()),i}function x(t,i){var r,o,a={};for(r in i)o=k(t,r),o!==n&&(J.test(r)&&(o=gt.template(e("#"+o).html())),a[r]=o);return a}function C(t,n){return e.contains(t,n)?-1:1}function T(){var t=e(this);return e.inArray(t.attr("data-"+gt.ns+"role"),["slider","rangeslider"])>-1||t.is(":visible")}function S(e,t){var n=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(n)?!e.disabled:"a"===n?e.href||t:t)&&D(e)}function D(t){return!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")||e.expr.filters.hidden(this)}).length}function A(e,t){return new A.fn.init(e,t)}var E,I,P,M,F,z,R,B,H,L,N,O,V,U,W,j,q,G,$,Y,Q,K,X,Z,J,et,tt,nt,it,rt,ot,at,st,lt,ct,dt,ut,ht,pt,ft,gt=t.kendo=t.kendo||{cultures:{}},mt=e.extend,vt=e.each,_t=e.isArray,wt=e.proxy,yt=e.noop,bt=Math,kt=t.JSON||{},xt={},Ct=/%/,Tt=/\{(\d+)(:[^\}]+)?\}/g,St=/(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i,Dt=/^(\+|-?)\d+(\.?)\d*$/,At="function",Et="string",It="number",Pt="object",Mt="null",Ft="boolean",zt="undefined",Rt={},Bt={},Ht=[].slice,Lt=t.Globalize;gt.version="2014.3.1316",i.extend=function(e){var t,n,i=function(){},r=this,o=e&&e.init?e.init:function(){r.apply(this,arguments)};i.prototype=r.prototype,n=o.fn=o.prototype=new i;for(t in e)n[t]=null!=e[t]&&e[t].constructor===Object?mt(!0,{},i.prototype[t],e[t]):e[t];return n.constructor=o,o.extend=r.extend,o},i.prototype._initOptions=function(e){this.options=l({},this.options,e)},I=gt.isFunction=function(e){return"function"==typeof e},P=function(){this._defaultPrevented=!0},M=function(){return this._defaultPrevented===!0},F=i.extend({init:function(){this._events={}},bind:function(e,t,i){var r,o,a,s,l,c=this,d=typeof e===Et?[e]:e,u=typeof t===At;if(t===n){for(r in e)c.bind(r,e[r]);return c}for(r=0,o=d.length;o>r;r++)e=d[r],s=u?t:t[e],s&&(i&&(a=s,s=function(){c.unbind(e,s),a.apply(c,arguments)},s.original=a),l=c._events[e]=c._events[e]||[],l.push(s));return c},one:function(e,t){return this.bind(e,t,!0)},first:function(e,t){var n,i,r,o,a=this,s=typeof e===Et?[e]:e,l=typeof t===At;for(n=0,i=s.length;i>n;n++)e=s[n],r=l?t:t[e],r&&(o=a._events[e]=a._events[e]||[],o.unshift(r));return a},trigger:function(e,t){var n,i,r=this,o=r._events[e];if(o){for(t=t||{},t.sender=r,t._defaultPrevented=!1,t.preventDefault=P,t.isDefaultPrevented=M,o=o.slice(),n=0,i=o.length;i>n;n++)o[n].call(r,t);return t._defaultPrevented===!0}return!1},unbind:function(e,t){var i,r=this,o=r._events[e];if(e===n)r._events={};else if(o)if(t)for(i=o.length-1;i>=0;i--)(o[i]===t||o[i].original===t)&&o.splice(i,1);else r._events[e]=[];return r}}),z=/^\w+/,R=/\$\{([^}]*)\}/g,B=/\\\}/g,H=/__CURLY__/g,L=/\\#/g,N=/__SHARP__/g,O=["","0","00","000","0000"],E={paramName:"data",useWithBlock:!0,render:function(e,t){var n,i,r="";for(n=0,i=t.length;i>n;n++)r+=e(t[n]);return r},compile:function(e,t){var n,i,o,a=mt({},this,t),s=a.paramName,l=s.match(z)[0],c=a.useWithBlock,d="var o,e=kendo.htmlEncode;";if(I(e))return e;for(d+=c?"with("+s+"){":"",d+="o=",i=e.replace(B,"__CURLY__").replace(R,"#=e($1)#").replace(H,"}").replace(L,"__SHARP__").split("#"),o=0;i.length>o;o++)d+=r(i[o],o%2===0);d+=c?";}":";",d+="return o;",d=d.replace(N,"#");try{return n=Function(l,d),n._slotCount=Math.floor(i.length/2),n}catch(u){throw Error(gt.format("Invalid template:'{0}' Generated code:'{1}'",e,d))}}},function(){function e(e){return a.lastIndex=0,a.test(e)?'"'+e.replace(a,function(e){var t=s[e];return typeof t===Et?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function t(o,a){var s,c,d,u,h,p,f=n,g=a[o];if(g&&typeof g===Pt&&typeof g.toJSON===At&&(g=g.toJSON(o)),typeof r===At&&(g=r.call(a,o,g)),p=typeof g,p===Et)return e(g);if(p===It)return isFinite(g)?g+"":Mt;if(p===Ft||p===Mt)return g+"";if(p===Pt){if(!g)return Mt;if(n+=i,h=[],"[object Array]"===l.apply(g)){for(u=g.length,s=0;u>s;s++)h[s]=t(s,g)||Mt;return d=0===h.length?"[]":n?"[\n"+n+h.join(",\n"+n)+"\n"+f+"]":"["+h.join(",")+"]",n=f,d}if(r&&typeof r===Pt)for(u=r.length,s=0;u>s;s++)typeof r[s]===Et&&(c=r[s],d=t(c,g),d&&h.push(e(c)+(n?": ":":")+d));else for(c in g)Object.hasOwnProperty.call(g,c)&&(d=t(c,g),d&&h.push(e(c)+(n?": ":":")+d));return d=0===h.length?"{}":n?"{\n"+n+h.join(",\n"+n)+"\n"+f+"}":"{"+h.join(",")+"}",n=f,d}}var n,i,r,a=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},l={}.toString;typeof Date.prototype.toJSON!==At&&(Date.prototype.toJSON=function(){var e=this;return isFinite(e.valueOf())?o(e.getUTCFullYear(),4)+"-"+o(e.getUTCMonth()+1)+"-"+o(e.getUTCDate())+"T"+o(e.getUTCHours())+":"+o(e.getUTCMinutes())+":"+o(e.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}),typeof kt.stringify!==At&&(kt.stringify=function(e,o,a){var s;if(n="",i="",typeof a===It)for(s=0;a>s;s+=1)i+=" ";else typeof a===Et&&(i=a);if(r=o,o&&typeof o!==At&&(typeof o!==Pt||typeof o.length!==It))throw Error("JSON.stringify");return t("",{"":e})})}(),function(){function t(e){if(e){if(e.numberFormat)return e;if(typeof e===Et){var t=gt.cultures;return t[e]||t[e.split("-")[0]]||null}return null}return null}function i(e){return e&&(e=t(e)),e||gt.cultures.current}function r(e){e.groupSizes=e.groupSize,e.percent.groupSizes=e.percent.groupSize,e.currency.groupSizes=e.currency.groupSize}function a(e,t,r){r=i(r);var a=r.calendars.standard,s=a.days,l=a.months;return t=a.patterns[t]||t,t.replace(d,function(t){var i,r,c;return"d"===t?r=e.getDate():"dd"===t?r=o(e.getDate()):"ddd"===t?r=s.namesAbbr[e.getDay()]:"dddd"===t?r=s.names[e.getDay()]:"M"===t?r=e.getMonth()+1:"MM"===t?r=o(e.getMonth()+1):"MMM"===t?r=l.namesAbbr[e.getMonth()]:"MMMM"===t?r=l.names[e.getMonth()]:"yy"===t?r=o(e.getFullYear()%100):"yyyy"===t?r=o(e.getFullYear(),4):"h"===t?r=e.getHours()%12||12:"hh"===t?r=o(e.getHours()%12||12):"H"===t?r=e.getHours():"HH"===t?r=o(e.getHours()):"m"===t?r=e.getMinutes():"mm"===t?r=o(e.getMinutes()):"s"===t?r=e.getSeconds():"ss"===t?r=o(e.getSeconds()):"f"===t?r=bt.floor(e.getMilliseconds()/100):"ff"===t?(r=e.getMilliseconds(),r>99&&(r=bt.floor(r/10)),r=o(r)):"fff"===t?r=o(e.getMilliseconds(),3):"tt"===t?r=e.getHours()<12?a.AM[0]:a.PM[0]:"zzz"===t?(i=e.getTimezoneOffset(),c=0>i,r=(""+bt.abs(i/60)).split(".")[0],i=bt.abs(i)-60*r,r=(c?"+":"-")+o(r),r+=":"+o(i)):("zz"===t||"z"===t)&&(r=e.getTimezoneOffset()/60,c=0>r,r=(""+bt.abs(r)).split(".")[0],r=(c?"+":"-")+("zz"===t?o(r):r)),r!==n?r:t.slice(1,t.length-1)})}function s(e,t,r){r=i(r);var o,a,s,c,d,y,b,k,x,C,T,S,D,A,E,I,P,M,F,z,R,B,H,L=r.numberFormat,N=L.groupSize[0],O=L[m],V=L[g],U=L.decimals,W=L.pattern[0],j=[],q=0>e,G=f,$=f,Y=-1;if(e===n)return f;if(!isFinite(e))return e;if(!t)return r.name.length?e.toLocaleString():""+e;if(d=u.exec(t)){if(t=d[1].toLowerCase(),a="c"===t,s="p"===t,(a||s)&&(L=a?L.currency:L.percent,N=L.groupSize[0],O=L[m],V=L[g],U=L.decimals,o=L.symbol,W=L.pattern[q?0:1]),c=d[2],c&&(U=+c),"e"===t)return c?e.toExponential(U):e.toExponential();if(s&&(e*=100),e=l(e,U),q=0>e,e=e.split(g),y=e[0],b=e[1],q&&(y=y.substring(1)),$=y,k=y.length,k>=N)for($=f,C=0;k>C;C++)C>0&&(k-C)%N===0&&($+=O),$+=y.charAt(C);if(b&&($+=V+b),"n"===t&&!q)return $;for(e=f,C=0,T=W.length;T>C;C++)S=W.charAt(C),e+="n"===S?$:"$"===S||"%"===S?o:S;return e}if(q&&(e=-e),(t.indexOf("'")>-1||t.indexOf('"')>-1||t.indexOf("\\")>-1)&&(t=t.replace(h,function(e){var t=e.charAt(0).replace("\\",""),n=e.slice(1).replace(t,"");return j.push(n),w})),t=t.split(";"),q&&t[1])t=t[1],A=!0;else if(0===e){if(t=t[2]||t[0],-1==t.indexOf(v)&&-1==t.indexOf(_))return t}else t=t[0];if(z=t.indexOf("%"),R=t.indexOf("$"),s=-1!=z,a=-1!=R,s&&(e*=100),a&&"\\"===t[R-1]&&(t=t.split("\\").join(""),a=!1),(a||s)&&(L=a?L.currency:L.percent,N=L.groupSize[0],O=L[m],V=L[g],U=L.decimals,o=L.symbol),D=t.indexOf(m)>-1,D&&(t=t.replace(p,f)),E=t.indexOf(g),T=t.length,-1!=E?(b=(""+e).split("e"),b=b[1]?l(e,Math.abs(b[1])):b[0],b=b.split(g)[1]||f,P=t.lastIndexOf(_)-E,I=t.lastIndexOf(v)-E,M=P>-1,F=I>-1,C=b.length,M||F||(t=t.substring(0,E)+t.substring(E+1),T=t.length,E=-1,C=0),M&&P>I?C=P:I>P&&(F&&C>I?C=I:M&&P>C&&(C=P)),C>-1&&(e=l(e,C))):e=l(e),I=t.indexOf(v),B=P=t.indexOf(_),Y=-1==I&&-1!=P?P:-1!=I&&-1==P?I:I>P?P:I,I=t.lastIndexOf(v),P=t.lastIndexOf(_),H=-1==I&&-1!=P?P:-1!=I&&-1==P?I:I>P?I:P,Y==T&&(H=Y),-1!=Y){if($=(""+e).split(g),y=$[0],b=$[1]||f,k=y.length,x=b.length,q&&-1*e>=0&&(q=!1),D)if(k===N&&E-B>k)y=O+y;else if(k>N){for($=f,C=0;k>C;C++)C>0&&(k-C)%N===0&&($+=O),$+=y.charAt(C);y=$}for(e=t.substring(0,Y),q&&!A&&(e+="-"),C=Y;T>C;C++){if(S=t.charAt(C),-1==E){if(k>H-C){e+=y;break}}else if(-1!=P&&C>P&&(G=f),k>=E-C&&E-C>-1&&(e+=y,C=E),E===C){e+=(b?V:f)+b,C+=H-E+1;continue}S===_?(e+=S,G=S):S===v&&(e+=G)}if(H>=Y&&(e+=t.substring(H+1)),a||s){for($=f,C=0,T=e.length;T>C;C++)S=e.charAt(C),$+="$"===S||"%"===S?o:S;e=$}if(T=j.length)for(C=0;T>C;C++)e=e.replace(w,j[C])}return e}var l,c,d=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|HH|H|hh|h|mm|m|fff|ff|f|tt|ss|s|zzz|zz|z|"[^"]*"|'[^']*'/g,u=/^(n|c|p|e)(\d*)$/i,h=/(\\.)|(['][^']*[']?)|(["][^"]*["]?)/g,p=/\,/g,f="",g=".",m=",",v="#",_="0",w="??",y="en-US",b={}.toString;gt.cultures["en-US"]={name:y,numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSize:[3],percent:{pattern:["-n %","n %"],decimals:2,",":",",".":".",groupSize:[3],symbol:"%"},currency:{pattern:["($n)","$n"],decimals:2,",":",",".":".",groupSize:[3],symbol:"$"}},calendars:{standard:{days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December"],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},AM:["AM","am","AM"],PM:["PM","pm","PM"],patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",F:"dddd, MMMM dd, yyyy h:mm:ss tt",g:"M/d/yyyy h:mm tt",G:"M/d/yyyy h:mm:ss tt",m:"MMMM dd",M:"MMMM dd",s:"yyyy'-'MM'-'ddTHH':'mm':'ss",t:"h:mm tt",T:"h:mm:ss tt",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM, yyyy",Y:"MMMM, yyyy"},"/":"/",":":":",firstDay:0,twoDigitYearMax:2029}}},gt.culture=function(e){var i,o=gt.cultures;return e===n?o.current:(i=t(e)||o[y],i.calendar=i.calendars.standard,o.current=i,Lt&&!Lt.load&&r(i.numberFormat),n)},gt.findCulture=t,gt.getCulture=i,gt.culture(y),l=function(e,t){return t=t||0,e=(""+e).split("e"),e=Math.round(+(e[0]+"e"+(e[1]?+e[1]+t:t))),e=(""+e).split("e"),e=+(e[0]+"e"+(e[1]?+e[1]-t:-t)),e.toFixed(t)},c=function(e,t,i){if(t){if("[object Date]"===b.call(e))return a(e,t,i);if(typeof e===It)return s(e,t,i)}return e!==n?e:""},Lt&&!Lt.load&&(c=function(t,n,i){return e.isPlainObject(i)&&(i=i.name),Lt.format(t,n,i)}),gt.format=function(e){var t=arguments;return e.replace(Tt,function(e,n,i){var r=t[parseInt(n,10)+1];return c(r,i?i.substring(1):"")})},gt._extractFormat=function(e){return"{0:"===e.slice(0,3)&&(e=e.slice(3,e.length-1)),e},gt._activeElement=function(){try{return document.activeElement}catch(e){return document.documentElement.activeElement}},gt._round=l,gt.toString=c}(),function(){function t(e,t,n){return!(e>=t&&n>=e)}function i(e){return e.charAt(0)}function r(t){return e.map(t,i)}function o(e,t){t||23!==e.getHours()||e.setHours(e.getHours()+2)}function a(e){for(var t=0,n=e.length,i=[];n>t;t++)i[t]=(e[t]+"").toLowerCase();return i}function s(e){var t,n={};for(t in e)n[t]=a(e[t]);return n}function l(e,i,a){if(!e)return null;var l,c,d,u,f,g,m,_,w,y,b,k,x,C=function(e){for(var t=0;i[B]===e;)t++,B++;return t>0&&(B-=1),t},T=function(t){var n=v[t]||RegExp("^\\d{1,"+t+"}"),i=e.substr(H,t).match(n);return i?(i=i[0],H+=i.length,parseInt(i,10)):null},S=function(t,n){for(var i,r,o,a=0,s=t.length;s>a;a++)if(i=t[a],r=i.length,o=e.substr(H,r),n&&(o=o.toLowerCase()),o==i)return H+=r,a+1;return null},D=function(){var t=!1;return e.charAt(H)===i[B]&&(H++,t=!0),t},A=a.calendars.standard,E=null,I=null,P=null,M=null,F=null,z=null,R=null,B=0,H=0,L=!1,N=new Date,O=A.twoDigitYearMax||2029,V=N.getFullYear();for(i||(i="d"),u=A.patterns[i],u&&(i=u),i=i.split(""),d=i.length;d>B;B++)if(l=i[B],L)"'"===l?L=!1:D();else if("d"===l){if(c=C("d"),A._lowerDays||(A._lowerDays=s(A.days)),P=3>c?T(2):S(A._lowerDays[3==c?"namesAbbr":"names"],!0),null===P||t(P,1,31))return null}else if("M"===l){if(c=C("M"),A._lowerMonths||(A._lowerMonths=s(A.months)),I=3>c?T(2):S(A._lowerMonths[3==c?"namesAbbr":"names"],!0),null===I||t(I,1,12))return null;I-=1}else if("y"===l){if(c=C("y"),E=T(c),null===E)return null;2==c&&("string"==typeof O&&(O=V+parseInt(O,10)),E=V-V%100+E,E>O&&(E-=100))}else if("h"===l){if(C("h"),M=T(2),12==M&&(M=0),null===M||t(M,0,11))return null}else if("H"===l){if(C("H"),M=T(2),null===M||t(M,0,23))return null}else if("m"===l){if(C("m"),F=T(2),null===F||t(F,0,59))return null}else if("s"===l){if(C("s"),z=T(2),null===z||t(z,0,59))return null}else if("f"===l){if(c=C("f"),x=e.substr(H,c).match(v[3]),R=T(c),null!==R&&(x=x[0].length,3>x&&(R*=Math.pow(10,3-x)),c>3&&(R=parseInt((""+R).substring(0,3),10))),null===R||t(R,0,999))return null}else if("t"===l){if(c=C("t"),_=A.AM,w=A.PM,1===c&&(_=r(_),w=r(w)),f=S(w),!f&&!S(_))return null}else if("z"===l){if(g=!0,c=C("z"),"Z"===e.substr(H,1)){D();continue}if(m=e.substr(H,6).match(c>2?p:h),!m)return null;if(m=m[0].split(":"),y=m[0],b=m[1],!b&&y.length>3&&(H=y.length-2,b=y.substring(H),y=y.substring(0,H)),y=parseInt(y,10),t(y,-12,13))return null;if(c>2&&(b=parseInt(b,10),isNaN(b)||t(b,0,59)))return null}else if("'"===l)L=!0,D();else if(!D())return null;return k=null!==M||null!==F||z||null,null===E&&null===I&&null===P&&k?(E=V,I=N.getMonth(),P=N.getDate()):(null===E&&(E=V),null===P&&(P=1)),f&&12>M&&(M+=12),g?(y&&(M+=-y),b&&(F+=-b),e=new Date(Date.UTC(E,I,P,M,F,z,R))):(e=new Date(E,I,P,M,F,z,R),o(e,M)),100>E&&e.setFullYear(E),e.getDate()!==P&&g===n?null:e}function c(e){var t="-"===e.substr(0,1)?-1:1;return e=e.substring(1),e=60*parseInt(e.substr(0,2),10)+parseInt(e.substring(2),10),t*e}var d=/\u00A0/g,u=/[eE][\-+]?[0-9]+/,h=/[+|\-]\d{1,2}/,p=/[+|\-]\d{1,2}:?\d{2}/,f=/^\/Date\((.*?)\)\/$/,g=/[+-]\d*/,m=["G","g","d","F","D","y","m","T","t"],v={2:/^\d{1,2}/,3:/^\d{1,3}/,4:/^\d{4}/},_={}.toString;gt.parseDate=function(e,t,n){var i,r,o,a,s;if("[object Date]"===_.call(e))return e;if(i=0,r=null,e&&0===e.indexOf("/D")&&(r=f.exec(e)))return r=r[1],s=g.exec(r.substring(1)),r=new Date(parseInt(r,10)),s&&(s=c(s[0]),r=gt.timezone.apply(r,0),r=gt.timezone.convert(r,0,-1*s)),r;if(n=gt.getCulture(n),!t){for(t=[],a=n.calendar.patterns,o=m.length;o>i;i++)t[i]=a[m[i]];i=0,t=["yyyy/MM/dd HH:mm:ss","yyyy/MM/dd HH:mm","yyyy/MM/dd","ddd MMM dd yyyy HH:mm:ss","yyyy-MM-ddTHH:mm:ss.fffffffzzz","yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mm:ss.fffffff","yyyy-MM-ddTHH:mm:ss.fff","yyyy-MM-ddTHH:mmzzz","yyyy-MM-ddTHH:mmzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","yyyy-MM-dd","HH:mm:ss","HH:mm"].concat(t)}for(t=_t(t)?t:[t],o=t.length;o>i;i++)if(r=l(e,t[i],n))return r;return r},gt.parseInt=function(e,t){var n=gt.parseFloat(e,t);return n&&(n=0|n),n},gt.parseFloat=function(e,t,n){if(!e&&0!==e)return null;if(typeof e===It)return e;e=""+e,t=gt.getCulture(t);var i,r,o=t.numberFormat,a=o.percent,s=o.currency,l=s.symbol,c=a.symbol,h=e.indexOf("-");return u.test(e)?(e=parseFloat(e.replace(o["."],".")),isNaN(e)&&(e=null),e):h>0?null:(h=h>-1,e.indexOf(l)>-1||n&&n.toLowerCase().indexOf("c")>-1?(o=s,i=o.pattern[0].replace("$",l).split("n"),e.indexOf(i[0])>-1&&e.indexOf(i[1])>-1&&(e=e.replace(i[0],"").replace(i[1],""),h=!0)):e.indexOf(c)>-1&&(r=!0,o=a,l=c),e=e.replace("-","").replace(l,"").replace(d," ").split(o[","].replace(d," ")).join("").replace(o["."],"."),e=parseFloat(e),isNaN(e)?e=null:h&&(e*=-1),e&&r&&(e/=100),e)},Lt&&!Lt.load&&(gt.parseDate=function(e,t,n){return"[object Date]"===_.call(e)?e:Lt.parseDate(e,t,n)},gt.parseFloat=function(t,i){return typeof t===It?t:t===n||null===t?null:(e.isPlainObject(i)&&(i=i.name),t=Lt.parseFloat(t,i),isNaN(t)?null:t)})}(),function(){var i,r,o,a,s,l,c;xt._scrollbar=n,xt.scrollbar=function(e){if(isNaN(xt._scrollbar)||e){var t,n=document.createElement("div");return n.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",n.innerHTML="&nbsp;",document.body.appendChild(n),xt._scrollbar=t=n.offsetWidth-n.scrollWidth,document.body.removeChild(n),t}return xt._scrollbar},xt.isRtl=function(t){return e(t).closest(".k-rtl").length>0},i=document.createElement("table");try{i.innerHTML="<tr><td></td></tr>",xt.tbodyInnerHtml=!0}catch(u){xt.tbodyInnerHtml=!1}xt.touch="ontouchstart"in t,xt.msPointers=t.MSPointerEvent,xt.pointers=t.PointerEvent,r=xt.transitions=!1,o=xt.transforms=!1,a="HTMLElement"in t?HTMLElement.prototype:[],xt.hasHW3D="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix||"MozPerspective"in document.documentElement.style||"msPerspective"in document.documentElement.style,vt(["Moz","webkit","O","ms"],function(){var e,t=""+this,a=typeof i.style[t+"Transition"]===Et;return a||typeof i.style[t+"Transform"]===Et?(e=t.toLowerCase(),o={css:"ms"!=e?"-"+e+"-":"",prefix:t,event:"o"===e||"webkit"===e?e:""},a&&(r=o,r.event=r.event?r.event+"TransitionEnd":"transitionend"),!1):n}),i=null,xt.transforms=o,xt.transitions=r,xt.devicePixelRatio=t.devicePixelRatio===n?1:t.devicePixelRatio;try{xt.screenWidth=t.outerWidth||t.screen?t.screen.availWidth:t.innerWidth,xt.screenHeight=t.outerHeight||t.screen?t.screen.availHeight:t.innerHeight}catch(u){xt.screenWidth=t.screen.availWidth,xt.screenHeight=t.screen.availHeight}xt.detectOS=function(e){var n,i,r=!1,o=[],a=!/mobile safari/i.test(e),s={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)\.(\d+(\.\d+)?)/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,meego:/(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,webos:/(webOS)\/(\d+)\.(\d+(\.\d+)?)/,blackberry:/(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i,ffos:/(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/},l={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,blackberry:/^blackberry|playbook/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i,meego:/meego/},c={tablet:/playbook|ipad|fire/i},u={omini:/Opera\sMini/i,omobile:/Opera\sMobi/i,firefox:/Firefox|Fennec/i,mobilesafari:/version\/.*safari/i,ie:/MSIE|Windows\sPhone/i,chrome:/chrome|crios/i,webkit:/webkit/i};for(i in s)if(s.hasOwnProperty(i)&&(o=e.match(s[i]))){if("windows"==i&&"plugins"in navigator)return!1;r={},r.device=i,r.tablet=d(i,c,!1),r.browser=d(e,u,"default"),r.name=d(i,l),r[r.name]=!0,r.majorVersion=o[2],r.minorVersion=o[3].replace("_","."),n=r.minorVersion.replace(".","").substr(0,2),r.flatVersion=r.majorVersion+n+Array(3-(3>n.length?n.length:2)).join("0"),r.cordova=typeof t.PhoneGap!==zt||typeof t.cordova!==zt,r.appMode=t.navigator.standalone||/file|local|wmapp/.test(t.location.protocol)||r.cordova,r.android&&(1.5>xt.devicePixelRatio&&400>r.flatVersion||a)&&(xt.screenWidth>800||xt.screenHeight>800)&&(r.tablet=i);break}return r},s=xt.mobileOS=xt.detectOS(navigator.userAgent),xt.wpDevicePixelRatio=s.wp?screen.width/320:0,xt.kineticScrollNeeded=s&&(xt.touch||xt.msPointers||xt.pointers),xt.hasNativeScrolling=!1,(s.ios||s.android&&s.majorVersion>2||s.wp)&&(xt.hasNativeScrolling=s),xt.mouseAndTouchPresent=xt.touch&&!(xt.mobileOS.ios||xt.mobileOS.android),xt.detectBrowser=function(e){var t,n=!1,i=[],r={webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i};for(t in r)if(r.hasOwnProperty(t)&&(i=e.match(r[t]))){n={},n[t]=!0,n[i[1].toLowerCase().split(" ")[0].split("/")[0]]=!0,n.version=parseInt(document.documentMode||i[2],10);break}return n},xt.browser=xt.detectBrowser(navigator.userAgent),xt.zoomLevel=function(){try{return xt.touch?document.documentElement.clientWidth/t.innerWidth:xt.browser.msie&&xt.browser.version>=10?(top||t).document.documentElement.offsetWidth/(top||t).innerWidth:1}catch(e){return 1}},xt.cssBorderSpacing=n!==document.documentElement.style.borderSpacing&&!(xt.browser.msie&&8>xt.browser.version),function(t){var n="",i=e(document.documentElement),r=parseInt(t.version,10);t.msie?n="ie":t.mozilla?n="ff":t.safari?n="safari":t.webkit?n="webkit":t.opera&&(n="opera"),n&&(n="k-"+n+" k-"+n+r),xt.mobileOS&&(n+=" k-mobile"),i.addClass(n)}(xt.browser),xt.eventCapture=document.documentElement.addEventListener,l=document.createElement("input"),xt.placeholder="placeholder"in l,xt.propertyChangeEvent="onpropertychange"in l,xt.input=function(){for(var e,t=["number","date","time","month","week","datetime","datetime-local"],n=t.length,i="test",r={},o=0;n>o;o++)e=t[o],l.setAttribute("type",e),l.value=i,r[e.replace("-","")]="text"!==l.type&&l.value!==i;return r}(),l.style.cssText="float:left;",xt.cssFloat=!!l.style.cssFloat,l=null,xt.stableSort=function(){var e,t=513,n=[{index:0,field:"b"}];for(e=1;t>e;e++)n.push({index:e,field:"a"});return n.sort(function(e,t){return e.field>t.field?1:t.field>e.field?-1:0}),1===n[0].index}(),xt.matchesSelector=a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.matchesSelector||a.matches||function(t){for(var n=document.querySelectorAll?(this.parentNode||document).querySelectorAll(t)||[]:e(t),i=n.length;i--;)if(n[i]==this)return!0;return!1},xt.pushState=t.history&&t.history.pushState,c=document.documentMode,xt.hashChange="onhashchange"in t&&!(xt.browser.msie&&(!c||8>=c))}(),V={left:{reverse:"right"},right:{reverse:"left"},down:{reverse:"up"},up:{reverse:"down"},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out"},out:{reverse:"in"}},U={},e.extend(U,{enabled:!0,Element:function(t){this.element=e(t)},promise:function(e,t){e.is(":visible")||e.css({display:e.data("olddisplay")||"block"}).css("display"),t.hide&&e.data("olddisplay",e.css("display")).hide(),t.init&&t.init(),t.completeCallback&&t.completeCallback(e),e.dequeue()},disable:function(){this.enabled=!1,this.promise=this.promiseShim},enable:function(){this.enabled=!0,this.promise=this.animatedPromise}}),U.promiseShim=U.promise,"kendoAnimate"in e.fn||mt(e.fn,{kendoStop:function(e,t){return this.stop(e,t)},kendoAnimate:function(e,t,n,i){return w(this,e,t,n,i)},kendoAddClass:function(e,t){return gt.toggleClass(this,e,t,!0)},kendoRemoveClass:function(e,t){return gt.toggleClass(this,e,t,!1)},kendoToggleClass:function(e,t,n){return gt.toggleClass(this,e,t,n)}}),W=/&/g,j=/</g,q=/"/g,G=/'/g,$=/>/g,Y=function(e){return e.target},xt.touch&&(Y=function(e){var t="originalEvent"in e?e.originalEvent.changedTouches:"changedTouches"in e?e.changedTouches:null;return t?document.elementFromPoint(t[0].clientX,t[0].clientY):e.target},vt(["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap"],function(t,n){e.fn[n]=function(e){return this.bind(n,e)}})),xt.touch?xt.mobileOS?(xt.mousedown="touchstart",xt.mouseup="touchend",xt.mousemove="touchmove",xt.mousecancel="touchcancel",xt.click="touchend",xt.resize="orientationchange"):(xt.mousedown="mousedown touchstart",xt.mouseup="mouseup touchend",xt.mousemove="mousemove touchmove",xt.mousecancel="mouseleave touchcancel",xt.click="click",xt.resize="resize"):xt.pointers?(xt.mousemove="pointermove",xt.mousedown="pointerdown",xt.mouseup="pointerup",xt.mousecancel="pointercancel",xt.click="pointerup",xt.resize="orientationchange resize"):xt.msPointers?(xt.mousemove="MSPointerMove",xt.mousedown="MSPointerDown",xt.mouseup="MSPointerUp",xt.mousecancel="MSPointerCancel",xt.click="MSPointerUp",xt.resize="orientationchange resize"):(xt.mousemove="mousemove",xt.mousedown="mousedown",xt.mouseup="mouseup",xt.mousecancel="mouseleave",xt.click="click",xt.resize="resize"),Q=function(e,t){var n,i,r,o,a=t||"d",s=1;for(i=0,r=e.length;r>i;i++)o=e[i],""!==o&&(n=o.indexOf("["),0!==n&&(-1==n?o="."+o:(s++,o="."+o.substring(0,n)+" || {})"+o.substring(n))),s++,a+=o+(r-1>i?" || {})":")"));return Array(s).join("(")+a},K=/^([a-z]+:)?\/\//i,mt(gt,{ui:gt.ui||{},fx:gt.fx||v,effects:gt.effects||U,mobile:gt.mobile||{},data:gt.data||{},dataviz:gt.dataviz||{},keys:{INSERT:45,DELETE:46,BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,END:35,HOME:36,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F2:113,F10:121,F12:123,NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DOT:110},support:gt.support||xt,animate:gt.animate||w,ns:"",attr:function(e){return"data-"+gt.ns+e},getShadows:a,wrap:s,deepExtend:l,getComputedStyles:p,size:f,toCamelCase:h,toHyphens:u,getOffset:gt.getOffset||g,parseEffects:gt.parseEffects||m,toggleClass:gt.toggleClass||y,directions:gt.directions||V,Observable:F,Class:i,Template:E,template:wt(E.compile,E),render:wt(E.render,E),stringify:wt(kt.stringify,kt),eventTarget:Y,htmlEncode:b,isLocalUrl:function(e){return e&&!K.test(e)},expr:function(e,t,n){return e=e||"",typeof t==Et&&(n=t,t=!1),n=n||"d",e&&"["!==e.charAt(0)&&(e="."+e),e=t?Q(e.split("."),n):n+e},getter:function(e,t){var n=e+t;return Rt[n]=Rt[n]||Function("d","return "+gt.expr(e,t))},setter:function(e){return Bt[e]=Bt[e]||Function("d,value",gt.expr(e)+"=value")},accessor:function(e){return{get:gt.getter(e),set:gt.setter(e)}},guid:function(){var e,t,n="";for(e=0;32>e;e++)t=16*bt.random()|0,(8==e||12==e||16==e||20==e)&&(n+="-"),n+=(12==e?4:16==e?3&t|8:t).toString(16);return n},roleSelector:function(e){return e.replace(/(\S+)/g,"["+gt.attr("role")+"=$1],").slice(0,-1)},directiveSelector:function(e){var t,n=e.split(" ");if(n)for(t=0;n.length>t;t++)"view"!=n[t]&&(n[t]=n[t].replace(/(\w*)(view|bar|strip|over)$/,"$1-$2"));return n.join(" ").replace(/(\S+)/g,"kendo-mobile-$1,").slice(0,-1)},triggeredByInput:function(e){return/^(label|input|textarea|select)$/i.test(e.target.tagName)},logToConsole:function(e){var i=t.console;!gt.suppressLog&&n!==i&&i.log&&i.log(e)}}),X=F.extend({init:function(e,t){var n,i=this;i.element=gt.jQuery(e).handler(i),i.angular("init",t),F.fn.init.call(i),n=t?t.dataSource:null,n&&(t=mt({},t,{dataSource:{}})),t=i.options=mt(!0,{},i.options,t),n&&(t.dataSource=n),i.element.attr(gt.attr("role"))||i.element.attr(gt.attr("role"),(t.name||"").toLowerCase()),i.element.data("kendo"+t.prefix+t.name,i),i.bind(i.events,t)},events:[],options:{prefix:""},_hasBindingTarget:function(){return!!this.element[0].kendoBindingTarget},_tabindex:function(e){e=e||this.wrapper;var t=this.element,n="tabindex",i=e.attr(n)||t.attr(n);t.removeAttr(n),e.attr(n,isNaN(i)?0:i)},setOptions:function(t){this._setEvents(t),e.extend(this.options,t)},_setEvents:function(e){for(var t,n=this,i=0,r=n.events.length;r>i;i++)t=n.events[i],n.options[t]&&e[t]&&n.unbind(t,n.options[t]);n.bind(n.events,e)},resize:function(e){var t=this.getSize(),n=this._size;(e||!n||t.width!==n.width||t.height!==n.height)&&(this._size=t,this._resize(t),this.trigger("resize",t))},getSize:function(){return gt.dimensions(this.element)},size:function(e){return e?(this.setSize(e),n):this.getSize()},setSize:e.noop,_resize:e.noop,destroy:function(){var e=this;e.element.removeData("kendo"+e.options.prefix+e.options.name),e.element.removeData("handler"),e.unbind()},angular:function(){}}),Z=X.extend({dataItems:function(){return this.dataSource.flatView()},_angularItems:function(t){var n=this;n.angular(t,function(){return{elements:n.items(),data:e.map(n.dataItems(),function(e){return{dataItem:e}})}})}}),gt.dimensions=function(e,t){var n=e[0];return t&&e.css(t),{width:n.offsetWidth,height:n.offsetHeight}},gt.notify=yt,J=/template$/i,et=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,tt=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]*\]$/,nt=/([A-Z])/g,gt.initWidget=function(i,r,o){var a,s,l,c,d,u,h,p,f,g,m,v,_;if(o?o.roles&&(o=o.roles):o=gt.ui.roles,i=i.nodeType?i:i[0],u=i.getAttribute("data-"+gt.ns+"role")){f=-1===u.indexOf("."),l=f?o[u]:gt.getter(u)(t),m=e(i).data(),v=l?"kendo"+l.fn.options.prefix+l.fn.options.name:"",g=f?RegExp("^kendo.*"+u+"$","i"):RegExp("^"+v+"$","i");
for(_ in m)if(_.match(g)){if(_!==v)return m[_];a=m[_]}if(l){for(p=k(i,"dataSource"),r=e.extend({},x(i,l.fn.options),r),p&&(r.dataSource=typeof p===Et?gt.getter(p)(t):p),c=0,d=l.fn.events.length;d>c;c++)s=l.fn.events[c],h=k(i,s),h!==n&&(r[s]=gt.getter(h)(t));return a?e.isEmptyObject(r)||a.setOptions(r):a=new l(i,r),a}}},gt.rolesFromNamespaces=function(e){var t,n,i=[];for(e[0]||(e=[gt.ui,gt.dataviz.ui]),t=0,n=e.length;n>t;t++)i[t]=e[t].roles;return mt.apply(null,[{}].concat(i.reverse()))},gt.init=function(t){var n=gt.rolesFromNamespaces(Ht.call(arguments,1));e(t).find("[data-"+gt.ns+"role]").addBack().each(function(){gt.initWidget(this,{},n)})},gt.destroy=function(t){e(t).find("[data-"+gt.ns+"role]").addBack().each(function(){var t,n=e(this).data();for(t in n)0===t.indexOf("kendo")&&typeof n[t].destroy===At&&n[t].destroy()})},gt.resize=function(t,n){var i,r=e(t).find("[data-"+gt.ns+"role]").addBack().filter(T);r.length&&(i=e.makeArray(r),i.sort(C),e.each(i,function(){var t=gt.widgetInstance(e(this));t&&t.resize(n)}))},gt.parseOptions=x,mt(gt.ui,{Widget:X,DataBoundWidget:Z,roles:{},progress:function(t,n){var i,r,o,a,s=t.find(".k-loading-mask"),l=gt.support,c=l.browser;n?s.length||(i=l.isRtl(t),r=i?"right":"left",a=t.scrollLeft(),o=c.webkit&&i?t[0].scrollWidth-t.width()-2*a:0,s=e("<div class='k-loading-mask'><span class='k-loading-text'>Loading...</span><div class='k-loading-image'/><div class='k-loading-color'/></div>").width("100%").height("100%").css("top",t.scrollTop()).css(r,Math.abs(a)+o).prependTo(t)):s&&s.remove()},plugin:function(t,i,r){var o,a=t.fn.options.name;i=i||gt.ui,r=r||"",i[a]=t,i.roles[a.toLowerCase()]=t,o="getKendo"+r+a,a="kendo"+r+a,e.fn[a]=function(i){var r,o=this;return typeof i===Et?(r=Ht.call(arguments,1),this.each(function(){var t,s,l=e.data(this,a);if(!l)throw Error(gt.format("Cannot call method '{0}' of {1} before it is initialized",i,a));if(t=l[i],typeof t!==At)throw Error(gt.format("Cannot find method '{0}' of {1}",i,a));return s=t.apply(l,r),s!==n?(o=s,!1):n})):this.each(function(){new t(this,i)}),o},e.fn[a].widget=t,e.fn[o]=function(){return this.data(a)}}}),it={bind:function(){return this},nullObject:!0,options:{}},rt=X.extend({init:function(e,t){X.fn.init.call(this,e,t),this.element.autoApplyNS(),this.wrapper=this.element,this.element.addClass("km-widget")},destroy:function(){X.fn.destroy.call(this),this.element.kendoDestroy()},options:{prefix:"Mobile"},events:[],view:function(){var e=this.element.closest(gt.roleSelector("view splitview modalview drawer"));return gt.widgetInstance(e,gt.mobile.ui)||it},viewHasNativeScrolling:function(){var e=this.view();return e&&e.options.useNativeScrolling},container:function(){var e=this.element.closest(gt.roleSelector("view layout modalview drawer splitview"));return gt.widgetInstance(e.eq(0),gt.mobile.ui)||it}}),mt(gt.mobile,{init:function(e){gt.init(e,gt.mobile.ui,gt.ui,gt.dataviz.ui)},appLevelNativeScrolling:function(){return gt.mobile.application&&gt.mobile.application.options&&gt.mobile.application.options.useNativeScrolling},roles:{},ui:{Widget:rt,DataBoundWidget:Z.extend(rt.prototype),roles:{},plugin:function(e){gt.ui.plugin(e,gt.mobile.ui,"Mobile")}}}),l(gt.dataviz,{init:function(e){gt.init(e,gt.dataviz.ui)},ui:{roles:{},themes:{},views:[],plugin:function(e){gt.ui.plugin(e,gt.dataviz.ui)}},roles:{}}),gt.touchScroller=function(t,n){return e(t).map(function(t,i){return i=e(i),xt.kineticScrollNeeded&&gt.mobile.ui.Scroller&&!i.data("kendoMobileScroller")?(i.kendoMobileScroller(n),i.data("kendoMobileScroller")):!1})[0]},gt.preventDefault=function(e){e.preventDefault()},gt.widgetInstance=function(e,n){var i,r,o,a,s=e.data(gt.ns+"role"),l=[];if(s){if("content"===s&&(s="scroller"),n)if(n[0])for(i=0,r=n.length;r>i;i++)l.push(n[i].roles[s]);else l.push(n.roles[s]);else l=[gt.ui.roles[s],gt.dataviz.ui.roles[s],gt.mobile.ui.roles[s]];for(s.indexOf(".")>=0&&(l=[gt.getter(s)(t)]),i=0,r=l.length;r>i;i++)if(o=l[i],o&&(a=e.data("kendo"+o.fn.options.prefix+o.fn.options.name)))return a}},gt.onResize=function(n){var i=n;return xt.mobileOS.android&&(i=function(){setTimeout(n,600)}),e(t).on(xt.resize,i),i},gt.unbindResize=function(n){e(t).off(xt.resize,n)},gt.attrValue=function(e,t){return e.data(gt.ns+t)},gt.days={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},e.extend(e.expr[":"],{kendoFocusable:function(t){var n=e.attr(t,"tabindex");return S(t,!isNaN(n)&&n>-1)}}),ot=["mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","click"],at="label, input, [data-rel=external]",st={setupMouseMute:function(){var t,n=0,i=ot.length,r=document.documentElement;if(!st.mouseTrap&&xt.eventCapture)for(st.mouseTrap=!0,st.bustClick=!1,st.captureMouse=!1,t=function(t){st.captureMouse&&("click"===t.type?st.bustClick&&!e(t.target).is(at)&&(t.preventDefault(),t.stopPropagation()):t.stopPropagation())};i>n;n++)r.addEventListener(ot[n],t,!0)},muteMouse:function(e){st.captureMouse=!0,e.data.bustClick&&(st.bustClick=!0),clearTimeout(st.mouseTrapTimeoutID)},unMuteMouse:function(){clearTimeout(st.mouseTrapTimeoutID),st.mouseTrapTimeoutID=setTimeout(function(){st.captureMouse=!1,st.bustClick=!1},400)}},lt={down:"touchstart mousedown",move:"mousemove touchmove",up:"mouseup touchend touchcancel",cancel:"mouseleave touchcancel"},xt.touch&&(xt.mobileOS.ios||xt.mobileOS.android)?lt={down:"touchstart",move:"touchmove",up:"touchend touchcancel",cancel:"touchcancel"}:xt.pointers?lt={down:"pointerdown",move:"pointermove",up:"pointerup",cancel:"pointercancel pointerleave"}:xt.msPointers&&(lt={down:"MSPointerDown",move:"MSPointerMove",up:"MSPointerUp",cancel:"MSPointerCancel MSPointerLeave"}),!xt.msPointers||"onmspointerenter"in t||e.each({MSPointerEnter:"MSPointerOver",MSPointerLeave:"MSPointerOut"},function(t,n){e.event.special[t]={delegateType:n,bindType:n,handle:function(t){var i,r=this,o=t.relatedTarget,a=t.handleObj;return(!o||o!==r&&!e.contains(r,o))&&(t.type=a.origType,i=a.handler.apply(this,arguments),t.type=n),i}}}),ct=function(e){return lt[e]||e},dt=/([^ ]+)/g,gt.applyEventMap=function(e,t){return e=e.replace(dt,ct),t&&(e=e.replace(dt,"$1."+t)),e},ut=e.fn.on,mt(!0,A,e),A.fn=A.prototype=new e,A.fn.constructor=A,A.fn.init=function(t,n){return n&&n instanceof e&&!(n instanceof A)&&(n=A(n)),e.fn.init.call(this,t,n,ht)},A.fn.init.prototype=A.fn,ht=A(document),mt(A.fn,{handler:function(e){return this.data("handler",e),this},autoApplyNS:function(e){return this.data("kendoNS",e||gt.guid()),this},on:function(){var e,t,n,i,r,o,a=this,s=a.data("kendoNS");return 1===arguments.length?ut.call(a,arguments[0]):(e=a,t=Ht.call(arguments),typeof t[t.length-1]===zt&&t.pop(),n=t[t.length-1],i=gt.applyEventMap(t[0],s),xt.mouseAndTouchPresent&&i.search(/mouse|click/)>-1&&this[0]!==document.documentElement&&(st.setupMouseMute(),r=2===t.length?null:t[1],o=i.indexOf("click")>-1&&i.indexOf("touchend")>-1,ut.call(this,{touchstart:st.muteMouse,touchend:st.unMuteMouse},r,{bustClick:o})),typeof n===Et&&(e=a.data("handler"),n=e[n],t[t.length-1]=function(t){n.call(e,t)}),t[0]=i,ut.apply(a,t),a)},kendoDestroy:function(e){return e=e||this.data("kendoNS"),e&&this.off("."+e),this}}),gt.jQuery=A,gt.eventMap=lt,gt.timezone=function(){function e(e,t){var n,i,r,o=t[3],a=t[4],s=t[5],l=t[8];return l||(t[8]=l={}),l[e]?l[e]:(isNaN(a)?0===a.indexOf("last")?(n=new Date(Date.UTC(e,d[o]+1,1,s[0]-24,s[1],s[2],0)),i=u[a.substr(4,3)],r=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+i-r-(i>r?7:0))):a.indexOf(">=")>=0&&(n=new Date(Date.UTC(e,d[o],a.substr(5),s[0],s[1],s[2],0)),i=u[a.substr(0,3)],r=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+i-r+(r>i?7:0))):n=new Date(Date.UTC(e,d[o],a,s[0],s[1],s[2],0)),l[e]=n)}function t(t,n,i){var r,o,a,s;return(n=n[i])?(a=new Date(t).getUTCFullYear(),n=jQuery.grep(n,function(e){var t=e[0],n=e[1];return a>=t&&(n>=a||t==a&&"only"==n||"max"==n)}),n.push(t),n.sort(function(t,n){return"number"!=typeof t&&(t=+e(a,t)),"number"!=typeof n&&(n=+e(a,n)),t-n}),s=n[jQuery.inArray(t,n)-1]||n[n.length-1],isNaN(s)?s:null):(r=i.split(":"),o=0,r.length>1&&(o=60*r[0]+ +r[1]),[-1e6,"max","-","Jan",1,[0,0,0],o,"-"])}function n(e,t,n){var i,r,o,a=t[n];if("string"==typeof a&&(a=t[a]),!a)throw Error('Timezone "'+n+'" is either incorrect, or kendo.timezones.min.js is not included.');for(i=a.length-1;i>=0&&(r=a[i][3],!(r&&e>r));i--);if(o=a[i+1],!o)throw Error('Timezone "'+n+'" not found on '+e+".");return o}function i(e,i,r,o){typeof e!=It&&(e=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));var a=n(e,i,o);return{zone:a,rule:t(e,r,a[1])}}function r(e,t){var n,r,o;return"Etc/UTC"==t||"Etc/GMT"==t?0:(n=i(e,this.zones,this.rules,t),r=n.zone,o=n.rule,gt.parseFloat(o?r[0]-o[6]:r[0]))}function o(e,t){var n=i(e,this.zones,this.rules,t),r=n.zone,o=n.rule,a=r[2];return a.indexOf("/")>=0?a.split("/")[o&&+o[6]?1:0]:a.indexOf("%s")>=0?a.replace("%s",o&&"-"!=o[7]?o[7]:""):a}function a(e,t,n){var i,r;return typeof t==Et&&(t=this.offset(e,t)),typeof n==Et&&(n=this.offset(e,n)),i=e.getTimezoneOffset(),e=new Date(e.getTime()+6e4*(t-n)),r=e.getTimezoneOffset(),new Date(e.getTime()+6e4*(r-i))}function s(e,t){return this.convert(e,e.getTimezoneOffset(),t)}function l(e,t){return this.convert(e,t,e.getTimezoneOffset())}function c(e){return this.apply(new Date(e),"Etc/UTC")}var d={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},u={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};return{zones:{},rules:{},offset:r,convert:a,apply:s,remove:l,abbr:o,toLocalDate:c}}(),gt.date=function(){function e(e,t){return 0===t&&23===e.getHours()?(e.setHours(e.getHours()+2),!0):!1}function t(t,n,i){var r=t.getHours();i=i||1,n=(n-t.getDay()+7*i)%7,t.setDate(t.getDate()+n),e(t,r)}function n(e,n,i){return e=new Date(e),t(e,n,i),e}function i(e){return new Date(e.getFullYear(),e.getMonth(),1)}function r(e){var t=new Date(e.getFullYear(),e.getMonth()+1,0),n=i(e),r=Math.abs(t.getTimezoneOffset()-n.getTimezoneOffset());return r&&t.setHours(n.getHours()+r/60),t}function o(t){return t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),e(t,0),t}function a(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function s(e){return e.getTime()-o(e)}function l(e,t,n){var i,r=s(t),o=s(n);return e&&r!=o?(t>=n&&(n+=m),i=s(e),r>i&&(i+=m),r>o&&(o+=m),i>=r&&o>=i):!0}function c(e,t,n){var i,r=t.getTime(),o=n.getTime();return r>=o&&(o+=m),i=e.getTime(),i>=r&&o>=i}function d(t,n){var i=t.getHours();return t=new Date(t),u(t,n*m),e(t,i),t}function u(e,t,n){var i,r=e.getTimezoneOffset();e.setTime(e.getTime()+t),n||(i=e.getTimezoneOffset()-r,e.setTime(e.getTime()+i*g))}function h(){return o(new Date)}function p(e){return o(e).getTime()==h().getTime()}function f(e){var t=new Date(1980,1,1,0,0,0);return e&&t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}var g=6e4,m=864e5;return{adjustDST:e,dayOfWeek:n,setDayOfWeek:t,getDate:o,isInDateRange:c,isInTimeRange:l,isToday:p,nextDay:function(e){return d(e,1)},previousDay:function(e){return d(e,-1)},toUtcTime:a,MS_PER_DAY:m,MS_PER_HOUR:60*g,MS_PER_MINUTE:g,setTime:u,addDays:d,today:h,toInvariantTime:f,firstDayOfMonth:i,lastDayOfMonth:r,getMilliseconds:s}}(),gt.stripWhitespace=function(e){var t,n,i;if(document.createNodeIterator)for(t=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,function(t){return t.parentNode==e?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},!1);t.nextNode();)t.referenceNode&&!t.referenceNode.textContent.trim()&&t.referenceNode.parentNode.removeChild(t.referenceNode);else for(n=0;e.childNodes.length>n;n++)i=e.childNodes[n],3!=i.nodeType||/\S/.test(i.nodeValue)||(e.removeChild(i),n--),1==i.nodeType&&gt.stripWhitespace(i)},pt=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},gt.animationFrame=function(e){pt.call(t,e)},ft=[],gt.queueAnimation=function(e){ft[ft.length]=e,1===ft.length&&gt.runNextAnimation()},gt.runNextAnimation=function(){gt.animationFrame(function(){ft[0]&&(ft.shift()(),ft[0]&&gt.runNextAnimation())})},gt.parseQueryStringParams=function(e){for(var t=e.split("?")[1]||"",n={},i=t.split(/&|=/),r=i.length,o=0;r>o;o+=2)""!==i[o]&&(n[decodeURIComponent(i[o])]=decodeURIComponent(i[o+1]));return n},gt.elementUnderCursor=function(e){return document.elementFromPoint(e.x.client,e.y.client)},gt.wheelDeltaY=function(e){var t,i=e.originalEvent,r=i.wheelDeltaY;return i.wheelDelta?(r===n||r)&&(t=i.wheelDelta):i.detail&&i.axis===i.VERTICAL_AXIS&&(t=10*-i.detail),t},gt.throttle=function(e,t){var i,r,o=0;return!t||0>=t?e:(r=function(){function r(){e.apply(a,l),o=+new Date}var a=this,s=+new Date-o,l=arguments;return o?(i&&clearTimeout(i),s>t?r():i=setTimeout(r,t-s),n):r()},r.cancel=function(){clearTimeout(i)},r)},gt.caret=function(t,i,r){var o,a,s,l,c=i!==n;if(r===n&&(r=i),t[0]&&(t=t[0]),!c||!t.disabled){try{t.selectionStart!==n?c?(t.focus(),t.setSelectionRange(i,r)):i=[t.selectionStart,t.selectionEnd]:document.selection&&(e(t).is(":visible")&&t.focus(),o=t.createTextRange(),c?(o.collapse(!0),o.moveStart("character",i),o.moveEnd("character",r-i),o.select()):(a=o.duplicate(),o.moveToBookmark(document.selection.createRange().getBookmark()),a.setEndPoint("EndToStart",o),s=a.text.length,l=s+o.text.length,i=[s,l]))}catch(d){i=[]}return i}},gt.compileMobileDirective=function(e,n){var i=t.angular;return e.attr("data-"+gt.ns+"role",e[0].tagName.toLowerCase().replace("kendo-mobile-","").replace("-","")),i.element(e).injector().invoke(["$compile",function(t){var r=i.element(e).scope();n&&n(r),t(e)(r),/^\$(digest|apply)$/.test(r.$$phase)||r.$digest()}]),gt.widgetInstance(e,gt.mobile.ui)},gt.antiForgeryTokens=function(){var t={},i=e("meta[name=csrf-token]").attr("content"),r=e("meta[name=csrf-param]").attr("content");return e("input[name^='__RequestVerificationToken']").each(function(){t[this.name]=this.value}),r!==n&&i!==n&&(t[r]=i),t},function(){function n(t,n,i){var r,o,a=e("<form>").attr({action:i,method:"POST"}),s=gt.antiForgeryTokens();s.fileName=n,r=t.split(";base64,"),s.contentType=r[0].replace("data:",""),s.base64=r[1];for(o in s)s.hasOwnProperty(o)&&e("<input>").attr({value:s[o],name:o,type:"hidden"}).appendTo(a);a.appendTo("body").submit().remove()}function i(e,t){var n,i,r,o,a,s=e;if("string"==typeof e){for(n=e.split(";base64,"),i=n[0],r=atob(n[1]),o=new Uint8Array(r.length),a=0;r.length>a;a++)o[a]=r.charCodeAt(a);s=new Blob([o.buffer],{type:i})}navigator.msSaveBlob(s,t)}function r(e,n){t.Blob&&e instanceof Blob&&(e=URL.createObjectURL(e)),o.download=n,o.href=e;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),o.dispatchEvent(i)}var o=document.createElement("a"),a="download"in o;gt.saveAs=function(e){var t=n;e.forceProxy||(a?t=r:navigator.msSaveBlob&&(t=i)),t(e.dataURI,e.fileName,e.proxyURL)}}()}(jQuery,window),function(e,t){function n(e,t){if(!t)return e;e+"/"===t&&(e=t);var n=RegExp("^"+t,"i");return n.test(e)||(e=t+"/"+e),p.protocol+"//"+(p.host+"/"+e).replace(/\/\/+/g,"/")}function i(e){return e?"#!":"#"}function r(e){var t=p.href;return"#!"===e&&t.indexOf("#")>-1&&t.indexOf("#!")<0?null:t.split(e)[1]||""}function o(e,t){return 0===t.indexOf(e)?t.substr(e.length).replace(/\/\//g,"/"):t}function a(e){return e.replace(/^(#)?/,"#")}function s(e){return e.replace(/^(#(!)?)?/,"#!")}var l=window.kendo,c="change",d="back",u="same",h=l.support,p=window.location,f=window.history,g=50,m=l.support.browser.msie,v=/^#*/,_=window.document,w=l.Class.extend({back:function(){m?setTimeout(function(){f.back()}):f.back()},forward:function(){m?setTimeout(function(){f.forward()}):f.forward()},length:function(){return f.length},replaceLocation:function(e){p.replace(e)}}),y=w.extend({init:function(e){this.root=e},navigate:function(e){f.pushState({},_.title,n(e,this.root))},replace:function(e){f.replaceState({},_.title,n(e,this.root))},normalize:function(e){return o(this.root,e)},current:function(){var e=p.pathname;return p.search&&(e+=p.search),o(this.root,e)},change:function(t){e(window).bind("popstate.kendo",t)},stop:function(){e(window).unbind("popstate.kendo")},normalizeCurrent:function(e){var t,o=e.root,a=p.pathname,s=r(i(e.hashBang));o===a+"/"&&(t=o),o===a&&s&&(t=n(s.replace(v,""),o)),t&&f.pushState({},_.title,t)}}),b=w.extend({init:function(e){this._id=l.guid(),this.prefix=i(e),this.fix=e?s:a},navigate:function(e){p.hash=this.fix(e)},replace:function(e){this.replaceLocation(this.fix(e))},normalize:function(e){return e.indexOf(this.prefix)<0?e:e.split(this.prefix)[1]},change:function(t){h.hashChange?e(window).on("hashchange."+this._id,t):this._interval=setInterval(t,g)},stop:function(){e(window).off("hashchange."+this._id),clearInterval(this._interval)},current:function(){return r(this.prefix)},normalizeCurrent:function(e){var t=p.pathname,n=e.root;return e.pushState&&n!==t?(this.replaceLocation(n+this.prefix+o(n,t)),!0):!1}}),k=l.Observable.extend({start:function(t){if(t=t||{},this.bind([c,d,u],t),!this._started){this._started=!0,t.root=t.root||"/";var n,i=this.createAdapter(t);i.normalizeCurrent(t)||(n=i.current(),e.extend(this,{adapter:i,root:t.root,historyLength:i.length(),current:n,locations:[n]}),i.change(e.proxy(this,"_checkUrl")))}},createAdapter:function(e){return h.pushState&&e.pushState?new y(e.root):new b(e.hashBang)},stop:function(){this._started&&(this.adapter.stop(),this.unbind(c),this._started=!1)},change:function(e){this.bind(c,e)},replace:function(e,t){this._navigate(e,t,function(t){t.replace(e),this.locations[this.locations.length-1]=this.current})},navigate:function(e,n){return"#:back"===e?(this.backCalled=!0,this.adapter.back(),t):(this._navigate(e,n,function(t){t.navigate(e),this.locations.push(this.current)}),t)},_navigate:function(e,n,i){var r=this.adapter;return e=r.normalize(e),this.current===e||this.current===decodeURIComponent(e)?(this.trigger(u),t):((n||!this.trigger(c,{url:e}))&&(this.current=e,i.call(this,r),this.historyLength=r.length()),t)},_checkUrl:function(){var e=this.adapter,n=e.current(),i=e.length(),r=this.historyLength===i,o=n===this.locations[this.locations.length-2]&&r,a=this.backCalled,s=this.current;return null===n||this.current===n||this.current===decodeURIComponent(n)?!0:(this.historyLength=i,this.backCalled=!1,this.current=n,o&&this.trigger("back",{url:s,to:n})?(e.forward(),this.current=s,t):this.trigger(c,{url:n,backButtonPressed:!a})?(o?e.forward():(e.back(),this.historyLength--),this.current=s,t):(o?this.locations.pop():this.locations.push(n),t))}});l.History=k,l.History.HistoryAdapter=w,l.History.HashAdapter=b,l.History.PushStateAdapter=y,l.absoluteURL=n,l.history=new k}(window.kendo.jQuery),function(){function e(e,t){return t?e:"([^/]+)"}function t(t,n){return RegExp("^"+t.replace(f,"\\$&").replace(u,"(?:$1)?").replace(h,e).replace(p,"(.*?)")+"$",n?"i":"")}function n(e){return e.replace(/(\?.*)|(#.*)/g,"")}var i=window.kendo,r=i.history,o=i.Observable,a="init",s="routeMissing",l="change",c="back",d="same",u=/\((.*?)\)/g,h=/(\(\?)?:\w+/g,p=/\*\w+/g,f=/[\-{}\[\]+?.,\\\^$|#\s]/g,g=i.Class.extend({init:function(e,n,i){e instanceof RegExp||(e=t(e,i)),this.route=e,this._callback=n},callback:function(e){var t,r,o=0,a=i.parseQueryStringParams(e);for(e=n(e),t=this.route.exec(e).slice(1),r=t.length;r>o;o++)void 0!==t[o]&&(t[o]=decodeURIComponent(t[o]));t.push(a),this._callback.apply(null,t)},worksWith:function(e){return this.route.test(n(e))?(this.callback(e),!0):!1}}),m=o.extend({init:function(e){e||(e={}),o.fn.init.call(this),this.routes=[],this.pushState=e.pushState,this.hashBang=e.hashBang,this.root=e.root,this.ignoreCase=e.ignoreCase!==!1,this.bind([a,s,l,d],e)},destroy:function(){r.unbind(l,this._urlChangedProxy),r.unbind(d,this._sameProxy),r.unbind(c,this._backProxy),this.unbind()},start:function(){var e,t=this,n=function(){t._same()},i=function(e){t._back(e)},o=function(e){t._urlChanged(e)};r.start({same:n,change:o,back:i,pushState:t.pushState,hashBang:t.hashBang,root:t.root}),e={url:r.current||"/",preventDefault:$.noop},t.trigger(a,e)||t._urlChanged(e),this._urlChangedProxy=o,this._backProxy=i},route:function(e,t){this.routes.push(new g(e,t,this.ignoreCase))},navigate:function(e,t){i.history.navigate(e,t)},replace:function(e,t){i.history.replace(e,t)},_back:function(e){this.trigger(c,{url:e.url,to:e.to})&&e.preventDefault()},_same:function(){this.trigger(d)},_urlChanged:function(e){var t,n,r,o,a=e.url;if(a||(a="/"),this.trigger(l,{url:e.url,params:i.parseQueryStringParams(e.url),backButtonPressed:e.backButtonPressed}))return void e.preventDefault();for(t=0,n=this.routes,o=n.length;o>t;t++)if(r=n[t],r.worksWith(a))return;this.trigger(s,{url:a,params:i.parseQueryStringParams(a),backButtonPressed:e.backButtonPressed})&&e.preventDefault()}});i.Router=m}(),function(e,t){function n(i,o){var l,c,d,u,h,p,f,g,m=[],v=i.logic||"and",_=i.filters;for(l=0,c=_.length;c>l;l++)i=_[l],d=i.field,f=i.value,p=i.operator,i.filters?i=n(i,o):(g=i.ignoreCase,d=d.replace(/\./g,"/"),i=a[p],o&&(i=s[p]),i&&f!==t&&(u=e.type(f),"string"===u?(h="'{1}'",f=f.replace(/'/g,"''"),g===!0&&(d="tolower("+d+")")):h="date"===u?o?"{1:yyyy-MM-ddTHH:mm:ss+00:00}":"datetime'{1:yyyy-MM-ddTHH:mm:ss}'":"{1}",i.length>3?"substringof"!==i?h="{0}({2},"+h+")":(h="{0}("+h+",{2})","doesnotcontain"===p&&(o?(h="{0}({2},'{1}') eq -1",i="indexof"):h+=" eq false")):h="{2} {0} "+h,i=r.format(h,i,f,d))),m.push(i);return i=m.join(" "+v+" "),m.length>1&&(i="("+i+")"),i}function i(e){for(var t in e)0===t.indexOf("@odata")&&delete e[t]}var r=window.kendo,o=e.extend,a={eq:"eq",neq:"ne",gt:"gt",gte:"ge",lt:"lt",lte:"le",contains:"substringof",doesnotcontain:"substringof",endswith:"endswith",startswith:"startswith"},s=o({},a,{contains:"contains"}),l={pageSize:e.noop,page:e.noop,filter:function(e,t,i){t&&(e.$filter=n(t,i))},sort:function(t,n){var i=e.map(n,function(e){var t=e.field.replace(/\./g,"/");return"desc"===e.dir&&(t+=" desc"),t}).join(",");i&&(t.$orderby=i)},skip:function(e,t){t&&(e.$skip=t)},take:function(e,t){t&&(e.$top=t)}},c={read:{dataType:"jsonp"}};o(!0,r.data,{schemas:{odata:{type:"json",data:function(e){return e.d.results||[e.d]},total:"d.__count"}},transports:{odata:{read:{cache:!0,dataType:"jsonp",jsonp:"$callback"},update:{cache:!0,dataType:"json",contentType:"application/json",type:"PUT"},create:{cache:!0,dataType:"json",contentType:"application/json",type:"POST"},destroy:{cache:!0,dataType:"json",type:"DELETE"},parameterMap:function(e,t,n){var i,o,a,s;if(e=e||{},t=t||"read",s=(this.options||c)[t],s=s?s.dataType:"json","read"===t){i={$inlinecount:"allpages"},"json"!=s&&(i.$format="json");for(a in e)l[a]?l[a](i,e[a],n):i[a]=e[a]}else{if("json"!==s)throw Error("Only json dataType can be used for "+t+" operation.");if("destroy"!==t){for(a in e)o=e[a],"number"==typeof o&&(e[a]=o+"");i=r.stringify(e)}}return i}}}}),o(!0,r.data,{schemas:{"odata-v4":{type:"json",data:function(t){return t=e.extend({},t),i(t),t.value?t.value:[t]},total:function(e){return e["@odata.count"]}}},transports:{"odata-v4":{read:{cache:!0,dataType:"json"},update:{cache:!0,dataType:"json",contentType:"application/json;IEEE754Compatible=true",type:"PUT"},create:{cache:!0,dataType:"json",contentType:"application/json;IEEE754Compatible=true",type:"POST"},destroy:{cache:!0,dataType:"json",type:"DELETE"},parameterMap:function(e,t){var n=r.data.transports.odata.parameterMap(e,t,!0);return"read"==t&&(n.$count=!0,delete n.$inlinecount),n}}}})}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=e.isArray,r=e.isPlainObject,o=e.map,a=e.each,s=e.extend,l=n.getter,c=n.Class,d=c.extend({init:function(e){var t,l,c,d,u=this,h=e.total,p=e.model,f=e.parse,g=e.errors,m=e.serialize,v=e.data;p&&(r(p)&&(t=e.modelBase||n.data.Model,p.fields&&a(p.fields,function(e,t){t=r(t)&&t.field?s(t,{field:u.getter(t.field)}):{field:u.getter(t)},p.fields[e]=t}),l=p.id,l&&(c={},c[u.xpathToMember(l,!0)]={field:u.getter(l)},p.fields=s(c,p.fields),p.id=u.xpathToMember(l)),p=t.define(p)),u.model=p),h&&("string"==typeof h?(h=u.getter(h),u.total=function(e){return parseInt(h(e),10)}):"function"==typeof h&&(u.total=h)),g&&("string"==typeof g?(g=u.getter(g),u.errors=function(e){return g(e)||null}):"function"==typeof g&&(u.errors=g)),v&&("string"==typeof v?(v=u.xpathToMember(v),u.data=function(e){var t,n=u.evaluate(e,v);return n=i(n)?n:[n],u.model&&p.fields?(t=new u.model,o(n,function(e){if(e){var n,i={};for(n in p.fields)i[n]=t._parse(n,p.fields[n].field(e));return i}})):n}):"function"==typeof v&&(u.data=v)),"function"==typeof f&&(d=u.parse,u.parse=function(e){var t=f.call(u,e);return d.call(u,t)}),"function"==typeof m&&(u.serialize=m)},total:function(e){return this.data(e).length},errors:function(e){return e?e.errors:null},serialize:function(e){return e},parseDOM:function(e){var n,r,o,a,s,l,c,d={},u=e.attributes,h=u.length;for(c=0;h>c;c++)l=u[c],d["@"+l.nodeName]=l.nodeValue;for(r=e.firstChild;r;r=r.nextSibling)o=r.nodeType,3===o||4===o?d["#text"]=r.nodeValue:1===o&&(n=this.parseDOM(r),a=r.nodeName,s=d[a],i(s)?s.push(n):s=s!==t?[s,n]:n,d[a]=s);return d},evaluate:function(e,t){for(var n,r,o,a,s,l=t.split(".");n=l.shift();)if(e=e[n],i(e)){for(r=[],t=l.join("."),s=0,o=e.length;o>s;s++)a=this.evaluate(e[s],t),a=i(a)?a:[a],r.push.apply(r,a);return r}return e},parse:function(t){var n,i,r={};return n=t.documentElement||e.parseXML(t).documentElement,i=this.parseDOM(n),r[n.nodeName]=i,r},xpathToMember:function(e,t){return e?(e=e.replace(/^\//,"").replace(/\//g,"."),e.indexOf("@")>=0?e.replace(/\.?(@.*)/,t?"$1":'["$1"]'):e.indexOf("text()")>=0?e.replace(/(\.?text\(\))/,t?"#text":'["#text"]'):e):""},getter:function(e){return l(this.xpathToMember(e),!0)}});e.extend(!0,n.data,{XmlDataReader:d,readers:{xml:d}})}(window.kendo.jQuery),function(e,t){function n(e,t,n,i){return function(r){var o,a={};for(o in r)a[o]=r[o];a.field=i?n+"."+r.field:n,t==yt&&e._notifyChange&&e._notifyChange(a),e.trigger(t,a)}}function i(t,n){if(t===n)return!0;var r,o=e.type(t),a=e.type(n);if(o!==a)return!1;if("date"===o)return t.getTime()===n.getTime();if("object"!==o&&"array"!==o)return!1;for(r in t)if(!i(t[r],n[r]))return!1;return!0}function r(e,t){var n,i;for(i in e){if(n=e[i],it(n)&&n.field&&n.field===t)return n;if(n===t)return n}return null}function o(e){this.data=e||[]}function a(e,n){if(e){var i=typeof e===ft?{field:e,dir:n}:e,r=ot(i)?i:i!==t?[i]:[];return at(r,function(e){return!!e.dir})}}function s(e){var t,n,i,r,o=e.filters;if(o)for(t=0,n=o.length;n>t;t++)i=o[t],r=i.operator,r&&typeof r===ft&&(i.operator=W[r.toLowerCase()]||r),s(i)}function l(e){return e&&!rt(e)?((ot(e)||!e.filters)&&(e={logic:"and",filters:ot(e)?e:[e]}),s(e),e):t}function c(e){return ot(e)?e:[e]}function d(e,n){var i=typeof e===ft?{field:e,dir:n}:e,r=ot(i)?i:i!==t?[i]:[];return N(r,function(e){return{field:e.field,dir:e.dir||"asc",aggregates:e.aggregates}})}function u(e,t){return e&&e.getTime&&t&&t.getTime?e.getTime()===t.getTime():e===t}function h(e,t,n,i,r,o){var a,s,l,c,d;for(t=t||[],c=t.length,a=0;c>a;a++)s=t[a],l=s.aggregate,d=s.field,e[d]=e[d]||{},o[d]=o[d]||{},o[d][l]=o[d][l]||{},e[d][l]=j[l.toLowerCase()](e[d][l],n,dt.accessor(d),i,r,o[d][l])}function p(e){return"number"==typeof e&&!isNaN(e)}function f(e){return e&&e.getTime}function g(e){var t,n=e.length,i=Array(n);for(t=0;n>t;t++)i[t]=e[t].toJSON();return i}function m(e,t,n,i,r){var o,a,s,l,c;for(l=0,c=e.length;c>l;l++){o=e[l];for(a in t)s=r[a],s&&s!==a&&(o[s]=t[a](o),delete o[a])}}function v(e,t,n,i,r){var o,a,s,l,c;for(l=0,c=e.length;c>l;l++){o=e[l];for(a in t)o[a]=n._parse(a,t[a](o)),s=r[a],s&&s!==a&&delete o[s]}}function _(e,t,n,i,r){var o,a,s,l;for(a=0,l=e.length;l>a;a++)o=e[a],s=i[o.field],s&&s!=o.field&&(o.field=s),o.value=n._parse(o.field,o.value),o.hasSubgroups?_(o.items,t,n,i,r):v(o.items,t,n,i,r)}function w(e,t,n,i,r,o){return function(a){return a=e(a),a&&!rt(i)&&("[object Array]"===Nt.call(a)||a instanceof jt||(a=[a]),n(a,i,new t,r,o)),a||[]}}function y(e,t,n,i){for(var r,o,a,s=0;t.length&&i&&(r=t[s],o=r.items,a=o.length,e&&e.field===r.field&&e.value===r.value?(e.hasSubgroups&&e.items.length?y(e.items[e.items.length-1],r.items,n,i):(o=o.slice(n,n+i),e.items=e.items.concat(o)),t.splice(s--,1)):r.hasSubgroups&&o.length?y(r,o,n,i):(o=o.slice(n,n+i),r.items=o,r.items.length||t.splice(s--,1)),0===o.length?n-=a:(n=0,i-=o.length),!(++s>=t.length)););t.length>s&&t.splice(s,t.length-s)}function b(e){var t,n,i,r,o,a=[];for(t=0,n=e.length;n>t;t++)if(o=e.at(t),o.hasSubgroups)a=a.concat(b(o.items));else for(i=o.items,r=0;i.length>r;r++)a.push(i.at(r));return a}function k(e,t){var n,i,r;if(t)for(n=0,i=e.length;i>n;n++)r=e.at(n),r.hasSubgroups?k(r.items,t):r.items=new qt(r.items,t)}function x(e,t){for(var n=0,i=e.length;i>n;n++)if(e[n].hasSubgroups){if(x(e[n].items,t))return!0}else if(t(e[n].items,e[n]))return!0}function C(e,t,n,i){for(var r=0;e.length>r&&e[r].data!==t&&!T(e[r].data,n,i);r++);}function T(e,t,n){for(var i=0,r=e.length;r>i;i++){if(e[i]&&e[i].hasSubgroups)return T(e[i].items,t,n);if(e[i]===t||e[i]===n)return e[i]=n,!0}}function S(e,n,i,r,o){var a,s,l,c;for(a=0,s=e.length;s>a;a++)if(l=e[a],l&&!(l instanceof r))if(l.hasSubgroups===t||o){for(c=0;n.length>c;c++)if(n[c]===l){e[a]=n.at(c),C(i,n,l,e[a]);break}}else S(l.items,n,i,r,o)}function D(e,t){var n,i,r;for(n=0,i=e.length;i>n;n++)if(r=e.at(n),r.uid==t.uid)return e.splice(n,1),r}function A(e,t){var n,i,r,o;for(r=e.length-1,o=0;r>=o;r--)i=e[r],n={value:t.get(i.field),field:i.field,items:n?[n]:[t],hasSubgroups:!!n,aggregates:{}};return n}function E(e,t){return t?P(e,function(e){return e.uid?e.uid==t.uid:e[t.idField]===t.id}):-1}function I(e,t){return t?P(e,function(e){return e.uid==t.uid}):-1}function P(e,t){var n,i;for(n=0,i=e.length;i>n;n++)if(t(e[n]))return n;return-1}function M(e,t){var n,i;return e&&!rt(e)?(n=e[t],i=it(n)?n.from||n.field||t:e[t]||t,ut(i)?t:i):t}function F(e,t){var n,i,r,o={};for(r in e)"filters"!==r&&(o[r]=e[r]);if(e.filters)for(o.filters=[],n=0,i=e.filters.length;i>n;n++)o.filters[n]=F(e.filters[n],t);else o.field=M(t.fields,o.field);return o}function z(e,t){var n,i,r,o,a,s=[];for(n=0,i=e.length;i>n;n++){r={},o=e[n];for(a in o)r[a]=o[a];r.field=M(t.fields,r.field),r.aggregates&&ot(r.aggregates)&&(r.aggregates=z(r.aggregates,t)),s.push(r)}return s}function R(t,n){var i,r,o,a,s,l=e(t)[0].children,c=[],d=n[0],u=n[1];for(i=0,r=l.length;r>i;i++)o={},s=l[i],s.disabled||(o[d.field]=s.text,a=s.attributes.value,a=a&&a.specified?s.value:s.text,o[u.field]=a,c.push(o));return c}function B(t,n){var i,r,o,a,s,l,c,d=e(t)[0].tBodies[0],u=d?d.rows:[],h=n.length,p=[];for(i=0,r=u.length;r>i;i++){for(s={},c=!0,a=u[i].cells,o=0;h>o;o++)l=a[o],"th"!==l.nodeName.toLowerCase()&&(c=!1,s[n[o].field]=l.innerHTML);c||p.push(s)}return p}function H(e){return function(){var t=this._data,n=Q.fn[e].apply(this,Ht.call(arguments));return this._data!=t&&this._attachBubbleHandlers(),n}}function L(t,n){function i(e,t){return e.filter(t).add(e.find(t))}var r,o,a,s,l,c,d,u,h=e(t).children(),p=[],f=n[0].field,g=n[1]&&n[1].field,m=n[2]&&n[2].field,v=n[3]&&n[3].field;for(r=0,o=h.length;o>r;r++)a={_loaded:!0},s=h.eq(r),c=s[0].firstChild,u=s.children(),t=u.filter("ul"),u=u.filter(":not(ul)"),l=s.attr("data-id"),l&&(a.id=l),c&&(a[f]=3==c.nodeType?c.nodeValue:u.text()),g&&(a[g]=i(u,"a").attr("href")),v&&(a[v]=i(u,"img").attr("src")),m&&(d=i(u,".k-sprite").prop("className"),a[m]=d&&e.trim(d.replace("k-sprite",""))),t.length&&(a.items=L(t.eq(0),n)),"true"==s.attr("data-hasChildren")&&(a.hasChildren=!0),p.push(a);return p}var N,O,V,U,W,j,q,G,$,Y,Q,K,X,Z,J,et,tt=e.extend,nt=e.proxy,it=e.isPlainObject,rt=e.isEmptyObject,ot=e.isArray,at=e.grep,st=e.ajax,lt=e.each,ct=e.noop,dt=window.kendo,ut=dt.isFunction,ht=dt.Observable,pt=dt.Class,ft="string",gt="function",mt="create",vt="read",_t="update",wt="destroy",yt="change",bt="sync",kt="get",xt="error",Ct="requestStart",Tt="progress",St="requestEnd",Dt=[mt,vt,_t,wt],At=function(e){return e},Et=dt.getter,It=dt.stringify,Pt=Math,Mt=[].push,Ft=[].join,zt=[].pop,Rt=[].splice,Bt=[].shift,Ht=[].slice,Lt=[].unshift,Nt={}.toString,Ot=dt.support.stableSort,Vt=/^\/Date\((.*?)\)\/$/,Ut=/(\r+|\n+)/g,Wt=/(?=['\\])/g,jt=ht.extend({init:function(e,t){var n=this;
n.type=t||Gt,ht.fn.init.call(n),n.length=e.length,n.wrapAll(e,n)},at:function(e){return this[e]},toJSON:function(){var e,t,n=this.length,i=Array(n);for(e=0;n>e;e++)t=this[e],t instanceof Gt&&(t=t.toJSON()),i[e]=t;return i},parent:ct,wrapAll:function(e,t){var n,i,r=this,o=function(){return r};for(t=t||[],n=0,i=e.length;i>n;n++)t[n]=r.wrap(e[n],o);return t},wrap:function(e,t){var n,i=this;return null!==e&&"[object Object]"===Nt.call(e)&&(n=e instanceof i.type||e instanceof Qt,n||(e=e instanceof Gt?e.toJSON():e,e=new i.type(e)),e.parent=t,e.bind(yt,function(e){i.trigger(yt,{field:e.field,node:e.node,index:e.index,items:e.items||[this],action:e.node?e.action||"itemloaded":"itemchange"})})),e},push:function(){var e,t=this.length,n=this.wrapAll(arguments);return e=Mt.apply(this,n),this.trigger(yt,{action:"add",index:t,items:n}),e},slice:Ht,sort:[].sort,join:Ft,pop:function(){var e=this.length,t=zt.apply(this);return e&&this.trigger(yt,{action:"remove",index:e-1,items:[t]}),t},splice:function(e,t,n){var i,r,o,a=this.wrapAll(Ht.call(arguments,2));if(i=Rt.apply(this,[e,t].concat(a)),i.length)for(this.trigger(yt,{action:"remove",index:e,items:i}),r=0,o=i.length;o>r;r++)i[r].children&&i[r].unbind(yt);return n&&this.trigger(yt,{action:"add",index:e,items:a}),i},shift:function(){var e=this.length,t=Bt.apply(this);return e&&this.trigger(yt,{action:"remove",index:0,items:[t]}),t},unshift:function(){var e,t=this.wrapAll(arguments);return e=Lt.apply(this,t),this.trigger(yt,{action:"add",index:0,items:t}),e},indexOf:function(e){var t,n,i=this;for(t=0,n=i.length;n>t;t++)if(i[t]===e)return t;return-1},forEach:function(e){for(var t=0,n=this.length;n>t;t++)e(this[t],t,this)},map:function(e){for(var t=0,n=[],i=this.length;i>t;t++)n[t]=e(this[t],t,this);return n},filter:function(e){for(var t,n=0,i=[],r=this.length;r>n;n++)t=this[n],e(t,n,this)&&(i[i.length]=t);return i},find:function(e){for(var t,n=0,i=this.length;i>n;n++)if(t=this[n],e(t,n,this))return t},every:function(e){for(var t,n=0,i=this.length;i>n;n++)if(t=this[n],!e(t,n,this))return!1;return!0},some:function(e){for(var t,n=0,i=this.length;i>n;n++)if(t=this[n],e(t,n,this))return!0;return!1},remove:function(e){var t=this.indexOf(e);-1!==t&&this.splice(t,1)},empty:function(){this.splice(0,this.length)}}),qt=jt.extend({init:function(e,t){ht.fn.init.call(this),this.type=t||Gt;for(var n=0;e.length>n;n++)this[n]=e[n];this.length=n,this._parent=nt(function(){return this},this)},at:function(e){var t=this[e];return t instanceof this.type?t.parent=this._parent:t=this[e]=this.wrap(t,this._parent),t}}),Gt=ht.extend({init:function(e){var t,n,i=this,r=function(){return i};ht.fn.init.call(this);for(n in e)t=e[n],"object"==typeof t&&t&&!t.getTime&&"_"!=n.charAt(0)&&(t=i.wrap(t,n,r)),i[n]=t;i.uid=dt.guid()},shouldSerialize:function(e){return this.hasOwnProperty(e)&&"_events"!==e&&typeof this[e]!==gt&&"uid"!==e},forEach:function(e){for(var t in this)this.shouldSerialize(t)&&e(this[t],t)},toJSON:function(){var e,t,n={};for(t in this)this.shouldSerialize(t)&&(e=this[t],(e instanceof Gt||e instanceof jt)&&(e=e.toJSON()),n[t]=e);return n},get:function(e){var t,n=this;return n.trigger(kt,{field:e}),t="this"===e?n:dt.getter(e,!0)(n)},_set:function(e,t){var n,i,r,o=this,a=e.indexOf(".")>=0;if(a)for(n=e.split("."),i="";n.length>1;){if(i+=n.shift(),r=dt.getter(i,!0)(o),r instanceof Gt)return r.set(n.join("."),t),a;i+="."}return dt.setter(e)(o,t),a},set:function(e,t){var n=this,i=e.indexOf(".")>=0,r=dt.getter(e,!0)(n);r!==t&&(n.trigger("set",{field:e,value:t})||(i||(t=n.wrap(t,e,function(){return n})),(!n._set(e,t)||e.indexOf("(")>=0||e.indexOf("[")>=0)&&n.trigger(yt,{field:e})))},parent:ct,wrap:function(e,t,i){var r,o,a=this,s=Nt.call(e);return null==e||"[object Object]"!==s&&"[object Array]"!==s||(r=e instanceof jt,o=e instanceof Q,"[object Object]"!==s||o||r?("[object Array]"===s||r||o)&&(r||o||(e=new jt(e)),e.parent()!=i()&&e.bind(yt,n(a,yt,t,!1))):(e instanceof Gt||(e=new Gt(e)),e.parent()!=i()&&(e.bind(kt,n(a,kt,t,!0)),e.bind(yt,n(a,yt,t,!0)))),e.parent=i),e}}),$t={number:function(e){return dt.parseFloat(e)},date:function(e){return dt.parseDate(e)},"boolean":function(e){return typeof e===ft?"true"===e.toLowerCase():null!=e?!!e:e},string:function(e){return null!=e?e+"":e},"default":function(e){return e}},Yt={string:"",number:0,date:new Date,"boolean":!1,"default":""},Qt=Gt.extend({init:function(n){var i,r,o=this;if((!n||e.isEmptyObject(n))&&(n=e.extend({},o.defaults,n),o._initializers))for(i=0;o._initializers.length>i;i++)r=o._initializers[i],n[r]=o.defaults[r]();Gt.fn.init.call(o,n),o.dirty=!1,o.idField&&(o.id=o.get(o.idField),o.id===t&&(o.id=o._defaultId))},shouldSerialize:function(e){return Gt.fn.shouldSerialize.call(this,e)&&"uid"!==e&&!("id"!==this.idField&&"id"===e)&&"dirty"!==e&&"_accessors"!==e},_parse:function(e,t){var n,i=this,o=e,a=i.fields||{};return e=a[e],e||(e=r(a,o)),e&&(n=e.parse,!n&&e.type&&(n=$t[e.type.toLowerCase()])),n?n(t):t},_notifyChange:function(e){var t=e.action;("add"==t||"remove"==t)&&(this.dirty=!0)},editable:function(e){return e=(this.fields||{})[e],e?e.editable!==!1:!0},set:function(e,t,n){var r=this;r.editable(e)&&(t=r._parse(e,t),i(t,r.get(e))||(r.dirty=!0,Gt.fn.set.call(r,e,t,n)))},accept:function(e){var t,n,i=this,r=function(){return i};for(t in e)n=e[t],"_"!=t.charAt(0)&&(n=i.wrap(e[t],t,r)),i._set(t,n);i.idField&&(i.id=i.get(i.idField)),i.dirty=!1},isNew:function(){return this.id===this._defaultId}});Qt.define=function(e,n){n===t&&(n=e,e=Qt);var i,r,o,a,s,l,c,d,u=tt({defaults:{}},n),h={},p=u.id,f=[];if(p&&(u.idField=p),u.id&&delete u.id,p&&(u.defaults[p]=u._defaultId=""),"[object Array]"===Nt.call(u.fields)){for(l=0,c=u.fields.length;c>l;l++)o=u.fields[l],typeof o===ft?h[o]={}:o.field&&(h[o.field]=o);u.fields=h}for(r in u.fields)o=u.fields[r],a=o.type||"default",s=null,d=r,r=typeof o.field===ft?o.field:r,o.nullable||(s=u.defaults[d!==r?d:r]=o.defaultValue!==t?o.defaultValue:Yt[a.toLowerCase()],"function"==typeof s&&f.push(r)),n.id===r&&(u._defaultId=s),u.defaults[d!==r?d:r]=s,o.parse=o.parse||$t[a];return f.length>0&&(u._initializers=f),i=e.extend(u),i.define=function(e){return Qt.define(i,e)},u.fields&&(i.fields=u.fields,i.idField=u.idField),i},O={selector:function(e){return ut(e)?e:Et(e)},compare:function(e){var t=this.selector(e);return function(e,n){return e=t(e),n=t(n),null==e&&null==n?0:null==e?-1:null==n?1:e.localeCompare?e.localeCompare(n):e>n?1:n>e?-1:0}},create:function(e){var t=e.compare||this.compare(e.field);return"desc"==e.dir?function(e,n){return t(n,e,!0)}:t},combine:function(e){return function(t,n){var i,r,o=e[0](t,n);for(i=1,r=e.length;r>i;i++)o=o||e[i](t,n);return o}}},V=tt({},O,{asc:function(e){var t=this.selector(e);return function(e,n){var i=t(e),r=t(n);return i&&i.getTime&&r&&r.getTime&&(i=i.getTime(),r=r.getTime()),i===r?e.__position-n.__position:null==i?-1:null==r?1:i.localeCompare?i.localeCompare(r):i>r?1:-1}},desc:function(e){var t=this.selector(e);return function(e,n){var i=t(e),r=t(n);return i&&i.getTime&&r&&r.getTime&&(i=i.getTime(),r=r.getTime()),i===r?e.__position-n.__position:null==i?1:null==r?-1:r.localeCompare?r.localeCompare(i):r>i?1:-1}},create:function(e){return this[e.dir](e.field)}}),N=function(e,t){var n,i=e.length,r=Array(i);for(n=0;i>n;n++)r[n]=t(e[n],n,e);return r},U=function(){function e(e){return e.replace(Wt,"\\").replace(Ut,"")}function t(t,n,i,r){var o;return null!=i&&(typeof i===ft&&(i=e(i),o=Vt.exec(i),o?i=new Date(+o[1]):r?(i="'"+i.toLowerCase()+"'",n="("+n+" || '').toLowerCase()"):i="'"+i+"'"),i.getTime&&(n="("+n+"?"+n+".getTime():"+n+")",i=i.getTime())),n+" "+t+" "+i}return{eq:function(e,n,i){return t("==",e,n,i)},neq:function(e,n,i){return t("!=",e,n,i)},gt:function(e,n,i){return t(">",e,n,i)},gte:function(e,n,i){return t(">=",e,n,i)},lt:function(e,n,i){return t("<",e,n,i)},lte:function(e,n,i){return t("<=",e,n,i)},startswith:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".lastIndexOf('"+n+"', 0) == 0"},endswith:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"', "+t+".length - "+(n||"").length+") >= 0"},contains:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"') >= 0"},doesnotcontain:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"') == -1"}}}(),o.filterExpr=function(e){var n,i,r,a,s,l,c=[],d={and:" && ",or:" || "},u=[],h=[],p=e.filters;for(n=0,i=p.length;i>n;n++)r=p[n],s=r.field,l=r.operator,r.filters?(a=o.filterExpr(r),r=a.expression.replace(/__o\[(\d+)\]/g,function(e,t){return t=+t,"__o["+(h.length+t)+"]"}).replace(/__f\[(\d+)\]/g,function(e,t){return t=+t,"__f["+(u.length+t)+"]"}),h.push.apply(h,a.operators),u.push.apply(u,a.fields)):(typeof s===gt?(a="__f["+u.length+"](d)",u.push(s)):a=dt.expr(s),typeof l===gt?(r="__o["+h.length+"]("+a+", "+r.value+")",h.push(l)):r=U[(l||"eq").toLowerCase()](a,r.value,r.ignoreCase!==t?r.ignoreCase:!0)),c.push(r);return{expression:"("+c.join(d[e.logic])+")",fields:u,operators:h}},W={"==":"eq",equals:"eq",isequalto:"eq",equalto:"eq",equal:"eq","!=":"neq",ne:"neq",notequals:"neq",isnotequalto:"neq",notequalto:"neq",notequal:"neq","<":"lt",islessthan:"lt",lessthan:"lt",less:"lt","<=":"lte",le:"lte",islessthanorequalto:"lte",lessthanequal:"lte",">":"gt",isgreaterthan:"gt",greaterthan:"gt",greater:"gt",">=":"gte",isgreaterthanorequalto:"gte",greaterthanequal:"gte",ge:"gte",notsubstringof:"doesnotcontain"},o.normalizeFilter=l,o.prototype={toArray:function(){return this.data},range:function(e,t){return new o(this.data.slice(e,e+t))},skip:function(e){return new o(this.data.slice(e))},take:function(e){return new o(this.data.slice(0,e))},select:function(e){return new o(N(this.data,e))},order:function(e,t){var n={dir:t};return e&&(e.compare?n.compare=e.compare:n.field=e),new o(this.data.slice(0).sort(O.create(n)))},orderBy:function(e){return this.order(e,"asc")},orderByDescending:function(e){return this.order(e,"desc")},sort:function(e,t,n){var i,r,o=a(e,t),s=[];if(n=n||O,o.length){for(i=0,r=o.length;r>i;i++)s.push(n.create(o[i]));return this.orderBy({compare:n.combine(s)})}return this},filter:function(e){var t,n,i,r,a,s,c,d,u=this.data,h=[];if(e=l(e),!e||0===e.filters.length)return this;for(r=o.filterExpr(e),s=r.fields,c=r.operators,a=d=Function("d, __f, __o","return "+r.expression),(s.length||c.length)&&(d=function(e){return a(e,s,c)}),t=0,i=u.length;i>t;t++)n=u[t],d(n)&&h.push(n);return new o(h)},group:function(e,t){e=d(e||[]),t=t||this.data;var n,i=this,r=new o(i.data);return e.length>0&&(n=e[0],r=r.groupBy(n).select(function(i){var r=new o(t).filter([{field:i.field,operator:"eq",value:i.value,ignoreCase:!1}]);return{field:i.field,value:i.value,items:e.length>1?new o(i.items).group(e.slice(1),r.toArray()).toArray():i.items,hasSubgroups:e.length>1,aggregates:r.aggregate(n.aggregates)}})),r},groupBy:function(e){if(rt(e)||!this.data.length)return new o([]);var t,n,i,r,a=e.field,s=this._sortForGrouping(a,e.dir||"asc"),l=dt.accessor(a),c=l.get(s[0],a),d={field:a,value:c,items:[]},h=[d];for(i=0,r=s.length;r>i;i++)t=s[i],n=l.get(t,a),u(c,n)||(c=n,d={field:a,value:c,items:[]},h.push(d)),d.items.push(t);return new o(h)},_sortForGrouping:function(e,t){var n,i,r=this.data;if(!Ot){for(n=0,i=r.length;i>n;n++)r[n].__position=n;for(r=new o(r).sort(e,t,V).toArray(),n=0,i=r.length;i>n;n++)delete r[n].__position;return r}return this.sort(e,t).toArray()},aggregate:function(e){var t,n,i={},r={};if(e&&e.length)for(t=0,n=this.data.length;n>t;t++)h(i,e,this.data[t],t,n,r);return i}},j={sum:function(e,t,n){var i=n.get(t);return p(e)?p(i)&&(e+=i):e=i,e},count:function(e){return(e||0)+1},average:function(e,n,i,r,o,a){var s=i.get(n);return a.count===t&&(a.count=0),p(e)?p(s)&&(e+=s):e=s,p(s)&&a.count++,r==o-1&&p(e)&&(e/=a.count),e},max:function(e,t,n){var i=n.get(t);return p(e)||f(e)||(e=i),i>e&&(p(i)||f(i))&&(e=i),e},min:function(e,t,n){var i=n.get(t);return p(e)||f(e)||(e=i),e>i&&(p(i)||f(i))&&(e=i),e}},o.process=function(e,n){n=n||{};var i,r=new o(e),s=n.group,l=d(s||[]).concat(a(n.sort||[])),c=n.filterCallback,u=n.filter,h=n.skip,p=n.take;return u&&(r=r.filter(u),c&&(r=c(r)),i=r.toArray().length),l&&(r=r.sort(l),s&&(e=r.toArray())),h!==t&&p!==t&&(r=r.range(h,p)),s&&(r=r.group(s,e)),{total:i,data:r.toArray()}},q=pt.extend({init:function(e){this.data=e.data},read:function(e){e.success(this.data)},update:function(e){e.success(e.data)},create:function(e){e.success(e.data)},destroy:function(e){e.success(e.data)}}),G=pt.extend({init:function(e){var t,n=this;e=n.options=tt({},n.options,e),lt(Dt,function(t,n){typeof e[n]===ft&&(e[n]={url:e[n]})}),n.cache=e.cache?$.create(e.cache):{find:ct,add:ct},t=e.parameterMap,ut(e.push)&&(n.push=e.push),n.push||(n.push=At),n.parameterMap=ut(t)?t:function(e){var n={};return lt(e,function(e,i){e in t&&(e=t[e],it(e)&&(i=e.value(i),e=e.key)),n[e]=i}),n}},options:{parameterMap:At},create:function(e){return st(this.setup(e,mt))},read:function(n){var i,r,o,a=this,s=a.cache;n=a.setup(n,vt),i=n.success||ct,r=n.error||ct,o=s.find(n.data),o!==t?i(o):(n.success=function(e){s.add(n.data,e),i(e)},e.ajax(n))},update:function(e){return st(this.setup(e,_t))},destroy:function(e){return st(this.setup(e,wt))},setup:function(e,t){e=e||{};var n,i=this,r=i.options[t],o=ut(r.data)?r.data(e.data):r.data;return e=tt(!0,{},r,e),n=tt(!0,{},o,e.data),e.data=i.parameterMap(n,t),ut(e.url)&&(e.url=e.url(n)),e}}),$=pt.extend({init:function(){this._store={}},add:function(e,n){e!==t&&(this._store[It(e)]=n)},find:function(e){return this._store[It(e)]},clear:function(){this._store={}},remove:function(e){delete this._store[It(e)]}}),$.create=function(e){var t={inmemory:function(){return new $}};return it(e)&&ut(e.find)?e:e===!0?new $:t[e]()},Y=pt.extend({init:function(e){var t,n,i,r,o,a,s,l,c,d,u,h,p,f=this;e=e||{};for(t in e)n=e[t],f[t]=typeof n===ft?Et(n):n;r=e.modelBase||Qt,it(f.model)&&(f.model=i=r.define(f.model)),o=nt(f.data,f),f._dataAccessFunction=o,f.model&&(a=nt(f.groups,f),s=nt(f.serialize,f),l={},c={},d={},u={},h=!1,i=f.model,i.fields&&(lt(i.fields,function(e,t){var n;p=e,it(t)&&t.field?p=t.field:typeof t===ft&&(p=t),it(t)&&t.from&&(n=t.from),h=h||n&&n!==e||p!==e,c[e]=Et(n||p),d[e]=Et(e),l[n||p]=e,u[e]=n||p}),!e.serialize&&h&&(f.serialize=w(s,i,m,d,l,u))),f._dataAccessFunction=o,f.data=w(o,i,v,c,l,u),f.groups=w(a,i,_,c,l,u))},errors:function(e){return e?e.errors:null},parse:At,data:At,total:function(e){return e.length},groups:At,aggregates:function(){return{}},serialize:function(e){return e}}),Q=ht.extend({init:function(e){var n,i,r,o=this;e&&(i=e.data),e=o.options=tt({},o.options,e),o._map={},o._prefetch={},o._data=[],o._pristineData=[],o._ranges=[],o._view=[],o._pristineTotal=0,o._destroyed=[],o._pageSize=e.pageSize,o._page=e.page||(e.pageSize?1:t),o._sort=a(e.sort),o._filter=l(e.filter),o._group=d(e.group),o._aggregate=e.aggregate,o._total=e.total,o._shouldDetachObservableParents=!0,ht.fn.init.call(o),o.transport=K.create(e,i),ut(o.transport.push)&&o.transport.push({pushCreate:nt(o._pushCreate,o),pushUpdate:nt(o._pushUpdate,o),pushDestroy:nt(o._pushDestroy,o)}),null!=e.offlineStorage&&("string"==typeof e.offlineStorage?(r=e.offlineStorage,o._storage={getItem:function(){return JSON.parse(localStorage.getItem(r))},setItem:function(e){localStorage.setItem(r,It(e))}}):o._storage=e.offlineStorage),o.reader=new dt.data.readers[e.schema.type||"json"](e.schema),n=o.reader.model||{},o._detachObservableParents(),o._data=o._observe(o._data),o._online=!0,o.bind(["push",xt,yt,Ct,bt,St,Tt],e)},options:{data:null,schema:{modelBase:Qt},offlineStorage:null,serverSorting:!1,serverPaging:!1,serverFiltering:!1,serverGrouping:!1,serverAggregates:!1,batch:!1},online:function(e){return e===t?this._online:(this._online!=e&&(this._online=e,e&&this.sync()),t)},offlineData:function(e){return null==this.options.offlineStorage?null:e!==t?this._storage.setItem(e):this._storage.getItem()||{}},_isServerGrouped:function(){var e=this.group()||[];return this.options.serverGrouping&&e.length},_pushCreate:function(e){this._push(e,"pushCreate")},_pushUpdate:function(e){this._push(e,"pushUpdate")},_pushDestroy:function(e){this._push(e,"pushDestroy")},_push:function(e,t){var n=this._readData(e);n||(n=e),this[t](n)},_flatData:function(e,t){if(e){if(this._isServerGrouped())return b(e);if(!t)for(var n=0;e.length>n;n++)e.at(n)}return e},parent:ct,get:function(e){var t,n,i=this._flatData(this._data);for(t=0,n=i.length;n>t;t++)if(i[t].id==e)return i[t]},getByUid:function(e){var t,n,i=this._flatData(this._data);if(i)for(t=0,n=i.length;n>t;t++)if(i[t].uid==e)return i[t]},indexOf:function(e){return I(this._data,e)},at:function(e){return this._data.at(e)},data:function(e){var n,i=this;if(e===t){if(i._data)for(n=0;i._data.length>n;n++)i._data.at(n);return i._data}i._detachObservableParents(),i._data=this._observe(e),i._pristineData=e.slice(0),i._storeData(),i._ranges=[],i.trigger("reset"),i._addRange(i._data),i._total=i._data.length,i._pristineTotal=i._total,i._process(i._data)},view:function(e){return e===t?this._view:(this._view=this._observeView(e),t)},_observeView:function(e){var t,n=this;return S(e,n._data,n._ranges,n.reader.model||Gt,n._isServerGrouped()),t=new qt(e,n.reader.model),t.parent=function(){return n.parent()},t},flatView:function(){var e=this.group()||[];return e.length?b(this._view):this._view},add:function(e){return this.insert(this._data.length,e)},_createNewModel:function(e){return this.reader.model?new this.reader.model(e):e instanceof Gt?e:new Gt(e)},insert:function(e,t){return t||(t=e,e=0),t instanceof Qt||(t=this._createNewModel(t)),this._isServerGrouped()?this._data.splice(e,0,A(this.group(),t)):this._data.splice(e,0,t),t},pushCreate:function(e){var t,n,i,r,o,a;ot(e)||(e=[e]),t=[],n=this.options.autoSync,this.options.autoSync=!1;try{for(i=0;e.length>i;i++)r=e[i],o=this.add(r),t.push(o),a=o.toJSON(),this._isServerGrouped()&&(a=A(this.group(),a)),this._pristineData.push(a)}finally{this.options.autoSync=n}t.length&&this.trigger("push",{type:"create",items:t})},pushUpdate:function(e){var t,n,i,r,o;for(ot(e)||(e=[e]),t=[],n=0;e.length>n;n++)i=e[n],r=this._createNewModel(i),o=this.get(r.id),o?(t.push(o),o.accept(i),o.trigger(yt),this._updatePristineForModel(o,i)):this.pushCreate(i);t.length&&this.trigger("push",{type:"update",items:t})},pushDestroy:function(e){var t=this._removeItems(e);t.length&&this.trigger("push",{type:"destroy",items:t})},_removeItems:function(e){var t,n,i,r,o,a;ot(e)||(e=[e]),t=[],n=this.options.autoSync,this.options.autoSync=!1;try{for(i=0;e.length>i;i++)r=e[i],o=this._createNewModel(r),a=!1,this._eachItem(this._data,function(e){var n,i;for(n=0;e.length>n;n++)if(i=e.at(n),i.id===o.id){t.push(i),e.splice(n,1),a=!0;break}}),a&&(this._removePristineForModel(o),this._destroyed.pop())}finally{this.options.autoSync=n}return t},remove:function(e){var n,i=this,r=i._isServerGrouped();return this._eachItem(i._data,function(o){return n=D(o,e),n&&r?(n.isNew&&n.isNew()||i._destroyed.push(n),!0):t}),this._removeModelFromRanges(e),this._updateRangesLength(),e},sync:function(){var t,n,i,r,o=this,a=[],s=[],l=o._destroyed,c=o._flatData(o._data);if(o.online()){if(!o.reader.model)return;for(t=0,n=c.length;n>t;t++)c[t].isNew()?a.push(c[t]):c[t].dirty&&s.push(c[t]);r=[],r.push.apply(r,o._send("create",a)),r.push.apply(r,o._send("update",s)),r.push.apply(r,o._send("destroy",l)),i=e.when.apply(null,r).then(function(){var e,t;for(e=0,t=arguments.length;t>e;e++)o._accept(arguments[e]);o._storeData(!0),o._change({action:"sync"}),o.trigger(bt)})}else o._storeData(!0),o._change({action:"sync"}),i=e.Deferred().resolve().promise();return i},cancelChanges:function(e){var t=this;e instanceof dt.data.Model?t._cancelModel(e):(t._destroyed=[],t._detachObservableParents(),t._data=t._observe(t._pristineData),t.options.serverPaging&&(t._total=t._pristineTotal),t._change())},hasChanges:function(){var e,t,n=this._data;if(this._destroyed.length)return!0;for(e=0,t=n.length;t>e;e++)if(n[e].isNew&&n[e].isNew()||n[e].dirty)return!0;return!1},_accept:function(t){var n,i=this,r=t.models,o=t.response,a=0,s=i._isServerGrouped(),l=i._pristineData,c=t.type;if(i.trigger(St,{response:o,type:c}),o&&!rt(o)){if(o=i.reader.parse(o),i._handleCustomErrors(o))return;o=i.reader.data(o),ot(o)||(o=[o])}else o=e.map(r,function(e){return e.toJSON()});for("destroy"===c&&(i._destroyed=[]),a=0,n=r.length;n>a;a++)"destroy"!==c?(r[a].accept(o[a]),"create"===c?l.push(s?A(i.group(),r[a]):o[a]):"update"===c&&i._updatePristineForModel(r[a],o[a])):i._removePristineForModel(r[a])},_updatePristineForModel:function(e,t){this._executeOnPristineForModel(e,function(e,n){dt.deepExtend(n[e],t)})},_executeOnPristineForModel:function(e,n){this._eachPristineItem(function(i){var r=E(i,e);return r>-1?(n(r,i),!0):t})},_removePristineForModel:function(e){this._executeOnPristineForModel(e,function(e,t){t.splice(e,1)})},_readData:function(e){var t=this._isServerGrouped()?this.reader.groups:this.reader.data;return t.call(this.reader,e)},_eachPristineItem:function(e){this._eachItem(this._pristineData,e)},_eachItem:function(e,t){e&&e.length&&(this._isServerGrouped()?x(e,t):t(e))},_pristineForModel:function(e){var n,i,r=function(r){return i=E(r,e),i>-1?(n=r[i],!0):t};return this._eachPristineItem(r),n},_cancelModel:function(e){var t=this._pristineForModel(e);this._eachItem(this._data,function(n){var i=I(n,e);i>=0&&(!t||e.isNew()&&!t.__state__?n.splice(i,1):n[i].accept(t))})},_promise:function(t,n,i){var r=this;return e.Deferred(function(e){r.trigger(Ct,{type:i}),r.transport[i].call(r.transport,tt({success:function(t){e.resolve({response:t,models:n,type:i})},error:function(t,n,i){e.reject(t),r.error(t,n,i)}},t))}).promise()},_send:function(e,t){var n,i,r=this,o=[],a=r.reader.serialize(g(t));if(r.options.batch)t.length&&o.push(r._promise({data:{models:a}},t,e));else for(n=0,i=t.length;i>n;n++)o.push(r._promise({data:a[n]},[t[n]],e));return o},read:function(t){var n=this,i=n._params(t),r=e.Deferred();return n._queueRequest(i,function(){var e=n.trigger(Ct,{type:"read"});e?(n._dequeueRequest(),r.resolve(e)):(n.trigger(Tt),n._ranges=[],n.trigger("reset"),n.online()?n.transport.read({data:i,success:function(e){n.success(e),r.resolve()},error:function(){var e=Ht.call(arguments);n.error.apply(n,e),r.reject.apply(r,e)}}):null!=n.options.offlineStorage&&(n.success(n.offlineData()),r.resolve()))}),r.promise()},_readAggregates:function(e){return this.reader.aggregates(e)},success:function(e){var n,i,r,o,a=this,s=a.options;if(a.trigger(St,{response:e,type:"read"}),a.online()){if(e=a.reader.parse(e),a._handleCustomErrors(e))return a._dequeueRequest(),t;a._total=a.reader.total(e),a._aggregate&&s.serverAggregates&&(a._aggregateResult=a._readAggregates(e)),e=a._readData(e)}else{for(e=a._readData(e),n=[],i=0;e.length>i;i++)r=e[i],o=r.__state__,"destroy"==o?this._destroyed.push(this._createNewModel(r)):n.push(r);e=n,a._total=e.length}a._pristineTotal=a._total,a._pristineData=e.slice(0),a._detachObservableParents(),a._data=a._observe(e),null!=a.options.offlineStorage&&a._eachItem(a._data,function(e){var t,n;for(t=0;e.length>t;t++)n=e.at(t),"update"==n.__state__&&(n.dirty=!0)}),a._storeData(),a._addRange(a._data),a._process(a._data),a._dequeueRequest()},_detachObservableParents:function(){if(this._data&&this._shouldDetachObservableParents)for(var e=0;this._data.length>e;e++)this._data[e].parent&&(this._data[e].parent=ct)},_storeData:function(e){function t(e){var n,i,r,s=[];for(n=0;e.length>n;n++)i=e.at(n),r=i.toJSON(),o&&i.items?r.items=t(i.items):(r.uid=i.uid,a&&(i.isNew()?r.__state__="create":i.dirty&&(r.__state__="update"))),s.push(r);return s}var n,i,r,o=this._isServerGrouped(),a=this.reader.model;if(null!=this.options.offlineStorage){for(n=t(this._data),i=0;this._destroyed.length>i;i++)r=this._destroyed[i].toJSON(),r.__state__="destroy",n.push(r);this.offlineData(n),e&&(this._pristineData=n)}},_addRange:function(e){var t=this,n=t._skip||0,i=n+t._flatData(e,!0).length;t._ranges.push({start:n,end:i,data:e}),t._ranges.sort(function(e,t){return e.start-t.start})},error:function(e,t,n){this._dequeueRequest(),this.trigger(St,{}),this.trigger(xt,{xhr:e,status:t,errorThrown:n})},_params:function(e){var t=this,n=tt({take:t.take(),skip:t.skip(),page:t.page(),pageSize:t.pageSize(),sort:t._sort,filter:t._filter,group:t._group,aggregate:t._aggregate},e);return t.options.serverPaging||(delete n.take,delete n.skip,delete n.page,delete n.pageSize),t.options.serverGrouping?t.reader.model&&n.group&&(n.group=z(n.group,t.reader.model)):delete n.group,t.options.serverFiltering?t.reader.model&&n.filter&&(n.filter=F(n.filter,t.reader.model)):delete n.filter,t.options.serverSorting?t.reader.model&&n.sort&&(n.sort=z(n.sort,t.reader.model)):delete n.sort,t.options.serverAggregates?t.reader.model&&n.aggregate&&(n.aggregate=z(n.aggregate,t.reader.model)):delete n.aggregate,n},_queueRequest:function(e,n){var i=this;i._requestInProgress?i._pending={callback:nt(n,i),options:e}:(i._requestInProgress=!0,i._pending=t,n())},_dequeueRequest:function(){var e=this;e._requestInProgress=!1,e._pending&&e._queueRequest(e._pending.options,e._pending.callback)},_handleCustomErrors:function(e){if(this.reader.errors){var t=this.reader.errors(e);if(t)return this.trigger(xt,{xhr:null,status:"customerror",errorThrown:"custom error",errors:t}),!0}return!1},_observe:function(e){var t,n=this,i=n.reader.model,r=!1;return n._shouldDetachObservableParents=!0,i&&e.length&&(r=!(e[0]instanceof i)),e instanceof jt?(n._shouldDetachObservableParents=!1,r&&(e.type=n.reader.model,e.wrapAll(e,e))):(t=n.pageSize()?qt:jt,e=new t(e,n.reader.model),e.parent=function(){return n.parent()}),n._isServerGrouped()&&k(e,i),n._changeHandler&&n._data&&n._data instanceof jt?n._data.unbind(yt,n._changeHandler):n._changeHandler=nt(n._change,n),e.bind(yt,n._changeHandler)},_change:function(e){var t,n,i,r=this,o=e?e.action:"";if("remove"===o)for(t=0,n=e.items.length;n>t;t++)e.items[t].isNew&&e.items[t].isNew()||r._destroyed.push(e.items[t]);!r.options.autoSync||"add"!==o&&"remove"!==o&&"itemchange"!==o?(i=parseInt(r._total,10),p(r._total)||(i=parseInt(r._pristineTotal,10)),"add"===o?i+=e.items.length:"remove"===o?i-=e.items.length:"itemchange"===o||"sync"===o||r.options.serverPaging?"sync"===o&&(i=r._pristineTotal=parseInt(r._total,10)):i=r._pristineTotal,r._total=i,r._process(r._data,e)):r.sync()},_calculateAggregates:function(e,t){t=t||{};var n=new o(e),i=t.aggregate,r=t.filter;return r&&(n=n.filter(r)),n.aggregate(i)},_process:function(e,n){var i,r=this,o={};r.options.serverPaging!==!0&&(o.skip=r._skip,o.take=r._take||r._pageSize,o.skip===t&&r._page!==t&&r._pageSize!==t&&(o.skip=(r._page-1)*r._pageSize)),r.options.serverSorting!==!0&&(o.sort=r._sort),r.options.serverFiltering!==!0&&(o.filter=r._filter),r.options.serverGrouping!==!0&&(o.group=r._group),r.options.serverAggregates!==!0&&(o.aggregate=r._aggregate,r._aggregateResult=r._calculateAggregates(e,o)),i=r._queryProcess(e,o),r.view(i.data),i.total===t||r.options.serverFiltering||(r._total=i.total),n=n||{},n.items=n.items||r._view,r.trigger(yt,n)},_queryProcess:function(e,t){return o.process(e,t)},_mergeState:function(e){var n=this;return e!==t&&(n._pageSize=e.pageSize,n._page=e.page,n._sort=e.sort,n._filter=e.filter,n._group=e.group,n._aggregate=e.aggregate,n._skip=e.skip,n._take=e.take,n._skip===t&&(n._skip=n.skip(),e.skip=n.skip()),n._take===t&&n._pageSize!==t&&(n._take=n._pageSize,e.take=n._take),e.sort&&(n._sort=e.sort=a(e.sort)),e.filter&&(n._filter=e.filter=l(e.filter)),e.group&&(n._group=e.group=d(e.group)),e.aggregate&&(n._aggregate=e.aggregate=c(e.aggregate))),e},query:function(n){var i,r,o=this.options.serverSorting||this.options.serverPaging||this.options.serverFiltering||this.options.serverGrouping||this.options.serverAggregates;return o||(this._data===t||0===this._data.length)&&!this._destroyed.length?this.read(this._mergeState(n)):(r=this.trigger(Ct,{type:"read"}),r||(this.trigger(Tt),i=this._queryProcess(this._data,this._mergeState(n)),this.options.serverFiltering||(this._total=i.total!==t?i.total:this._data.length),this._aggregateResult=this._calculateAggregates(this._data,n),this.view(i.data),this.trigger(St,{}),this.trigger(yt,{items:i.data})),e.Deferred().resolve(r).promise())},fetch:function(e){var t=this,n=function(n){n!==!0&&ut(e)&&e.call(t)};return this._query().then(n)},_query:function(e){var t=this;return t.query(tt({},{page:t.page(),pageSize:t.pageSize(),sort:t.sort(),filter:t.filter(),group:t.group(),aggregate:t.aggregate()},e))},next:function(e){var n=this,i=n.page(),r=n.total();return e=e||{},!i||r&&i+1>n.totalPages()?t:(n._skip=i*n.take(),i+=1,e.page=i,n._query(e),i)},prev:function(e){var n=this,i=n.page();return e=e||{},i&&1!==i?(n._skip=n._skip-n.take(),i-=1,e.page=i,n._query(e),i):t},page:function(e){var n,i=this;return e!==t?(e=Pt.max(Pt.min(Pt.max(e,1),i.totalPages()),1),i._query({page:e}),t):(n=i.skip(),n!==t?Pt.round((n||0)/(i.take()||1))+1:t)},pageSize:function(e){var n=this;return e!==t?(n._query({pageSize:e,page:1}),t):n.take()},sort:function(e){var n=this;return e!==t?(n._query({sort:e}),t):n._sort},filter:function(e){var n=this;return e===t?n._filter:(n._query({filter:e,page:1}),t)},group:function(e){var n=this;return e!==t?(n._query({group:e}),t):n._group},total:function(){return parseInt(this._total||0,10)},aggregate:function(e){var n=this;return e!==t?(n._query({aggregate:e}),t):n._aggregate},aggregates:function(){return this._aggregateResult},totalPages:function(){var e=this,t=e.pageSize()||e.total();return Pt.ceil((e.total()||0)/t)},inRange:function(e,t){var n=this,i=Pt.min(e+t,n.total());return!n.options.serverPaging&&n._data.length>0?!0:n._findRange(e,i).length>0},lastRange:function(){var e=this._ranges;return e[e.length-1]||{start:0,end:0,data:[]}},firstItemUid:function(){var e=this._ranges;return e.length&&e[0].data.length&&e[0].data[0].uid},enableRequestsInProgress:function(){this._skipRequestsInProgress=!1},range:function(e,n){var i,r,o,a,s,l,c,d;if(e=Pt.min(e||0,this.total()),i=this,r=Pt.max(Pt.floor(e/n),0)*n,o=Pt.min(r+n,i.total()),i._skipRequestsInProgress=!1,a=i._findRange(e,Pt.min(e+n,i.total())),a.length){i._skipRequestsInProgress=!0,i._pending=t,i._skip=e>i.skip()?Pt.min(o,(i.totalPages()-1)*i.take()):r,i._take=n,s=i.options.serverPaging,l=i.options.serverSorting,c=i.options.serverFiltering,d=i.options.serverAggregates;try{i.options.serverPaging=!0,i._isServerGrouped()||i.group()&&i.group().length||(i.options.serverSorting=!0),i.options.serverFiltering=!0,i.options.serverPaging=!0,i.options.serverAggregates=!0,s&&(i._detachObservableParents(),i._data=a=i._observe(a)),i._process(a)}finally{i.options.serverPaging=s,i.options.serverSorting=l,i.options.serverFiltering=c,i.options.serverAggregates=d}}else n!==t&&(i._rangeExists(r,o)?e>r&&i.prefetch(o,n,function(){i.range(e,n)}):i.prefetch(r,n,function(){e>r&&o<i.total()&&!i._rangeExists(o,Pt.min(o+n,i.total()))?i.prefetch(o,n,function(){i.range(e,n)}):i.range(e,n)}))},_findRange:function(e,n){var i,r,o,s,l,c,u,h,p,f,g,m,v=this,_=v._ranges,w=[],y=v.options,b=y.serverSorting||y.serverPaging||y.serverFiltering||y.serverGrouping||y.serverAggregates;for(r=0,g=_.length;g>r;r++)if(i=_[r],e>=i.start&&i.end>=e){for(f=0,o=r;g>o;o++)if(i=_[o],p=v._flatData(i.data,!0),p.length&&e+f>=i.start&&(c=i.data,u=i.end,b||(m=d(v.group()||[]).concat(a(v.sort()||[])),h=v._queryProcess(i.data,{sort:m,filter:v.filter()}),p=c=h.data,h.total!==t&&(u=h.total)),s=0,e+f>i.start&&(s=e+f-i.start),l=p.length,u>n&&(l-=u-n),f+=l-s,w=v._mergeGroups(w,c,s,l),i.end>=n&&f==n-e))return w;break}return[]},_mergeGroups:function(e,t,n,i){if(this._isServerGrouped()){var r,o=t.toJSON();return e.length&&(r=e[e.length-1]),y(r,o,n,i),e.concat(o)}return e.concat(t.slice(n,i))},skip:function(){var e=this;return e._skip===t?e._page!==t?(e._page-1)*(e.take()||1):t:e._skip},take:function(){return this._take||this._pageSize
},_prefetchSuccessHandler:function(e,t,n){var i=this;return function(r){var o,a,s,l=!1,c={start:e,end:t,data:[]};if(i._dequeueRequest(),i.trigger(St,{response:r,type:"read"}),r=i.reader.parse(r),s=i._readData(r),s.length){for(o=0,a=i._ranges.length;a>o;o++)if(i._ranges[o].start===e){l=!0,c=i._ranges[o];break}l||i._ranges.push(c)}c.data=i._observe(s),c.end=c.start+i._flatData(c.data,!0).length,i._ranges.sort(function(e,t){return e.start-t.start}),i._total=i.reader.total(r),i._skipRequestsInProgress||(n&&s.length?n():i.trigger(yt,{}))}},prefetch:function(e,t,n){var i=this,r=Pt.min(e+t,i.total()),o={take:t,skip:e,page:e/t+1,pageSize:t,sort:i._sort,filter:i._filter,group:i._group,aggregate:i._aggregate};i._rangeExists(e,r)?n&&n():(clearTimeout(i._timeout),i._timeout=setTimeout(function(){i._queueRequest(o,function(){i.trigger(Ct,{type:"read"})?i._dequeueRequest():i.transport.read({data:i._params(o),success:i._prefetchSuccessHandler(e,r,n)})})},100))},_rangeExists:function(e,t){var n,i,r=this,o=r._ranges;for(n=0,i=o.length;i>n;n++)if(e>=o[n].start&&o[n].end>=t)return!0;return!1},_removeModelFromRanges:function(e){var t,n,i,r,o;for(r=0,o=this._ranges.length;o>r&&(i=this._ranges[r],this._eachItem(i.data,function(i){t=D(i,e),t&&(n=!0)}),!n);r++);},_updateRangesLength:function(){var e,t,n,i,r=0;for(n=0,i=this._ranges.length;i>n;n++)e=this._ranges[n],e.start=e.start-r,t=this._flatData(e.data,!0).length,r=e.end-t,e.end=e.start+t}}),K={},K.create=function(e,t){var n,i=e.transport;return i?(i.read=typeof i.read===ft?{url:i.read}:i.read,e.type&&(dt.data.transports=dt.data.transports||{},dt.data.schemas=dt.data.schemas||{},dt.data.transports[e.type]&&!it(dt.data.transports[e.type])?n=new dt.data.transports[e.type](tt(i,{data:t})):i=tt(!0,{},dt.data.transports[e.type],i),e.schema=tt(!0,{},dt.data.schemas[e.type],e.schema)),n||(n=ut(i.read)?i:new G(i))):n=new q({data:e.data||[]}),n},Q.create=function(e){(ot(e)||e instanceof jt)&&(e={data:e});var t,n,i,r=e||{},o=r.data,a=r.fields,s=r.table,l=r.select,c={};if(o||!a||r.transport||(s?o=B(s,a):l&&(o=R(l,a))),dt.data.Model&&a&&(!r.schema||!r.schema.model)){for(t=0,n=a.length;n>t;t++)i=a[t],i.type&&(c[i.field]=i);rt(c)||(r.schema=tt(!0,r.schema,{model:{fields:c}}))}return r.data=o,s=null,r.table=null,r instanceof Q?r:new Q(r)},X=Qt.define({idField:"id",init:function(e){var t=this,n=t.hasChildren||e&&e.hasChildren,i="items",r={};dt.data.Model.fn.init.call(t,e),typeof t.children===ft&&(i=t.children),r={schema:{data:i,model:{hasChildren:n,id:t.idField,fields:t.fields}}},typeof t.children!==ft&&tt(r,t.children),r.data=e,n||(n=r.schema.data),typeof n===ft&&(n=dt.getter(n)),ut(n)&&(t.hasChildren=!!n.call(t,t)),t._childrenOptions=r,t.hasChildren&&t._initChildren(),t._loaded=!(!e||!e[i]&&!e._loaded)},_initChildren:function(){var e,t,n,i=this;i.children instanceof Z||(e=i.children=new Z(i._childrenOptions),t=e.transport,n=t.parameterMap,t.parameterMap=function(e,t){return e[i.idField||"id"]=i.id,n&&(e=n(e,t)),e},e.parent=function(){return i},e.bind(yt,function(e){e.node=e.node||i,i.trigger(yt,e)}),e.bind(xt,function(e){var t=i.parent();t&&(e.node=e.node||i,t.trigger(xt,e))}),i._updateChildrenField())},append:function(e){this._initChildren(),this.loaded(!0),this.children.add(e)},hasChildren:!1,level:function(){for(var e=this.parentNode(),t=0;e&&e.parentNode;)t++,e=e.parentNode?e.parentNode():null;return t},_updateChildrenField:function(){var e=this._childrenOptions.schema.data;this[e||"items"]=this.children.data()},_childrenLoaded:function(){this._loaded=!0,this._updateChildrenField()},load:function(){var n,i,r={},o="_query";return this.hasChildren?(this._initChildren(),n=this.children,r[this.idField||"id"]=this.id,this._loaded||(n._data=t,o="read"),n.one(yt,nt(this._childrenLoaded,this)),i=n[o](r)):this.loaded(!0),i||e.Deferred().resolve().promise()},parentNode:function(){var e=this.parent();return e.parent()},loaded:function(e){return e===t?this._loaded:(this._loaded=e,t)},shouldSerialize:function(e){return Qt.fn.shouldSerialize.call(this,e)&&"children"!==e&&"_loaded"!==e&&"hasChildren"!==e&&"_childrenOptions"!==e}}),Z=Q.extend({init:function(e){var t=X.define({children:e});Q.fn.init.call(this,tt(!0,{},{schema:{modelBase:t,model:t}},e)),this._attachBubbleHandlers()},_attachBubbleHandlers:function(){var e=this;e._data.bind(xt,function(t){e.trigger(xt,t)})},remove:function(e){var t,n=e.parentNode(),i=this;return n&&n._initChildren&&(i=n.children),t=Q.fn.remove.call(i,e),n&&!i.data().length&&(n.hasChildren=!1),t},success:H("success"),data:H("data"),insert:function(e,t){var n=this.parent();return n&&n._initChildren&&(n.hasChildren=!0,n._initChildren()),Q.fn.insert.call(this,e,t)},_find:function(e,t){var n,i,r,o,a;if(r=Q.fn[e].call(this,t))return r;if(o=this._flatData(this._data))for(n=0,i=o.length;i>n;n++)if(a=o[n].children,a instanceof Z&&(r=a[e](t)))return r},get:function(e){return this._find("get",e)},getByUid:function(e){return this._find("getByUid",e)}}),Z.create=function(e){e=e&&e.push?{data:e}:e;var t=e||{},n=t.data,i=t.fields,r=t.list;return n&&n._dataSource?n._dataSource:(n||!i||t.transport||r&&(n=L(r,i)),t.data=n,t instanceof Z?t:new Z(t))},J=dt.Observable.extend({init:function(e,t,n){dt.Observable.fn.init.call(this),this._prefetching=!1,this.dataSource=e,this.prefetch=!n;var i=this;e.bind("change",function(){i._change()}),e.bind("reset",function(){i._reset()}),this._syncWithDataSource(),this.setViewSize(t)},setViewSize:function(e){this.viewSize=e,this._recalculate()},at:function(e){var n=this.pageSize,i=!0;return e>=this.total()?(this.trigger("endreached",{index:e}),null):this.useRanges?this.useRanges?((this.dataOffset>e||e>=this.skip+n)&&(i=this.range(Math.floor(e/n)*n)),e===this.prefetchThreshold&&this._prefetch(),e===this.midPageThreshold?this.range(this.nextMidRange,!0):e===this.nextPageThreshold?this.range(this.nextFullRange):e===this.pullBackThreshold&&this.range(this.offset===this.skip?this.previousMidRange:this.previousFullRange),i?this.dataSource.at(e-this.dataOffset):(this.trigger("endreached",{index:e}),null)):t:this.dataSource.view()[e]},indexOf:function(e){return this.dataSource.data().indexOf(e)+this.dataOffset},total:function(){return parseInt(this.dataSource.total(),10)},next:function(){var e=this,t=e.pageSize,n=e.skip-e.viewSize+t,i=Pt.max(Pt.floor(n/t),0)*t;this.offset=n,this.dataSource.prefetch(i,t,function(){e._goToRange(n,!0)})},range:function(e,t){if(this.offset===e)return!0;var n=this,i=this.pageSize,r=Pt.max(Pt.floor(e/i),0)*i,o=this.dataSource;return t&&(r+=i),o.inRange(e,i)?(this.offset=e,this._recalculate(),this._goToRange(e),!0):this.prefetch?(o.prefetch(r,i,function(){n.offset=e,n._recalculate(),n._goToRange(e,!0)}),!1):!0},syncDataSource:function(){var e=this.offset;this.offset=null,this.range(e)},destroy:function(){this.unbind()},_prefetch:function(){var e=this,t=this.pageSize,n=this.skip+t,i=this.dataSource;i.inRange(n,t)||this._prefetching||!this.prefetch||(this._prefetching=!0,this.trigger("prefetching",{skip:n,take:t}),i.prefetch(n,t,function(){e._prefetching=!1,e.trigger("prefetched",{skip:n,take:t})}))},_goToRange:function(e,t){this.offset===e&&(this.dataOffset=e,this._expanding=t,this.dataSource.range(e,this.pageSize),this.dataSource.enableRequestsInProgress())},_reset:function(){this._syncPending=!0},_change:function(){var e=this.dataSource;this.length=this.useRanges?e.lastRange().end:e.view().length,this._syncPending&&(this._syncWithDataSource(),this._recalculate(),this._syncPending=!1,this.trigger("reset",{offset:this.offset})),this.trigger("resize"),this._expanding&&this.trigger("expand"),delete this._expanding},_syncWithDataSource:function(){var e=this.dataSource;this._firstItemUid=e.firstItemUid(),this.dataOffset=this.offset=e.skip()||0,this.pageSize=e.pageSize(),this.useRanges=e.options.serverPaging},_recalculate:function(){var e=this.pageSize,t=this.offset,n=this.viewSize,i=Math.ceil(t/e)*e;this.skip=i,this.midPageThreshold=i+e-1,this.nextPageThreshold=i+n-1,this.prefetchThreshold=i+Math.floor(e/3*2),this.pullBackThreshold=this.offset-1,this.nextMidRange=i+e-n,this.nextFullRange=i,this.previousMidRange=t-n,this.previousFullRange=i-e}}),et=dt.Observable.extend({init:function(e,t){var n=this;dt.Observable.fn.init.call(n),this.dataSource=e,this.batchSize=t,this._total=0,this.buffer=new J(e,3*t),this.buffer.bind({endreached:function(e){n.trigger("endreached",{index:e.index})},prefetching:function(e){n.trigger("prefetching",{skip:e.skip,take:e.take})},prefetched:function(e){n.trigger("prefetched",{skip:e.skip,take:e.take})},reset:function(){n._total=0,n.trigger("reset")},resize:function(){n._total=Math.ceil(this.length/n.batchSize),n.trigger("resize",{total:n.total(),offset:this.offset})}})},syncDataSource:function(){this.buffer.syncDataSource()},at:function(e){var n,i,r=this.buffer,o=e*this.batchSize,a=this.batchSize,s=[];for(r.offset>o&&r.at(r.offset-1),i=0;a>i&&(n=r.at(o+i),n!==t);i++)s.push(n);return s},total:function(){return this._total},destroy:function(){this.buffer.destroy(),this.unbind()}}),tt(!0,dt.data,{readers:{json:Y},Query:o,DataSource:Q,HierarchicalDataSource:Z,Node:X,ObservableObject:Gt,ObservableArray:jt,LazyObservableArray:qt,LocalTransport:q,RemoteTransport:G,Cache:$,DataReader:Y,Model:Qt,Buffer:J,BatchBuffer:et})}(window.kendo.jQuery),function(e,t){function n(t,n,i){return v.extend({init:function(e,t,n){var i=this;v.fn.init.call(i,e.element[0],t,n),i.widget=e,i._dataBinding=I(i.dataBinding,i),i._dataBound=I(i.dataBound,i),i._itemChange=I(i.itemChange,i)},itemChange:function(e){a(e.item[0],e.data,this._ns(e.ns),[e.data].concat(this.bindings[t]._parents()))},dataBinding:function(e){var t,n,i=this.widget,r=e.removedItems||i.items();for(t=0,n=r.length;n>t;t++)c(r[t])},_ns:function(t){t=t||x.ui;var n=[x.ui,x.dataviz.ui,x.mobile.ui];return n.splice(e.inArray(t,n),1),n.unshift(t),x.rolesFromNamespaces(n)},dataBound:function(e){{var i,r,o,s,l=this.widget,c=e.addedItems||l.items(),d=l[n];d.group()||[]}if(c.length)for(o=e.addedDataItems||d.flatView(),s=this.bindings[t]._parents(),i=0,r=o.length;r>i;i++)a(c[i],o[i],this._ns(e.ns),[o[i]].concat(s))},refresh:function(e){var r,o=this,a=o.widget;e=e||{},e.action||(o.destroy(),a.bind("dataBinding",o._dataBinding),a.bind("dataBound",o._dataBound),a.bind("itemChange",o._itemChange),r=o.bindings[t].get(),a[n]instanceof x.data.DataSource&&a[n]!=r&&(r instanceof x.data.DataSource?a[i](r):r&&r._dataSource?a[i](r._dataSource):a[n].data(r)))},destroy:function(){var e=this.widget;e.unbind("dataBinding",this._dataBinding),e.unbind("dataBound",this._dataBound),e.unbind("itemChange",this._itemChange)}})}function i(e,n){var i=x.initWidget(e,{},n);return i?new y(i):t}function r(e){var t,n,i,o,a,s,l,c={};for(l=e.match(b),t=0,n=l.length;n>t;t++)i=l[t],o=i.indexOf(":"),a=i.substring(0,o),s=i.substring(o+1),"{"==s.charAt(0)&&(s=r(s)),c[a]=s;return c}function o(e,t,n){var i,r={};for(i in e)r[i]=new n(t,e[i]);return r}function a(e,t,n,s){var c,d,u,h=e.getAttribute("data-"+x.ns+"role"),p=e.getAttribute("data-"+x.ns+"bind"),v=e.children,_=[],y=!0,b={};if(s=s||[t],(h||p)&&l(e),h&&(u=i(e,n)),p&&(p=r(p.replace(k,"")),u||(b=x.parseOptions(e,{textField:"",valueField:"",template:"",valueUpdate:B,valuePrimitive:!1,autoBind:!0}),b.roles=n,u=new w(e,b)),u.source=t,d=o(p,s,f),b.template&&(d.template=new m(s,"",b.template)),d.click&&(p.events=p.events||{},p.events.click=p.click,d.click.destroy(),delete d.click),d.source&&(y=!1),p.attr&&(d.attr=o(p.attr,s,f)),p.style&&(d.style=o(p.style,s,f)),p.events&&(d.events=o(p.events,s,g)),u.bind(d)),u&&(e.kendoBindingTarget=u),y&&v){for(c=0;v.length>c;c++)_[c]=v[c];for(c=0;_.length>c;c++)a(_[c],t,n,s)}}function s(t,n){var i,r,o,s=x.rolesFromNamespaces([].slice.call(arguments,2));for(n=x.observable(n),t=e(t),i=0,r=t.length;r>i;i++)o=t[i],1===o.nodeType&&a(o,n,s)}function l(e){var t=e.kendoBindingTarget;t&&(t.destroy(),R?delete e.kendoBindingTarget:e.removeAttribute?e.removeAttribute("kendoBindingTarget"):e.kendoBindingTarget=null)}function c(e){l(e),d(e)}function d(e){var t,n,i=e.children;if(i)for(t=0,n=i.length;n>t;t++)c(i[t])}function u(t){var n,i;for(t=e(t),n=0,i=t.length;i>n;n++)c(t[n])}function h(e,t){var n=e.element,i=n[0].kendoBindingTarget;i&&s(n,i.source,t)}var p,f,g,m,v,_,w,y,b,k,x=window.kendo,C=x.Observable,T=x.data.ObservableObject,S=x.data.ObservableArray,D={}.toString,A={},E=x.Class,I=e.proxy,P="value",M="source",F="events",z="checked",R=!0,B="change";!function(){var e=document.createElement("a");e.innerText!==t?p="innerText":e.textContent!==t&&(p="textContent");try{delete e.test}catch(n){R=!1}}(),f=C.extend({init:function(e,t){var n=this;C.fn.init.call(n),n.source=e[0],n.parents=e,n.path=t,n.dependencies={},n.dependencies[t]=!0,n.observable=n.source instanceof C,n._access=function(e){n.dependencies[e.field]=!0},n.observable&&(n._change=function(e){n.change(e)},n.source.bind(B,n._change))},_parents:function(){var t,n=this.parents,i=this.get();return i&&"function"==typeof i.parent&&(t=i.parent(),e.inArray(t,n)<0&&(n=[t].concat(n))),n},change:function(e){var t,n,i=e.field,r=this;if("this"===r.path)r.trigger(B,e);else for(t in r.dependencies)if(0===t.indexOf(i)&&(n=t.charAt(i.length),!n||"."===n||"["===n)){r.trigger(B,e);break}},start:function(e){e.bind("get",this._access)},stop:function(e){e.unbind("get",this._access)},get:function(){var e=this,n=e.source,i=0,r=e.path,o=n;if(!e.observable)return o;for(e.start(e.source),o=n.get(r);o===t&&n;)n=e.parents[++i],n instanceof T&&(o=n.get(r));if(o===t)for(n=e.source;o===t&&n;)n=n.parent(),n instanceof T&&(o=n.get(r));return"function"==typeof o&&(i=r.lastIndexOf("."),i>0&&(n=n.get(r.substring(0,i))),e.start(n),o=n!==e.source?o.call(n,e.source):o.call(n),e.stop(n)),n&&n!==e.source&&(e.currentSource=n,n.unbind(B,e._change).bind(B,e._change)),e.stop(e.source),o},set:function(e){var t=this.currentSource||this.source,n=x.getter(this.path)(t);"function"==typeof n?t!==this.source?n.call(t,this.source,e):n.call(t,e):t.set(this.path,e)},destroy:function(){this.observable&&(this.source.unbind(B,this._change),this.currentSource&&this.currentSource.unbind(B,this._change)),this.unbind()}}),g=f.extend({get:function(){var e,t=this.source,n=this.path,i=0;for(e=t.get(n);!e&&t;)t=this.parents[++i],t instanceof T&&(e=t.get(n));return I(e,t)}}),m=f.extend({init:function(e,t,n){var i=this;f.fn.init.call(i,e,t),i.template=n},render:function(e){var t;return this.start(this.source),t=x.render(this.template,e),this.stop(this.source),t}}),v=E.extend({init:function(e,t,n){this.element=e,this.bindings=t,this.options=n},bind:function(e,t){var n=this;e=t?e[t]:e,e.bind(B,function(e){n.refresh(t||e)}),n.refresh(t)},destroy:function(){}}),A.attr=v.extend({refresh:function(e){this.element.setAttribute(e,this.bindings.attr[e].get())}}),A.style=v.extend({refresh:function(e){this.element.style[e]=this.bindings.style[e].get()||""}}),A.enabled=v.extend({refresh:function(){this.bindings.enabled.get()?this.element.removeAttribute("disabled"):this.element.setAttribute("disabled","disabled")}}),A.readonly=v.extend({refresh:function(){this.bindings.readonly.get()?this.element.setAttribute("readonly","readonly"):this.element.removeAttribute("readonly")}}),A.disabled=v.extend({refresh:function(){this.bindings.disabled.get()?this.element.setAttribute("disabled","disabled"):this.element.removeAttribute("disabled")}}),A.events=v.extend({init:function(e,t,n){v.fn.init.call(this,e,t,n),this.handlers={}},refresh:function(t){var n=e(this.element),i=this.bindings.events[t],r=this.handlers[t];r&&n.off(t,r),r=this.handlers[t]=i.get(),n.on(t,i.source,r)},destroy:function(){var t,n=e(this.element);for(t in this.handlers)n.off(t,this.handlers[t])}}),A.text=v.extend({refresh:function(){var e=this.bindings.text.get();null==e&&(e=""),this.element[p]=e}}),A.visible=v.extend({refresh:function(){this.element.style.display=this.bindings.visible.get()?"":"none"}}),A.invisible=v.extend({refresh:function(){this.element.style.display=this.bindings.invisible.get()?"none":""}}),A.html=v.extend({refresh:function(){this.element.innerHTML=this.bindings.html.get()}}),A.value=v.extend({init:function(t,n,i){v.fn.init.call(this,t,n,i),this._change=I(this.change,this),this.eventName=i.valueUpdate||B,e(this.element).on(this.eventName,this._change),this._initChange=!1},change:function(){var e,t;this._initChange=this.eventName!=B,e=this.element.value,t=this.element.type,"date"==t?e=x.parseDate(e,"yyyy-MM-dd"):"datetime-local"==t?e=x.parseDate(e,["yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm"]):"number"==t&&(e=x.parseFloat(e)),this.bindings[P].set(e),this._initChange=!1},refresh:function(){var e,t;this._initChange||(e=this.bindings[P].get(),null==e&&(e=""),t=this.element.type,"date"==t?e=x.toString(e,"yyyy-MM-dd"):"datetime-local"==t&&(e=x.toString(e,"yyyy-MM-ddTHH:mm:ss")),this.element.value=e),this._initChange=!1},destroy:function(){e(this.element).off(this.eventName,this._change)}}),A.source=v.extend({init:function(e,t,n){v.fn.init.call(this,e,t,n);var i=this.bindings.source.get();i instanceof x.data.DataSource&&n.autoBind!==!1&&i.fetch()},refresh:function(e){var t=this,n=t.bindings.source.get();n instanceof S||n instanceof x.data.DataSource?(e=e||{},"add"==e.action?t.add(e.index,e.items):"remove"==e.action?t.remove(e.index,e.items):"itemchange"!=e.action&&t.render()):t.render()},container:function(){var e=this.element;return"table"==e.nodeName.toLowerCase()&&(e.tBodies[0]||e.appendChild(document.createElement("tbody")),e=e.tBodies[0]),e},template:function(){var e=this.options,t=e.template,n=this.container().nodeName.toLowerCase();return t||(t="select"==n?e.valueField||e.textField?x.format('<option value="#:{0}#">#:{1}#</option>',e.valueField||e.textField,e.textField||e.valueField):"<option>#:data#</option>":"tbody"==n?"<tr><td>#:data#</td></tr>":"ul"==n||"ol"==n?"<li>#:data#</li>":"#:data#",t=x.template(t)),t},add:function(t,n){var i,r,o,s,l=this.container(),c=l.cloneNode(!1),d=l.children[t];if(e(c).html(x.render(this.template(),n)),c.children.length)for(i=this.bindings.source._parents(),r=0,o=n.length;o>r;r++)s=c.children[0],l.insertBefore(s,d||null),a(s,n[r],this.options.roles,[n[r]].concat(i))},remove:function(e,t){var n,i,r=this.container();for(n=0;t.length>n;n++)i=r.children[e],c(i),r.removeChild(i)},render:function(){var t,n,i,r=this.bindings.source.get(),o=this.container(),s=this.template();if(r instanceof x.data.DataSource&&(r=r.view()),r instanceof S||"[object Array]"===D.call(r)||(r=[r]),this.bindings.template){if(d(o),e(o).html(this.bindings.template.render(r)),o.children.length)for(t=this.bindings.source._parents(),n=0,i=r.length;i>n;n++)a(o.children[n],r[n],this.options.roles,[r[n]].concat(t))}else e(o).html(x.render(s,r))}}),A.input={checked:v.extend({init:function(t,n,i){v.fn.init.call(this,t,n,i),this._change=I(this.change,this),e(this.element).change(this._change)},change:function(){var e,t,n=this.element,i=this.value();"radio"==n.type?this.bindings[z].set(i):"checkbox"==n.type&&(e=this.bindings[z].get(),e instanceof S?(i=this.element.value,"on"!==i&&"off"!==i&&(t=e.indexOf(i),t>-1?e.splice(t,1):e.push(i))):this.bindings[z].set(i))},refresh:function(){var e=this.bindings[z].get(),t=e,n=this.element;"checkbox"==n.type?(t instanceof S&&(e=this.element.value,t.indexOf(e)>=0&&(e=!0)),n.checked=e===!0):"radio"==n.type&&null!=e&&n.value===""+e&&(n.checked=!0)},value:function(){var e=this.element,t=e.value;return"checkbox"==e.type&&(t=e.checked),t},destroy:function(){e(this.element).off(B,this._change)}})},A.select={value:v.extend({init:function(t,n,i){v.fn.init.call(this,t,n,i),this._change=I(this.change,this),e(this.element).change(this._change)},change:function(){var e,n,i,r,o,a,s=[],l=this.element,c=this.options.valueField||this.options.textField,d=this.options.valuePrimitive;for(o=0,a=l.options.length;a>o;o++)n=l.options[o],n.selected&&(r=n.attributes.value,r=r&&r.specified?n.value:n.text,s.push(r));if(c)for(e=this.bindings.source.get(),e instanceof x.data.DataSource&&(e=e.view()),i=0;s.length>i;i++)for(o=0,a=e.length;a>o;o++)if(e[o].get(c)==s[i]){s[i]=e[o];break}r=this.bindings[P].get(),r instanceof S?r.splice.apply(r,[0,r.length].concat(s)):this.bindings[P].set(d||!(r instanceof T||null===r||r===t)&&c?s[0].get(c):s[0])},refresh:function(){var e,t,n,i=this.element,r=i.options,o=this.bindings[P].get(),a=o,s=this.options.valueField||this.options.textField,l=!1;for(a instanceof S||(a=new S([o])),i.selectedIndex=-1,n=0;a.length>n;n++)for(o=a[n],s&&o instanceof T&&(o=o.get(s)),e=0;r.length>e;e++)t=r[e].value,""===t&&""!==o&&(t=r[e].text),t==o&&(r[e].selected=!0,l=!0)},destroy:function(){e(this.element).off(B,this._change)}})},A.widget={events:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e,this.handlers={}},refresh:function(e){var t=this.bindings.events[e],n=this.handlers[e];n&&this.widget.unbind(e,n),n=t.get(),this.handlers[e]=function(e){e.data=t.source,n(e),e.data===t.source&&delete e.data},this.widget.bind(e,this.handlers[e])},destroy:function(){var e;for(e in this.handlers)this.widget.unbind(e,this.handlers[e])}}),checked:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e,this._change=I(this.change,this),this.widget.bind(B,this._change)},change:function(){this.bindings[z].set(this.value())},refresh:function(){this.widget.check(this.bindings[z].get()===!0)},value:function(){var e=this.element,t=e.value;return("on"==t||"off"==t)&&(t=e.checked),t},destroy:function(){this.widget.unbind(B,this._change)}}),visible:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){var e=this.bindings.visible.get();this.widget.wrapper[0].style.display=e?"":"none"}}),invisible:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){var e=this.bindings.invisible.get();this.widget.wrapper[0].style.display=e?"none":""}}),enabled:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){this.widget.enable&&this.widget.enable(this.bindings.enabled.get())}}),disabled:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){this.widget.enable&&this.widget.enable(!this.bindings.disabled.get())}}),source:n("source","dataSource","setDataSource"),value:v.extend({init:function(t,n,i){v.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=e.proxy(this.change,this),this.widget.first(B,this._change);var r=this.bindings.value.get();this._valueIsObservableObject=!i.valuePrimitive&&(null==r||r instanceof T),this._valueIsObservableArray=r instanceof S,this._initChange=!1},change:function(){var e,t,n,i,r,o,a,s=this.widget.value(),l=this.options.dataValueField||this.options.dataTextField,c="[object Array]"===D.call(s),d=this._valueIsObservableObject,u=[];if(this._initChange=!0,l)if(this.bindings.source&&(a=this.bindings.source.get()),""===s&&(d||this.options.valuePrimitive))s=null;else{for((!a||a instanceof x.data.DataSource)&&(a=this.widget.dataSource.view()),c&&(t=s.length,u=s.slice(0)),r=0,o=a.length;o>r;r++)if(n=a[r],i=n.get(l),c){for(e=0;t>e;e++)if(i==u[e]){u[e]=n;break}}else if(i==s){s=d?n:i;break}u[0]&&(s=this._valueIsObservableArray?u:d||!l?u[0]:u[0].get(l))}this.bindings.value.set(s),this._initChange=!1},refresh:function(){if(!this._initChange){var e,n=this.options.dataValueField||this.options.dataTextField,i=this.bindings.value.get(),r=0,o=[];if(i===t&&(i=null),n)if(i instanceof S){for(e=i.length;e>r;r++)o[r]=i[r].get(n);i=o}else i instanceof T&&(i=i.get(n));this.widget.value(i)}this._initChange=!1},destroy:function(){this.widget.unbind(B,this._change)}}),gantt:{dependencies:n("dependencies","dependencies","setDependenciesDataSource")},multiselect:{value:v.extend({init:function(t,n,i){v.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=e.proxy(this.change,this),this.widget.first(B,this._change),this._initChange=!1},change:function(){var e,n,i,r,o,a,s,l,c,d=this,u=d.bindings[P].get(),h=d.options.valuePrimitive,p=h?d.widget.value():d.widget.dataItems(),f=this.options.dataValueField||this.options.dataTextField;if(p=p.slice(0),d._initChange=!0,u instanceof S){for(e=[],n=p.length,i=0,r=0,o=u[i],a=!1;o!==t;){for(c=!1,r=0;n>r;r++)if(h?a=p[r]==o:(l=p[r],l=l.get?l.get(f):l,a=l==(o.get?o.get(f):o)),a){p.splice(r,1),n-=1,c=!0;break}c?i+=1:(e.push(o),_(u,i,1),s=i),o=u[i]}_(u,u.length,0,p),e.length&&u.trigger("change",{action:"remove",items:e,index:s}),p.length&&u.trigger("change",{action:"add",items:p,index:u.length-1})}else d.bindings[P].set(p);d._initChange=!1},refresh:function(){if(!this._initChange){var e,n,i=this.options.dataValueField||this.options.dataTextField,r=this.bindings.value.get(),o=0,a=[];if(r===t&&(r=null),i)if(r instanceof S){for(e=r.length;e>o;o++)n=r[o],a[o]=n.get?n.get(i):n;r=a}else r instanceof T&&(r=r.get(i));this.widget.value(r)}},destroy:function(){this.widget.unbind(B,this._change)}})},scheduler:{source:n("source","dataSource","setDataSource").extend({dataBound:function(e){var t,n,i,r,o=this.widget,s=e.addedItems||o.items();if(s.length)for(i=e.addedDataItems||o.dataItems(),r=this.bindings.source._parents(),t=0,n=i.length;n>t;t++)a(s[t],i[t],this._ns(e.ns),[i[t]].concat(r))}})}},_=function(e,t,n,i){var r,o,a,s,l;if(i=i||[],n=n||0,r=i.length,o=e.length,a=[].slice.call(e,t+n),s=a.length,r){for(r=t+r,l=0;r>t;t++)e[t]=i[l],l++;e.length=r}else if(n)for(e.length=t,n+=t;n>t;)delete e[--n];if(s){for(s=t+s,l=0;s>t;t++)e[t]=a[l],l++;e.length=s}for(t=e.length;o>t;)delete e[t],t++},w=E.extend({init:function(e,t){this.target=e,this.options=t,this.toDestroy=[]},bind:function(e){var t,n,i,r,o=this.target.nodeName.toLowerCase(),a=A[o]||{};for(t in e)t==P?n=!0:t==M?i=!0:t==F?r=!0:this.applyBinding(t,e,a);i&&this.applyBinding(M,e,a),n&&this.applyBinding(P,e,a),r&&this.applyBinding(F,e,a)},applyBinding:function(e,t,n){var i,r=n[e]||A[e],o=this.toDestroy,a=t[e];if(r)if(r=new r(this.target,t,this.options),o.push(r),a instanceof f)r.bind(a),o.push(a);else for(i in a)r.bind(a,i),o.push(a[i]);else if("template"!==e)throw Error("The "+e+" binding is not supported by the "+this.target.nodeName.toLowerCase()+" element")},destroy:function(){var e,t,n=this.toDestroy;for(e=0,t=n.length;t>e;e++)n[e].destroy()}}),y=w.extend({bind:function(e){var t,n=this,i=!1,r=!1,o=A.widget[n.target.options.name.toLowerCase()]||{};for(t in e)t==P?i=!0:t==M?r=!0:n.applyBinding(t,e,o);r&&n.applyBinding(M,e,o),i&&n.applyBinding(P,e,o)},applyBinding:function(e,t,n){var i,r=n[e]||A.widget[e],o=this.toDestroy,a=t[e];if(!r)throw Error("The "+e+" binding is not supported by the "+this.target.options.name+" widget");if(r=new r(this.target,t,this.target.options),o.push(r),a instanceof f)r.bind(a),o.push(a);else for(i in a)r.bind(a,i),o.push(a[i])}}),b=/[A-Za-z0-9_\-]+:(\{([^}]*)\}|[^,}]+)/g,k=/\s/g,x.unbind=u,x.bind=s,x.data.binders=A,x.data.Binder=v,x.notify=h,x.observable=function(e){return e instanceof T||(e=new T(e)),e},x.observableHierarchy=function(e){function t(e){var n,i;for(n=0;e.length>n;n++)e[n]._initChildren(),i=e[n].children,i.fetch(),e[n].items=i.data(),t(e[n].items)}var n=x.data.HierarchicalDataSource.create(e);return n.fetch(),t(n.data()),n._data._dataSource=n,n._data}}(window.kendo.jQuery),function(e,t){function n(e){return parseInt(e,10)}function i(e,t){return n(e.css(t))}function r(e){var t,n=[];for(t in e)n.push(t);return n}function o(e){for(var t in e)-1!=U.indexOf(t)&&-1==W.indexOf(t)&&delete e[t];return e}function a(e,t){var n,i,r,o,a=[],s={};for(i in t)n=i.toLowerCase(),o=P&&-1!=U.indexOf(n),!E.hasHW3D&&o&&-1==W.indexOf(n)?delete t[i]:(r=t[i],o?a.push(i+"("+r+")"):s[i]=r);return a.length&&(s[st]=a.join(" ")),s}function s(e,t){var i,r,o;return P?(i=e.css(st),i==Q?"scale"==t?1:0:(r=i.match(RegExp(t+"\\s*\\(([\\d\\w\\.]+)")),o=0,r?o=n(r[1]):(r=i.match(B)||[0,0,0,0,0],t=t.toLowerCase(),L.test(t)?o=parseFloat(r[3]/r[2]):"translatey"==t?o=parseFloat(r[4]/r[2]):"scale"==t?o=parseFloat(r[2]):"rotate"==t&&(o=parseFloat(Math.atan2(r[2],r[1])))),o)):parseFloat(e.css(t))}function l(e){return e.charAt(0).toUpperCase()+e.substring(1)}function c(e,t){var n=f.extend(t),i=n.prototype.directions;T[l(e)]=n,T.Element.prototype[e]=function(e,t,i,r){return new n(this.element,e,t,i,r)},S(i,function(t,i){T.Element.prototype[e+l(i)]=function(e,t,r){return new n(this.element,i,e,t,r)}})}function d(e,n,i,r){c(e,{directions:m,startValue:function(e){return this._startValue=e,this},endValue:function(e){return this._endValue=e,this},shouldHide:function(){return this._shouldHide},prepare:function(e,o){var a,s,l=this,c="out"===this._direction,d=l.element.data(n),u=!(isNaN(d)||d==i);a=u?d:t!==this._startValue?this._startValue:c?i:r,s=t!==this._endValue?this._endValue:c?r:i,this._reverse?(e[n]=s,o[n]=a):(e[n]=a,o[n]=s),l._shouldHide=o[n]===r}})}function u(e,t){var n=C.directions[t].vertical,i=e[n?Z:X]()/2+"px";return _[t].replace("$size",i)}var h,p,f,g,m,v,_,w,y,b,k,x,C=window.kendo,T=C.effects,S=e.each,D=e.extend,A=e.proxy,E=C.support,I=E.browser,P=E.transforms,M=E.transitions,F={scale:0,scalex:0,scaley:0,scale3d:0},z={translate:0,translatex:0,translatey:0,translate3d:0},R=t!==document.documentElement.style.zoom&&!P,B=/matrix3?d?\s*\(.*,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?/i,H=/^(-?[\d\.\-]+)?[\w\s]*,?\s*(-?[\d\.\-]+)?[\w\s]*/i,L=/translatex?$/i,N=/(zoom|fade|expand)(\w+)/,O=/(zoom|fade|expand)/,V=/[xy]$/i,U=["perspective","rotate","rotatex","rotatey","rotatez","rotate3d","scale","scalex","scaley","scalez","scale3d","skew","skewx","skewy","translate","translatex","translatey","translatez","translate3d","matrix","matrix3d"],W=["rotate","scale","scalex","scaley","skew","skewx","skewy","translate","translatex","translatey","matrix"],j={rotate:"deg",scale:"",skew:"px",translate:"px"},q=P.css,G=Math.round,$="",Y="px",Q="none",K="auto",X="width",Z="height",J="hidden",et="origin",tt="abortId",nt="overflow",it="translate",rt="position",ot="completeCallback",at=q+"transition",st=q+"transform",lt=q+"backface-visibility",ct=q+"perspective",dt="1500px",ut="perspective("+dt+")",ht={left:{reverse:"right",property:"left",transition:"translatex",vertical:!1,modifier:-1},right:{reverse:"left",property:"left",transition:"translatex",vertical:!1,modifier:1},down:{reverse:"up",property:"top",transition:"translatey",vertical:!0,modifier:1},up:{reverse:"down",property:"top",transition:"translatey",vertical:!0,modifier:-1},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out",modifier:-1},out:{reverse:"in",modifier:1},vertical:{reverse:"vertical"},horizontal:{reverse:"horizontal"}};C.directions=ht,D(e.fn,{kendoStop:function(e,t){return M?T.stopQueue(this,e||!1,t||!1):this.stop(e,t)}}),P&&!M&&(S(W,function(n,i){e.fn[i]=function(n){if(t===n)return s(this,i);var r=e(this)[0],o=i+"("+n+j[i.replace(V,"")]+")";return-1==r.style.cssText.indexOf(st)?e(this).css(st,o):r.style.cssText=r.style.cssText.replace(RegExp(i+"\\(.*?\\)","i"),o),this},e.fx.step[i]=function(t){e(t.elem)[i](t.now)}}),h=e.fx.prototype.cur,e.fx.prototype.cur=function(){return-1!=W.indexOf(this.prop)?parseFloat(e(this.elem)[this.prop]()):h.apply(this,arguments)}),C.toggleClass=function(e,t,n,i){return t&&(t=t.split(" "),M&&(n=D({exclusive:"all",duration:400,ease:"ease-out"},n),e.css(at,n.exclusive+" "+n.duration+"ms "+n.ease),setTimeout(function(){e.css(at,"").css(Z)},n.duration)),S(t,function(t,n){e.toggleClass(n,i)})),e},C.parseEffects=function(e,t){var n={};return"string"==typeof e?S(e.split(" "),function(e,i){var r=!O.test(i),o=i.replace(N,function(e,t,n){return t+":"+n.toLowerCase()}),a=o.split(":"),s=a[1],l={};a.length>1&&(l.direction=t&&r?ht[s].reverse:s),n[a[0]]=l}):S(e,function(e){var i=this.direction;i&&t&&!O.test(e)&&(this.direction=ht[i].reverse),n[e]=this}),n},M&&D(T,{transition:function(t,n,i){var o,s,l,c,d=0,u=t.data("keys")||[];i=D({duration:200,ease:"ease-out",complete:null,exclusive:"all"},i),l=!1,c=function(){l||(l=!0,s&&(clearTimeout(s),s=null),t.removeData(tt).dequeue().css(at,"").css(at),i.complete.call(t))
},i.duration=e.fx?e.fx.speeds[i.duration]||i.duration:i.duration,o=a(t,n),e.merge(u,r(o)),t.data("keys",e.unique(u)).height(),t.css(at,i.exclusive+" "+i.duration+"ms "+i.ease).css(at),t.css(o).css(st),M.event&&(t.one(M.event,c),0!==i.duration&&(d=500)),s=setTimeout(c,i.duration+d),t.data(tt,s),t.data(ot,c)},stopQueue:function(e,t,n){var i,r=e.data("keys"),o=!n&&r,a=e.data(ot);return o&&(i=C.getComputedStyles(e[0],r)),a&&a(),o&&e.css(i),e.removeData("keys").stop(t)}}),p=C.Class.extend({init:function(e,t){var n=this;n.element=e,n.effects=[],n.options=t,n.restore=[]},run:function(t){var n,i,r,s,l,c,d,u=this,h=t.length,p=u.element,f=u.options,g=e.Deferred(),m={},v={};for(u.effects=t,g.then(e.proxy(u,"complete")),p.data("animating",!0),i=0;h>i;i++)for(n=t[i],n.setReverse(f.reverse),n.setOptions(f),u.addRestoreProperties(n.restore),n.prepare(m,v),l=n.children(),r=0,c=l.length;c>r;r++)l[r].duration(f.duration).run();for(d in f.effects)D(v,f.effects[d].properties);for(p.is(":visible")||D(m,{display:p.data("olddisplay")||"block"}),P&&!f.reset&&(s=p.data("targetTransform"),s&&(m=D(s,m))),m=a(p,m),P&&!M&&(m=o(m)),p.css(m).css(st),i=0;h>i;i++)t[i].setup();return f.init&&f.init(),p.data("targetTransform",v),T.animate(p,v,D({},f,{complete:g.resolve})),g.promise()},stop:function(){e(this.element).kendoStop(!0,!0)},addRestoreProperties:function(e){for(var t,n=this.element,i=0,r=e.length;r>i;i++)t=e[i],this.restore.push(t),n.data(t)||n.data(t,n.css(t))},restoreCallback:function(){var e,t,n,i=this.element;for(e=0,t=this.restore.length;t>e;e++)n=this.restore[e],i.css(n,i.data(n))},complete:function(){var t=this,n=0,i=t.element,r=t.options,o=t.effects,a=o.length;for(i.removeData("animating").dequeue(),r.hide&&i.data("olddisplay",i.css("display")).hide(),this.restoreCallback(),R&&!P&&setTimeout(e.proxy(this,"restoreCallback"),0);a>n;n++)o[n].teardown();r.completeCallback&&r.completeCallback(i)}}),T.promise=function(e,t){var n,i,r,o=[],a=new p(e,t),s=C.parseEffects(t.effects);t.effects=s;for(r in s)n=T[l(r)],n&&(i=new n(e,s[r].direction),o.push(i));o[0]?a.run(o):(e.is(":visible")||e.css({display:e.data("olddisplay")||"block"}).css("display"),t.init&&t.init(),e.dequeue(),a.complete())},D(T,{animate:function(n,r,a){var s=a.transition!==!1;delete a.transition,M&&"transition"in T&&s?T.transition(n,r,a):P?n.animate(o(r),{queue:!1,show:!1,hide:!1,duration:a.duration,complete:a.complete}):n.each(function(){var n=e(this),o={};S(U,function(e,a){var s,l,c,d,u,h,p,f=r?r[a]+" ":null;f&&(l=r,a in F&&r[a]!==t?(s=f.match(H),P&&D(l,{scale:+s[0]})):a in z&&r[a]!==t&&(c=n.css(rt),d="absolute"==c||"fixed"==c,n.data(it)||(d?n.data(it,{top:i(n,"top")||0,left:i(n,"left")||0,bottom:i(n,"bottom"),right:i(n,"right")}):n.data(it,{top:i(n,"marginTop")||0,left:i(n,"marginLeft")||0})),u=n.data(it),s=f.match(H),s&&(h=a==it+"y"?0:+s[1],p=a==it+"y"?+s[1]:+s[2],d?(isNaN(u.right)?isNaN(h)||D(l,{left:u.left+h}):isNaN(h)||D(l,{right:u.right-h}),isNaN(u.bottom)?isNaN(p)||D(l,{top:u.top+p}):isNaN(p)||D(l,{bottom:u.bottom-p})):(isNaN(h)||D(l,{marginLeft:u.left+h}),isNaN(p)||D(l,{marginTop:u.top+p})))),!P&&"scale"!=a&&a in l&&delete l[a],l&&D(o,l))}),I.msie&&delete o.scale,n.animate(o,{queue:!1,show:!1,hide:!1,duration:a.duration,complete:a.complete})})}}),T.animatedPromise=T.promise,f=C.Class.extend({init:function(e,t){var n=this;n.element=e,n._direction=t,n.options={},n._additionalEffects=[],n.restore||(n.restore=[])},reverse:function(){return this._reverse=!0,this.run()},play:function(){return this._reverse=!1,this.run()},add:function(e){return this._additionalEffects.push(e),this},direction:function(e){return this._direction=e,this},duration:function(e){return this._duration=e,this},compositeRun:function(){var e=this,t=new p(e.element,{reverse:e._reverse,duration:e._duration}),n=e._additionalEffects.concat([e]);return t.run(n)},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var t,n,i=this,r=i.element,s=0,l=i.restore,c=l.length,d=e.Deferred(),u={},h={},p=i.children(),f=p.length;for(d.then(e.proxy(i,"_complete")),r.data("animating",!0),s=0;c>s;s++)t=l[s],r.data(t)||r.data(t,r.css(t));for(s=0;f>s;s++)p[s].duration(i._duration).run();return i.prepare(u,h),r.is(":visible")||D(u,{display:r.data("olddisplay")||"block"}),P&&(n=r.data("targetTransform"),n&&(u=D(n,u))),u=a(r,u),P&&!M&&(u=o(u)),r.css(u).css(st),i.setup(),r.data("targetTransform",h),T.animate(r,h,{duration:i._duration,complete:d.resolve}),d.promise()},stop:function(){var t=0,n=this.children(),i=n.length;for(t=0;i>t;t++)n[t].stop();return e(this.element).kendoStop(!0,!0),this},restoreCallback:function(){var e,t,n,i=this.element;for(e=0,t=this.restore.length;t>e;e++)n=this.restore[e],i.css(n,i.data(n))},_complete:function(){var t=this,n=t.element;n.removeData("animating").dequeue(),t.restoreCallback(),t.shouldHide()&&n.data("olddisplay",n.css("display")).hide(),R&&!P&&setTimeout(e.proxy(t,"restoreCallback"),0),t.teardown()},setOptions:function(e){D(!0,this.options,e)},children:function(){return[]},shouldHide:e.noop,setup:e.noop,prepare:e.noop,teardown:e.noop,directions:[],setReverse:function(e){return this._reverse=e,this}}),g=["left","right","up","down"],m=["in","out"],c("slideIn",{directions:g,divisor:function(e){return this.options.divisor=e,this},prepare:function(e,t){var n,i=this,r=i.element,o=ht[i._direction],a=-o.modifier*(o.vertical?r.outerHeight():r.outerWidth()),s=a/(i.options&&i.options.divisor||1)+Y,l="0px";i._reverse&&(n=e,e=t,t=n),P?(e[o.transition]=s,t[o.transition]=l):(e[o.property]=s,t[o.property]=l)}}),c("tile",{directions:g,init:function(e,t,n){f.prototype.init.call(this,e,t),this.options={previous:n}},previousDivisor:function(e){return this.options.previousDivisor=e,this},children:function(){var e=this,t=e._reverse,n=e.options.previous,i=e.options.previousDivisor||1,r=e._direction,o=[C.fx(e.element).slideIn(r).setReverse(t)];return n&&o.push(C.fx(n).slideIn(ht[r].reverse).divisor(i).setReverse(!t)),o}}),d("fade","opacity",1,0),d("zoom","scale",1,.01),c("slideMargin",{prepare:function(e,t){var n,i=this,r=i.element,o=i.options,a=r.data(et),s=o.offset,l=i._reverse;l||null!==a||r.data(et,parseFloat(r.css("margin-"+o.axis))),n=r.data(et)||0,t["margin-"+o.axis]=l?n:n+s}}),c("slideTo",{prepare:function(e,t){var n=this,i=n.element,r=n.options,o=r.offset.split(","),a=n._reverse;P?(t.translatex=a?0:o[0],t.translatey=a?0:o[1]):(t.left=a?0:o[0],t.top=a?0:o[1]),i.css("left")}}),c("expand",{directions:["horizontal","vertical"],restore:[nt],prepare:function(e,n){var i=this,r=i.element,o=i.options,a=i._reverse,s="vertical"===i._direction?Z:X,l=r[0].style[s],c=r.data(s),d=parseFloat(c||l),u=G(r.css(s,K)[s]());e.overflow=J,d=o&&o.reset?u||d:d||u,n[s]=(a?0:d)+Y,e[s]=(a?d:0)+Y,c===t&&r.data(s,l)},shouldHide:function(){return this._reverse},teardown:function(){var e=this,t=e.element,n="vertical"===e._direction?Z:X,i=t.data(n);(i==K||i===$)&&setTimeout(function(){t.css(n,K).css(n)},0)}}),v={position:"absolute",marginLeft:0,marginTop:0,scale:1},c("transfer",{init:function(e,t){this.element=e,this.options={target:t},this.restore=[]},setup:function(){this.element.appendTo(document.body)},prepare:function(e,t){var n=this,i=n.element,r=T.box(i),o=T.box(n.options.target),a=s(i,"scale"),l=T.fillScale(o,r),c=T.transformOrigin(o,r);D(e,v),t.scale=1,i.css(st,"scale(1)").css(st),i.css(st,"scale("+a+")"),e.top=r.top,e.left=r.left,e.transformOrigin=c.x+Y+" "+c.y+Y,n._reverse?e.scale=l:t.scale=l}}),_={top:"rect(auto auto $size auto)",bottom:"rect($size auto auto auto)",left:"rect(auto $size auto auto)",right:"rect(auto auto auto $size)"},w={top:{start:"rotatex(0deg)",end:"rotatex(180deg)"},bottom:{start:"rotatex(-180deg)",end:"rotatex(0deg)"},left:{start:"rotatey(0deg)",end:"rotatey(-180deg)"},right:{start:"rotatey(180deg)",end:"rotatey(0deg)"}},c("turningPage",{directions:g,init:function(e,t,n){f.prototype.init.call(this,e,t),this._container=n},prepare:function(e,t){var n=this,i=n._reverse,r=i?ht[n._direction].reverse:n._direction,o=w[r];e.zIndex=1,n._clipInHalf&&(e.clip=u(n._container,C.directions[r].reverse)),e[lt]=J,t[st]=ut+(i?o.start:o.end),e[st]=ut+(i?o.end:o.start)},setup:function(){this._container.append(this.element)},face:function(e){return this._face=e,this},shouldHide:function(){var e=this,t=e._reverse,n=e._face;return t&&!n||!t&&n},clipInHalf:function(e){return this._clipInHalf=e,this},temporary:function(){return this.element.addClass("temp-page"),this}}),c("staticPage",{directions:g,init:function(e,t,n){f.prototype.init.call(this,e,t),this._container=n},restore:["clip"],prepare:function(e,t){var n=this,i=n._reverse?ht[n._direction].reverse:n._direction;e.clip=u(n._container,i),e.opacity=.999,t.opacity=1},shouldHide:function(){var e=this,t=e._reverse,n=e._face;return t&&!n||!t&&n},face:function(e){return this._face=e,this}}),c("pageturn",{directions:["horizontal","vertical"],init:function(e,t,n,i){f.prototype.init.call(this,e,t),this.options={},this.options.face=n,this.options.back=i},children:function(){var e,t=this,n=t.options,i="horizontal"===t._direction?"left":"top",r=C.directions[i].reverse,o=t._reverse,a=n.face.clone(!0).removeAttr("id"),s=n.back.clone(!0).removeAttr("id"),l=t.element;return o&&(e=i,i=r,r=e),[C.fx(n.face).staticPage(i,l).face(!0).setReverse(o),C.fx(n.back).staticPage(r,l).setReverse(o),C.fx(a).turningPage(i,l).face(!0).clipInHalf(!0).temporary().setReverse(o),C.fx(s).turningPage(r,l).clipInHalf(!0).temporary().setReverse(o)]},prepare:function(e,t){e[ct]=dt,e.transformStyle="preserve-3d",e.opacity=.999,t.opacity=1},teardown:function(){this.element.find(".temp-page").remove()}}),c("flip",{directions:["horizontal","vertical"],init:function(e,t,n,i){f.prototype.init.call(this,e,t),this.options={},this.options.face=n,this.options.back=i},children:function(){var e,t=this,n=t.options,i="horizontal"===t._direction?"left":"top",r=C.directions[i].reverse,o=t._reverse,a=t.element;return o&&(e=i,i=r,r=e),[C.fx(n.face).turningPage(i,a).face(!0).setReverse(o),C.fx(n.back).turningPage(r,a).setReverse(o)]},prepare:function(e){e[ct]=dt,e.transformStyle="preserve-3d"}}),y=!E.mobileOS.android,b=".km-touch-scrollbar, .km-actionsheet-wrapper",c("replace",{_before:e.noop,_after:e.noop,init:function(t,n,i){f.prototype.init.call(this,t),this._previous=e(n),this._transitionClass=i},duration:function(){throw Error("The replace effect does not support duration setting; the effect duration may be customized through the transition class rule")},beforeTransition:function(e){return this._before=e,this},afterTransition:function(e){return this._after=e,this},_both:function(){return e().add(this._element).add(this._previous)},_containerClass:function(){var e=this._direction,t="k-fx k-fx-start k-fx-"+this._transitionClass;return e&&(t+=" k-fx-"+e),this._reverse&&(t+=" k-fx-reverse"),t},complete:function(t){if(!(!this.deferred||t&&e(t.target).is(b))){var n=this.container;n.removeClass("k-fx-end").removeClass(this._containerClass()).off(M.event,this.completeProxy),this._previous.hide().removeClass("k-fx-current"),this.element.removeClass("k-fx-next"),y&&n.css(nt,""),this.isAbsolute||this._both().css(rt,""),this.deferred.resolve(),delete this.deferred}},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var t,n=this,i=n.element,r=n._previous,o=i.parents().filter(r.parents()).first(),a=n._both(),s=e.Deferred(),l=i.css(rt);return o.length||(o=i.parent()),this.container=o,this.deferred=s,this.isAbsolute="absolute"==l,this.isAbsolute||a.css(rt,"absolute"),y&&(t=o.css(nt),o.css(nt,"hidden")),M?(i.addClass("k-fx-hidden"),o.addClass(this._containerClass()),this.completeProxy=e.proxy(this,"complete"),o.on(M.event,this.completeProxy),C.animationFrame(function(){i.removeClass("k-fx-hidden").addClass("k-fx-next"),r.css("display","").addClass("k-fx-current"),n._before(r,i),C.animationFrame(function(){o.removeClass("k-fx-start").addClass("k-fx-end"),n._after(r,i)})})):this.complete(),s.promise()},stop:function(){this.complete()}}),k=C.Class.extend({init:function(){var e=this;e._tickProxy=A(e._tick,e),e._started=!1},tick:e.noop,done:e.noop,onEnd:e.noop,onCancel:e.noop,start:function(){this.enabled()&&(this.done()?this.onEnd():(this._started=!0,C.animationFrame(this._tickProxy)))},enabled:function(){return!0},cancel:function(){this._started=!1,this.onCancel()},_tick:function(){var e=this;e._started&&(e.tick(),e.done()?(e._started=!1,e.onEnd()):C.animationFrame(e._tickProxy))}}),x=k.extend({init:function(e){var t=this;D(t,e),k.fn.init.call(t)},done:function(){return this.timePassed()>=this.duration},timePassed:function(){return Math.min(this.duration,new Date-this.startDate)},moveTo:function(e){var t=this,n=t.movable;t.initial=n[t.axis],t.delta=e.location-t.initial,t.duration="number"==typeof e.duration?e.duration:300,t.tick=t._easeProxy(e.ease),t.startDate=new Date,t.start()},_easeProxy:function(e){var t=this;return function(){t.movable.moveAxis(t.axis,e(t.timePassed(),t.initial,t.delta,t.duration))}}}),D(x,{easeOutExpo:function(e,t,n,i){return e==i?t+n:n*(-Math.pow(2,-10*e/i)+1)+t},easeOutBack:function(e,t,n,i,r){return r=1.70158,n*((e=e/i-1)*e*((r+1)*e+r)+1)+t}}),T.Animation=k,T.Transition=x,T.createEffect=c,T.box=function(t){t=e(t);var n=t.offset();return n.width=t.outerWidth(),n.height=t.outerHeight(),n},T.transformOrigin=function(e,t){var n=(e.left-t.left)*t.width/(t.width-e.width),i=(e.top-t.top)*t.height/(t.height-e.height);return{x:isNaN(n)?0:n,y:isNaN(i)?0:i}},T.fillScale=function(e,t){return Math.min(e.width/t.width,e.height/t.height)},T.fitScale=function(e,t){return Math.max(e.width/t.width,e.height/t.height)}}(window.kendo.jQuery),function(e){function t(e){if(!e)return{};var t=e.match(v)||[];return{type:t[1],direction:t[3],reverse:"reverse"===t[5]}}var n=window.kendo,i=n.Observable,r="SCRIPT",o="init",a="show",s="hide",l="transitionStart",c="transitionEnd",d="attach",u="detach",h=/unrecognized expression/,p=i.extend({init:function(e,t){var r=this;t=t||{},i.fn.init.call(r),r.content=e,r.id=n.guid(),r.tagName=t.tagName||"div",r.model=t.model,r._wrap=t.wrap!==!1,this._evalTemplate=t.evalTemplate||!1,r._fragments={},r.bind([o,a,s,l,c],t)},render:function(t){var i=this,r=!i.element;return r&&(i.element=i._createElement()),t&&e(t).append(i.element),r&&(n.bind(i.element,i.model),i.trigger(o)),t&&(i._eachFragment(d),i.trigger(a)),i.element},clone:function(){return new f(this)},triggerBeforeShow:function(){return!0},showStart:function(){this.element.css("display","")},showEnd:function(){},hideStart:function(){},hideEnd:function(){this.hide()},beforeTransition:function(e){this.trigger(l,{type:e})},afterTransition:function(e){this.trigger(c,{type:e})},hide:function(){this._eachFragment(u),this.element.detach(),this.trigger(s)},destroy:function(){var e=this.element;e&&(n.unbind(e),n.destroy(e),e.remove())},fragments:function(t){e.extend(this._fragments,t)},_eachFragment:function(e){for(var t in this._fragments)this._fragments[t][e](this,t)},_createElement:function(){var t,i,o=this,a="<"+o.tagName+" />";try{i=e(document.getElementById(o.content)||o.content),i[0].tagName===r&&(i=i.html())}catch(s){h.test(s.message)&&(i=o.content)}return"string"==typeof i?(i=i.replace(/^\s+|\s+$/g,""),o._evalTemplate&&(i=n.template(i)(o.model||{})),t=e(a).append(i),o._wrap||(t=t.contents())):(t=i,o._evalTemplate&&t.html(n.template(t.html())(o.model||{})),o._wrap&&(t=t.wrapAll(a).parent())),t}}),f=n.Class.extend({init:function(t){e.extend(this,{element:t.element.clone(!0),transition:t.transition,id:t.id}),t.element.parent().append(this.element)},hideStart:e.noop,hideEnd:function(){this.element.remove()},beforeTransition:e.noop,afterTransition:e.noop}),g=p.extend({init:function(e,t){p.fn.init.call(this,e,t),this.containers={}},container:function(e){var t=this.containers[e];return t||(t=this._createContainer(e),this.containers[e]=t),t},showIn:function(e,t,n){this.container(e).show(t,n)},_createContainer:function(e){var t,n=this.render(),i=n.find(e);if(!i.length&&n.is(e)){if(!n.is(e))throw Error("can't find a container with the specified "+e+" selector");i=n}return t=new _(i),t.bind("accepted",function(e){e.view.render(i)}),t}}),m=p.extend({attach:function(e,t){e.element.find(t).replaceWith(this.render())},detach:function(){}}),v=/^(\w+)(:(\w+))?( (\w+))?$/,_=i.extend({init:function(e){i.fn.init.call(this),this.container=e,this.history=[],this.view=null,this.running=!1},after:function(){this.running=!1,this.trigger("complete",{view:this.view}),this.trigger("after")},end:function(){this.view.showEnd(),this.previous.hideEnd(),this.after()},show:function(e,i,r){if(!e.triggerBeforeShow())return this.trigger("after"),!1;r=r||e.id;var o=this,a=e===o.view?e.clone():o.view,s=o.history,l=s[s.length-2]||{},c=l.id===r,d=i||(c?s[s.length-1].transition:e.transition),u=t(d);return o.running&&o.effect.stop(),"none"===d&&(d=null),o.trigger("accepted",{view:e}),o.view=e,o.previous=a,o.running=!0,c?s.pop():s.push({id:r,transition:d}),a?(a.hideStart(),d&&n.effects.enabled?(e.element.addClass("k-fx-hidden"),e.showStart(),c&&!i&&(u.reverse=!u.reverse),o.effect=n.fx(e.element).replace(a.element,u.type).beforeTransition(function(){e.beforeTransition("show"),a.beforeTransition("hide")}).afterTransition(function(){e.afterTransition("show"),a.afterTransition("hide")}).direction(u.direction).setReverse(u.reverse),o.effect.run().then(function(){o.end()})):(e.showStart(),o.end()),!0):(e.showStart(),e.showEnd(),o.after(),!0)}});n.ViewContainer=_,n.Fragment=m,n.Layout=g,n.View=p,n.ViewClone=f}(window.kendo.jQuery),function(e){function t(){this.node=null}function n(e,t,n){this.nodeName=e,this.attr=t||{},this.cssText=null,this.children=n||[]}function i(e){this.nodeValue=e}function r(e){this.html=e}function o(e){return new r(e)}function a(e,t,i){return new n(e,t,i)}function s(e){return new i(e)}function l(e){this.root=e,this.children=[]}t.prototype={remove:function(){this.node.parentNode.removeChild(this.node)}},n.prototype=new t,n.prototype.render=function(e,t){var n,i,r,o,a,s,l,c,d=this.children,u=d.length;if(t&&t.nodeName===this.nodeName){if(n=t.node,r=t.children,Math.abs(r.length-u)>2)return void this.render({appendChild:function(n){e.replaceChild(n,t.node)}},null);for(i=0;u>i;i++)d[i].render(n,r[i]);for(i=u,u=r.length;u>i;i++)r[i].remove()}else{for(t&&(t.remove(),t=null),n=document.createElement(this.nodeName),i=0;u>i;i++)d[i].render(n,null);e.appendChild(n)}o=this.attr;for(a in o)if(!t||o[a]!==t.attr[a])if(void 0!==n[a])if("style"!==a)n[a]=o[a];else{s="",l=o[a];for(c in l)s+=c,s+=":",s+=l[c],s+=";";t&&t.cssText===s||(n.style.cssText=s),this.cssText=s}else n.setAttribute(a,o[a]);if(t)for(a in t.attr)void 0===o[a]&&(void 0!==n[a]?"style"===a?n.style.cssText="":"className"===a?n[a]="":n.removeAttribute(a):n.removeAttribute(a));this.node=n},i.prototype=new t,i.prototype.nodeName="#text",i.prototype.render=function(e,t){var n;t&&t.nodeName===this.nodeName?(n=t.node,this.nodeValue!==t.nodeValue&&(n.nodeValue=this.nodeValue)):(t&&t.remove(),n=document.createTextNode(this.nodeValue),e.appendChild(n)),this.node=n},r.prototype={nodeName:"#html",remove:function(){for(var e=0;this.nodes.length>e;e++)this.nodes[e].parentNode.removeChild(this.nodes[e])},render:function(e,t){var n,i;if(t&&t.nodeName===this.nodeName&&t.html===this.html)this.nodes=t.nodes.slice(0);else for(t&&t.remove(),n=e.lastChild,e.insertAdjacentHTML("beforeend",this.html),this.nodes=[],i=n?n.nextSibling:e.firstChild;i;i=i.nextSibling)this.nodes.push(i)}},l.prototype={html:o,element:a,text:s,render:function(e){var t,n,i=this.children;for(t=0,n=e.length;n>t;t++)e[t].render(this.root,i[t]);for(t=n;i.length>t;t++)i[t].remove();this.children=e}},e.dom={html:o,text:s,element:a,Tree:l}}(window.kendo),function(e){function t(e){var n=Math.floor(e/26)-1;return(n>=0?t(n):"")+String.fromCharCode(65+e%26)}function n(e,n){return t(n)+(e+1)}function i(e){return 6>e.length&&(e=e.replace(/(\w)/g,function(e,t){return t+t})),e=e.substring(1).toUpperCase(),8>e.length&&(e="FF"+e),e}var r='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',o=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>${creator}</dc:creator><cp:lastModifiedBy>${lastModifiedBy}</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">${created}</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">${modified}</dcterms:modified></cp:coreProperties>'),a=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>${sheets.length}</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="${sheets.length}" baseType="lpstr"># for (var idx = 0; idx < sheets.length; idx++) { ## if (sheets[idx].options.title) { #<vt:lpstr>${sheets[idx].options.title}</vt:lpstr># } else { #<vt:lpstr>Sheet${idx+1}</vt:lpstr># } ## } #</vt:vector></TitlesOfParts><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>14.0300</AppVersion></Properties>'),s=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="xml" ContentType="application/xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/># for (var idx = 1; idx <= count; idx++) { #<Override PartName="/xl/worksheets/sheet${idx}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /># } #<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /></Types>'),l=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303" /><workbookPr defaultThemeVersion="124226" /><bookViews><workbookView xWindow="240" yWindow="45" windowWidth="18195" windowHeight="7995" /></bookViews><sheets># for (var idx = 0; idx < sheets.length; idx++) { ## if (sheets[idx].options.title) { #<sheet name="${sheets[idx].options.title}" sheetId="${idx+1}" r:id="rId${idx+1}" /># } else { #<sheet name="Sheet${idx+1}" sheetId="${idx+1}" r:id="rId${idx+1}" /># } ## } #</sheets><calcPr calcId="145621" /></workbook>'),c=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" mc:Ignorable="x14ac"><dimension ref="A1" /><sheetViews><sheetView tabSelected="1" workbookViewId="0"># if (freezePane) { #<pane state="frozen"# if (freezePane.colSplit) { # xSplit="${freezePane.colSplit}"# } ## if (freezePane.rowSplit) { # ySplit="${freezePane.rowSplit}"# } # topLeftCell="${String.fromCharCode(65 + (freezePane.colSplit || 0))}${(freezePane.rowSplit || 0)+1}"/># } #</sheetView></sheetViews><sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25" /># if (columns) { #<cols># for (var ci = 0; ci < columns.length; ci++) { ## var column = columns[ci]; ## if (column.width) { #<col min="${ci+1}" max="${ci+1}" customWidth="1"# if (column.autoWidth) { # width="${((column.width*7+5)/7*256)/256}" bestFit="1"# } else { # width="${(((column.width)/7)*100+0.5)/100}" # } #/># } ## } #</cols># } #<sheetData># for (var ri = 0; ri < data.length; ri++) { ## var row = data[ri]; #<row r="${ri + 1}"># for (var ci = 0; ci < row.data.length; ci++) { ## var cell = row.data[ci];#<c r="${cell.ref}"# if (cell.style) { # s="${cell.style}" # } ## if (cell.type) { # t="${cell.type}"# } #># if (cell.value != null) { #<v>${cell.value}</v># } #</c># } #</row># } #</sheetData># if (filter) { #<autoFilter ref="${filter.from}:${filter.to}"/># } ## if (mergeCells.length) { #<mergeCells count="${mergeCells.length}"># for (var ci = 0; ci < mergeCells.length; ci++) { #<mergeCell ref="${mergeCells[ci]}"/># } #</mergeCells># } #<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" /></worksheet>'),d=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"># for (var idx = 1; idx <= count; idx++) { #<Relationship Id="rId${idx}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${idx}.xml" /># } #<Relationship Id="rId${count+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" /><Relationship Id="rId${count+2}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" /></Relationships>'),u=e.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${count}" uniqueCount="${uniqueCount}"># for (var index in indexes) { #<si><t>${index.substring(1)}</t></si># } #</sst>'),h=e.template('<?xml version="1.0" encoding="UTF-8"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><numFmts count="${formats.length}"># for (var fi = 0; fi < formats.length; fi++) { ## var format = formats[fi]; #<numFmt formatCode="${format.format}" numFmtId="${165+fi}" /># } #</numFmts><fonts count="${fonts.length+1}" x14ac:knownFonts="1"><font><sz val="11" /><color theme="1" /><name val="Calibri" /><family val="2" /><scheme val="minor" /></font># for (var fi = 0; fi < fonts.length; fi++) { ## var font = fonts[fi]; #<font># if (font.bold) { #<b/># } ## if (font.italic) { #<i/># } ## if (font.underline) { #<u/># } ## if (font.color) { #<color rgb="${font.color}" /># } else { #<color theme="1" /># } ## if (font.fontSize) { #<sz val="${font.fontSize}" /># } else { #<sz val="11" /># } ## if (font.fontName) { #<name val="${font.fontName}" /># } else { #<name val="Calibri" /><scheme val="minor" /># } #<family val="2" /></font># } #</fonts><fills count="${fills.length+1}"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill># for (var fi = 0; fi < fills.length; fi++) { ## var fill = fills[fi]; ## if (fill.background) { #<fill><patternFill patternType="solid"><fgColor rgb="${fill.background}"/></patternFill></fill># } ## } #</fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellXfs count="${styles.length+1}"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/># for (var si = 0; si < styles.length; si++) { ## var style = styles[si]; #<xf xfid="0"# if (style.fontId) { # fontId="${style.fontId}" applyFont="1"# } ## if (style.fillId) { # fillId="${style.fillId}" applyFill="1"# } ## if (style.numFmtId) { # numFmtId="${style.numFmtId}" applyNumberFormat="1"# } ## if (style.hAlign || style.vAlign || style.wrap) { # applyAlignment="1"# } #># if (style.hAlign || style.vAlign || style.wrap) { #<alignment# if (style.hAlign) { # horizontal="${style.hAlign}"# } ## if (style.vAlign) { # vertical="${style.vAlign}"# } ## if (style.wrap) { # wrapText="1"# } #/># } #</xf># } #</cellXfs><dxfs count="0" /><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleMedium9" /></styleSheet>'),p=e.timezone.remove(new Date(1900,0,0),"Etc/UTC"),f=e.Class.extend({init:function(e,t,n){this.options=e,this._strings=t,this._styles=n,this._mergeCells=[]},toXML:function(){var e=this.options.rows||[],t=this.options.filter,i={};return this._maxCellIndex=0,c({freezePane:this.options.freezePane,columns:this.options.columns,data:$.map(e,$.proxy(this._row,this,e,i)),mergeCells:this._mergeCells,filter:t?{from:n(0,t.from),to:n(0,t.to)}:null})},_row:function(e,t,i,r){var o,a,s,l,c,d;for(this._cellIndex&&this._cellIndex>this._maxCellIndex&&(this._maxCellIndex=this._cellIndex),this._cellIndex=0,a=[],s=i.cells,l=0,c=s.length;c>l;l++)o=this._cell(s[l],t,r),o&&(a=a.concat(o));for(;this._maxCellIndex>this._cellIndex;)d=t[this._cellIndex],d&&(d.rowSpan-=1),a.push({ref:n(r,this._cellIndex)}),this._cellIndex++;return{data:a}},_lookupString:function(e){var t="$"+e,n=this._strings.indexes[t];return void 0!==n?e=n:(e=this._strings.indexes[t]=this._strings.uniqueCount,this._strings.uniqueCount++),this._strings.count++,e},_lookupStyle:function(t){var n,i=e.stringify(t);return"{}"==i?0:(n=$.inArray(i,this._styles),0>n&&(n=this._styles.push(i)-1),n+1)},_cell:function(t,i,r){var o,a,s,l,c,d,u,h,f,g,m,v;if(!t)return void this._cellIndex++;for(o=t.value,a={bold:t.bold,color:t.color,background:t.background,italic:t.italic,underline:t.underline,fontName:t.fontName,fontSize:t.fontSize,format:t.format,hAlign:t.hAlign,vAlign:t.vAlign,wrap:t.wrap},s=this.options.columns||[],l=s[this._cellIndex],l&&l.autoWidth&&(l.width=Math.max(l.width||0,(""+o).length)),c=typeof o,"string"===c?(o=this._lookupString(o),c="s"):"number"===c?c="n":"boolean"===c?(c="b",o=+o):o&&o.getTime?(c=null,o=(e.timezone.remove(o,"Etc/UTC")-p)/e.date.MS_PER_DAY+1,a.format||(a.format="mm-dd-yy")):(c=null,o=""),a=this._lookupStyle(a),d=[],f=i[this._cellIndex]||{};f.rowSpan>1;){for(f.rowSpan-=1,u=f.colSpan;u>0;)d.push({ref:n(r,this._cellIndex)}),u--,this._cellIndex++;f=i[this._cellIndex]||{}}if(h=n(r,this._cellIndex),d.push({value:o,type:c,style:a,ref:h}),g=t.colSpan||1,m=t.rowSpan||1,g>1||m>1){for(m>1&&(i[this._cellIndex]={colSpan:g,rowSpan:m}),v=1;g>v;v++)this._cellIndex++,d.push({ref:n(r,this._cellIndex)});this._mergeCells.push(h+":"+n(r+m-1,this._cellIndex))}return this._cellIndex++,d}}),g={General:0,0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49,"[$-404]e/m/d":27,"m/d/yy":30,t0:59,"t0.00":60,"t#,##0":61,"t#,##0.00":62,"t0%":67,"t0.00%":68,"t# ?/?":69,"t# ??/??":70},m=e.Class.extend({init:function(e){this.options=e||{},this._strings={indexes:{},count:0,uniqueCount:0},this._styles=[],this._sheets=$.map(this.options.sheets||[],$.proxy(function(e){return new f(e,this._strings,this._styles)
},this))},toDataURL:function(){var t,n,c,p,f,m,v,_,w,y,b,k,x;if("undefined"==typeof JSZip)throw Error("JSZip not found. Check http://docs.telerik.com/kendo-ui/framework/excel/introduction#requirements for more details.");for(t=new JSZip,n=t.folder("docProps"),n.file("core.xml",o({creator:this.options.creator||"Kendo UI",lastModifiedBy:this.options.creator||"Kendo UI",created:this.options.date||(new Date).toJSON(),modified:this.options.date||(new Date).toJSON()})),c=this._sheets.length,n.file("app.xml",a({sheets:this._sheets})),p=t.folder("_rels"),p.file(".rels",r),f=t.folder("xl"),m=f.folder("_rels"),m.file("workbook.xml.rels",d({count:c})),f.file("workbook.xml",l({sheets:this._sheets})),v=f.folder("worksheets"),_=0;c>_;_++)v.file(e.format("sheet{0}.xml",_+1),this._sheets[_].toXML());return w=$.map(this._styles,$.parseJSON),y=function(e){return e.underline||e.bold||e.italic||e.color||e.fontName||e.fontSize},b=$.map(w,function(e){return e.color&&(e.color=i(e.color)),y(e)?e:void 0}),k=$.map(w,function(e){return e.format&&void 0===g[e.format]?e:void 0}),x=$.map(w,function(e){return e.background?(e.background=i(e.background),e):void 0}),f.file("styles.xml",h({fonts:b,fills:x,formats:k,styles:$.map(w,function(e){var t={};return y(e)&&(t.fontId=$.inArray(e,b)+1),e.background&&(t.fillId=$.inArray(e,x)+2),t.hAlign=e.hAlign,t.vAlign=e.vAlign,t.wrap=e.wrap,e.format&&(t.numFmtId=void 0!==g[e.format]?g[e.format]:165+$.inArray(e,k)),t})})),f.file("sharedStrings.xml",u(this._strings)),t.file("[Content_Types].xml",s({count:c})),"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"+t.generate({compression:"DEFLATE"})}});e.ooxml={Workbook:m,Worksheet:f}}(kendo),function(e,t){t.ExcelExporter=t.Class.extend({init:function(n){var i,r;n.columns=this._trimColumns(n.columns||[]),this.columns=e.map(this._leafColumns(n.columns||[]),this._prepareColumn),this.options=n,i=n.dataSource,i instanceof t.data.DataSource?(this.dataSource=new i.constructor(e.extend({},i.options,{page:n.allPages?0:i.page(),filter:i.filter(),pageSize:n.allPages?i.total():i.pageSize(),sort:i.sort(),group:i.group(),aggregate:i.aggregate()})),r=i.data(),r.length>0&&this.dataSource.data(r.toJSON())):this.dataSource=t.data.DataSource.create(i)},_trimColumns:function(t){var n=this;return e.grep(t,function(e){var t=!(!e.field||e.hidden);return!t&&e.columns&&(t=n._trimColumns(e.columns).length>0),t})},_leafColumns:function(e){var t,n=[];for(t=0;e.length>t;t++)e[t].columns?n=n.concat(this._leafColumns(e[t].columns)):n.push(e[t]);return n},workbook:function(){return e.Deferred(e.proxy(function(t){this.dataSource.fetch().then(e.proxy(function(){var e={sheets:[{columns:this._columns(),rows:this._rows(),freezePane:this._freezePane(),filter:this._filter()}]};t.resolve(e,this.dataSource.view())},this))},this)).promise()},_prepareColumn:function(n){var i,r;if(n.field&&!n.hidden)return i=function(e){return e.get(n.field)},n.values&&(r={},e.each(n.values,function(){r[this.value]=this.text}),i=function(e){return r[e.get(n.field)]}),e.extend({},n,{value:i,groupHeaderTemplate:t.template(n.groupHeaderTemplate||"${title}: ${value}"),groupFooterTemplate:n.groupFooterTemplate?t.template(n.groupFooterTemplate):null,footerTemplate:n.footerTemplate?t.template(n.footerTemplate):null})},_filter:function(){if(!this.options.filterable)return null;var e=this._depth();return{from:e,to:e+this.columns.length-1}},_dataRows:function(t,n){var i=this._depth(),r=e.map(t,e.proxy(function(t){var r,o,a,s,l,c,d,u;return this._hierarchical()&&(n=this.dataSource.level(t)+1),r=e.map(Array(n),function(){return{background:"#dfdfdf",color:"#333"}}),i&&t.items?(o=e.grep(this.columns,function(e){return e.field==t.field})[0],a=o&&o.title?o.title:t.field,s=o?o.groupHeaderTemplate:null,l=a+": "+t.value,c=e.extend({title:a,field:t.field,value:t.value,aggregates:t.aggregates},t.aggregates[t.field]),s&&(l=s(c)),r.push({value:l,background:"#dfdfdf",color:"#333",colSpan:this.columns.length+i-n}),d=this._dataRows(t.items,n+1),d.unshift({type:"group-header",cells:r}),d.concat(this._footer(t,n+1))):(u=e.map(this.columns,e.proxy(this._cell,this,t)),this._hierarchical()&&(u[0].colSpan=i-n+1),{type:"data",cells:r.concat(u)})},this));return r},_footer:function(t,n){var i=[],r=!1,o=e.map(this.columns,function(e){return e.groupFooterTemplate?(r=!0,{background:"#dfdfdf",color:"#333",value:e.groupFooterTemplate(t.aggregates[e.field])}):{background:"#dfdfdf",color:"#333"}});return r&&i.push({type:"group-footer",cells:e.map(Array(n),function(){return{background:"#dfdfdf",color:"#333"}}).concat(o)}),i},_isColumnVisible:function(e){return this._visibleColumns([e]).length>0&&(e.field||e.columns)},_visibleColumns:function(t){var n=this;return e.grep(t,function(e){var t=!e.hidden;return t&&e.columns&&(t=n._visibleColumns(e.columns).length>0),t})},_headerRow:function(t,n){var i=e.map(t.cells,function(e){return{background:"#7a7a7a",color:"#fff",value:e.title,colSpan:e.colSpan>1?e.colSpan:1,rowSpan:t.rowSpan>1&&!e.colSpan?t.rowSpan:1}});return this._hierarchical()&&(i[0].colSpan=this._depth()+1),{type:"header",cells:e.map(Array(n.length),function(){return{background:"#7a7a7a",color:"#fff"}}).concat(i)}},_prependHeaderRows:function(e){var t,n=this.dataSource.group(),i=[{rowSpan:1,cells:[],index:0}];for(this._prepareHeaderRows(i,this.options.columns),t=i.length-1;t>=0;t--)e.unshift(this._headerRow(i[t],n))},_prepareHeaderRows:function(e,t,n,i){var r,o,a,s=i||e[e.length-1],l=e[s.index+1],c=0;for(a=0;t.length>a;a++)r=t[a],this._isColumnVisible(r)&&(o={title:r.title||r.field,colSpan:0},s.cells.push(o),r.columns&&r.columns.length&&(l||(l={rowSpan:0,cells:[],index:e.length},e.push(l)),o.colSpan=this._trimColumns(this._visibleColumns(r.columns)).length,this._prepareHeaderRows(e,r.columns,o,l),c+=o.colSpan-1,s.rowSpan=e.length-s.index));n&&(n.colSpan+=c)},_rows:function(){var t,n,i=this.dataSource.group(),r=this._dataRows(this.dataSource.view(),0);return this.columns.length&&(this._prependHeaderRows(r),t=!1,n=e.map(this.columns,e.proxy(function(e){var n,i;return e.footerTemplate?(t=!0,n=this.dataSource.aggregates(),i=n[e.field]||{},i.data=n,{background:"#dfdfdf",color:"#333",value:e.footerTemplate(i)}):{background:"#dfdfdf",color:"#333"}},this)),t&&r.push({type:"footer",cells:e.map(Array(i.length),function(){return{background:"#dfdfdf",color:"#333"}}).concat(n)})),r},_headerDepth:function(e){var t,n,i=1,r=0;for(t=0;e.length>t;t++)e[t].columns&&(n=this._headerDepth(e[t].columns),n>r&&(r=n));return i+r},_freezePane:function(){var t=this._visibleColumns(this.options.columns||[]),n=this._trimColumns(this._leafColumns(e.grep(t,function(e){return e.locked}))).length;return{rowSplit:this._headerDepth(t),colSplit:n?n+this.dataSource.group().length:0}},_cell:function(e,t){return{value:t.value(e)}},_hierarchical:function(){return this.options.hierarchy&&this.dataSource.level},_depth:function(){var e,t,n,i=this.dataSource,r=0;if(this._hierarchical()){for(e=i.view(),t=0;e.length>t;t++)n=i.level(e[t]),n>r&&(r=n);r++}else r=i.group().length;return r},_columns:function(){var t=this._depth(),n=e.map(Array(t),function(){return{width:20}});return n.concat(e.map(this.columns,function(e){return{width:parseInt(e.width,10),autoWidth:e.width?!1:!0}}))}}),t.ExcelMixin={extend:function(t){t.events.push("excelExport"),t.options.excel=e.extend(t.options.excel,this.options),t.saveAsExcel=this.saveAsExcel},options:{proxyURL:"",allPages:!1,filterable:!1,fileName:"Export.xlsx"},saveAsExcel:function(){var n=this.options.excel||{},i=new t.ExcelExporter({columns:this.columns,dataSource:this.dataSource,allPages:n.allPages,filterable:n.filterable,hierarchy:n.hierarchy});i.workbook().then(e.proxy(function(e,i){if(!this.trigger("excelExport",{workbook:e,data:i})){var r=new t.ooxml.Workbook(e);t.saveAs({dataURI:r.toDataURL(),fileName:e.fileName||n.fileName,proxyURL:n.proxyURL,forceProxy:n.forceProxy})}},this))}}}(kendo.jQuery,kendo),function(e){var t=kendo.data.RemoteTransport.extend({init:function(e){var t,n=e&&e.signalr?e.signalr:{},i=n.promise;if(!i)throw Error('The "promise" option must be set.');if("function"!=typeof i.done||"function"!=typeof i.fail)throw Error('The "promise" option must be a Promise.');if(this.promise=i,t=n.hub,!t)throw Error('The "hub" option must be set.');if("function"!=typeof t.on||"function"!=typeof t.invoke)throw Error('The "hub" option is not a valid SignalR hub proxy.');this.hub=t,kendo.data.RemoteTransport.fn.init.call(this,e)},push:function(e){var t=this.options.signalr.client||{};t.create&&this.hub.on(t.create,e.pushCreate),t.update&&this.hub.on(t.update,e.pushUpdate),t.destroy&&this.hub.on(t.destroy,e.pushDestroy)},_crud:function(t,n){var i,r,o=this.hub,a=this.options.signalr.server;if(!a||!a[n])throw Error(kendo.format('The "server.{0}" option must be set.',n));i=[a[n]],r=this.parameterMap(t.data,n),e.isEmptyObject(r)||i.push(r),this.promise.done(function(){o.invoke.apply(o,i).done(t.success).fail(t.error)})},read:function(e){this._crud(e,"read")},create:function(e){this._crud(e,"create")},update:function(e){this._crud(e,"update")},destroy:function(e){this._crud(e,"destroy")}});e.extend(!0,kendo.data,{transports:{signalr:t}})}(window.kendo.jQuery),function(e,t,n){function i(e,r){var a,d;if(null==e||"none"==e)return null;if(e instanceof s)return e;if(e=e.toLowerCase(),a=o.exec(e))return e="transparent"==a[1]?new l(1,1,1,0):i(u.namedColors[a[1]],r),e.match=[a[1]],e;if((a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i.exec(e))?d=new c(n(a[1],16),n(a[2],16),n(a[3],16),1):(a=/^#?([0-9a-f])([0-9a-f])([0-9a-f])/i.exec(e))?d=new c(n(a[1]+a[1],16),n(a[2]+a[2],16),n(a[3]+a[3],16),1):(a=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(e))?d=new c(n(a[1],10),n(a[2],10),n(a[3],10),1):(a=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(e))?d=new c(n(a[1],10),n(a[2],10),n(a[3],10),t(a[4])):(a=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(e))?d=new l(t(a[1])/100,t(a[2])/100,t(a[3])/100,1):(a=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(e))&&(d=new l(t(a[1])/100,t(a[2])/100,t(a[3])/100,t(a[4]))),d)d.match=a;else if(!r)throw Error("Cannot parse color: "+e);return d}function r(e,t,n){for(n||(n="0"),e=e.toString(16);t>e.length;)e="0"+e;return e}var o,a,s,l,c,d,u=function(e){var t,n,i,r,o,a=this,s=u.formats;if(1===arguments.length)for(e=a.resolveColor(e),r=0;s.length>r;r++)t=s[r].re,n=s[r].process,i=t.exec(e),i&&(o=n(i),a.r=o[0],a.g=o[1],a.b=o[2]);else a.r=arguments[0],a.g=arguments[1],a.b=arguments[2];a.r=a.normalizeByte(a.r),a.g=a.normalizeByte(a.g),a.b=a.normalizeByte(a.b)};u.prototype={toHex:function(){var e=this,t=e.padDigit,n=e.r.toString(16),i=e.g.toString(16),r=e.b.toString(16);return"#"+t(n)+t(i)+t(r)},resolveColor:function(e){return e=e||"black","#"==e.charAt(0)&&(e=e.substr(1,6)),e=e.replace(/ /g,""),e=e.toLowerCase(),e=u.namedColors[e]||e},normalizeByte:function(e){return 0>e||isNaN(e)?0:e>255?255:e},padDigit:function(e){return 1===e.length?"0"+e:e},brightness:function(e){var t=this,n=Math.round;return t.r=n(t.normalizeByte(t.r*e)),t.g=n(t.normalizeByte(t.g*e)),t.b=n(t.normalizeByte(t.b*e)),t},percBrightness:function(){var e=this;return Math.sqrt(.241*e.r*e.r+.691*e.g*e.g+.068*e.b*e.b)}},u.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(e){return[n(e[1],10),n(e[2],10),n(e[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(e){return[n(e[1],16),n(e[2],16),n(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(e){return[n(e[1]+e[1],16),n(e[2]+e[2],16),n(e[3]+e[3],16)]}}],u.namedColors={aqua:"00ffff",azure:"f0ffff",beige:"f5f5dc",black:"000000",blue:"0000ff",brown:"a52a2a",coral:"ff7f50",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgray:"a9a9a9",darkgreen:"006400",darkorange:"ff8c00",darkred:"8b0000",dimgray:"696969",fuchsia:"ff00ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lightblue:"add8e6",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumblue:"0000cd",navy:"000080",olive:"808000",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",pink:"ffc0cb",plum:"dda0dd",purple:"800080",red:"ff0000",royalblue:"4169e1",salmon:"fa8072",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",steelblue:"4682b4",tan:"d2b48c",teal:"008080",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},o=["transparent"];for(a in u.namedColors)u.namedColors.hasOwnProperty(a)&&o.push(a);o=RegExp("^("+o.join("|")+")(\\W|$)","i"),s=kendo.Class.extend({toHSV:function(){return this},toRGB:function(){return this},toHex:function(){return this.toBytes().toHex()},toBytes:function(){return this},toCss:function(){return"#"+this.toHex()},toCssRgba:function(){var e=this.toBytes();return"rgba("+e.r+", "+e.g+", "+e.b+", "+t((+this.a).toFixed(3))+")"},toDisplay:function(){return kendo.support.browser.msie&&9>kendo.support.browser.version?this.toCss():this.toCssRgba()},equals:function(e){return e===this||null!==e&&this.toCssRgba()==i(e).toCssRgba()},diff:function(e){if(null==e)return 0/0;var t=this.toBytes();return e=e.toBytes(),Math.sqrt(Math.pow(.3*(t.r-e.r),2)+Math.pow(.59*(t.g-e.g),2)+Math.pow(.11*(t.b-e.b),2))},clone:function(){var e=this.toBytes();return e===this&&(e=new c(e.r,e.g,e.b,e.a)),e}}),l=s.extend({init:function(e,t,n,i){this.r=e,this.g=t,this.b=n,this.a=i},toHSV:function(){var e,t,n=this.r,i=this.g,r=this.b,o=Math.min(n,i,r),a=Math.max(n,i,r),s=a,l=a-o;return 0===l?new d(0,0,s,this.a):(0!==a?(t=l/a,e=n==a?(i-r)/l:i==a?2+(r-n)/l:4+(n-i)/l,e*=60,0>e&&(e+=360)):(t=0,e=-1),new d(e,t,s,this.a))},toBytes:function(){return new c(255*this.r,255*this.g,255*this.b,this.a)}}),c=l.extend({init:function(e,t,n,i){this.r=Math.round(e),this.g=Math.round(t),this.b=Math.round(n),this.a=i},toRGB:function(){return new l(this.r/255,this.g/255,this.b/255,this.a)},toHSV:function(){return this.toRGB().toHSV()},toHex:function(){return r(this.r,2)+r(this.g,2)+r(this.b,2)},toBytes:function(){return this}}),d=s.extend({init:function(e,t,n,i){this.h=e,this.s=t,this.v=n,this.a=i},toRGB:function(){var e,t,n,i,r,o,a,s,c=this.h,d=this.s,u=this.v;if(0===d)t=n=i=u;else switch(c/=60,e=Math.floor(c),r=c-e,o=u*(1-d),a=u*(1-d*r),s=u*(1-d*(1-r)),e){case 0:t=u,n=s,i=o;break;case 1:t=a,n=u,i=o;break;case 2:t=o,n=u,i=s;break;case 3:t=o,n=a,i=u;break;case 4:t=s,n=o,i=u;break;default:t=u,n=o,i=a}return new l(t,n,i,this.a)},toBytes:function(){return this.toRGB().toBytes()}}),u.fromBytes=function(e,t,n,i){return new c(e,t,n,null!=i?i:1)},u.fromRGB=function(e,t,n,i){return new l(e,t,n,null!=i?i:1)},u.fromHSV=function(e,t,n,i){return new d(e,t,n,null!=i?i:1)},kendo.Color=u,kendo.parseColor=i}(window.kendo.jQuery,parseFloat,parseInt),function(e){function t(e){return typeof e!==z}function n(e,t){var n=i(t);return A.round(e*n)/n}function i(e){return e?A.pow(10,e):1}function r(e,t,n){return A.max(A.min(e,n),t)}function o(e){return e*P}function a(e){return e/P}function s(e){return"number"==typeof e&&!isNaN(e)}function l(e,n){return t(e)?e:n}function c(e){return e*e}function d(e){var t,n=[];for(t in e)n.push(t+e[t]);return n.sort().join("")}function u(e){var t,n=2166136261;for(t=0;e.length>t;++t)n+=(n<<1)+(n<<4)+(n<<7)+(n<<8)+(n<<24),n^=e.charCodeAt(t);return n>>>0}function h(e){return u(d(e))}function p(e){var t,n=e.length,i=M,r=F;for(t=0;n>t;t++)r=A.max(r,e[t]),i=A.min(i,e[t]);return{min:i,max:r}}function f(e){return p(e).min}function g(e){return p(e).max}function m(e){return _(e).min}function v(e){return _(e).max}function _(e){var t,n,i,r=M,o=F;for(t=0,n=e.length;n>t;t++)i=e[t],null!==i&&isFinite(i)&&(r=A.min(r,i),o=A.max(o,i));return{min:r===M?void 0:r,max:o===F?void 0:o}}function w(e){return e?e[e.length-1]:void 0}function y(e,t){return e.push.apply(e,t),e}function b(e){return E.template(e,{useWithBlock:!1,paramName:"d"})}function k(e,n){return t(n)&&null!==n?" "+e+"='"+n+"' ":""}function x(e){var t,n="";for(t=0;e.length>t;t++)n+=k(e[t][0],e[t][1]);return n}function C(e){var n,i,r="";for(n=0;e.length>n;n++)i=e[n][1],t(i)&&(r+=e[n][0]+":"+i+";");return""!==r?r:void 0}function T(e){return"string"!=typeof e&&(e+="px"),e}function S(e){var t,n,i=[];if(e)for(t=E.toHyphens(e).split("-"),n=0;t.length>n;n++)i.push("k-pos-"+t[n]);return i.join(" ")}function D(e){return""===e||null===e||"none"===e||"transparent"===e||!t(e)}var A=Math,E=window.kendo,I=E.deepExtend,P=A.PI/180,M=Number.MAX_VALUE,F=-Number.MAX_VALUE,z="undefined",R=Date.now;R||(R=function(){return(new Date).getTime()}),I(E,{util:{MAX_NUM:M,MIN_NUM:F,append:y,arrayLimits:p,arrayMin:f,arrayMax:g,defined:t,deg:a,hashKey:u,hashObject:h,isNumber:s,isTransparent:D,last:w,limitValue:r,now:R,objectKey:d,round:n,rad:o,renderAttr:k,renderAllAttr:x,renderPos:S,renderSize:T,renderStyle:C,renderTemplate:b,sparseArrayLimits:_,sparseArrayMin:m,sparseArrayMax:v,sqr:c,valueOrDefault:l}}),E.dataviz.util=E.util}(window.kendo.jQuery),function(){function e(e){var n,i,r,a,s,l,c,d="",u=0;for(e=t(e);e.length>u;)n=e.charCodeAt(u++),i=e.charCodeAt(u++),r=e.charCodeAt(u++),a=n>>2,s=(3&n)<<4|i>>4,l=(15&i)<<2|r>>6,c=63&r,isNaN(i)?l=c=64:isNaN(r)&&(c=64),d=d+o.charAt(a)+o.charAt(s)+o.charAt(l)+o.charAt(c);return d}function t(e){var t,n,i;for(e=e.replace(/\r\n/g,"\n"),t="",n=0;e.length>n;n++)i=e.charCodeAt(n),128>i?t+=r(i):2048>i?(t+=r(192|i>>>6),t+=r(128|63&i)):65536>i&&(t+=r(224|i>>>12),t+=r(128|i>>>6&63),t+=r(128|63&i));return t}var n=window.kendo,i=n.deepExtend,r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i(n.util,{encodeBase64:e,encodeUTF8:t})}(window.kendo.jQuery),function(e){var t=Math,n=window.kendo,i=n.deepExtend,r=e.inArray,o={observers:function(){return this._observers=this._observers||[]},addObserver:function(e){return this._observers?this._observers.push(e):this._observers=[e],this},removeObserver:function(e){var t=this.observers(),n=r(e,t);return-1!=n&&t.splice(n,1),this},trigger:function(e,t){var n,i,r=this._observers;if(r&&!this._suspended)for(i=0;r.length>i;i++)n=r[i],n[e]&&n[e](t);return this},optionsChange:function(e){this.trigger("optionsChange",e)},geometryChange:function(e){this.trigger("geometryChange",e)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=t.max((this._suspended||0)-1,0),this},_observerField:function(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};i(n,{mixins:{ObserversMixin:o}})}(window.kendo.jQuery),function(e){function t(e){return null===e?null:e instanceof m?e:new m(e)}function n(e){return e&&w.isFunction(e.matrix)?e.matrix():e}function i(e,t,n,i){var r=0,o=0;return i&&(r=v.atan2(i.c*n,i.a*t),0!==i.b&&(o=v.atan2(i.d*n,i.b*t))),{x:r,y:o}}function r(e,t){for(;t>e;)e+=90;return e}function o(e,t){var n,i,r;for(n=0;t.length>n;n++)i=t[n],r=i.charAt(0).toUpperCase()+i.substring(1,i.length),e["set"+r]=a(i),e["get"+r]=s(i)}function a(e){return function(t){return this[e]!==t&&(this[e]=t,this.geometryChange()),this}}function s(e){return function(){return this[e]}}function l(e,t,n){e>t&&(t+=360);var i=v.abs(t-e);return n||(i=360-i),i}function c(e,t,n,i,r,o){var a=D((r-e)/n,3),s=D((o-t)/i,3);return D(S(v.atan2(s,a)))}function d(e,t,n,i,r,o,a,s){var d,u,h,p,f,g,m,w,y,b,k,x,C,T,S,D,A,E;if(t!==i)y=n-e,b=i-t,k=_(r,2),x=_(o,2),C=(x*y*(e+n)+k*b*(t+i))/(2*k*b),T=C-i,S=-(y*x)/(k*b),f=1/k+_(S,2)/x,g=2*(S*T/x-n/k),m=_(n,2)/k+_(T,2)/x-1,w=v.sqrt(_(g,2)-4*f*m),d=(-g-w)/(2*f),u=C+S*d,h=(-g+w)/(2*f),p=C+S*h;else{if(e===n)return!1;g=-2*i,m=_((n-e)*o/(2*r),2)+_(i,2)-_(o,2),w=v.sqrt(_(g,2)-4*m),d=h=(e+n)/2,u=(-g-w)/2,p=(-g+w)/2}return D=c(d,u,r,o,e,t),A=c(d,u,r,o,n,i),E=l(D,A,s),(a&&180>=E||!a&&E>180)&&(d=h,u=p,D=c(d,u,r,o,e,t),A=c(d,u,r,o,n,i)),{center:new P(d,u),startAngle:D,endAngle:A}}var u,h,p,f,g,m,v=Math,_=v.pow,w=window.kendo,y=w.Class,b=w.deepExtend,k=w.mixins.ObserversMixin,x=w.util,C=x.defined,T=x.rad,S=x.deg,D=x.round,A=v.PI/2,E=x.MIN_NUM,I=x.MAX_NUM,P=y.extend({init:function(e,t){this.x=e||0,this.y=t||0},equals:function(e){return e&&e.x===this.x&&e.y===this.y},clone:function(){return new P(this.x,this.y)},rotate:function(e,n){return this.transform(t().rotate(e,n))},translate:function(e,t){return this.x+=e,this.y+=t,this.geometryChange(),this},translateWith:function(e){return this.translate(e.x,e.y)},move:function(e,t){return this.x=this.y=0,this.translate(e,t)},scale:function(e,t){return C(t)||(t=e),this.x*=e,this.y*=t,this.geometryChange(),this},scaleCopy:function(e,t){return this.clone().scale(e,t)},transform:function(e){var t=n(e),i=this.x,r=this.y;return this.x=t.a*i+t.c*r+t.e,this.y=t.b*i+t.d*r+t.f,this.geometryChange(),this},transformCopy:function(e){var t=this.clone();return e&&t.transform(e),t},distanceTo:function(e){var t=this.x-e.x,n=this.y-e.y;return v.sqrt(t*t+n*n)},round:function(e){return this.x=D(this.x,e),this.y=D(this.y,e),this.geometryChange(),this},toArray:function(e){var t=C(e),n=t?D(this.x,e):this.x,i=t?D(this.y,e):this.y;return[n,i]}});o(P.fn,["x","y"]),b(P.fn,k),P.fn.toString=function(e,t){var n=this.x,i=this.y;return C(e)&&(n=D(n,e),i=D(i,e)),t=t||" ",n+t+i},P.create=function(e,t){return C(e)?e instanceof P?e:1===arguments.length&&2===e.length?new P(e[0],e[1]):new P(e,t):void 0},P.min=function(){var e,t,n=x.MAX_NUM,i=x.MAX_NUM;for(e=0;arguments.length>e;e++)t=arguments[e],n=v.min(t.x,n),i=v.min(t.y,i);return new P(n,i)},P.max=function(){var e,t,n=x.MIN_NUM,i=x.MIN_NUM;for(e=0;arguments.length>e;e++)t=arguments[e],n=v.max(t.x,n),i=v.max(t.y,i);return new P(n,i)},P.minPoint=function(){return new P(E,E)},P.maxPoint=function(){return new P(I,I)},P.ZERO=new P(0,0),u=y.extend({init:function(e,t){this.width=e||0,this.height=t||0},equals:function(e){return e&&e.width===this.width&&e.height===this.height},clone:function(){return new u(this.width,this.height)},toArray:function(e){var t=C(e),n=t?D(this.width,e):this.width,i=t?D(this.height,e):this.height;return[n,i]}}),o(u.fn,["width","height"]),b(u.fn,k),u.create=function(e,t){return C(e)?e instanceof u?e:1===arguments.length&&2===e.length?new u(e[0],e[1]):new u(e,t):void 0},u.ZERO=new u(0,0),h=y.extend({init:function(e,t){this.setOrigin(e||new P),this.setSize(t||new u)},clone:function(){return new h(this.origin.clone(),this.size.clone())},equals:function(e){return e&&e.origin.equals(this.origin)&&e.size.equals(this.size)},setOrigin:function(e){return this._observerField("origin",P.create(e)),this.geometryChange(),this},getOrigin:function(){return this.origin},setSize:function(e){return this._observerField("size",u.create(e)),this.geometryChange(),this},getSize:function(){return this.size},width:function(){return this.size.width},height:function(){return this.size.height},topLeft:function(){return this.origin.clone()},bottomRight:function(){return this.origin.clone().translate(this.width(),this.height())},topRight:function(){return this.origin.clone().translate(this.width(),0)},bottomLeft:function(){return this.origin.clone().translate(0,this.height())},center:function(){return this.origin.clone().translate(this.width()/2,this.height()/2)},bbox:function(e){var t=this.topLeft().transformCopy(e),n=this.topRight().transformCopy(e),i=this.bottomRight().transformCopy(e),r=this.bottomLeft().transformCopy(e);return h.fromPoints(t,n,i,r)}}),b(h.fn,k),h.fromPoints=function(){var e=P.min.apply(this,arguments),t=P.max.apply(this,arguments),n=new u(t.x-e.x,t.y-e.y);return new h(e,n)},h.union=function(e,t){return h.fromPoints(P.min(e.topLeft(),t.topLeft()),P.max(e.bottomRight(),t.bottomRight()))},h.intersect=function(e,t){return e={left:e.topLeft().x,top:e.topLeft().y,right:e.bottomRight().x,bottom:e.bottomRight().y},t={left:t.topLeft().x,top:t.topLeft().y,right:t.bottomRight().x,bottom:t.bottomRight().y},t.right>=e.left&&e.right>=t.left&&t.bottom>=e.top&&e.bottom>=t.top?h.fromPoints(new P(v.max(e.left,t.left),v.max(e.top,t.top)),new P(v.min(e.right,t.right),v.min(e.bottom,t.bottom))):void 0},p=y.extend({init:function(e,t){this.setCenter(e||new P),this.setRadius(t||0)},setCenter:function(e){return this._observerField("center",P.create(e)),this.geometryChange(),this},getCenter:function(){return this.center},equals:function(e){return e&&e.center.equals(this.center)&&e.radius===this.radius},clone:function(){return new p(this.center.clone(),this.radius)},pointAt:function(e){return this._pointAt(T(e))},bbox:function(e){var t,n,r,o,a=P.maxPoint(),s=P.minPoint(),l=i(this.center,this.radius,this.radius,e);for(t=0;4>t;t++)n=this._pointAt(l.x+t*A).transformCopy(e),r=this._pointAt(l.y+t*A).transformCopy(e),o=new P(n.x,r.y),a=P.min(a,o),s=P.max(s,o);return h.fromPoints(a,s)},_pointAt:function(e){var t=this.center,n=this.radius;return new P(t.x-n*v.cos(e),t.y-n*v.sin(e))}}),o(p.fn,["radius"]),b(p.fn,k),f=y.extend({init:function(e,t){this.setCenter(e||new P),t=t||{},this.radiusX=t.radiusX,this.radiusY=t.radiusY||t.radiusX,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.anticlockwise=t.anticlockwise||!1},clone:function(){return new f(this.center,{radiusX:this.radiusX,radiusY:this.radiusY,startAngle:this.startAngle,endAngle:this.endAngle,anticlockwise:this.anticlockwise})},setCenter:function(e){return this._observerField("center",P.create(e)),this.geometryChange(),this},getCenter:function(){return this.center},MAX_INTERVAL:45,pointAt:function(e){var t=this.center,n=T(e);return new P(t.x+this.radiusX*v.cos(n),t.y+this.radiusY*v.sin(n))},curvePoints:function(){var e,t,n,i=this.startAngle,r=this.anticlockwise?-1:1,o=[this.pointAt(i)],a=i,s=this._arcInterval(),l=s.endAngle-s.startAngle,c=v.ceil(l/this.MAX_INTERVAL),d=l/c;for(e=1;c>=e;e++)t=a+r*d,n=this._intervalCurvePoints(a,t),o.push(n.cp1,n.cp2,n.p2),a=t;return o},bbox:function(e){for(var t,n,o=this,a=o._arcInterval(),s=a.startAngle,l=a.endAngle,c=i(this.center,this.radiusX,this.radiusY,e),d=S(c.x),u=S(c.y),p=o.pointAt(s).transformCopy(e),f=o.pointAt(l).transformCopy(e),g=P.min(p,f),m=P.max(p,f),v=r(d,s),_=r(u,s);l>v||l>_;)l>v&&(t=o.pointAt(v).transformCopy(e),v+=90),l>_&&(n=o.pointAt(_).transformCopy(e),_+=90),p=new P(t.x,n.y),g=P.min(g,p),m=P.max(m,p);return h.fromPoints(g,m)},_arcInterval:function(){var e,t=this.startAngle,n=this.endAngle,i=this.anticlockwise;return i&&(e=t,t=n,n=e),(t>n||i&&t===n)&&(n+=360),{startAngle:t,endAngle:n}},_intervalCurvePoints:function(e,t){var n=this,i=n.pointAt(e),r=n.pointAt(t),o=n._derivativeAt(e),a=n._derivativeAt(t),s=(T(t)-T(e))/3,l=new P(i.x+s*o.x,i.y+s*o.y),c=new P(r.x-s*a.x,r.y-s*a.y);return{p1:i,cp1:l,cp2:c,p2:r}},_derivativeAt:function(e){var t=this,n=T(e);return new P(-t.radiusX*v.sin(n),t.radiusY*v.cos(n))}}),o(f.fn,["radiusX","radiusY","startAngle","endAngle","anticlockwise"]),b(f.fn,k),f.fromPoints=function(e,t,n,i,r,o){var a=d(e.x,e.y,t.x,t.y,n,i,r,o);return new f(a.center,{startAngle:a.startAngle,endAngle:a.endAngle,radiusX:n,radiusY:i,anticlockwise:0===o})},g=y.extend({init:function(e,t,n,i,r,o){this.a=e||0,this.b=t||0,this.c=n||0,this.d=i||0,this.e=r||0,this.f=o||0},multiplyCopy:function(e){return new g(this.a*e.a+this.c*e.b,this.b*e.a+this.d*e.b,this.a*e.c+this.c*e.d,this.b*e.c+this.d*e.d,this.a*e.e+this.c*e.f+this.e,this.b*e.e+this.d*e.f+this.f)},clone:function(){return new g(this.a,this.b,this.c,this.d,this.e,this.f)},equals:function(e){return e?this.a===e.a&&this.b===e.b&&this.c===e.c&&this.d===e.d&&this.e===e.e&&this.f===e.f:!1},round:function(e){return this.a=D(this.a,e),this.b=D(this.b,e),this.c=D(this.c,e),this.d=D(this.d,e),this.e=D(this.e,e),this.f=D(this.f,e),this},toArray:function(e){var t,n=[this.a,this.b,this.c,this.d,this.e,this.f];if(C(e))for(t=0;n.length>t;t++)n[t]=D(n[t],e);return n}}),g.fn.toString=function(e,t){return this.toArray(e).join(t||",")},g.translate=function(e,t){return new g(1,0,0,1,e,t)},g.unit=function(){return new g(1,0,0,1,0,0)},g.rotate=function(e,t,n){var i=new g;return i.a=v.cos(T(e)),i.b=v.sin(T(e)),i.c=-i.b,i.d=i.a,i.e=t-t*i.a+n*i.b||0,i.f=n-n*i.a-t*i.b||0,i},g.scale=function(e,t){return new g(e,0,0,t,0,0)},g.IDENTITY=g.unit(),m=y.extend({init:function(e){this._matrix=e||g.unit()},clone:function(){return new m(this._matrix.clone())},equals:function(e){return e&&e._matrix.equals(this._matrix)},_optionsChange:function(){this.optionsChange({field:"transform",value:this})},translate:function(e,t){return this._matrix=this._matrix.multiplyCopy(g.translate(e,t)),this._optionsChange(),this},scale:function(e,t,n){return C(t)||(t=e),n&&(n=P.create(n),this._matrix=this._matrix.multiplyCopy(g.translate(n.x,n.y))),this._matrix=this._matrix.multiplyCopy(g.scale(e,t)),n&&(this._matrix=this._matrix.multiplyCopy(g.translate(-n.x,-n.y))),this._optionsChange(),this},rotate:function(e,t){return t=P.create(t)||P.ZERO,this._matrix=this._matrix.multiplyCopy(g.rotate(e,t.x,t.y)),this._optionsChange(),this},multiply:function(e){var t=n(e);return this._matrix=this._matrix.multiplyCopy(t),this._optionsChange(),this},matrix:function(){return this._matrix}}),b(m.fn,k),b(w,{geometry:{Arc:f,Circle:p,Matrix:g,Point:P,Rect:h,Size:u,Transformation:m,transform:t,toMatrix:n}}),w.dataviz.geometry=w.geometry}(window.kendo.jQuery),function(e){var t,n,i,r=e.noop,o=Object.prototype.toString,a=window.kendo,s=a.Class,l=a.ui.Widget,c=a.deepExtend,d=a.util,u=d.defined,h=a.Observable.extend({init:function(t,n){a.Observable.fn.init.call(this),this.options=c({},this.options,n),this.bind(this.events,this.options),this._click=this._handler("click"),this._mouseenter=this._handler("mouseenter"),this._mouseleave=this._handler("mouseleave"),this.element=e(t),this.options.width&&this.element.css("width",this.options.width),this.options.height&&this.element.css("height",this.options.height)},options:{},events:["click","mouseenter","mouseleave","resize"],draw:r,clear:r,destroy:r,resize:l.fn.resize,size:l.fn.size,getSize:function(){return{width:this.element.width(),height:this.element.height()}},setSize:function(e){this.element.css({width:e.width,height:e.height}),this._size=e,this._resize()},eventTarget:function(t){for(var n,i=e(t.touch?t.touch.initialTouch:t.target);!n&&i.length>0&&(n=i[0]._kendoNode,!i.is(this.element)&&0!==i.length);)i=i.parent();return n?n.srcElement:void 0},_resize:r,_handler:function(e){var t=this;return function(n){var i=t.eventTarget(n);i&&t.trigger(e,{element:i,originalEvent:n})}}});h.create=function(e,t){return i.current.create(e,t)},t=s.extend({init:function(e){this.childNodes=[],this.parent=null,e&&(this.srcElement=e,this.observe())},destroy:function(){var e,t;for(this.srcElement&&this.srcElement.removeObserver(this),e=this.childNodes,t=0;e.length>t;t++)this.childNodes[t].destroy();this.parent=null},load:r,observe:function(){this.srcElement&&this.srcElement.addObserver(this)},append:function(e){this.childNodes.push(e),e.parent=this},insertAt:function(e,t){this.childNodes.splice(t,0,e),e.parent=this},remove:function(e,t){var n,i=e+t;for(n=e;i>n;n++)this.childNodes[n].removeSelf();this.childNodes.splice(e,t)},removeSelf:function(){this.clear(),this.destroy()},clear:function(){this.remove(0,this.childNodes.length)},invalidate:function(){this.parent&&this.parent.invalidate()},geometryChange:function(){this.invalidate()},optionsChange:function(){this.invalidate()},childrenChange:function(e){"add"===e.action?this.load(e.items,e.index):"remove"===e.action&&this.remove(e.index,e.items.length),this.invalidate()}}),n=s.extend({init:function(e,t){var n,i;this.prefix=t||"";for(n in e)i=e[n],i=this._wrap(i,n),this[n]=i},get:function(e){return a.getter(e,!0)(this)},set:function(e,t){var n,i=a.getter(e,!0)(this);i!==t&&(n=this._set(e,this._wrap(t,e)),n||this.optionsChange({field:this.prefix+e,value:t}))},_set:function(e,t){var i,r,o,s=e.indexOf(".")>=0;if(s)for(i=e.split("."),r="";i.length>1;){if(r+=i.shift(),o=a.getter(r,!0)(this),o||(o=new n({},r+"."),o.addObserver(this),this[r]=o),o instanceof n)return o.set(i.join("."),t),s;
r+="."}return this._clear(e),a.setter(e)(this,t),s},_clear:function(e){var t=a.getter(e,!0)(this);t&&t.removeObserver&&t.removeObserver(this)},_wrap:function(e,t){var i=o.call(e);return null!==e&&u(e)&&"[object Object]"===i&&(e instanceof n||e instanceof s||(e=new n(e,this.prefix+t+".")),e.addObserver(this)),e}}),c(n.fn,a.mixins.ObserversMixin),i=function(){this._items=[]},i.prototype={register:function(e,t,n){var i=this._items,r=i[0],o={name:e,type:t,order:n};!r||r.order>n?i.unshift(o):i.push(o)},create:function(e,t){var n,i,r=this._items,o=r[0];if(t&&t.type)for(n=t.type.toLowerCase(),i=0;r.length>i;i++)if(r[i].name===n){o=r[i];break}return o?new o.type(e,t):void a.logToConsole("Warning: Unable to create Kendo UI Drawing Surface. Possible causes:\n- The browser does not support SVG, VML and Canvas. User agent: "+navigator.userAgent+"\n- The Kendo UI scripts are not fully loaded")}},i.current=new i,c(a,{drawing:{DASH_ARRAYS:{dot:[1.5,3.5],dash:[4,3.5],longdash:[8,3.5],dashdot:[3.5,3.5,1.5,3.5],longdashdot:[8,3.5,1.5,3.5],longdashdotdot:[8,3.5,1.5,3.5,1.5,3.5]},Color:a.Color,BaseNode:t,OptionsStore:n,Surface:h,SurfaceFactory:i}}),a.dataviz.drawing=a.drawing}(window.kendo.jQuery),function(){var e=window.kendo,t=e.deepExtend,n=e.util.defined,i="gradient",r={extend:function(e){e.fill=this.fill,e.stroke=this.stroke},fill:function(e,t){var r,o=this.options;return n(e)?(e&&e.nodeType!=i?(r={color:e},n(t)&&(r.opacity=t),o.set("fill",r)):o.set("fill",e),this):o.get("fill")},stroke:function(e,t,i){return n(e)?(this.options.set("stroke.color",e),n(t)&&this.options.set("stroke.width",t),n(i)&&this.options.set("stroke.opacity",i),this):this.options.get("stroke")}},o={extend:function(e,t){e.traverse=function(e){var n,i,r=this[t];for(n=0;r.length>n;n++)i=r[n],i.traverse?i.traverse(e):e(i);return this}}};t(e.drawing,{mixins:{Paintable:r,Traversable:o}})}(window.kendo.jQuery),function(e){function t(e,t){return d.current.measure(e,t)}var n=document,i=window.kendo,r=i.Class,o=i.deepExtend,a=i.util,s=a.defined,l=1,c=r.extend({init:function(e){this._size=e,this._length=0,this._map={}},put:function(e,t){var n=this,i=n._map,r={key:e,value:t};i[e]=r,n._head?(n._tail.newer=r,r.older=n._tail,n._tail=r):n._head=n._tail=r,n._length>=n._size?(i[n._head.key]=null,n._head=n._head.newer,n._head.older=null):n._length++},get:function(e){var t=this,n=t._map[e];return n?(n===t._head&&n!==t._tail&&(t._head=n.newer,t._head.older=null),n!==t._tail&&(n.older&&(n.older.newer=n.newer,n.newer.older=n.older),n.older=t._tail,n.newer=null,t._tail.newer=n,t._tail=n),n.value):void 0}}),d=r.extend({init:function(){this._cache=new c(1e3)},measure:function(e,t){var i,r,o,c,d,u=a.objectKey(t),h=a.hashKey(e+u),p=this._cache.get(h);if(p)return p;i={width:0,height:0,baseline:0},r=this._measureBox,o=this._baselineMarker.cloneNode(!1);for(c in t)d=t[c],s(d)&&(r.style[c]=d);return r.innerHTML=e,r.appendChild(o),n.body.appendChild(r),(e+"").length&&(i.width=r.offsetWidth-l,i.height=r.offsetHeight,i.baseline=o.offsetTop+l),this._cache.put(h,i),r.parentNode.removeChild(r),i}});d.fn._baselineMarker=e("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+l+"px; height: "+l+"px;overflow: hidden;' />")[0],d.fn._measureBox=e("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space:nowrap !important;' />")[0],d.current=new d,o(i.drawing,{util:{TextMetrics:d,LRUCache:c,measureText:t}})}(window.kendo.jQuery),function(e){function t(e,t,n){var i,r,o,a;for(r=0;e.length>r;r++)o=e[r],o.visible()&&(a=t?o.bbox(n):o.rawBBox(),a&&(i=i?I.union(i,a):a));return i}function n(e,t){var n,i,r,o;for(i=0;e.length>i;i++)r=e[i],r.visible()&&(o=r.clippedBBox(t),o&&(n=n?I.union(n,o):o));return n}function i(e,t){e.origin.x-=t,e.origin.y-=t,e.size.width+=2*t,e.size.height+=2*t}function r(e,t){for(var n=0;t.length>n;n++)e[t[n]]=o(t[n])}function o(e){var t="_"+e;return function(e){return V(e)?(this._observerField(t,e),this.geometryChange(),this):this[t]}}function a(e,t){for(var n=0;t.length>n;n++)e[t[n]]=s(t[n])}function s(e){var t="_"+e;return function(e){return V(e)?(this._observerField(t,E.create(e)),this.geometryChange(),this):this[t]}}function l(e,t){for(var n=0;t.length>n;n++)e[t[n]]=c(t[n])}function c(e){return function(t){return V(t)?(this.options.set(e,t),this):this.options.get(e)}}var d,u,h,p,f,g,m,v,_,w,y,b,k,x,C,T=window.kendo,S=T.Class,D=T.deepExtend,A=T.geometry,E=A.Point,I=A.Rect,P=A.Size,M=A.Matrix,F=A.toMatrix,z=T.drawing,R=z.OptionsStore,B=Math,H=B.pow,L=T.util,N=L.append,O=L.arrayLimits,V=L.defined,U=L.last,W=L.valueOrDefault,j=T.mixins.ObserversMixin,q=e.inArray,G=[].push,$=[].pop,Y=[].splice,Q=[].shift,K=[].slice,X=[].unshift,Z=S.extend({nodeType:"Element",init:function(e){this._initOptions(e)},_initOptions:function(e){var t,n;e=e||{},t=e.transform,n=e.clip,t&&(e.transform=A.transform(t)),n&&!n.id&&(n.id=T.guid()),this.options=new R(e),this.options.addObserver(this)},transform:function(e){return V(e)?void this.options.set("transform",A.transform(e)):this.options.get("transform")},parentTransform:function(){for(var e,t,n=this;n.parent;)n=n.parent,e=n.transform(),e&&(t=e.matrix().multiplyCopy(t||M.unit()));return t?A.transform(t):void 0},currentTransform:function(e){var t,n,i=this.transform(),r=F(i);return V(e)||(e=this.parentTransform()),t=F(e),n=r&&t?t.multiplyCopy(r):r||t,n?A.transform(n):void 0},visible:function(e){return V(e)?(this.options.set("visible",e),this):this.options.get("visible")!==!1},clip:function(e){var t=this.options;return V(e)?(e&&!e.id&&(e.id=T.guid()),t.set("clip",e),this):t.get("clip")},opacity:function(e){return V(e)?(this.options.set("opacity",e),this):W(this.options.get("opacity"),1)},clippedBBox:function(e){var t,n=this._clippedBBox(e);return n?(t=this.clip(),t?I.intersect(n,t.bbox(e)):n):void 0},_clippedBBox:function(e){return this.bbox(e)}});D(Z.fn,j),d=S.extend({init:function(e){e=e||[],this.length=0,this._splice(0,e.length,e)},elements:function(e){return e?(this._splice(0,this.length,e),this._change(),this):this.slice(0)},push:function(){var e=arguments,t=G.apply(this,e);return this._add(e),t},slice:K,pop:function(){var e=this.length,t=$.apply(this);return e&&this._remove([t]),t},splice:function(e,t){var n=K.call(arguments,2),i=this._splice(e,t,n);return this._change(),i},shift:function(){var e=this.length,t=Q.apply(this);return e&&this._remove([t]),t},unshift:function(){var e=arguments,t=X.apply(this,e);return this._add(e),t},indexOf:function(e){var t,n,i=this;for(t=0,n=i.length;n>t;t++)if(i[t]===e)return t;return-1},_splice:function(e,t,n){var i=Y.apply(this,[e,t].concat(n));return this._clearObserver(i),this._setObserver(n),i},_add:function(e){this._setObserver(e),this._change()},_remove:function(e){this._clearObserver(e),this._change()},_setObserver:function(e){for(var t=0;e.length>t;t++)e[t].addObserver(this)},_clearObserver:function(e){for(var t=0;e.length>t;t++)e[t].removeObserver(this)},_change:function(){}}),D(d.fn,j),u=Z.extend({nodeType:"Group",init:function(e){Z.fn.init.call(this,e),this.children=[]},childrenChange:function(e,t,n){this.trigger("childrenChange",{action:e,items:t,index:n})},append:function(){return N(this.children,arguments),this._reparent(arguments,this),this.childrenChange("add",arguments),this},insertAt:function(e,t){return this.children.splice(t,0,e),e.parent=this,this.childrenChange("add",[e],t),this},remove:function(e){var t=q(e,this.children);return t>=0&&(this.children.splice(t,1),e.parent=null,this.childrenChange("remove",[e],t)),this},removeAt:function(e){if(e>=0&&this.children.length>e){var t=this.children[e];this.children.splice(e,1),t.parent=null,this.childrenChange("remove",[t],e)}return this},clear:function(){var e=this.children;return this.children=[],this._reparent(e,null),this.childrenChange("remove",e,0),this},bbox:function(e){return t(this.children,!0,this.currentTransform(e))},rawBBox:function(){return t(this.children,!1)},_clippedBBox:function(e){return n(this.children,this.currentTransform(e))},currentTransform:function(e){return Z.fn.currentTransform.call(this,e)||null},_reparent:function(e,t){var n,i,r;for(n=0;e.length>n;n++)i=e[n],r=i.parent,r&&r!=this&&r.remove&&r.remove(i),i.parent=t}}),z.mixins.Traversable.extend(u.fn,"children"),h=Z.extend({nodeType:"Text",init:function(e,t,n){Z.fn.init.call(this,n),this.content(e),this.position(t||new A.Point),this.options.font||(this.options.font="12px sans-serif"),V(this.options.fill)||this.fill("#000")},content:function(e){return V(e)?(this.options.set("content",e),this):this.options.get("content")},measure:function(){var e=z.util.measureText(this.content(),{font:this.options.get("font")});return e},rect:function(){var e=this.measure(),t=this.position().clone();return new A.Rect(t,[e.width,e.height])},bbox:function(e){var t=F(this.currentTransform(e));return this.rect().bbox(t)},rawBBox:function(){return this.rect().bbox()}}),z.mixins.Paintable.extend(h.fn),a(h.fn,["position"]),p=Z.extend({nodeType:"Circle",init:function(e,t){Z.fn.init.call(this,t),this.geometry(e||new A.Circle),V(this.options.stroke)||this.stroke("#000")},bbox:function(e){var t=F(this.currentTransform(e)),n=this._geometry.bbox(t),r=this.options.get("stroke.width");return r&&i(n,r/2),n},rawBBox:function(){return this._geometry.bbox()}}),z.mixins.Paintable.extend(p.fn),r(p.fn,["geometry"]),f=Z.extend({nodeType:"Arc",init:function(e,t){Z.fn.init.call(this,t),this.geometry(e||new A.Arc),V(this.options.stroke)||this.stroke("#000")},bbox:function(e){var t=F(this.currentTransform(e)),n=this.geometry().bbox(t),r=this.options.get("stroke.width");return r&&i(n,r/2),n},rawBBox:function(){return this.geometry().bbox()},toPath:function(){var e,t=new v,n=this.geometry().curvePoints();if(n.length>0)for(t.moveTo(n[0].x,n[0].y),e=1;n.length>e;e+=3)t.curveTo(n[e],n[e+1],n[e+2]);return t}}),z.mixins.Paintable.extend(f.fn),r(f.fn,["geometry"]),g=d.extend({_change:function(){this.geometryChange()}}),m=S.extend({init:function(e,t,n){this.anchor(e||new E),this.controlIn(t),this.controlOut(n)},bboxTo:function(e,t){var n,i=this.anchor().transformCopy(t),r=e.anchor().transformCopy(t);return n=this.controlOut()&&e.controlIn()?this._curveBoundingBox(i,this.controlOut().transformCopy(t),e.controlIn().transformCopy(t),r):this._lineBoundingBox(i,r)},_lineBoundingBox:function(e,t){return I.fromPoints(e,t)},_curveBoundingBox:function(e,t,n,i){var r=[e,t,n,i],o=this._curveExtremesFor(r,"x"),a=this._curveExtremesFor(r,"y"),s=O([o.min,o.max,e.x,i.x]),l=O([a.min,a.max,e.y,i.y]);return I.fromPoints(new E(s.min,l.min),new E(s.max,l.max))},_curveExtremesFor:function(e,t){var n=this._curveExtremes(e[0][t],e[1][t],e[2][t],e[3][t]);return{min:this._calculateCurveAt(n.min,t,e),max:this._calculateCurveAt(n.max,t,e)}},_calculateCurveAt:function(e,t,n){var i=1-e;return H(i,3)*n[0][t]+3*H(i,2)*e*n[1][t]+3*H(e,2)*i*n[2][t]+H(e,3)*n[3][t]},_curveExtremes:function(e,t,n,i){var r,o,a=e-3*t+3*n-i,s=-2*(e-2*t+n),l=e-t,c=B.sqrt(s*s-4*a*l),d=0,u=1;return 0===a?0!==s&&(d=u=-l/s):isNaN(c)||(d=(-s+c)/(2*a),u=(-s-c)/(2*a)),r=B.max(B.min(d,u),0),(0>r||r>1)&&(r=0),o=B.min(B.max(d,u),1),(o>1||0>o)&&(o=1),{min:r,max:o}}}),a(m.fn,["anchor","controlIn","controlOut"]),D(m.fn,j),v=Z.extend({nodeType:"Path",init:function(e){Z.fn.init.call(this,e),this.segments=new g,this.segments.addObserver(this),V(this.options.stroke)||(this.stroke("#000"),V(this.options.stroke.lineJoin)||this.options.set("stroke.lineJoin","miter"))},moveTo:function(e,t){return this.suspend(),this.segments.elements([]),this.resume(),this.lineTo(e,t),this},lineTo:function(e,t){var n=V(t)?new E(e,t):e,i=new m(n);return this.segments.push(i),this},curveTo:function(e,t,n){var i,r;return this.segments.length>0&&(i=U(this.segments),r=new m(n,t),this.suspend(),i.controlOut(e),this.resume(),this.segments.push(r)),this},arc:function(e,t,n,i,r){var o,a,s,l,c;return this.segments.length>0&&(o=U(this.segments),a=o.anchor(),s=L.rad(e),l=new E(a.x-n*B.cos(s),a.y-i*B.sin(s)),c=new A.Arc(l,{startAngle:e,endAngle:t,radiusX:n,radiusY:i,anticlockwise:r}),this._addArcSegments(c)),this},arcTo:function(e,t,n,i,r){var o,a,s;return this.segments.length>0&&(o=U(this.segments),a=o.anchor(),s=A.Arc.fromPoints(a,e,t,n,i,r),this._addArcSegments(s)),this},_addArcSegments:function(e){var t,n;for(this.suspend(),t=e.curvePoints(),n=1;t.length>n;n+=3)this.curveTo(t[n],t[n+1],t[n+2]);this.resume(),this.geometryChange()},close:function(){return this.options.closed=!0,this.geometryChange(),this},bbox:function(e){var t=F(this.currentTransform(e)),n=this._bbox(t),r=this.options.get("stroke.width");return r&&i(n,r/2),n},rawBBox:function(){return this._bbox()},_bbox:function(e){var t,n,i,r,o=this.segments,a=o.length;if(1===a)n=o[0].anchor().transformCopy(e),t=new I(n,P.ZERO);else if(a>0)for(i=1;a>i;i++)r=o[i-1].bboxTo(o[i],e),t=t?I.union(t,r):r;return t}}),z.mixins.Paintable.extend(v.fn),v.fromRect=function(e,t){return new v(t).moveTo(e.topLeft()).lineTo(e.topRight()).lineTo(e.bottomRight()).lineTo(e.bottomLeft()).close()},v.fromPoints=function(e,t){var n,i,r;if(e){for(n=new v(t),i=0;e.length>i;i++)r=E.create(e[i]),r&&(0===i?n.moveTo(r):n.lineTo(r));return n}},v.fromArc=function(e,t){var n=new v(t),i=e.startAngle,r=e.pointAt(i);return n.moveTo(r.x,r.y),n.arc(i,e.endAngle,e.radiusX,e.radiusY,e.anticlockwise),n},_=Z.extend({nodeType:"MultiPath",init:function(e){Z.fn.init.call(this,e),this.paths=new g,this.paths.addObserver(this),V(this.options.stroke)||this.stroke("#000")},moveTo:function(e,t){var n=new v;return n.moveTo(e,t),this.paths.push(n),this},lineTo:function(e,t){return this.paths.length>0&&U(this.paths).lineTo(e,t),this},curveTo:function(e,t,n){return this.paths.length>0&&U(this.paths).curveTo(e,t,n),this},arc:function(e,t,n,i,r){return this.paths.length>0&&U(this.paths).arc(e,t,n,i,r),this},arcTo:function(e,t,n,i,r){return this.paths.length>0&&U(this.paths).arcTo(e,t,n,i,r),this},close:function(){return this.paths.length>0&&U(this.paths).close(),this},bbox:function(e){return t(this.paths,!0,this.currentTransform(e))},rawBBox:function(){return t(this.paths,!1)},_clippedBBox:function(e){return n(this.paths,this.currentTransform(e))}}),z.mixins.Paintable.extend(_.fn),w=Z.extend({nodeType:"Image",init:function(e,t,n){Z.fn.init.call(this,n),this.src(e),this.rect(t||new A.Rect)},src:function(e){return V(e)?(this.options.set("src",e),this):this.options.get("src")},bbox:function(e){var t=F(this.currentTransform(e));return this._rect.bbox(t)},rawBBox:function(){return this._rect.bbox()}}),r(w.fn,["rect"]),y=S.extend({init:function(e,t,n){this.options=new R({offset:e,color:t,opacity:V(n)?n:1}),this.options.addObserver(this)}}),l(y.fn,["offset","color","opacity"]),D(y.fn,j),y.create=function(e){if(V(e)){var t;return t=e instanceof y?e:e.length>1?new y(e[0],e[1],e[2]):new y(e.offset,e.color,e.opacity)}},b=d.extend({_change:function(){this.optionsChange({field:"stops"})}}),k=S.extend({nodeType:"gradient",init:function(e){this.stops=new b(this._createStops(e.stops)),this.stops.addObserver(this),this._userSpace=e.userSpace,this.id=T.guid()},userSpace:function(e){return V(e)?(this._userSpace=e,this.optionsChange(),this):this._userSpace},_createStops:function(e){var t,n=[];for(e=e||[],t=0;e.length>t;t++)n.push(y.create(e[t]));return n},addStop:function(e,t,n){this.stops.push(new y(e,t,n))},removeStop:function(e){var t=this.stops.indexOf(e);t>=0&&this.stops.splice(t,1)}}),D(k.fn,j,{optionsChange:function(e){this.trigger("optionsChange",{field:"gradient"+(e?"."+e.field:""),value:this})},geometryChange:function(){this.optionsChange()}}),x=k.extend({init:function(e){e=e||{},k.fn.init.call(this,e),this.start(e.start||new E),this.end(e.end||new E(1,0))}}),a(x.fn,["start","end"]),C=k.extend({init:function(e){e=e||{},k.fn.init.call(this,e),this.center(e.center||new E),this._radius=V(e.radius)?e.radius:1,this._fallbackFill=e.fallbackFill},radius:function(e){return V(e)?(this._radius=e,this.geometryChange(),this):this._radius},fallbackFill:function(e){return V(e)?(this._fallbackFill=e,this.optionsChange(),this):this._fallbackFill}}),a(C.fn,["center"]),D(z,{Arc:f,Circle:p,Element:Z,ElementsArray:d,Gradient:k,GradientStop:y,Group:u,Image:w,LinearGradient:x,MultiPath:_,Path:v,RadialGradient:C,Segment:m,Text:h})}(window.kendo.jQuery),function(e){function t(e){var t=[];return e.replace(g,function(e,n){t.push(parseFloat(n))}),t}function n(e,t,n){var i,r=t?0:1;for(i=0;e.length>i;i+=2)e.splice(i+r,0,n)}function i(e,t){return e&&t?t.scaleCopy(2).translate(-e.x,-e.y):void 0}function r(e,t,n){var i=1/3;return t=t.clone().scale(2/3),{controlOut:t.clone().translateWith(e.scaleCopy(i)),controlIn:t.translateWith(n.scaleCopy(i))}}var o=window.kendo,a=o.drawing,s=o.geometry,l=o.Class,c=s.Point,d=o.deepExtend,u=e.trim,h=o.util,p=h.last,f=/([a-z]{1})([^a-z]*)(z)?/gi,g=/[,\s]?(-?(?:\d+\.)?\d+)/g,m="m",v="z",_=l.extend({parse:function(e,n){var i,r=new a.MultiPath(n),o=new c;return e.replace(f,function(e,n,a,s){var l=n.toLowerCase(),c=l===n,d=t(u(a));if(l===m&&(c?(o.x+=d[0],o.y+=d[1]):(o.x=d[0],o.y=d[1]),r.moveTo(o.x,o.y),d.length>2&&(l="l",d.splice(0,2))),w[l])w[l](r,{parameters:d,position:o,isRelative:c,previousCommand:i}),s&&s.toLowerCase()===v&&r.close();else if(l!==m)throw Error("Error while parsing SVG path. Unsupported command: "+l);i=l}),r}}),w={l:function(e,t){var n,i,r=t.parameters,o=t.position;for(n=0;r.length>n;n+=2)i=new c(r[n],r[n+1]),t.isRelative&&i.translateWith(o),e.lineTo(i.x,i.y),o.x=i.x,o.y=i.y},c:function(e,t){var n,i,r,o,a=t.parameters,s=t.position;for(o=0;a.length>o;o+=6)n=new c(a[o],a[o+1]),i=new c(a[o+2],a[o+3]),r=new c(a[o+4],a[o+5]),t.isRelative&&(i.translateWith(s),n.translateWith(s),r.translateWith(s)),e.curveTo(n,i,r),s.x=r.x,s.y=r.y},v:function(e,t){var i=t.isRelative?0:t.position.x;n(t.parameters,!0,i),this.l(e,t)},h:function(e,t){var i=t.isRelative?0:t.position.y;n(t.parameters,!1,i),this.l(e,t)},a:function(e,t){var n,i,r,o,a,s,l=t.parameters,d=t.position;for(n=0;l.length>n;n+=7)i=l[n],r=l[n+1],o=l[n+3],a=l[n+4],s=new c(l[n+5],l[n+6]),t.isRelative&&s.translateWith(d),e.arcTo(s,i,r,o,a),d.x=s.x,d.y=s.y},s:function(e,t){var n,r,o,a,s,l=t.parameters,d=t.position,u=t.previousCommand;for(("s"==u||"c"==u)&&(a=p(p(e.paths).segments).controlIn()),s=0;l.length>s;s+=4)o=new c(l[s],l[s+1]),r=new c(l[s+2],l[s+3]),t.isRelative&&(o.translateWith(d),r.translateWith(d)),n=a?i(a,d):d.clone(),a=o,e.curveTo(n,o,r),d.x=r.x,d.y=r.y},q:function(e,t){var n,i,o,a,s=t.parameters,l=t.position;for(a=0;s.length>a;a+=4)o=new c(s[a],s[a+1]),i=new c(s[a+2],s[a+3]),t.isRelative&&(o.translateWith(l),i.translateWith(l)),n=r(l,o,i),e.curveTo(n.controlOut,n.controlIn,i),l.x=i.x,l.y=i.y},t:function(e,t){var n,o,a,s,l,d=t.parameters,u=t.position,h=t.previousCommand;for(("q"==h||"t"==h)&&(s=p(p(e.paths).segments),o=s.controlIn().clone().translateWith(u.scaleCopy(-1/3)).scale(1.5)),l=0;d.length>l;l+=2)a=new c(d[l],d[l+1]),t.isRelative&&a.translateWith(u),o=o?i(o,u):u.clone(),n=r(u,o,a),e.curveTo(n.controlOut,n.controlIn,a),u.x=a.x,u.y=a.y}};_.current=new _,a.Path.parse=function(e,t){return _.current.parse(e,t)},d(a,{PathParser:_})}(window.kendo.jQuery),function(e){function t(e){var t,n,i,r;try{t=e.getScreenCTM?e.getScreenCTM():null}catch(o){}t&&(n=-t.e%1,i=-t.f%1,r=e.style,(0!==n||0!==i)&&(r.left=n+"px",r.top=i+"px"))}function n(){var e=document.getElementsByTagName("base")[0],t="",n=document.location.href,i=n.indexOf("#");return e&&!d.support.browser.msie&&(-1!==i&&(n=n.substring(0,i)),t=n),t}function i(e){return"url("+n()+"#"+e+")"}function r(e){var t,n,i,r=new z({encodeText:!0}),o=e.clippedBBox();return o&&(t=o.getOrigin(),n=new p.Group,n.transform(h.transform().translate(-t.x,-t.y)),n.children.push(e),e=n),r.load([e]),i="<?xml version='1.0' ?><svg style='width: 100%; height: 100%; overflow: hidden;' xmlns='"+E+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"+r.render()+"</svg>",r.destroy(),i}function o(t,n){var i=r(t);return n&&n.raw||(i="data:image/svg+xml;base64,"+g.encodeBase64(i)),e.Deferred().resolve(i).promise()}function a(e,t){return"clip"==e||"fill"==e&&(!t||t.nodeType==C)}function s(e){if(!e||!e.indexOf||e.indexOf("&")<0)return e;var t=s._element;return t.innerHTML=e,t.textContent||t.innerText}var l,c=document,d=window.kendo,u=d.deepExtend,h=d.geometry,p=d.drawing,f=p.BaseNode,g=d.util,m=g.defined,v=g.isTransparent,_=g.renderAttr,w=g.renderAllAttr,y=g.renderTemplate,b=e.inArray,k="butt",x=p.DASH_ARRAYS,C="gradient",T="none",S=".kendo",D="solid",A=" ",E="http://www.w3.org/2000/svg",I="transform",P="undefined",M=p.Surface.extend({init:function(e,n){p.Surface.fn.init.call(this,e,n),this._root=new z(this.options),Q(this.element[0],this._template(this)),this._rootElement=this.element[0].firstElementChild,t(this._rootElement),this._root.attachTo(this._rootElement),this.element.on("click"+S,this._click),this.element.on("mouseover"+S,this._mouseenter),this.element.on("mouseout"+S,this._mouseleave),this.resize()},type:"svg",destroy:function(){this._root&&(this._root.destroy(),this._root=null,this._rootElement=null,this.element.off(S)),p.Surface.fn.destroy.call(this)},translate:function(e){var t=d.format("{0} {1} {2} {3}",Math.round(e.x),Math.round(e.y),this._size.width,this._size.height);this._offset=e,this._rootElement.setAttribute("viewBox",t)},draw:function(e){this._root.load([e])},clear:function(){this._root.clear()},svg:function(){return"<?xml version='1.0' ?>"+this._template(this)},_resize:function(){this._offset&&this.translate(this._offset)},_template:y("<svg style='width: 100%; height: 100%; overflow: hidden;' xmlns='"+E+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>#= d._root.render() #</svg>")}),F=f.extend({init:function(e){f.fn.init.call(this,e),this.definitions={}},destroy:function(){this.element&&(this.element._kendoNode=null,this.element=null),this.clearDefinitions(),f.fn.destroy.call(this)},load:function(e,t){var n,i,r,o,a=this,s=a.element;for(o=0;e.length>o;o++)i=e[o],r=i.children,n=new Y[i.nodeType](i),m(t)?a.insertAt(n,t):a.append(n),n.createDefinitions(),r&&r.length>0&&n.load(r),s&&n.attachTo(s,t)},root:function(){for(var e=this;e.parent;)e=e.parent;return e},attachTo:function(e,t){var n,i=c.createElement("div");Q(i,"<svg xmlns='"+E+"' version='1.1'>"+this.render()+"</svg>"),n=i.firstChild.firstChild,n&&(m(t)?e.insertBefore(n,e.childNodes[t]):e.appendChild(n),this.setElement(n))},setElement:function(e){var t,n,i=this.childNodes;for(this.element&&(this.element._kendoNode=null),this.element=e,this.element._kendoNode=this,n=0;i.length>n;n++)t=e.childNodes[n],i[n].setElement(t)},clear:function(){var e,t;for(this.clearDefinitions(),this.element&&(this.element.innerHTML=""),e=this.childNodes,t=0;e.length>t;t++)e[t].destroy();this.childNodes=[]},removeSelf:function(){this.element&&(this.element.parentNode.removeChild(this.element),this.element=null),f.fn.removeSelf.call(this)},template:y("#= d.renderChildren() #"),render:function(){return this.template(this)},renderChildren:function(){var e,t=this.childNodes,n="";for(e=0;t.length>e;e++)n+=t[e].render();return n},optionsChange:function(e){var t=e.field,n=e.value;"visible"===t?this.css("display",n?"":T):l[t]&&a(t,n)?this.updateDefinition(t,n):"opacity"===t&&this.attr("opacity",n),f.fn.optionsChange.call(this,e)},attr:function(e,t){this.element&&this.element.setAttribute(e,t)},allAttr:function(e){for(var t=0;e.length>t;t++)this.attr(e[t][0],e[t][1])},css:function(e,t){this.element&&(this.element.style[e]=t)},allCss:function(e){for(var t=0;e.length>t;t++)this.css(e[t][0],e[t][1])},removeAttr:function(e){this.element&&this.element.removeAttribute(e)},mapTransform:function(e){var t=[];return e&&t.push([I,"matrix("+e.matrix().toString(6)+")"]),t},renderTransform:function(){return w(this.mapTransform(this.srcElement.transform()))},transformChange:function(e){e?this.allAttr(this.mapTransform(e)):this.removeAttr(I)},mapStyle:function(){var e=this.srcElement.options,t=[["cursor",e.cursor]];return e.visible===!1&&t.push(["display",T]),t},renderStyle:function(){return _("style",g.renderStyle(this.mapStyle()))},renderOpacity:function(){return _("opacity",this.srcElement.options.opacity)},createDefinitions:function(){var e,t,n,i,r=this.srcElement,o=this.definitions;if(r){n=r.options;for(t in l)e=n.get(t),e&&a(t,e)&&(o[t]=e,i=!0);i&&this.definitionChange({action:"add",definitions:o})}},definitionChange:function(e){this.parent&&this.parent.definitionChange(e)},updateDefinition:function(e,t){var n=this.definitions,r=n[e],o=l[e],a={};r&&(a[e]=r,this.definitionChange({action:"remove",definitions:a}),delete n[e]),t?(a[e]=t,this.definitionChange({action:"add",definitions:a}),n[e]=t,this.attr(o,i(t.id))):r&&this.removeAttr(o)},clearDefinitions:function(){var e,t=this.definitions;for(e in t){this.definitionChange({action:"remove",definitions:t}),this.definitions={};break}},renderDefinitions:function(){return w(this.mapDefinitions())},mapDefinitions:function(){var e,t=this.definitions,n=[];for(e in t)n.push([l[e],i(t[e].id)]);return n}}),z=F.extend({init:function(e){F.fn.init.call(this),this.options=e,this.defs=new R},attachTo:function(e){this.element=e,this.defs.attachTo(e.firstElementChild)},clear:function(){f.fn.clear.call(this)},template:y("#=d.defs.render()##= d.renderChildren() #"),definitionChange:function(e){this.defs.definitionChange(e)}}),R=F.extend({init:function(){F.fn.init.call(this),this.definitionMap={}},attachTo:function(e){this.element=e},template:y("<defs>#= d.renderChildren()#</defs>"),definitionChange:function(e){var t=e.definitions,n=e.action;"add"==n?this.addDefinitions(t):"remove"==n&&this.removeDefinitions(t)},createDefinition:function(e,t){var n;return"clip"==e?n=B:"fill"==e&&(t instanceof p.LinearGradient?n=G:t instanceof p.RadialGradient&&(n=$)),new n(t)},addDefinitions:function(e){for(var t in e)this.addDefinition(t,e[t])},addDefinition:function(e,t){var n,i=this.definitionMap,r=t.id,o=this.element,a=i[r];a?a.count++:(n=this.createDefinition(e,t),i[r]={element:n,count:1},this.append(n),o&&n.attachTo(this.element))},removeDefinitions:function(e){for(var t in e)this.removeDefinition(e[t])},removeDefinition:function(e){var t=this.definitionMap,n=e.id,i=t[n];i&&(i.count--,0===i.count&&(this.remove(b(i.element,this.childNodes),1),delete t[n]))}}),B=F.extend({init:function(e){F.fn.init.call(this),this.srcElement=e,this.id=e.id,this.load([e])},template:y("<clipPath id='#=d.id#'>#= d.renderChildren()#</clipPath>")}),H=F.extend({template:y("<g#= d.renderTransform() + d.renderStyle() + d.renderOpacity() + d.renderDefinitions()#>#= d.renderChildren() #</g>"),optionsChange:function(e){e.field==I&&this.transformChange(e.value),F.fn.optionsChange.call(this,e)}}),L=F.extend({geometryChange:function(){this.attr("d",this.renderData()),this.invalidate()},optionsChange:function(e){switch(e.field){case"fill":e.value?this.allAttr(this.mapFill(e.value)):this.removeAttr("fill");break;case"fill.color":this.allAttr(this.mapFill({color:e.value}));break;case"stroke":e.value?this.allAttr(this.mapStroke(e.value)):this.removeAttr("stroke");break;case I:this.transformChange(e.value);break;default:var t=this.attributeMap[e.field];t&&this.attr(t,e.value)}F.fn.optionsChange.call(this,e)},attributeMap:{"fill.opacity":"fill-opacity","stroke.color":"stroke","stroke.width":"stroke-width","stroke.opacity":"stroke-opacity"},content:function(){this.element&&(this.element.textContent=this.srcElement.content())},renderData:function(){return this.printPath(this.srcElement)},printPath:function(e){var t,n,i,r,o,a=e.segments,s=a.length;if(s>0){for(t=[],o=1;s>o;o++)i=this.segmentType(a[o-1],a[o]),i!==r&&(r=i,t.push(i)),t.push("L"===i?this.printPoints(a[o].anchor()):this.printPoints(a[o-1].controlOut(),a[o].controlIn(),a[o].anchor()));return n="M"+this.printPoints(a[0].anchor())+A+t.join(A),e.options.closed&&(n+="Z"),n}},printPoints:function(){var e,t=arguments,n=t.length,i=[];for(e=0;n>e;e++)i.push(t[e].toString(3));return i.join(A)},segmentType:function(e,t){return e.controlOut()&&t.controlIn()?"C":"L"},mapStroke:function(e){var t=[];return e&&!v(e.color)?(t.push(["stroke",e.color]),t.push(["stroke-width",e.width]),t.push(["stroke-linecap",this.renderLinecap(e)]),t.push(["stroke-linejoin",e.lineJoin]),m(e.opacity)&&t.push(["stroke-opacity",e.opacity]),m(e.dashType)&&t.push(["stroke-dasharray",this.renderDashType(e)])):t.push(["stroke",T]),t},renderStroke:function(){return w(this.mapStroke(this.srcElement.options.stroke))},renderDashType:function(e){var t,n,i,r=e.width||1,o=e.dashType;if(o&&o!=D){for(t=x[o.toLowerCase()],n=[],i=0;t.length>i;i++)n.push(t[i]*r);return n.join(" ")}},renderLinecap:function(e){var t=e.dashType,n=e.lineCap;return t&&t!=D?k:n},mapFill:function(e){var t=[];return e&&e.nodeType==C||(e&&!v(e.color)?(t.push(["fill",e.color]),m(e.opacity)&&t.push(["fill-opacity",e.opacity])):t.push(["fill",T])),t},renderFill:function(){return w(this.mapFill(this.srcElement.options.fill))},template:y("<path #= d.renderStyle() # #= d.renderOpacity() # #= kendo.util.renderAttr('d', d.renderData()) # #= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() #></path>")}),N=L.extend({renderData:function(){return this.printPath(this.srcElement.toPath())}}),O=L.extend({renderData:function(){var e,t,n=this.srcElement.paths;if(n.length>0){for(e=[],t=0;n.length>t;t++)e.push(this.printPath(n[t]));return e.join(" ")}}}),V=L.extend({geometryChange:function(){var e=this.center();this.attr("cx",e.x),this.attr("cy",e.y),this.attr("r",this.radius()),this.invalidate()},center:function(){return this.srcElement.geometry().center},radius:function(){return this.srcElement.geometry().radius},template:y("<circle #= d.renderStyle() # #= d.renderOpacity() # cx='#= d.center().x #' cy='#= d.center().y #' r='#= d.radius() #' #= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() # ></circle>")}),U=L.extend({geometryChange:function(){var e=this.pos();this.attr("x",e.x),this.attr("y",e.y),this.invalidate()},optionsChange:function(e){"font"===e.field?(this.attr("style",g.renderStyle(this.mapStyle())),this.geometryChange()):"content"===e.field&&L.fn.content.call(this,this.srcElement.content()),L.fn.optionsChange.call(this,e)},mapStyle:function(){var e=L.fn.mapStyle.call(this),t=this.srcElement.options.font;return e.push(["font",d.htmlEncode(t)]),e},pos:function(){var e=this.srcElement.position(),t=this.srcElement.measure();return e.clone().setY(e.y+t.baseline)},content:function(){var e=this.srcElement.content(),t=this.root().options;return t&&t.encodeText&&(e=s(e),e=d.htmlEncode(e)),e},template:y("<text #= d.renderStyle() # #= d.renderOpacity() # x='#= this.pos().x #' y='#= this.pos().y #' #= d.renderStroke() # #= d.renderTransform() # #= d.renderDefinitions() # #= d.renderFill() #>#= d.content() #</text>")}),W=L.extend({geometryChange:function(){this.allAttr(this.mapPosition()),this.invalidate()},optionsChange:function(e){"src"===e.field&&this.allAttr(this.mapSource()),L.fn.optionsChange.call(this,e)},mapPosition:function(){var e=this.srcElement.rect(),t=e.topLeft();return[["x",t.x],["y",t.y],["width",e.width()+"px"],["height",e.height()+"px"]]},renderPosition:function(){return w(this.mapPosition())},mapSource:function(){return[["xlink:href",this.srcElement.src()]]},renderSource:function(){return w(this.mapSource())},template:y("<image preserveAspectRatio='none' #= d.renderStyle() # #= d.renderTransform()# #= d.renderOpacity() # #= d.renderPosition() # #= d.renderSource() # #= d.renderDefinitions()#></image>")}),j=F.extend({template:y("<stop #=d.renderOffset()# #=d.renderStyle()# />"),renderOffset:function(){return _("offset",this.srcElement.offset())},mapStyle:function(){var e=this.srcElement;return[["stop-color",e.color()],["stop-opacity",e.opacity()]]},optionsChange:function(e){"offset"==e.field?this.attr(e.field,e.value):("color"==e.field||"opacity"==e.field)&&this.css("stop-"+e.field,e.value)
}}),q=F.extend({init:function(e){F.fn.init.call(this,e),this.id=e.id,this.loadStops()},loadStops:function(){var e,t,n=this.srcElement,i=n.stops,r=this.element;for(t=0;i.length>t;t++)e=new j(i[t]),this.append(e),r&&e.attachTo(r)},optionsChange:function(e){"gradient.stops"==e.field?(f.fn.clear.call(this),this.loadStops()):e.field==C&&this.allAttr(this.mapCoordinates())},renderCoordinates:function(){return w(this.mapCoordinates())},mapSpace:function(){return["gradientUnits",this.srcElement.userSpace()?"userSpaceOnUse":"objectBoundingBox"]}}),G=q.extend({template:y("<linearGradient id='#=d.id#' #=d.renderCoordinates()#>#= d.renderChildren()#</linearGradient>"),mapCoordinates:function(){var e=this.srcElement,t=e.start(),n=e.end(),i=[["x1",t.x],["y1",t.y],["x2",n.x],["y2",n.y],this.mapSpace()];return i}}),$=q.extend({template:y("<radialGradient id='#=d.id#' #=d.renderCoordinates()#>#= d.renderChildren()#</radialGradient>"),mapCoordinates:function(){var e=this.srcElement,t=e.center(),n=e.radius(),i=[["cx",t.x],["cy",t.y],["r",n],this.mapSpace()];return i}}),Y={Group:H,Text:U,Path:L,MultiPath:O,Circle:V,Arc:N,Image:W},Q=function(e,t){e.innerHTML=t};!function(){var e="<svg xmlns='"+E+"'></svg>",t=c.createElement("div"),n=typeof DOMParser!=P;t.innerHTML=e,n&&t.firstChild.namespaceURI!=E&&(Q=function(e,t){var n=new DOMParser,i=n.parseFromString(t,"text/xml"),r=c.adoptNode(i.documentElement);e.innerHTML="",e.appendChild(r)})}(),s._element=document.createElement("span"),l={clip:"clip-path",fill:"fill"},d.support.svg=function(){return c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}(),d.support.svg&&p.SurfaceFactory.current.register("svg",M,10),u(p,{exportSVG:o,svg:{ArcNode:N,CircleNode:V,ClipNode:B,DefinitionNode:R,GradientStopNode:j,GroupNode:H,ImageNode:W,LinearGradientNode:G,MultiPathNode:O,Node:F,PathNode:L,RadialGradientNode:$,RootNode:z,Surface:M,TextNode:U,_exportGroup:r}})}(window.kendo.jQuery),function(e){function t(t,n){var i,r,o,a,s,l,c={width:"800px",height:"600px",cors:"Anonymous"},d=t.clippedBBox();return d&&(i=d.getOrigin(),r=new y.Group,r.transform(w.transform().translate(-i.x,-i.y)),r.children.push(t),t=r,o=d.getSize(),c.width=o.width+"px",c.height=o.height+"px"),n=p(c,n),a=e("<div />").css({display:"none",width:n.width,height:n.height}).appendTo(document.body),s=new S(a,n),s.draw(t),l=s.image(),l.always(function(){s.destroy(),a.remove()}),l}function n(e,t){var n,i,r;for(r=0;t.length>r;r++)i=t[r],n=h.parseColor(i.color()),n.a*=i.opacity(),e.addColorStop(i.offset(),n.toCssRgba())}var i,r,o,a,s,l,c,d,u=document,h=window.kendo,p=h.deepExtend,f=h.util,g=f.defined,m=f.isTransparent,v=f.renderTemplate,_=f.valueOrDefault,w=h.geometry,y=h.drawing,b=y.BaseNode,k="butt",x=y.DASH_ARRAYS,C=1e3/60,T="solid",S=y.Surface.extend({init:function(t,n){y.Surface.fn.init.call(this,t,n),this.element[0].innerHTML=this._template(this);var r=this.element[0].firstElementChild;r.width=e(t).width(),r.height=e(t).height(),this._rootElement=r,this._root=new i(r)},destroy:function(){y.Surface.fn.destroy.call(this),this._root&&(this._root.destroy(),this._root=null)},type:"canvas",draw:function(e){this._root.load([e],void 0,this.options.cors)},clear:function(){this._root.clear()},image:function(){var t,n=this._root,i=this._rootElement,r=[];return n.traverse(function(e){e.loading&&r.push(e.loading)}),t=e.Deferred(),e.when.apply(e,r).done(function(){n._invalidate();try{var e=i.toDataURL();t.resolve(e)}catch(r){t.reject(r)}}).fail(function(e){t.reject(e)}),t.promise()},_resize:function(){this._rootElement.width=this._size.width,this._rootElement.height=this._size.height,this._root.invalidate()},_template:v("<canvas style='width: 100%; height: 100%;'></canvas>")}),D=b.extend({init:function(e){b.fn.init.call(this,e),e&&this.initClip()},initClip:function(){var e=this.srcElement.clip();e&&(this.clip=e,e.addObserver(this))},clear:function(){this.srcElement&&this.srcElement.removeObserver(this),this.clearClip(),b.fn.clear.call(this)},clearClip:function(){this.clip&&(this.clip.removeObserver(this),delete this.clip)},setClip:function(e){this.clip&&(e.beginPath(),r.fn.renderPoints(e,this.clip),e.clip())},optionsChange:function(e){"clip"==e.field&&(this.clearClip(),this.initClip()),b.fn.optionsChange.call(this,e)},setTransform:function(e){if(this.srcElement){var t=this.srcElement.transform();t&&e.transform.apply(e,t.matrix().toArray(6))}},load:function(e,t,n){var i,r,o,a,s=this;for(a=0;e.length>a;a++)r=e[a],o=r.children,i=new d[r.nodeType](r,n),o&&o.length>0&&i.load(o,t,n),g(t)?s.insertAt(i,t):s.append(i);s.invalidate()},setOpacity:function(e){if(this.srcElement){var t=this.srcElement.opacity();g(t)&&this.globalAlpha(e,t)}},globalAlpha:function(e,t){t&&e.globalAlpha&&(t*=e.globalAlpha),e.globalAlpha=t}}),A=D.extend({renderTo:function(e){var t,n=this.childNodes;for(e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),t=0;n.length>t;t++)n[t].renderTo(e);e.restore()}});y.mixins.Traversable.extend(A.fn,"childNodes"),i=A.extend({init:function(t){A.fn.init.call(this),this.canvas=t,this.ctx=t.getContext("2d"),this.invalidate=h.throttle(e.proxy(this._invalidate,this),C)},destroy:function(){A.fn.destroy.call(this),this.canvas=null,this.ctx=null},_invalidate:function(){this.ctx&&(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderTo(this.ctx))}}),y.mixins.Traversable.extend(i.fn,"childNodes"),r=D.extend({renderTo:function(e){e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),this.renderPoints(e,this.srcElement),this.setLineDash(e),this.setLineCap(e),this.setLineJoin(e),this.setFill(e),this.setStroke(e),e.restore()},setFill:function(e){var t=this.srcElement.options.fill,n=!1;return t&&("gradient"==t.nodeType?(this.setGradientFill(e,t),n=!0):m(t.color)||(e.fillStyle=t.color,e.save(),this.globalAlpha(e,t.opacity),e.fill(),e.restore(),n=!0)),n},setGradientFill:function(e,t){var i,r,o,a,s=this.srcElement.rawBBox();t instanceof y.LinearGradient?(r=t.start(),o=t.end(),i=e.createLinearGradient(r.x,r.y,o.x,o.y)):t instanceof y.RadialGradient&&(a=t.center(),i=e.createRadialGradient(a.x,a.y,0,a.x,a.y,t.radius())),n(i,t.stops),e.save(),t.userSpace()||e.transform(s.width(),0,0,s.height(),s.origin.x,s.origin.y),e.fillStyle=i,e.fill(),e.restore()},setStroke:function(e){var t=this.srcElement.options.stroke;return t&&!m(t.color)?(e.strokeStyle=t.color,e.lineWidth=_(t.width,1),e.save(),this.globalAlpha(e,t.opacity),e.stroke(),e.restore(),!0):void 0},dashType:function(){var e=this.srcElement.options.stroke;return e&&e.dashType?e.dashType.toLowerCase():void 0},setLineDash:function(e){var t,n=this.dashType();n&&n!=T&&(t=x[n],e.setLineDash?e.setLineDash(t):(e.mozDash=t,e.webkitLineDash=t))},setLineCap:function(e){var t=this.dashType(),n=this.srcElement.options.stroke;t&&t!==T?e.lineCap=k:n&&n.lineCap&&(e.lineCap=n.lineCap)},setLineJoin:function(e){var t=this.srcElement.options.stroke;t&&t.lineJoin&&(e.lineJoin=t.lineJoin)},renderPoints:function(e,t){var n,i,r,o,a,s,l=t.segments;if(0!==l.length){for(n=l[0],i=n.anchor(),e.moveTo(i.x,i.y),r=1;l.length>r;r++)n=l[r],i=n.anchor(),o=l[r-1],a=o.controlOut(),s=n.controlIn(),a&&s?e.bezierCurveTo(a.x,a.y,s.x,s.y,i.x,i.y):e.lineTo(i.x,i.y);t.options.closed&&e.closePath()}}}),o=r.extend({renderPoints:function(e){var t,n=this.srcElement.paths;for(t=0;n.length>t;t++)r.fn.renderPoints(e,n[t])}}),a=r.extend({renderPoints:function(e){var t=this.srcElement.geometry(),n=t.center,i=t.radius;e.arc(n.x,n.y,i,0,2*Math.PI)}}),s=r.extend({renderPoints:function(e){var t=this.srcElement.toPath();r.fn.renderPoints.call(this,e,t)}}),l=r.extend({renderTo:function(e){var t=this.srcElement,n=t.position(),i=t.measure();e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),e.font=t.options.font,this.setFill(e)&&e.fillText(t.content(),n.x,n.y+i.baseline),this.setStroke(e)&&(this.setLineDash(e),e.strokeText(t.content(),n.x,n.y+i.baseline)),e.restore()}}),c=r.extend({init:function(t,n){var i,o;r.fn.init.call(this,t),this.onLoad=e.proxy(this.onLoad,this),this.onError=e.proxy(this.onError,this),i=this.img=new Image,n&&(i.crossOrigin=n),i.onload=this.onLoad,i.onerror=this.onError,o=i.src=t.src(),(i.complete||void 0===i.complete)&&(i.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",i.src=o),this.loading=e.Deferred()},renderTo:function(e){"resolved"===this.loading.state()&&(e.save(),this.setTransform(e),this.setClip(e),this.drawImage(e),e.restore())},optionsChange:function(t){"src"===t.field?(this.loading=e.Deferred(),this.img.src=this.srcElement.src()):r.fn.optionsChange.call(this,t)},onLoad:function(){this.loading.resolve(),this.invalidate()},onError:function(){this.loading.reject(Error("Unable to load image '"+this.img.src+"'. Check for connectivity and verify CORS headers."))},drawImage:function(e){var t=this.srcElement.rect(),n=t.topLeft();e.drawImage(this.img,n.x,n.y,t.width(),t.height())}}),d={Group:A,Text:l,Path:r,MultiPath:o,Circle:a,Arc:s,Image:c},h.support.canvas=function(){return!!u.createElement("canvas").getContext}(),h.support.canvas&&y.SurfaceFactory.current.register("canvas",S,20),p(h.drawing,{exportImage:t,canvas:{ArcNode:s,CircleNode:a,GroupNode:A,ImageNode:c,MultiPathNode:o,Node:D,PathNode:r,RootNode:i,Surface:S,TextNode:l}})}(window.kendo.jQuery),function(e){function t(){if(u.namespaces&&!u.namespaces.kvml){u.namespaces.add("kvml","urn:schemas-microsoft-com:vml");var e=u.styleSheets.length>30?u.styleSheets[0]:u.createStyleSheet();e.addRule(".kvml","behavior:url(#default#VML)")}}function n(e){var t=u.createElement("kvml:"+e);return t.className="kvml",t}function i(e){var t,n=e.length,i=[];for(t=0;n>t;t++)i.push(e[t].scaleCopy(M).toString(0,","));return i.join(" ")}function r(e,t){var n,r,a,s,l,c=e.segments,d=c.length;if(d>0){for(n=[],l=1;d>l;l++)a=o(c[l-1],c[l]),a!==s&&(s=a,n.push(a)),n.push("l"===a?i([c[l].anchor()]):i([c[l-1].controlOut(),c[l].controlIn(),c[l].anchor()]));return r="m "+i([c[0].anchor()])+" "+n.join(" "),e.options.closed&&(r+=" x"),t!==!0&&(r+=" e"),r}}function o(e,t){return e.controlOut()&&t.controlIn()?"c":"l"}function a(e){return 0===e.indexOf("fill")||0===e.indexOf(z)}function s(e,t){var n;return n=e?l(e,t.color(),t.opacity()):l(t.color(),"#fff",1-t.opacity())}function l(e,t,n){var i=new x(e),r=new x(t),o=c(i.r,r.r,n),a=c(i.g,r.g,n),s=c(i.b,r.b,n);return new x(o,a,s).toHex()}function c(e,t,n){return h.round(n*t+(1-n)*e)}var d,u=document,h=Math,p=h.atan2,f=h.ceil,g=h.sqrt,m=window.kendo,v=m.deepExtend,_=e.noop,w=m.drawing,y=w.BaseNode,b=m.geometry,k=b.toMatrix,x=m.Color,C=m.util,T=C.isTransparent,S=C.defined,D=C.deg,A=C.round,E=C.valueOrDefault,I="none",P=".kendo",M=100,F=M*M,z="gradient",R=4,B=w.Surface.extend({init:function(e,n){w.Surface.fn.init.call(this,e,n),t(),this.element.empty(),this._root=new L,this._root.attachTo(this.element[0]),this.element.on("click"+P,this._click),this.element.on("mouseover"+P,this._mouseenter),this.element.on("mouseout"+P,this._mouseleave)},type:"vml",destroy:function(){this._root&&(this._root.destroy(),this._root=null,this.element.off(P)),w.Surface.fn.destroy.call(this)},draw:function(e){this._root.load([e],void 0,null)},clear:function(){this._root.clear()}}),H=y.extend({init:function(e){y.fn.init.call(this,e),this.createElement(),this.attachReference()},observe:_,destroy:function(){this.element&&(this.element._kendoNode=null,this.element=null),y.fn.destroy.call(this)},clear:function(){var e,t;for(this.element&&(this.element.innerHTML=""),e=this.childNodes,t=0;e.length>t;t++)e[t].destroy();this.childNodes=[]},removeSelf:function(){this.element&&(this.element.parentNode.removeChild(this.element),this.element=null),y.fn.removeSelf.call(this)},createElement:function(){this.element=u.createElement("div")},attachReference:function(){this.element._kendoNode=this},load:function(e,t,n,i){var r,o,a,s,l,c;for(i=E(i,1),this.srcElement&&(i*=E(this.srcElement.options.opacity,1)),r=0;e.length>r;r++)o=e[r],a=o.children,s=o.currentTransform(n),l=i*E(o.options.opacity,1),c=new at[o.nodeType](o,s,l),a&&a.length>0&&c.load(a,t,s,i),S(t)?this.insertAt(c,t):this.append(c),c.attachTo(this.element,t)},attachTo:function(e,t){S(t)?e.insertBefore(this.element,e.children[t]||null):e.appendChild(this.element)},optionsChange:function(e){"visible"==e.field&&this.css("display",e.value!==!1?"":I)},setStyle:function(){this.allCss(this.mapStyle())},mapStyle:function(){var e=[];return this.srcElement&&this.srcElement.options.visible===!1&&e.push(["display",I]),e},mapOpacityTo:function(e,t){var n=E(this.opacity,1);n*=E(t,1),e.push(["opacity",n])},attr:function(e,t){this.element&&(this.element[e]=t)},allAttr:function(e){for(var t=0;e.length>t;t++)this.attr(e[t][0],e[t][1])},css:function(e,t){this.element&&(this.element.style[e]=t)},allCss:function(e){for(var t=0;e.length>t;t++)this.css(e[t][0],e[t][1])}}),L=H.extend({createElement:function(){H.fn.createElement.call(this),this.allCss([["width","100%"],["height","100%"],["position","relative"],["visibility","visible"]])},attachReference:_}),N=m.Class.extend({init:function(e,t){this.srcElement=e,this.observer=t,e.addObserver(this)},geometryChange:function(){this.observer.optionsChange({field:"clip",value:this.srcElement})},clear:function(){this.srcElement.removeObserver(this)}}),O=H.extend({init:function(e){H.fn.init.call(this,e),e&&this.initClip()},observe:function(){y.fn.observe.call(this)},mapStyle:function(){var e=H.fn.mapStyle.call(this);return this.srcElement&&this.srcElement.clip()&&e.push(["clip",this.clipRect()]),e},optionsChange:function(e){"clip"==e.field&&(this.clearClip(),this.initClip(),this.setClip()),H.fn.optionsChange.call(this,e)},clear:function(){this.clearClip(),H.fn.clear.call(this)},initClip:function(){this.srcElement.clip()&&(this.clip=new N(this.srcElement.clip(),this),this.clip.observer=this)},clearClip:function(){this.clip&&(this.clip.clear(),this.clip=null,this.css("clip",this.clipRect()))},setClip:function(){this.clip&&this.css("clip",this.clipRect())},clipRect:function(){var e,t,n,i=d,r=this.srcElement.clip();return r&&(e=this.clipBBox(r),t=e.topLeft(),n=e.bottomRight(),i=m.format("rect({0}px {1}px {2}px {3}px)",t.y,n.x,n.y,t.x)),i},clipBBox:function(e){var t=this.srcElement.rawBBox().topLeft(),n=e.rawBBox();return n.origin.translate(-t.x,-t.y),n}}),V=O.extend({createElement:function(){H.fn.createElement.call(this),this.setStyle()},attachTo:function(e,t){this.css("display",I),H.fn.attachTo.call(this,e,t),this.srcElement.options.visible!==!1&&this.css("display","")},_attachTo:function(e){var t=document.createDocumentFragment();t.appendChild(this.element),e.appendChild(t)},mapStyle:function(){var e=O.fn.mapStyle.call(this);return e.push(["position","absolute"]),e.push(["white-space","nowrap"]),e},optionsChange:function(e){"transform"===e.field&&this.refreshTransform(),"opacity"===e.field&&this.refreshOpacity(),O.fn.optionsChange.call(this,e)},refreshTransform:function(e){var t,n=this.srcElement.currentTransform(e),i=this.childNodes,r=i.length;for(this.setClip(),t=0;r>t;t++)i[t].refreshTransform(n)},currentOpacity:function(){var e=E(this.srcElement.options.opacity,1);return this.parent&&this.parent.currentOpacity&&(e*=this.parent.currentOpacity()),e},refreshOpacity:function(){var e,t=this.childNodes,n=t.length,i=this.currentOpacity();for(e=0;n>e;e++)t[e].refreshOpacity(i)},initClip:function(){if(O.fn.initClip.call(this),this.clip){var e=this.clip.srcElement.bbox(this.srcElement.currentTransform());e&&(this.css("width",e.width()+e.origin.x),this.css("height",e.height()+e.origin.y))}},clipBBox:function(e){return e.bbox(this.srcElement.currentTransform())},clearClip:function(){O.fn.clearClip.call(this)}}),U=H.extend({init:function(e,t){this.opacity=t,H.fn.init.call(this,e)},createElement:function(){this.element=n("stroke"),this.setOpacity()},optionsChange:function(e){0===e.field.indexOf("stroke")&&this.setStroke()},refreshOpacity:function(e){this.opacity=e,this.setStroke()},setStroke:function(){this.allAttr(this.mapStroke())},setOpacity:function(){this.setStroke()},mapStroke:function(){var e,t=this.srcElement.options.stroke,n=[];return t&&!T(t.color)&&0!==t.width?(n.push(["on","true"]),n.push(["color",t.color]),n.push(["weight",(t.width||1)+"px"]),this.mapOpacityTo(n,t.opacity),S(t.dashType)&&n.push(["dashstyle",t.dashType]),S(t.lineJoin)&&n.push(["joinstyle",t.lineJoin]),S(t.lineCap)&&(e=t.lineCap.toLowerCase(),"butt"===e&&(e="butt"===e?"flat":e),n.push(["endcap",e]))):n.push(["on","false"]),n}}),W=H.extend({init:function(e,t,n){this.opacity=n,H.fn.init.call(this,e)},createElement:function(){this.element=n("fill"),this.setFill()},optionsChange:function(e){a(e.field)&&this.setFill()},refreshOpacity:function(e){this.opacity=e,this.setOpacity()},setFill:function(){this.allAttr(this.mapFill())},setOpacity:function(){this.setFill()},attr:function(e,t){var n,i=this.element;if(i){for(n=e.split(".");n.length>1;)i=i[n.shift()];i[n[0]]=t}},mapFill:function(){var e=this.srcElement.fill(),t=[["on","false"]];return e&&(e.nodeType==z?t=this.mapGradient(e):T(e.color)||(t=this.mapFillColor(e))),t},mapFillColor:function(e){var t=[["on","true"],["color",e.color]];return this.mapOpacityTo(t,e.opacity),t},mapGradient:function(e){var t,n=this.srcElement.options,i=n.fallbackFill||e.fallbackFill&&e.fallbackFill();return t=e instanceof w.LinearGradient?this.mapLinearGradient(e):e instanceof w.RadialGradient&&e.supportVML?this.mapRadialGradient(e):i?this.mapFillColor(i):[["on","false"]]},mapLinearGradient:function(e){var t=e.start(),n=e.end(),i=C.deg(p(n.y-t.y,n.x-t.x)),r=[["on","true"],["type",z],["focus",0],["method","none"],["angle",270-i]];return this.addColors(r),r},mapRadialGradient:function(e){var t=this.srcElement.rawBBox(),n=e.center(),i=(n.x-t.origin.x)/t.width(),r=(n.y-t.origin.y)/t.height(),o=[["on","true"],["type","gradienttitle"],["focus","100%"],["focusposition",i+" "+r],["method","none"]];return this.addColors(o),o},addColors:function(e){var t,n,i=this.srcElement.options,r=[],o=i.fill.stops,a=i.baseColor,l=this.element.colors?"colors.value":"colors",c=s(a,o[0]),d=s(a,o[o.length-1]);for(n=0;o.length>n;n++)t=o[n],r.push(h.round(100*t.offset())+"% "+s(a,t));e.push([l,r.join(",")],["color",c],["color2",d])}}),j=H.extend({init:function(e,t){this.transform=t,H.fn.init.call(this,e)},createElement:function(){this.element=n("skew"),this.setTransform()},optionsChange:function(e){"transform"===e.field&&this.refresh(this.srcElement.currentTransform())},refresh:function(e){this.transform=e,this.setTransform()},transformOrigin:function(){return"-0.5,-0.5"},setTransform:function(){this.allAttr(this.mapTransform())},mapTransform:function(){var e=this.transform,t=[],n=k(e);return n?(n.round(R),t.push(["on","true"],["matrix",[n.a,n.c,n.b,n.d,0,0].join(",")],["offset",n.e+"px,"+n.f+"px"],["origin",this.transformOrigin()])):t.push(["on","false"]),t}}),q=O.extend({init:function(e,t,n){this.fill=this.createFillNode(e,t,n),this.stroke=new U(e,n),this.transform=this.createTransformNode(e,t),O.fn.init.call(this,e)},attachTo:function(e,t){this.fill.attachTo(this.element),this.stroke.attachTo(this.element),this.transform.attachTo(this.element),H.fn.attachTo.call(this,e,t)},createFillNode:function(e,t,n){return new W(e,t,n)},createTransformNode:function(e,t){return new j(e,t)},createElement:function(){this.element=n("shape"),this.setCoordsize(),this.setStyle()},optionsChange:function(e){a(e.field)?this.fill.optionsChange(e):0===e.field.indexOf("stroke")?this.stroke.optionsChange(e):"transform"===e.field?this.transform.optionsChange(e):"opacity"===e.field&&(this.fill.setOpacity(),this.stroke.setOpacity()),O.fn.optionsChange.call(this,e)},refreshTransform:function(e){this.transform.refresh(this.srcElement.currentTransform(e))},refreshOpacity:function(e){e*=E(this.srcElement.options.opacity,1),this.fill.refreshOpacity(e),this.stroke.refreshOpacity(e)},mapStyle:function(e,t){var n,i=O.fn.mapStyle.call(this);return e&&t||(e=t=M),i.push(["position","absolute"],["width",e+"px"],["height",t+"px"]),n=this.srcElement.options.cursor,n&&i.push(["cursor",n]),i},setCoordsize:function(){this.allAttr([["coordorigin","0 0"],["coordsize",F+" "+F]])}}),G=H.extend({createElement:function(){this.element=n("path"),this.setPathData()},geometryChange:function(){this.setPathData()},setPathData:function(){this.attr("v",this.renderData())},renderData:function(){return r(this.srcElement)}}),$=q.extend({init:function(e,t,n){this.pathData=this.createDataNode(e),q.fn.init.call(this,e,t,n)},attachTo:function(e,t){this.pathData.attachTo(this.element),q.fn.attachTo.call(this,e,t)},createDataNode:function(e){return new G(e)},geometryChange:function(){this.pathData.geometryChange(),q.fn.geometryChange.call(this)}}),Y=G.extend({renderData:function(){var e,t,n,i=this.srcElement.paths;if(i.length>0){for(e=[],t=0;i.length>t;t++)n=i.length-1>t,e.push(r(i[t],n));return e.join(" ")}}}),Q=$.extend({createDataNode:function(e){return new Y(e)}}),K=j.extend({transformOrigin:function(){var e=this.srcElement.geometry().bbox(),t=e.center(),n=-f(t.x)/f(e.width()),i=-f(t.y)/f(e.height());return n+","+i}}),X=q.extend({createElement:function(){this.element=n("oval"),this.setStyle()},createTransformNode:function(e,t){return new K(e,t)},geometryChange:function(){q.fn.geometryChange.call(this),this.setStyle(),this.refreshTransform()},mapStyle:function(){var e=this.srcElement.geometry(),t=e.radius,n=e.center,i=f(2*t),r=q.fn.mapStyle.call(this,i,i);return r.push(["left",f(n.x-t)+"px"],["top",f(n.y-t)+"px"]),r}}),Z=G.extend({renderData:function(){return r(this.srcElement.toPath())}}),J=$.extend({createDataNode:function(e){return new Z(e)}}),et=G.extend({createElement:function(){G.fn.createElement.call(this),this.attr("textpathok",!0)},renderData:function(){var e=this.srcElement.rect(),t=e.center();return"m "+i([new b.Point(e.topLeft().x,t.y)])+" l "+i([new b.Point(e.bottomRight().x,t.y)])}}),tt=H.extend({createElement:function(){this.element=n("textpath"),this.attr("on",!0),this.attr("fitpath",!1),this.setStyle(),this.setString()},optionsChange:function(e){"content"===e.field?this.setString():this.setStyle(),H.fn.optionsChange.call(this,e)},mapStyle:function(){return[["font",this.srcElement.options.font]]},setString:function(){this.attr("string",this.srcElement.content())}}),nt=$.extend({init:function(e,t,n){this.path=new tt(e),$.fn.init.call(this,e,t,n)},createDataNode:function(e){return new et(e)},attachTo:function(e,t){this.path.attachTo(this.element),$.fn.attachTo.call(this,e,t)},optionsChange:function(e){("font"===e.field||"content"===e.field)&&(this.path.optionsChange(e),this.pathData.geometryChange(e)),$.fn.optionsChange.call(this,e)}}),it=G.extend({renderData:function(){var e=this.srcElement.rect(),t=(new w.Path).moveTo(e.topLeft()).lineTo(e.topRight()).lineTo(e.bottomRight()).lineTo(e.bottomLeft()).close();return r(t)}}),rt=j.extend({init:function(e,t,n){this.opacity=n,j.fn.init.call(this,e,t)},createElement:function(){this.element=n("fill"),this.attr("type","frame"),this.attr("rotate",!0),this.setOpacity(),this.setSrc(),this.setTransform()},optionsChange:function(e){"src"===e.field&&this.setSrc(),j.fn.optionsChange.call(this,e)},geometryChange:function(){this.refresh()},refreshOpacity:function(e){this.opacity=e,this.setOpacity()},setOpacity:function(){var e=[];this.mapOpacityTo(e,this.srcElement.options.opacity),this.allAttr(e)},setSrc:function(){this.attr("src",this.srcElement.src())},mapTransform:function(){var e,t,n,i,r,o,a,s,l=this.srcElement,c=l.rawBBox(),d=c.center(),u=M/2,h=M,f=c.width()/h,m=c.height()/h,v=0,_=this.transform;return _?(n=k(_),i=g(n.a*n.a+n.b*n.b),r=g(n.c*n.c+n.d*n.d),f*=i,m*=r,o=D(p(n.b,n.d)),a=D(p(-n.c,n.a)),v=(o+a)/2,0!==v?(s=l.bbox().center(),e=(s.x-u)/h,t=(s.y-u)/h):(e=(d.x*i+n.e-u)/h,t=(d.y*r+n.f-u)/h)):(e=(d.x-u)/h,t=(d.y-u)/h),f=A(f,R),m=A(m,R),e=A(e,R),t=A(t,R),v=A(v,R),[["size",f+","+m],["position",e+","+t],["angle",v]]}}),ot=$.extend({createFillNode:function(e,t,n){return new rt(e,t,n)},createDataNode:function(e){return new it(e)},optionsChange:function(e){("src"===e.field||"transform"===e.field)&&this.fill.optionsChange(e),$.fn.optionsChange.call(this,e)},geometryChange:function(){this.fill.geometryChange(),$.fn.geometryChange.call(this)},refreshTransform:function(e){$.fn.refreshTransform.call(this,e),this.fill.refresh(this.srcElement.currentTransform(e))}}),at={Group:V,Text:nt,Path:$,MultiPath:Q,Circle:X,Arc:J,Image:ot};m.support.vml=function(){var e=m.support.browser;return e.msie&&9>e.version}(),d="inherit",m.support.browser.msie&&8>m.support.browser.version&&(d="rect(auto auto auto auto)"),m.support.vml&&w.SurfaceFactory.current.register("vml",B,30),v(w,{vml:{ArcDataNode:Z,ArcNode:J,CircleTransformNode:K,CircleNode:X,FillNode:W,GroupNode:V,ImageNode:ot,ImageFillNode:rt,ImagePathDataNode:it,MultiPathDataNode:Y,MultiPathNode:Q,Node:H,PathDataNode:G,PathNode:$,RootNode:L,StrokeNode:U,Surface:B,TextNode:nt,TextPathNode:tt,TextPathDataNode:et,TransformNode:j}})}(window.kendo.jQuery),function(e,t,n){"use strict";function i(){function e(){var t,r,o;for(t=0;arguments.length>t;++t){if(r=arguments[t],r===n)throw Error("Cannot output undefined to PDF");if(r instanceof y)r.beforeRender(e),r.render(e);else if(O(r))f(r,e);else if(p(r))g(r,e);else if("number"==typeof r){if(isNaN(r))throw Error("Cannot output NaN to PDF");o=r.toFixed(7),o.indexOf(".")>=0&&(o=o.replace(/\.?0+$/,"")),"-0"==o&&(o="0"),i.writeString(o)}else/string|boolean/.test(typeof r)?i.writeString(r+""):"function"==typeof r.get?i.write(r.get()):"object"==typeof r&&(r?e(new q(r)):i.writeString("null"))}}var t=0,i=M();return e.writeData=function(e){i.write(e)},e.withIndent=function(n){++t,n(e),--t},e.indent=function(){e(nt,d("",2*t,"  ")),e.apply(null,arguments)},e.offset=function(){return i.offset()},e.toString=function(){throw Error("FIX CALLER")},e.get=function(){return i.get()},e.stream=function(){return i},e}function r(e,t){var n=e.beforeRender,i=e.render;e.beforeRender=function(){},e.render=function(e){e(t," 0 R")},e.renderFull=function(r){e._offset=r.offset(),r(t," 0 obj "),n.call(e,r),i.call(e,r),r(" endobj")}}function o(e){function t(t,n){return e&&null!=e[t]?e[t]:n}function n(e){var t,n=e("paperSize",ot.a4);if(!n)return{};if("string"==typeof n&&(n=ot[n.toLowerCase()],null==n))throw Error("Unknown paper size");return n[0]=w(n[0]),n[1]=w(n[1]),e("landscape",!1)&&(n=[Math.max(n[0],n[1]),Math.min(n[0],n[1])]),t=e("margin"),t&&("string"==typeof t?(t=w(t,0),t={left:t,top:t,right:t,bottom:t}):(t.left=w(t.left,0),t.top=w(t.top,0),t.right=w(t.right,0),t.bottom=w(t.bottom,0)),e("addMargin")&&(n[0]+=t.left+t.right,n[1]+=t.top+t.bottom)),{paperSize:n,margin:t}}var o,a,s=this,l=i(),c=0,d=[];s.getOption=t,s.attach=function(e){return d.indexOf(e)<0&&(r(e,++c),d.push(e)),e},s.pages=[],s.FONTS={},s.IMAGES={},s.GRAD_COL_FUNCTIONS={},s.GRAD_OPC_FUNCTIONS={},s.GRAD_COL={},s.GRAD_OPC={},o=s.attach(new $),a=s.attach(new Y),o.setPages(a),s.addPage=function(e){var t,r,o,l=n(function(t,n){return e&&null!=e[t]?e[t]:n}),c=l.paperSize,d=l.margin,u=c[0],h=c[1];return d&&(u-=d.left+d.right,h-=d.top+d.bottom),t=new G(i(),null,!0),r={Contents:s.attach(t),Parent:a,MediaBox:[0,0,c[0],c[1]]},o=new Z(s,r),o._content=t,a.addPage(s.attach(o)),o.transform(1,0,0,-1,0,c[1]),d&&(o.translate(d.left,d.top),o.rect(0,0,u,h),o.clip()),s.pages.push(o),o},s.render=function(){var e,n;for(l("%PDF-1.4",nt,"%ÂÁÚÏÎ",nt,nt),e=0;d.length>e;++e)d[e].renderFull(l),l(nt,nt);for(n=l.offset(),l("xref",nt,0," ",d.length+1,nt),l("0000000000 65535 f ",nt),e=0;d.length>e;++e)l(u(d[e]._offset,10)," 00000 n ",nt);return l(nt),l("trailer",nt),l(new q({Size:d.length+1,Root:o,Info:new q({Producer:new V("Kendo UI PDF Generator"),Title:new V(t("title","")),Author:new V(t("author","")),Subject:new V(t("subject","")),Keywords:new V(t("keywords","")),Creator:new V(t("creator","Kendo UI PDF Generator")),CreationDate:t("date",new Date)})}),nt,nt),l("startxref",nt,n,nt),l("%%EOF",nt),l.stream().offset(0)}}function a(t,n){function i(){e.console&&(e.console.error?e.console.error("Cannot load URL: %s",t):e.console.log("Cannot load URL: %s",t)),n(null)}var r=new XMLHttpRequest;r.open("GET",t,!0),tt&&(r.responseType="arraybuffer"),r.onload=function(){200==r.status||304==r.status?n(tt?new Uint8Array(r.response):new VBArray(r.responseBody).toArray()):i()},r.onerror=i,r.send(null)}function s(e,t){var n=at[e];n?t(n):a(e,function(n){if(null==n)throw Error("Cannot load font from "+e);var i=new et.pdf.TTFFont(n);at[e]=i,t(i)})}function l(e,t){var n,i=st[e];i?t(i):(i=new Image,/^data:/i.test(e)||(i.crossOrigin="Anonymous"),i.src=e,n=function(){var n,r,o,a,s,l,c,d,u,h,p=document.createElement("canvas");p.width=i.width,p.height=i.height,n=p.getContext("2d"),n.drawImage(i,0,0);try{r=n.getImageData(0,0,i.width,i.height)}catch(f){return t(st[e]="TAINTED")}for(o=!1,a=M(),s=M(),l=r.data,c=0;l.length>c;)a.writeByte(l[c++]),a.writeByte(l[c++]),a.writeByte(l[c++]),d=l[c++],255>d&&(o=!0),s.writeByte(d);o?i=new C(i.width,i.height,a,s):(u=p.toDataURL("image/jpeg"),u=u.substr(u.indexOf(";base64,")+8),h=M(),h.writeBase64(u),h.offset(0),i=new x(i.width,i.height,h)),t(st[e]=i)},i.complete?n():(i.onload=n,i.onerror=function(){t(st[e]="TAINTED")}))}function c(e){return function(t,n){var i=t.length,r=i;if(0===i)return n();for(;r-->0;)e(t[r],function(){0===--i&&n()})}}function d(e,t,n){for(;t>e.length;)e=n+e;return e}function u(e,t){return d(e+"",t,"0")}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function p(e){return e instanceof Date}function f(e,t){t("["),e.length>0&&t.withIndent(function(){for(var n=0;e.length>n;++n)n>0&&n%8===0?t.indent(e[n]):t(" ",e[n])}),t(" ]")}function g(e,t){t("(D:",u(e.getUTCFullYear(),4),u(e.getUTCMonth()+1,2),u(e.getUTCDate(),2),u(e.getUTCHours(),2),u(e.getUTCMinutes(),2),u(e.getUTCSeconds(),2),"Z)")}function m(e){return e*(72/25.4)}function v(e){return m(10*e)}function _(e){return 72*e}function w(e,n){var i,r;if("number"==typeof e)return e;if("string"==typeof e&&(i=/^\s*([0-9.]+)\s*(mm|cm|in|pt)\s*$/.exec(e),i&&(r=t(i[1]),!isNaN(r))))return"pt"==i[2]?r:{mm:m,cm:v,"in":_}[i[2]](r);if(null!=n)return n;throw Error("Can't parse unit: "+e)}function y(){}function b(e,t,n){n||(n=y),e.prototype=new n;for(var i in t)h(t,i)&&(e.prototype[i]=t[i]);return e}function k(e){return h(j,e)?j[e]:j[e]=new W(e)}function x(e,t,n){this.asStream=function(){var i=new G(n,{Type:k("XObject"),Subtype:k("Image"),Width:e,Height:t,BitsPerComponent:8,ColorSpace:k("DeviceRGB"),Filter:k("DCTDecode")});return i._resourceName=k("I"+ ++it),i}}function C(e,t,n,i){this.asStream=function(r){var o=new G(i,{Type:k("XObject"),Subtype:k("Image"),Width:e,Height:t,BitsPerComponent:8,ColorSpace:k("DeviceGray")},!0),a=new G(n,{Type:k("XObject"),Subtype:k("Image"),Width:e,Height:t,BitsPerComponent:8,ColorSpace:k("DeviceRGB"),SMask:r.attach(o)},!0);return a._resourceName=k("I"+ ++it),a}}function T(e){return e.map(function(e){return O(e)?T(e):"number"==typeof e?(Math.round(1e3*e)/1e3).toFixed(3):e}).join(" ")}function S(e,t,n,i,r,o,a){var s=T([t,n,i,r,o,a]),l=e.GRAD_COL_FUNCTIONS[s];return l||(l=e.GRAD_COL_FUNCTIONS[s]=e.attach(new q({FunctionType:2,Domain:[0,1],Range:[0,1,0,1,0,1],N:1,C0:[t,n,i],C1:[r,o,a]}))),l}function D(e,t,n){var i=T([t,n]),r=e.GRAD_OPC_FUNCTIONS[i];return r||(r=e.GRAD_OPC_FUNCTIONS[i]=e.attach(new q({FunctionType:2,Domain:[0,1],Range:[0,1],N:1,C0:[t],C1:[n]}))),r}function A(e,t){function n(e){return 1==e.length?e[0]:{FunctionType:3,Functions:e,Domain:[0,1],Bounds:u,Encode:h}}var i,r,o,a,s,l=!1,c=[],d=[],u=[],h=[];for(i=1;t.length>i;++i)r=t[i-1],o=t[i],a=r.color,s=o.color,d.push(S(e,a.r,a.g,a.b,s.r,s.g,s.b)),(1>a.a||1>s.a)&&(l=!0),u.push(o.offset),h.push(0,1);if(l)for(i=1;t.length>i;++i)r=t[i-1],o=t[i],a=r.color,s=o.color,c.push(D(e,a.a,s.a));return u.pop(),{hasAlpha:l,colors:n(d),opacities:l?n(c):null}}function E(e,t,n,i,r,o){var a,s,l;return o||(l=[t].concat(i),n.forEach(function(e){l.push(e.offset,e.color.r,e.color.g,e.color.b)}),s=T(l),a=e.GRAD_COL[s]),a||(a=new q({Type:k("Shading"),ShadingType:t?3:2,ColorSpace:k("DeviceRGB"),Coords:i,Domain:[0,1],Function:r,Extend:[!0,!0]}),e.attach(a),a._resourceName="S"+ ++it,s&&(e.GRAD_COL[s]=a)),a
}function I(e,t,n,i,r,o){var a,s,l;return o||(l=[t].concat(i),n.forEach(function(e){l.push(e.offset,e.color.a)}),s=T(l),a=e.GRAD_OPC[s]),a||(a=new q({Type:k("ExtGState"),AIS:!1,CA:1,ca:1,SMask:{Type:k("Mask"),S:k("Luminosity"),G:e.attach(new G("/a0 gs /s0 sh",{Type:k("XObject"),Subtype:k("Form"),FormType:1,BBox:o?[o.left,o.top+o.height,o.left+o.width,o.top]:[0,1,1,0],Group:{Type:k("Group"),S:k("Transparency"),CS:k("DeviceGray"),I:!0},Resources:{ExtGState:{a0:{CA:1,ca:1}},Shading:{s0:{ColorSpace:k("DeviceGray"),Coords:i,Domain:[0,1],ShadingType:t?3:2,Function:r,Extend:[!0,!0]}}}}))}}),e.attach(a),a._resourceName="O"+ ++it,s&&(e.GRAD_OPC[s]=a)),a}function P(e,t,n){var i="radial"==t.type,r=A(e,t.stops),o=i?[t.start.x,t.start.y,t.start.r,t.end.x,t.end.y,t.end.r]:[t.start.x,t.start.y,t.end.x,t.end.y],a=E(e,i,t.stops,o,r.colors,t.userSpace&&n),s=r.hasAlpha?I(e,i,t.stops,o,r.opacities,t.userSpace&&n):null;return{hasAlpha:r.hasAlpha,shading:a,opacity:s}}function M(e){function t(){return T>=S}function n(){return S>T?e[T++]:0}function i(t){y(T),e[T++]=255&t,T>S&&(S=T)}function r(){return n()<<8|n()}function o(e){i(e>>8),i(e)}function a(){var e=r();return e>=32768?e-65536:e}function s(e){o(0>e?e+65536:e)}function l(){return 65536*r()+r()}function c(e){o(e>>>16&65535),o(65535&e)}function d(){var e=l();return e>=2147483648?e-4294967296:e}function u(e){c(0>e?e+4294967296:e)}function h(){return l()/65536}function p(e){c(Math.round(65536*e))}function f(){return d()/65536}function g(e){u(Math.round(65536*e))}function m(e){return w(e,n)}function v(e){return String.fromCharCode.apply(String,m(e))}function _(e){for(var t=0;e.length>t;++t)i(e.charCodeAt(t))}function w(e,t){for(var n=Array(e),i=0;e>i;++i)n[i]=t();return n}var y,b,k,x,C,T=0,S=0;return null==e?e=tt?new Uint8Array(256):[]:S=e.length,y=tt?function(t){if(t>=e.length){var n=new Uint8Array(Math.max(t+256,2*e.length));n.set(e,0),e=n}}:function(){},b=tt?function(){return new Uint8Array(e.buffer,0,S)}:function(){return e},k=tt?function(t){if("string"==typeof t)return _(t);var n=t.length;y(T+n),e.set(t,T),T+=n,T>S&&(S=T)}:function(e){if("string"==typeof e)return _(e);for(var t=0;e.length>t;++t)i(e[t])},x=tt?function(t,n){if(e.buffer.slice)return new Uint8Array(e.buffer.slice(t,t+n));var i=new Uint8Array(n);return i.set(new Uint8Array(e.buffer,t,n)),i}:function(t,n){return e.slice(t,t+n)},C={eof:t,readByte:n,writeByte:i,readShort:r,writeShort:o,readLong:l,writeLong:c,readFixed:h,writeFixed:p,readShort_:a,writeShort_:s,readLong_:d,writeLong_:u,readFixed_:f,writeFixed_:g,read:m,write:k,readString:v,writeString:_,times:w,get:b,slice:x,offset:function(e){return null!=e?(T=e,C):T},skip:function(e){T+=e},toString:function(){throw Error("FIX CALLER.  BinaryStream is no longer convertible to string!")},length:function(){return S},saveExcursion:function(e){var t=T;try{return e()}finally{T=t}},writeBase64:function(e){window.atob?_(window.atob(e)):k(rt.decode(e))},base64:function(){return rt.encode(b())}}}function F(e){return e.replace(/^\s*(['"])(.*)\1\s*$/,"$2")}function z(e){var t,n=/^\s*((normal|italic)\s+)?((normal|small-caps)\s+)?((normal|bold|\d+)\s+)?(([0-9.]+)(px|pt))(\/(([0-9.]+)(px|pt)|normal))?\s+(.*?)\s*$/i,i=n.exec(e);return i?(t=i[8]?parseInt(i[8],10):12,{italic:i[2]&&"italic"==i[2].toLowerCase(),variant:i[4],bold:i[6]&&/bold|700/i.test(i[6]),fontSize:t,lineHeight:i[12]?"normal"==i[12]?t:parseInt(i[12],10):null,fontFamily:i[14].split(/\s*,\s*/g).map(F)}):{fontSize:12,fontFamily:"sans-serif"}}function R(e){function t(t){return e.bold&&(t+="|bold"),e.italic&&(t+="|italic"),t.toLowerCase()}var n,i,r,o=e.fontFamily;if(o instanceof Array)for(r=0;o.length>r&&(n=t(o[r]),!(i=J[n]));++r);else i=J[o.toLowerCase()];for(;"function"==typeof i;)i=i();return i||(i="Times-Roman"),i}function B(e,t){e=e.toLowerCase(),J[e]=function(){return J[t]},J[e+"|bold"]=function(){return J[t+"|bold"]},J[e+"|italic"]=function(){return J[t+"|italic"]},J[e+"|bold|italic"]=function(){return J[t+"|bold|italic"]}}function H(e,t){if(1==arguments.length)for(var n in e)h(e,n)&&H(n,e[n]);else switch(e=e.toLowerCase(),J[e]=t,e){case"dejavu sans":J["sans-serif"]=t;break;case"dejavu sans|bold":J["sans-serif|bold"]=t;break;case"dejavu sans|italic":J["sans-serif|italic"]=t;break;case"dejavu sans|bold|italic":J["sans-serif|bold|italic"]=t;break;case"dejavu serif":J.serif=t;break;case"dejavu serif|bold":J["serif|bold"]=t;break;case"dejavu serif|italic":J["serif|italic"]=t;break;case"dejavu serif|bold|italic":J["serif|bold|italic"]=t;break;case"dejavu mono":J.monospace=t;break;case"dejavu mono|bold":J["monospace|bold"]=t;break;case"dejavu mono|italic":J["monospace|italic"]=t;break;case"dejavu mono|bold|italic":J["monospace|bold|italic"]=t}}function L(e,t){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=t[0],c=t[1],d=t[2],u=t[3],h=t[4],p=t[5];return[n*l+i*d,n*c+i*u,r*l+o*d,r*c+o*u,a*l+s*d+h,a*c+s*u+p]}function N(e){return 1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5]}var O,V,U,W,j,q,G,$,Y,Q,K,X,Z,J,et=e.kendo,tt=!!e.Uint8Array,nt="\n",it=0,rt=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{decode:function(t){for(var n,i,r,o,a,s,l,c=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),d=0,u=c.length,h=[];u>d;)n=e.indexOf(c.charAt(d++)),i=e.indexOf(c.charAt(d++)),r=e.indexOf(c.charAt(d++)),o=e.indexOf(c.charAt(d++)),a=n<<2|i>>>4,s=(15&i)<<4|r>>>2,l=(3&r)<<6|o,h.push(a),64!=r&&h.push(s),64!=o&&h.push(l);return h},encode:function(t){for(var n,i,r,o,a,s,l,c=0,d=t.length,u="";d>c;)n=t[c++],i=t[c++],r=t[c++],o=n>>>2,a=(3&n)<<4|i>>>4,s=(15&i)<<2|r>>>6,l=63&r,c-d==2?s=l=64:c-d==1&&(l=64),u+=e.charAt(o)+e.charAt(a)+e.charAt(s)+e.charAt(l);return u}}}(),ot={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],executive:[521.86,756],folio:[612,936],legal:[612,1008],letter:[612,792],tabloid:[792,1224]},at={"Times-Roman":!0,"Times-Bold":!0,"Times-Italic":!0,"Times-BoldItalic":!0,Helvetica:!0,"Helvetica-Bold":!0,"Helvetica-Oblique":!0,"Helvetica-BoldOblique":!0,Courier:!0,"Courier-Bold":!0,"Courier-Oblique":!0,"Courier-BoldOblique":!0,Symbol:!0,ZapfDingbats:!0},st={},lt=c(s),ct=c(l);o.prototype={loadFonts:lt,loadImages:ct,getFont:function(e){var t=this.FONTS[e];if(!t){if(t=at[e],!t)throw Error("Font "+e+" has not been loaded");t=this.attach(t===!0?new Q(e):new K(this,t)),this.FONTS[e]=t}return t},getImage:function(e){var t=this.IMAGES[e];if(!t){if(t=st[e],!t)throw Error("Image "+e+" has not been loaded");if("TAINTED"===t)return null;t=this.IMAGES[e]=this.attach(t.asStream(this))}return t},getOpacityGS:function(e,n){var i,r,o,a=t(e).toFixed(3);return e=t(a),a+=n?"S":"F",i=this._opacityGSCache||(this._opacityGSCache={}),r=i[a],r||(o={Type:k("ExtGState")},n?o.CA=e:o.ca=e,r=this.attach(new q(o)),r._resourceName=k("GS"+ ++it),i[a]=r),r},dict:function(e){return new q(e)},name:function(e){return k(e)},stream:function(e,t){return new G(t,e)}},O=Array.isArray||function(e){return e instanceof Array},y.prototype.beforeRender=function(){},V=b(function(e){this.value=e},{render:function(e){var t,n="",i=this.escape();for(t=0;i.length>t;++t)n+=String.fromCharCode(255&i.charCodeAt(t));e("(",n,")")},escape:function(){return this.value.replace(/([\(\)\\])/g,"\\$1")},toString:function(){return this.value}}),U=b(function(e){this.value=e},{render:function(e){e("<");for(var t=0;this.value.length>t;++t)e(u(this.value.charCodeAt(t).toString(16),4));e(">")}},V),W=b(function(e){this.name=e},{render:function(e){e("/"+this.escape())},escape:function(){return this.name.replace(/[^\x21-\x7E]/g,function(e){return"#"+u(e.charCodeAt(0).toString(16),2)})},toString:function(){return this.name}}),j={},W.get=k,q=b(function(e){this.props=e},{render:function(e){var t=this.props,n=!0;e("<<"),e.withIndent(function(){for(var i in t)h(t,i)&&!/^_/.test(i)&&(n=!1,e.indent(k(i)," ",t[i]))}),n||e.indent(),e(">>")}}),G=b(function(e,t,n){if("string"==typeof e){var i=M();i.write(e),e=i}this.data=e,this.props=t||{},this.compress=n},{render:function(t){var n=this.data.get(),i=this.props;this.compress&&e.pako&&"function"==typeof e.pako.deflate&&(i.Filter?i.Filter instanceof Array||(i.Filter=[i.Filter]):i.Filter=[],i.Filter.unshift(k("FlateDecode")),n=e.pako.deflate(n)),i.Length=n.length,t(new q(i)," stream",nt),t.writeData(n),t(nt,"endstream")}}),$=b(function(e){e=this.props=e||{},e.Type=k("Catalog")},{setPages:function(e){this.props.Pages=e}},q),Y=b(function(){this.props={Type:k("Pages"),Kids:[],Count:0}},{addPage:function(e){this.props.Kids.push(e),this.props.Count++}},q),Q=b(function(e){this.props={Type:k("Font"),Subtype:k("Type1"),BaseFont:k(e)},this._resourceName=k("F"+ ++it)},{encodeText:function(e){return new V(e+"")}},q),K=b(function(e,t,n){var i,r;n=this.props=n||{},n.Type=k("Font"),n.Subtype=k("Type0"),n.Encoding=k("Identity-H"),this._pdf=e,this._font=t,this._sub=t.makeSubset(),this._resourceName=k("F"+ ++it),i=t.head,this.name=t.psName,r=this.scale=t.scale,this.bbox=[i.xMin*r,i.yMin*r,i.xMax*r,i.yMax*r],this.italicAngle=t.post.italicAngle,this.ascent=t.ascent*r,this.descent=t.descent*r,this.lineGap=t.lineGap*r,this.capHeight=t.os2.capHeight||this.ascent,this.xHeight=t.os2.xHeight||0,this.stemV=0,this.familyClass=(t.os2.familyClass||0)>>8,this.isSerif=this.familyClass>=1&&7>=this.familyClass,this.isScript=10==this.familyClass,this.flags=(t.post.isFixedPitch?1:0)|(this.isSerif?2:0)|(this.isScript?8:0)|(0!==this.italicAngle?64:0)|32},{encodeText:function(e){return new U(this._sub.encodeText(e+""))},beforeRender:function(){var e,t,n,r,o=this,a=o._sub,s=a.render(),l=new G(M(s),{Length1:s.length},!0),c=o._pdf.attach(new q({Type:k("FontDescriptor"),FontName:k(o._sub.psName),FontBBox:o.bbox,Flags:o.flags,StemV:o.stemV,ItalicAngle:o.italicAngle,Ascent:o.ascent,Descent:o.descent,CapHeight:o.capHeight,XHeight:o.xHeight,FontFile2:o._pdf.attach(l)})),d=a.ncid2ogid,u=a.firstChar,h=a.lastChar,p=[];!function f(e,t){if(h>=e){var n=d[e];null==n?f(e+1):(t||p.push(e,t=[]),t.push(o._font.widthOfGlyph(n)),f(e+1,t))}}(u),e=new q({Type:k("Font"),Subtype:k("CIDFontType2"),BaseFont:k(o._sub.psName),CIDSystemInfo:new q({Registry:new V("Adobe"),Ordering:new V("Identity"),Supplement:0}),FontDescriptor:c,FirstChar:u,LastChar:h,DW:Math.round(o._font.widthOfGlyph(0)),W:p,CIDToGIDMap:o._pdf.attach(o._makeCidToGidMap())}),t=o.props,t.BaseFont=k(o._sub.psName),t.DescendantFonts=[o._pdf.attach(e)],n=new X(u,h,a.subset),r=new G(i(),null,!0),r.data(n),t.ToUnicode=o._pdf.attach(r)},_makeCidToGidMap:function(){return new G(M(this._sub.cidToGidMap()),null,!0)}},q),X=b(function(e,t,n){this.firstChar=e,this.lastChar=t,this.map=n},{render:function(e){e.indent("/CIDInit /ProcSet findresource begin"),e.indent("12 dict begin"),e.indent("begincmap"),e.indent("/CIDSystemInfo <<"),e.indent("  /Registry (Adobe)"),e.indent("  /Ordering (UCS)"),e.indent("  /Supplement 0"),e.indent(">> def"),e.indent("/CMapName /Adobe-Identity-UCS def"),e.indent("/CMapType 2 def"),e.indent("1 begincodespacerange"),e.indent("  <0000><ffff>"),e.indent("endcodespacerange");var t=this;e.indent(t.lastChar-t.firstChar+1," beginbfchar"),e.withIndent(function(){var n,i;for(n=t.firstChar;t.lastChar>=n;++n)i=t.map[n],e.indent("<",u(n.toString(16),4),">","<",u(i.toString(16),4),">")}),e.indent("endbfchar"),e.indent("endcmap"),e.indent("CMapName currentdict /CMap defineresource pop"),e.indent("end"),e.indent("end")}}),Z=b(function(e,t){this._pdf=e,this._rcount=0,this._textMode=!1,this._fontResources={},this._gsResources={},this._xResources={},this._patResources={},this._shResources={},this._opacity=1,this._matrix=[1,0,0,1,0,0],this._font=null,this._fontSize=null,this._contextStack=[],t=this.props=t||{},t.Type=k("Page"),t.ProcSet=[k("PDF"),k("Text"),k("ImageB"),k("ImageC"),k("ImageI")],t.Resources=new q({Font:new q(this._fontResources),ExtGState:new q(this._gsResources),XObject:new q(this._xResources),Pattern:new q(this._patResources),Shading:new q(this._shResources)})},{_out:function(){this._content.data.apply(null,arguments)},transform:function(e,t,n,i,r,o){N(arguments)||(this._matrix=L(this._matrix,arguments),this._out(e," ",t," ",n," ",i," ",r," ",o," cm"),this._out(nt))},translate:function(e,t){this.transform(1,0,0,1,e,t)},scale:function(e,t){this.transform(e,0,0,t,0,0)},rotate:function(e){var t=Math.cos(e),n=Math.sin(e);this.transform(t,n,-n,t,0,0)},beginText:function(){this._textMode=!0,this._out("BT",nt)},endText:function(){this._textMode=!1,this._out("ET",nt)},_requireTextMode:function(){if(!this._textMode)throw Error("Text mode required; call page.beginText() first")},_requireFont:function(){if(!this._font)throw Error("No font selected; call page.setFont() first")},setFont:function(e,t){this._requireTextMode(),null==e?e=this._font:e instanceof K||(e=this._pdf.getFont(e)),null==t&&(t=this._fontSize),this._fontResources[e._resourceName]=e,this._font=e,this._fontSize=t,this._out(e._resourceName," ",t," Tf",nt)},setTextLeading:function(e){this._requireTextMode(),this._out(e," TL",nt)},setTextRenderingMode:function(e){this._requireTextMode(),this._out(e," Tr",nt)},showText:function(e){this._requireFont(),this._out(this._font.encodeText(e)," Tj",nt)},showTextNL:function(e){this._requireFont(),this._out(this._font.encodeText(e)," '",nt)},setStrokeColor:function(e,t,n){this._out(e," ",t," ",n," RG",nt)},setOpacity:function(e){this.setFillOpacity(e),this.setStrokeOpacity(e),this._opacity*=e},setStrokeOpacity:function(e){if(1>e){var t=this._pdf.getOpacityGS(this._opacity*e,!0);this._gsResources[t._resourceName]=t,this._out(t._resourceName," gs",nt)}},setFillColor:function(e,t,n){this._out(e," ",t," ",n," rg",nt)},setFillOpacity:function(e){if(1>e){var t=this._pdf.getOpacityGS(this._opacity*e,!1);this._gsResources[t._resourceName]=t,this._out(t._resourceName," gs",nt)}},gradient:function(e,t){var n,i,r;this.save(),this.rect(t.left,t.top,t.width,t.height),this.clip(),e.userSpace||this.transform(t.width,0,0,t.height,t.left,t.top),n=P(this._pdf,e,t),i=n.shading._resourceName,this._shResources[i]=n.shading,n.hasAlpha&&(r=n.opacity._resourceName,this._gsResources[r]=n.opacity,this._out("/"+r+" gs ")),this._out("/"+i+" sh",nt),this.restore()},setDashPattern:function(e,t){this._out(e," ",t," d",nt)},setLineWidth:function(e){this._out(e," w",nt)},setLineCap:function(e){this._out(e," J",nt)},setLineJoin:function(e){this._out(e," j",nt)},setMitterLimit:function(e){this._out(e," M",nt)},save:function(){this._contextStack.push(this._context()),this._out("q",nt)},restore:function(){this._out("Q",nt),this._context(this._contextStack.pop())},moveTo:function(e,t){this._out(e," ",t," m",nt)},lineTo:function(e,t){this._out(e," ",t," l",nt)},bezier:function(e,t,n,i,r,o){this._out(e," ",t," ",n," ",i," ",r," ",o," c",nt)},bezier1:function(e,t,n,i){this._out(e," ",t," ",n," ",i," y",nt)},bezier2:function(e,t,n,i){this._out(e," ",t," ",n," ",i," v",nt)},close:function(){this._out("h",nt)},rect:function(e,t,n,i){this._out(e," ",t," ",n," ",i," re",nt)},ellipse:function(e,t,n,i){function r(t){return e+t}function o(e){return t+e}var a=.5522847498307936;this.moveTo(r(0),o(i)),this.bezier(r(n*a),o(i),r(n),o(i*a),r(n),o(0)),this.bezier(r(n),o(-i*a),r(n*a),o(-i),r(0),o(-i)),this.bezier(r(-n*a),o(-i),r(-n),o(-i*a),r(-n),o(0)),this.bezier(r(-n),o(i*a),r(-n*a),o(i),r(0),o(i))},circle:function(e,t,n){this.ellipse(e,t,n,n)},stroke:function(){this._out("S",nt)},nop:function(){this._out("n",nt)},clip:function(){this._out("W n",nt)},clipStroke:function(){this._out("W S",nt)},closeStroke:function(){this._out("s",nt)},fill:function(){this._out("f",nt)},fillStroke:function(){this._out("B",nt)},drawImage:function(e){var t=this._pdf.getImage(e);t&&(this._xResources[t._resourceName]=t,this._out(t._resourceName," Do",nt))},comment:function(e){var t=this;e.split(/\r?\n/g).forEach(function(e){t._out("% ",e,nt)})},_context:function(e){return null==e?{opacity:this._opacity,matrix:this._matrix}:(this._opacity=e.opacity,this._matrix=e.matrix,n)}},q),J={serif:"Times-Roman","serif|bold":"Times-Bold","serif|italic":"Times-Italic","serif|bold|italic":"Times-BoldItalic","sans-serif":"Helvetica","sans-serif|bold":"Helvetica-Bold","sans-serif|italic":"Helvetica-Oblique","sans-serif|bold|italic":"Helvetica-BoldOblique",monospace:"Courier","monospace|bold":"Courier-Bold","monospace|italic":"Courier-Oblique","monospace|bold|italic":"Courier-BoldOblique",zapfdingbats:"ZapfDingbats","zapfdingbats|bold":"ZapfDingbats","zapfdingbats|italic":"ZapfDingbats","zapfdingbats|bold|italic":"ZapfDingbats"},B("Times New Roman","serif"),B("Courier New","monospace"),B("Arial","sans-serif"),B("Helvetica","sans-serif"),B("Verdana","sans-serif"),B("Tahoma","sans-serif"),B("Georgia","sans-serif"),B("Monaco","monospace"),B("Andale Mono","monospace"),et.pdf={Document:o,BinaryStream:M,defineFont:H,parseFontDef:z,getFontURL:R,loadFonts:lt,loadImages:ct,TEXT_RENDERING_MODE:{fill:0,stroke:1,fillAndStroke:2,invisible:3,fillAndClip:4,strokeAndClip:5,fillStrokeClip:6,clip:7}}}(this,parseFloat),function(e){"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e){return Object.keys(e).sort(function(e,t){return e-t}).map(parseFloat)}function i(e){var t,n,i;for(this.raw=e,this.scalerType=e.readLong(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),t=this.tables={},n=0;this.tableCount>n;++n)i={tag:e.readString(4),checksum:e.readLong(),offset:e.readLong(),length:e.readLong()},t[i.tag]=i}function r(e){function n(e,t){this.definition=t,this.length=t.length,this.offset=t.offset,this.file=e,this.rawData=e.raw,this.parse(e.raw)}n.prototype.raw=function(){return this.rawData.slice(this.offset,this.length)};for(var i in e)t(e,i)&&(n[i]=n.prototype[i]=e[i]);return n}function o(){var e,t="",n=_+"";for(e=0;n.length>e;++e)t+=String.fromCharCode(n.charCodeAt(e)-48+65);return++_,t}function a(e){this.font=e,this.subset={},this.unicodes={},this.ogid2ngid={0:0},this.ngid2ogid={0:0},this.ncid2ogid={},this.next=this.firstChar=1,this.nextGid=1,this.psName=o()+"+"+this.font.psName}function s(e,t){var n,i,r,o,a=this,s=a.contents=y(e);if("ttcf"==s.readString(4)){if(!t)throw Error("Must specify a name for TTC files");for(n=s.readLong(),i=s.readLong(),r=0;i>r;++r)if(o=s.readLong(),s.saveExcursion(function(){s.offset(o),a.parse()}),a.psName==t)return;throw Error("Font "+t+" not found in collection")}s.offset(0),a.parse()}var l,c,d,u,h,p,f,g,m,v,_,w=e.kendo.pdf,y=w.BinaryStream;i.prototype={readTable:function(e,t){var n=this.tables[e];if(!n)throw Error("Table "+e+" not found in directory");return this[e]=n.table=new t(this,n)},render:function(e){var n,i,r,o,a,s,l,c,d=Object.keys(e).length,u=Math.pow(2,Math.floor(Math.log(d)/Math.LN2)),h=16*u,p=Math.floor(Math.log(u)/Math.LN2),f=16*d-h,g=y();g.writeLong(this.scalerType),g.writeShort(d),g.writeShort(h),g.writeShort(p),g.writeShort(f),n=16*d,i=g.offset()+n,r=null,o=y();for(a in e)if(t(e,a))for(s=e[a],g.writeString(a),g.writeLong(this.checksum(s)),g.writeLong(i),g.writeLong(s.length),o.write(s),"head"==a&&(r=i),i+=s.length;i%4;)o.writeByte(0),i++;return g.write(o.get()),l=this.checksum(g.get()),c=2981146554-l,g.offset(r+8),g.writeLong(c),g.get()},checksum:function(e){e=y(e);for(var t=0;!e.eof();)t+=e.readLong();return 4294967295&t}},l=r({parse:function(e){e.offset(this.offset),this.version=e.readLong(),this.revision=e.readLong(),this.checkSumAdjustment=e.readLong(),this.magicNumber=e.readLong(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.read(8),this.modified=e.read(8),this.xMin=e.readShort_(),this.yMin=e.readShort_(),this.xMax=e.readShort_(),this.yMax=e.readShort_(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort_(),this.indexToLocFormat=e.readShort_(),this.glyphDataFormat=e.readShort_()},render:function(e){var t=y();return t.writeLong(this.version),t.writeLong(this.revision),t.writeLong(0),t.writeLong(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.write(this.created),t.write(this.modified),t.writeShort_(this.xMin),t.writeShort_(this.yMin),t.writeShort_(this.xMax),t.writeShort_(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort_(this.fontDirectionHint),t.writeShort_(e),t.writeShort_(this.glyphDataFormat),t.get()}}),c=r({parse:function(e){e.offset(this.offset);var t=this.file.head.indexToLocFormat;this.offsets=0===t?e.times(this.length/2,function(){return 2*e.readShort()}):e.times(this.length/4,e.readLong)},offsetOf:function(e){return this.offsets[e]},lengthOf:function(e){return this.offsets[e+1]-this.offsets[e]},render:function(e){var t,n=y(),i=e[e.length-1]>65535;for(t=0;e.length>t;++t)i?n.writeLong(e[t]):n.writeShort(e[t]/2);return{format:i?1:0,table:n.get()}}}),d=r({parse:function(e){e.offset(this.offset),this.version=e.readLong(),this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort_(),this.minRightSideBearing=e.readShort_(),this.xMaxExtent=e.readShort_(),this.caretSlopeRise=e.readShort_(),this.caretSlopeRun=e.readShort_(),this.caretOffset=e.readShort_(),e.skip(8),this.metricDataFormat=e.readShort_(),this.numOfLongHorMetrics=e.readShort()},render:function(e){var t=y();return t.writeLong(this.version),t.writeShort_(this.ascent),t.writeShort_(this.descent),t.writeShort_(this.lineGap),t.writeShort(this.advanceWidthMax),t.writeShort_(this.minLeftSideBearing),t.writeShort_(this.minRightSideBearing),t.writeShort_(this.xMaxExtent),t.writeShort_(this.caretSlopeRise),t.writeShort_(this.caretSlopeRun),t.writeShort_(this.caretOffset),t.write([0,0,0,0,0,0,0,0]),t.writeShort_(this.metricDataFormat),t.writeShort(e.length),t.get()}}),u=r({parse:function(e){e.offset(this.offset),this.version=e.readLong(),this.numGlyphs=e.readShort(),this.maxPoints=e.readShort(),this.maxContours=e.readShort(),this.maxComponentPoints=e.readShort(),this.maxComponentContours=e.readShort(),this.maxZones=e.readShort(),this.maxTwilightPoints=e.readShort(),this.maxStorage=e.readShort(),this.maxFunctionDefs=e.readShort(),this.maxInstructionDefs=e.readShort(),this.maxStackElements=e.readShort(),this.maxSizeOfInstructions=e.readShort(),this.maxComponentElements=e.readShort(),this.maxComponentDepth=e.readShort()},render:function(e){var t=y();return t.writeLong(this.version),t.writeShort(e.length),t.writeShort(this.maxPoints),t.writeShort(this.maxContours),t.writeShort(this.maxComponentPoints),t.writeShort(this.maxComponentContours),t.writeShort(this.maxZones),t.writeShort(this.maxTwilightPoints),t.writeShort(this.maxStorage),t.writeShort(this.maxFunctionDefs),t.writeShort(this.maxInstructionDefs),t.writeShort(this.maxStackElements),t.writeShort(this.maxSizeOfInstructions),t.writeShort(this.maxComponentElements),t.writeShort(this.maxComponentDepth),t.get()}}),h=r({parse:function(e){var t,n,i;e.offset(this.offset),t=this.file,n=t.hhea,this.metrics=e.times(n.numOfLongHorMetrics,function(){return{advance:e.readShort(),lsb:e.readShort_()}}),i=t.maxp.numGlyphs-t.hhea.numOfLongHorMetrics,this.leftSideBearings=e.times(i,e.readShort_)},forGlyph:function(e){var t=this.metrics,n=t.length;return n>e?t[e]:{advance:t[n-1].advance,lsb:this.leftSideBearings[e-n]}},render:function(e){var t,n,i=y();for(t=0;e.length>t;++t)n=this.forGlyph(e[t]),i.writeShort(n.advance),i.writeShort_(n.lsb);return i.get()}}),p=function(){function e(e){this.raw=e}function n(e){var t,n,r;for(this.raw=e,t=this.glyphIds=[],n=this.idOffsets=[];;){if(r=e.readShort(),n.push(e.offset()),t.push(e.readShort()),!(r&a))break;e.skip(r&i?4:2),r&l?e.skip(8):r&s?e.skip(4):r&o&&e.skip(2)}}var i,o,a,s,l,c;return e.prototype={compound:!1,render:function(){return this.raw.get()}},i=1,o=8,a=32,s=64,l=128,c=256,n.prototype={compound:!0,render:function(e){var t,n,i=y(this.raw.get());for(t=0;this.glyphIds.length>t;++t)n=this.glyphIds[t],i.offset(this.idOffsets[t]),i.writeShort(e[n]);return i.get()}},r({parse:function(){this.cache={}},glyphFor:function(i){var r,o,a,s,l,c,d,u,h,p,f,g=this.cache;return t(g,i)?g[i]:(r=this.file.loca,o=r.lengthOf(i),0===o?g[i]=null:(a=this.rawData,s=this.offset+r.offsetOf(i),l=y(a.slice(s,o)),c=l.readShort_(),d=l.readShort_(),u=l.readShort_(),h=l.readShort_(),p=l.readShort_(),f=g[i]=-1==c?new n(l):new e(l),f.numberOfContours=c,f.xMin=d,f.yMin=u,f.xMax=h,f.yMax=p,f))},render:function(e,t,n){var i,r,o,a=y(),s=[];for(i=0;t.length>i;++i)r=t[i],o=e[r],s.push(a.offset()),o&&a.write(o.render(n));return s.push(a.offset()),{table:a.get(),offsets:s}}})}(),f=function(){function e(e,t){this.text=e,this.length=e.length,this.platformID=t.platformID,this.platformSpecificID=t.platformSpecificID,this.languageID=t.languageID,this.nameID=t.nameID}return r({parse:function(t){var n,i,r,o,a,s,l,c;for(t.offset(this.offset),n=t.readShort(),i=t.readShort(),r=this.offset+t.readShort(),o=t.times(i,function(){return{platformID:t.readShort(),platformSpecificID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:t.readShort()+r}}),a=this.strings={},s=0;o.length>s;++s)l=o[s],t.offset(l.offset),c=t.readString(l.length),a[l.nameID]||(a[l.nameID]=[]),a[l.nameID].push(new e(c,l));this.postscriptEntry=a[6][0],this.postscriptName=this.postscriptEntry.text.replace(/[^\x20-\x7F]/g,"")},render:function(n){var i,r,o,a,s,l,c=this.strings,d=0;for(i in c)t(c,i)&&(d+=c[i].length);r=y(),o=y(),r.writeShort(0),r.writeShort(d),r.writeShort(6+12*d);for(i in c)if(t(c,i))for(a=6==i?[new e(n,this.postscriptEntry)]:c[i],s=0;a.length>s;++s)l=a[s],r.writeShort(l.platformID),r.writeShort(l.platformSpecificID),r.writeShort(l.languageID),r.writeShort(l.nameID),r.writeShort(l.length),r.writeShort(o.offset()),o.writeString(l.text);return r.write(o.get()),r.get()}})}(),g=function(){var e=".notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat".split(/\s+/g);return r({parse:function(e){var t,n;switch(e.offset(this.offset),this.format=e.readLong(),this.italicAngle=e.readFixed_(),this.underlinePosition=e.readShort_(),this.underlineThickness=e.readShort_(),this.isFixedPitch=e.readLong(),this.minMemType42=e.readLong(),this.maxMemType42=e.readLong(),this.minMemType1=e.readLong(),this.maxMemType1=e.readLong(),this.format){case 65536:case 196608:break;case 131072:for(t=e.readShort(),this.glyphNameIndex=e.times(t,e.readShort),this.names=[],n=this.offset+this.length;e.offset()<n;)this.names.push(e.readString(e.readByte()));break;case 151552:t=e.readShort(),this.offsets=e.read(t);break;case 262144:this.map=e.times(this.file.maxp.numGlyphs,e.readShort)}},glyphFor:function(t){switch(this.format){case 65536:return e[t]||".notdef";case 131072:var n=this.glyphNameIndex[t];return e.length>n?e[n]:this.names[n-e.length]||".notdef";case 151552:case 196608:return".notdef";case 262144:return this.map[t]||65535}},render:function(t){var n,i,r,o,a,s,l;if(196608==this.format)return this.raw();for(n=y(this.rawData.slice(this.offset,32)),n.writeLong(131072),n.offset(32),i=[],r=[],o=0;t.length>o;++o)a=t[o],s=this.glyphFor(a),l=e.indexOf(s),l>=0?i.push(l):(i.push(e.length+r.length),r.push(s));for(n.writeShort(t.length),o=0;i.length>o;++o)n.writeShort(i[o]);for(o=0;r.length>o;++o)n.writeByte(r[o].length),n.writeString(r[o]);return n.get()}})}(),m=function(){function e(e,t){var n=this;n.platformID=e.readShort(),n.platformSpecificID=e.readShort(),n.offset=t+e.readLong(),e.saveExcursion(function(){var t,i,r,o,a,s,l,c,d,u,h,p,f;switch(e.offset(n.offset),n.format=e.readShort(),n.length=e.readShort(),n.language=e.readShort(),n.isUnicode=3==n.platformID&&1==n.platformSpecificID&&4==n.format||0===n.platformID&&4==n.format,n.codeMap={},n.format){case 0:for(t=0;256>t;++t)n.codeMap[t]=e.readByte();break;case 4:for(i=e.readShort()/2,e.skip(6),r=e.times(i,e.readShort),e.skip(2),o=e.times(i,e.readShort),a=e.times(i,e.readShort_),s=e.times(i,e.readShort),l=(n.length+n.offset-e.offset())/2,c=e.times(l,e.readShort),t=0;i>t;++t)for(d=o[t],u=r[t],h=d;u>=h;++h)0===s[t]?p=h+a[t]:(f=s[t]/2-(i-t)+(h-d),p=c[f]||0,0!==p&&(p+=a[t])),n.codeMap[h]=65535&p}})}function t(e,t){function i(n){return t[e[n]]}var r,o,a,s,l,c,d,u,h,p,f,g,m,v,_,w,b,k=n(e),x=[],C=[],T=null,S=null;for(r=0;k.length>r;++r)o=k[r],a=i(o),s=a-o,(null==T||s!==S)&&(T&&C.push(T),x.push(o),S=s),T=o;for(T&&C.push(T),C.push(65535),x.push(65535),l=x.length,c=2*l,d=2*Math.pow(2,Math.floor(Math.log(l)/Math.LN2)),u=Math.log(d/2)/Math.LN2,h=c-d,p=[],f=[],g=[],r=0;l>r;++r){if(m=x[r],v=C[r],65535==m){p.push(0),f.push(0);break}if(_=i(m),m-_>=32768)for(p.push(0),f.push(2*(g.length+l-r)),w=m;v>=w;++w)g.push(i(w));else p.push(_-m),f.push(0)}return b=y(),b.writeShort(3),b.writeShort(1),b.writeLong(12),b.writeShort(4),b.writeShort(16+8*l+2*g.length),b.writeShort(0),b.writeShort(c),b.writeShort(d),b.writeShort(u),b.writeShort(h),C.forEach(b.writeShort),b.writeShort(0),x.forEach(b.writeShort),p.forEach(b.writeShort_),f.forEach(b.writeShort),g.forEach(b.writeShort),b.get()}return r({parse:function(t){var n,i=this,r=i.offset;t.offset(r),i.version=t.readShort(),n=t.readShort(),i.unicodeEntry=null,i.tables=t.times(n,function(){var n=new e(t,r);return n.isUnicode&&(i.unicodeEntry=n),n})},render:function(e,n){var i=y();return i.writeShort(0),i.writeShort(1),i.write(t(e,n)),i.get()},getUnicodeEntry:function(){if(!this.unicodeEntry)throw Error("Font doesn't have an Unicode encoding");return this.unicodeEntry}})}(),v=r({parse:function(e){e.offset(this.offset),this.version=e.readShort(),this.averageCharWidth=e.readShort_(),this.weightClass=e.readShort(),this.widthClass=e.readShort(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort_(),this.ySubscriptYSize=e.readShort_(),this.ySubscriptXOffset=e.readShort_(),this.ySubscriptYOffset=e.readShort_(),this.ySuperscriptXSize=e.readShort_(),this.ySuperscriptYSize=e.readShort_(),this.ySuperscriptXOffset=e.readShort_(),this.ySuperscriptYOffset=e.readShort_(),this.yStrikeoutSize=e.readShort_(),this.yStrikeoutPosition=e.readShort_(),this.familyClass=e.readShort_(),this.panose=e.times(10,e.readByte),this.charRange=e.times(4,e.readLong),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=e.times(2,e.readLong),this.version>1&&(this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()))
},render:function(){return this.raw()}}),_=1e5,a.prototype={use:function(e){var t,n,i,r,o;if("string"==typeof e){for(n="",i=0;e.length>i;++i)t=this.use(e.charCodeAt(i)),n+=String.fromCharCode(t);return n}return t=this.unicodes[e],t||(t=this.next++,this.subset[t]=e,this.unicodes[e]=t,r=this.font.cmap.getUnicodeEntry().codeMap[e],r&&(this.ncid2ogid[t]=r,null==this.ogid2ngid[r]&&(o=this.nextGid++,this.ogid2ngid[r]=o,this.ngid2ogid[o]=r))),t},encodeText:function(e){return this.use(e)},glyphIds:function(){return n(this.ogid2ngid)},glyphsFor:function(e,t){var n,i,r;for(t||(t={}),n=0;e.length>n;++n)i=e[n],t[i]||(r=t[i]=this.font.glyf.glyphFor(i),r&&r.compound&&this.glyphsFor(r.glyphIds,t));return t},render:function(){var e,i,r,o,a,s,l,c,d=this.glyphsFor(this.glyphIds());for(e in d)t(d,e)&&(e=parseInt(e,10),null==this.ogid2ngid[e]&&(i=this.nextGid++,this.ogid2ngid[e]=i,this.ngid2ogid[i]=e));return r=n(this.ngid2ogid),o=r.map(function(e){return this.ngid2ogid[e]},this),a=this.font,s=a.glyf.render(d,o,this.ogid2ngid),l=a.loca.render(s.offsets),this.lastChar=this.next-1,c={cmap:m.render(this.ncid2ogid,this.ogid2ngid),glyf:s.table,loca:l.table,hmtx:a.hmtx.render(o),hhea:a.hhea.render(o),maxp:a.maxp.render(o),post:a.post.render(o),name:a.name.render(this.psName),head:a.head.render(l.format),"OS/2":a.os2.render()},this.font.directory.render(c)},cidToGidMap:function(){var e,t,n,i=y(),r=0;for(e=this.firstChar;this.next>e;++e){for(;e>r;)i.writeShort(0),r++;t=this.ncid2ogid[e],t?(n=this.ogid2ngid[t],i.writeShort(n)):i.writeShort(0),r++}return i.get()}},s.prototype={parse:function(){var e=this.directory=new i(this.contents);this.head=e.readTable("head",l),this.loca=e.readTable("loca",c),this.hhea=e.readTable("hhea",d),this.maxp=e.readTable("maxp",u),this.hmtx=e.readTable("hmtx",h),this.glyf=e.readTable("glyf",p),this.name=e.readTable("name",f),this.post=e.readTable("post",g),this.cmap=e.readTable("cmap",m),this.os2=e.readTable("OS/2",v),this.psName=this.name.postscriptName,this.ascent=this.os2.ascent||this.hhea.ascent,this.descent=this.os2.descent||this.hhea.descent,this.lineGap=this.os2.lineGap||this.hhea.lineGap,this.scale=1e3/this.head.unitsPerEm},widthOfGlyph:function(e){return this.hmtx.forGlyph(e).advance*this.scale},makeSubset:function(){return new a(this)}},w.TTFFont=s}(this),function(e){e.PDFMixin={extend:function(e){e.events.push("pdfExport"),e.options.pdf=this.options,e.saveAsPDF=this.saveAsPDF},options:{fileName:"Export.pdf",proxyURL:"",paperSize:"auto",landscape:!1,margin:null,title:null,author:null,subject:null,keywords:null,creator:"Kendo UI PDF Generator",date:null},saveAsPDF:function(){if(!this.trigger("pdfExport")){var t=this.options.pdf;e.drawing.drawDOM(this.wrapper[0]).then(function(n){return e.drawing.exportPDF(n,t)}).done(function(n){e.saveAs({dataURI:n,fileName:t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy})})}}}}(kendo),function(e,t){"use strict";function n(){if(!e.pdf)throw Error("kendo.pdf.js is not loaded");return e.pdf}function i(e,t){function i(e,t,n){return n||(n=d),n.pdf&&null!=n.pdf[e]?n.pdf[e]:t}function r(){function r(e){var t,n,r,o,s,c=e.options,d=S(e),u=d.bbox;e=d.root,t=i("paperSize",i("paperSize","auto"),c),n=!1,"auto"==t&&(u?(r=u.getSize(),t=[r.width,r.height],n=!0,o=u.getOrigin(),d=new D.Group,d.transform(new A.Matrix(1,0,0,1,-o.x,-o.y)),d.append(e),e=d):t="A4"),s=a.addPage({paperSize:t,margin:i("margin",i("margin"),c),addMargin:n,landscape:i("landscape",i("landscape",!1),c)}),l(e,s,a)}if(!(--o>0)){var a=new(n().Document)({title:i("title"),author:i("author"),subject:i("subject"),keywords:i("keywords"),creator:i("creator"),date:i("date")});u?e.children.forEach(r):r(e),t(a.render(),a)}}var o,a=[],c=[],d=e.options,u=i("multiPage");e.traverse(function(e){s({Image:function(e){c.indexOf(e.src())<0&&c.push(e.src())},Text:function(e){var t=n().parseFontDef(e.options.font),i=n().getFontURL(t);a.indexOf(i)<0&&a.push(i)}},e)}),o=2,n().loadFonts(a,r),n().loadImages(c,r)}function r(e,t){i(e,function(e){t("data:application/pdf;base64,"+e.base64())})}function o(e,t){i(e,function(e){t(new Blob([e.get()],{type:"application/pdf"}))})}function a(t,n,i,a){window.Blob&&!e.support.browser.safari?o(t,function(t){e.saveAs({dataURI:t,fileName:n}),a&&a(t)}):r(t,function(t){e.saveAs({dataURI:t,fileName:n,proxyURL:i}),a&&a(t)})}function s(e,t){var n=e[t.nodeType];return n?n.call.apply(n,arguments):t}function l(e,t,n){var i,r,o;e.DEBUG&&t.comment(e.DEBUG),i=e.transform(),r=e.opacity(),t.save(),null!=r&&1>r&&t.setOpacity(r),c(e,t,n),d(e,t,n),u(e,t,n),i&&(o=i.matrix(),t.transform(o.a,o.b,o.c,o.d,o.e,o.f)),s({Path:v,MultiPath:_,Circle:w,Arc:y,Text:b,Image:x,Group:k},e,t,n),t.restore()}function c(e,t){var n,i,r,o,a,s,l=e.stroke&&e.stroke();if(l){if(n=l.color){if(n=T(n),null==n)return;t.setStrokeColor(n.r,n.g,n.b),1!=n.a&&t.setStrokeOpacity(n.a)}if(i=l.width,null!=i){if(0===i)return;t.setLineWidth(i)}r=l.dashType,r&&t.setDashPattern(E[r],0),o=l.lineCap,o&&t.setLineCap(I[o]),a=l.lineJoin,a&&t.setLineJoin(P[a]),s=l.opacity,null!=s&&t.setStrokeOpacity(s)}}function d(e,t){var n,i,r=e.fill&&e.fill();if(r&&!(r instanceof D.Gradient)){if(n=r.color){if(n=T(n),null==n)return;t.setFillColor(n.r,n.g,n.b),1!=n.a&&t.setFillOpacity(n.a)}i=r.opacity,null!=i&&t.setFillOpacity(i)}}function u(e,t,n){var i=e.clip();i&&(m(i,t,n),t.clip())}function h(e){return e&&(e instanceof D.Gradient||e.color&&!/^(none|transparent)$/i.test(e.color)&&(null==e.width||e.width>0)&&(null==e.opacity||e.opacity>0))}function p(e,t,n,i){var r,o,a,s,l,c,d,u=e.fill();return u instanceof D.Gradient?(i?t.clipStroke():t.clip(),r=u instanceof D.RadialGradient,r?(o={x:u.center().x,y:u.center().y,r:0},a={x:u.center().x,y:u.center().y,r:u.radius()}):(o={x:u.start().x,y:u.start().y},a={x:u.end().x,y:u.end().y}),s={type:r?"radial":"linear",start:o,end:a,userSpace:u.userSpace(),stops:u.stops.elements().map(function(e){var t,n=e.offset();return n=/%$/.test(n)?parseFloat(n)/100:parseFloat(n),t=T(e.color()),t.a*=e.opacity(),{offset:n,color:t}})},l=e.rawBBox(),c=l.topLeft(),d=l.getSize(),l={left:c.x,top:c.y,width:d.width,height:d.height},t.gradient(s,l),!0):void 0}function f(e,t,n){h(e.fill())&&h(e.stroke())?p(e,t,n,!0)||t.fillStroke():h(e.fill())?p(e,t,n,!1)||t.fill():h(e.stroke())?t.stroke():t.nop()}function g(e,t){var n,i,r,o=e.segments;if(4==o.length&&e.options.closed){for(n=[],i=0;o.length>i;++i){if(o[i].controlIn())return!1;n[i]=o[i].anchor()}if(r=n[0].y==n[1].y&&n[1].x==n[2].x&&n[2].y==n[3].y&&n[3].x==n[0].x||n[0].x==n[1].x&&n[1].y==n[2].y&&n[2].x==n[3].x&&n[3].y==n[0].y)return t.rect(n[0].x,n[0].y,n[2].x-n[0].x,n[2].y-n[0].y),!0}}function m(e,t,n){var i,r,o,a,s,l,c=e.segments;if(0!==c.length&&!g(e,t,n)){for(r=0;c.length>r;++r)o=c[r],a=o.anchor(),i?(s=i.controlOut(),l=o.controlIn(),s&&l?t.bezier(s.x,s.y,l.x,l.y,a.x,a.y):t.lineTo(a.x,a.y)):t.moveTo(a.x,a.y),i=o;e.options.closed&&t.close()}}function v(e,t,n){m(e,t,n),f(e,t,n)}function _(e,t,n){var i,r=e.paths;for(i=0;r.length>i;++i)m(r[i],t,n);f(e,t,n)}function w(e,t,n){var i=e.geometry();t.circle(i.center.x,i.center.y,i.radius),f(e,t,n)}function y(e,t,n){var i,r=e.geometry().curvePoints();for(t.moveTo(r[0].x,r[0].y),i=1;r.length>i;)t.bezier(r[i].x,r[i++].y,r[i].x,r[i++].y,r[i].x,r[i++].y);f(e,t,n)}function b(e,t){var i,r=n().parseFontDef(e.options.font),o=e._position;e.fill()&&e.stroke()?i=n().TEXT_RENDERING_MODE.fillAndStroke:e.fill()?i=n().TEXT_RENDERING_MODE.fill:e.stroke()&&(i=n().TEXT_RENDERING_MODE.stroke),t.transform(1,0,0,-1,o.x,o.y+r.fontSize),t.beginText(),t.setFont(n().getFontURL(r),r.fontSize),t.setTextRenderingMode(i),t.showText(e.content()),t.endText()}function k(e,t,n){var i,r=e.children;for(i=0;r.length>i;++i)l(r[i],t,n)}function x(e,t){var n=e.src(),i=e.rect(),r=i.getOrigin(),o=i.getSize();t.transform(o.width,0,0,-o.height,r.x,r.y+o.height),t.drawImage(n)}function C(e,n){var i=t.Deferred();return e.options.set("pdf",n),D.pdf.toDataURL(e,i.resolve),i.promise()}function T(t){var n=e.parseColor(t,!0);return n?n.toRGB():null}function S(e){function t(e){return l=!0,e}function n(e){return e.visible()&&e.opacity()>0&&(h(e.fill())||h(e.stroke()))}function i(e){var t,n,i=[];for(t=0;e.length>t;++t)n=a(e[t]),null!=n&&i.push(n);return i}function r(e,t){var n,i=c,r=d;e.transform()&&(d=d.multiplyCopy(e.transform().matrix())),n=e.clip(),n&&(n=n.bbox(),n&&(n=n.bbox(d),c=c?A.Rect.intersect(c,n):n));try{return t()}finally{c=i,d=r}}function o(e){if(null==c)return!1;var t=e.rawBBox().bbox(d);return c&&t&&(t=A.Rect.intersect(t,c)),t}function a(a){return r(a,function(){if(!(a instanceof D.Group||a instanceof D.MultiPath)){var r=o(a);if(!r)return t(null);u=u?A.Rect.union(u,r):r}return s({Path:function(e){return 0!==e.segments.length&&n(e)?e:t(null)},MultiPath:function(e){if(!n(e))return t(null);var r=new D.MultiPath(e.options);return r.paths=i(e.paths),0===r.paths.length?t(null):r},Circle:function(e){return n(e)?e:t(null)},Arc:function(e){return n(e)?e:t(null)},Text:function(e){return/\S/.test(e.content())&&n(e)?e:t(null)},Image:function(e){return e.visible()&&e.opacity()>0?e:t(null)},Group:function(n){var r=new D.Group(n.options);return r.children=i(n.children),n!==e&&0===r.children.length?t(null):r}},a)})}var l,c=!1,d=A.Matrix.unit(),u=null;do l=!1,e=a(e);while(e&&l);return{root:e,bbox:u}}var D=e.drawing,A=e.geometry,E={dash:[4],dashDot:[4,2,1,2],dot:[1,2],longDash:[8,2],longDashDot:[8,2,1,2],longDashDotDot:[8,2,1,2,1,2],solid:[]},I={butt:0,round:1,square:2},P={miter:0,round:1,bevel:2};e.deepExtend(D,{exportPDF:C,pdf:{toDataURL:r,toBlob:o,saveAs:a,toStream:i}})}(window.kendo,window.kendo.jQuery),function(e,t,n){"use strict";function i(t){var n=e.Deferred();if(t=e(t)[0],"function"!=typeof window.getComputedStyle)throw Error("window.getComputedStyle is missing.  You are using an unsupported browser, or running in IE8 compatibility mode.  Drawing HTML is supported in Chrome, Firefox, Safari and IE9+.");return kendo.pdf&&kendo.pdf.defineFont(r()),t?h(t,function(){var i=new tt.Group,r=t.getBoundingClientRect();P(i,[1,0,0,1,-r.left,-r.top]),X._clipbox=!1,X._matrix=nt.Matrix.unit(),X._stackingContext={element:t,group:i},e(t).addClass("k-pdf-export"),Q(t,i),e(t).removeClass("k-pdf-export"),n.resolve(i)}):n.reject("No element to export"),n.promise()}function r(){function e(e){if(e){var t=null;try{t=e.cssRules}catch(i){}t&&n(e,t)}}function t(e){var t=b(e.style,"src");return t?J(t).reduce(function(e,t){var n=et(t);return n&&e.push(n),e},[]):[et(e.cssText)]}function n(n,r){var o,a,s,l,c,d,u;for(o=0;r.length>o;++o)switch(a=r[o],a.type){case 3:e(a.styleSheet);break;case 5:s=a.style,l=J(b(s,"font-family")),c=/^(400|bold)$/i.test(b(s,"font-weight")),d="italic"==b(s,"font-style"),u=t(a),u.length>0&&i(n,l,c,d,u[0])}}function i(e,t,n,i,r){/^https?:\/\//.test(r)||/^\//.test(r)||(r=(e.href+"").replace(/[^\/]*$/,"")+r),t.forEach(function(e){e=e.replace(/^(['"]?)(.*?)\1$/,"$2"),n&&(e+="|bold"),i&&(e+="|italic"),o[e]=r})}var r,o={};for(r=0;document.styleSheets.length>r;++r)e(document.styleSheets[r]);return o}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a(e){return e="_counter_"+e,X[e]}function s(e){var t=[],n=X;for(e="_counter_"+e;n;)o(n,e)&&t.push(n[e]),n=Object.getPrototypeOf(n);return t.reverse()}function l(e,t){var n=X;for(e="_counter_"+e;n&&!o(n,e);)n=Object.getPrototypeOf(n);n||(n=X._root),n[e]=(n[e]||0)+(null==t?1:t)}function c(e,t){e="_counter_"+e,X[e]=null==t?0:t}function d(e,n,i){var r,o,a;for(r=0;e.length>r;)o=e[r++],a=t(e[r]),isNaN(a)?n(o,i):(n(o,a),++r)}function u(e,t){var n=kendo.parseColor(e);return n&&(n=n.toRGB(),t?n=n.toCssRgba():0===n.a&&(n=null)),n}function h(e,t){function n(e){at[e]||(at[e]=!0,o.push(e))}function i(){--r<=0&&t()}var r,o=[];!function a(e){var t,i=g(b(y(e),"background-image"));for(/^img$/i.test(e.tagName)&&n(e.src),i&&n(i),t=e.firstChild;t;t=t.nextSibling)1==t.nodeType&&a(t)}(e),r=o.length,0===r&&i(),o.forEach(function(e){var t=at[e]=new Image;t.onload=i,t.onerror=function(){at[e]=null,i()},t.src=e,(t.complete||void 0===t.complete)&&(t.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",t.src=e)})}function p(e){for(var t={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},n=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],i="";e>0;)n[0]>e?n.shift():(i+=t[n[0]],e-=n[0]);return i}function f(e){var t,i="";do t=e%26,i=String.fromCharCode(97+t)+i,e=n.floor(e/26);while(e>0);return i}function g(e){var t=/^\s*url\((['"]?)(.*?)\1\)\s*$/i.exec(e);return t?t[2]:void 0}function m(e,t,n){var i,r;X=Object.create(X),X[e.tagName.toLowerCase()]={element:e,style:t},i=b(t,"text-decoration"),i&&"none"!=i&&(r=b(t,"color"),i.split(/\s+/g).forEach(function(e){X[e]||(X[e]=r)})),w(e)&&(X._stackingContext={element:e,group:n})}function v(){X=Object.getPrototypeOf(X)}function _(e){if(null!=X._clipbox){var t=e.bbox(X._matrix);X._clipbox=X._clipbox?nt.Rect.intersect(X._clipbox,t):t}}function w(e){function t(e){return b(n,e)}var n=y(e);return"none"!=t("transform")||"static"!=t("position")&&"auto"!=t("z-index")||t("opacity")<1?!0:void 0}function y(e,t){return window.getComputedStyle(e,t||null)}function b(e,t){return e.getPropertyValue(t)||rt.webkit&&e.getPropertyValue("-webkit-"+t)||rt.firefox&&e.getPropertyValue("-moz-"+t)||rt.opera&&e.getPropertyValue("-o-"+t)||rt.msie&&e.getPropertyValue("-ms-"+t)}function k(e,t,n,i){e.setProperty(t,n,i),rt.webkit?e.setProperty("-webkit-"+t,n,i):rt.firefox?e.setProperty("-moz-"+t,n,i):rt.opera?e.setProperty("-o-"+t,n,i):rt.msie&&(e.setProperty("-ms-"+t,n,i),t="ms"+t.replace(/(^|-)([a-z])/g,function(e,t,n){return t+n.toUpperCase()}),e[t]=n)}function x(e,n){return n="border-"+n,{width:t(b(e,n+"-width")),style:b(e,n+"-style"),color:u(b(e,n+"-color"),!0)}}function C(e,t){var n=e.style.cssText,i=t();return e.style.cssText=n,i}function T(e,n){var i=b(e,"border-"+n+"-radius").split(/\s+/g).map(t);return 1==i.length&&i.push(i[0]),z({x:i[0],y:i[1]})}function S(e){var t=e.getBoundingClientRect();return t=D(t,"border-*-width",e),t=D(t,"padding-*",e)}function D(e,n,i){var r,o,a,s,l;return"string"==typeof n?(r=y(i),o=t(b(r,n.replace("*","top"))),a=t(b(r,n.replace("*","right"))),s=t(b(r,n.replace("*","bottom"))),l=t(b(r,n.replace("*","left")))):"number"==typeof n&&(o=a=s=l=n),{top:e.top+o,right:e.right-a,bottom:e.bottom-s,left:e.left+l,width:e.right-e.left-a-l,height:e.bottom-e.top-s-o}}function A(e){var n,i,r=b(e,"transform");return"none"==r?null:(n=/^\s*matrix\(\s*(.*?)\s*\)\s*$/.exec(r),n?(i=b(e,"transform-origin"),n=n[1].split(/\s*,\s*/g).map(t),i=i.split(/\s+/g).map(t),{matrix:n,origin:i}):void 0)}function E(e){return 180*e/n.PI%360}function I(e){var i=t(e);return/grad$/.test(e)?n.PI*i/200:/rad$/.test(e)?i:/turn$/.test(e)?n.PI*i*2:/deg$/.test(e)?n.PI*i/180:void 0}function P(e,t){return t=new nt.Matrix(t[0],t[1],t[2],t[3],t[4],t[5]),e.transform(t),t}function M(e,t){e.clip(t)}function F(e,t,n,i){for(var r=new nt.Arc([t,n],i).curvePoints(),o=1;r.length>o;)e.curveTo(r[o++],r[o++],r[o++])}function z(e){return(0>=e.x||0>=e.y)&&(e.x=e.y=0),e}function R(e,n,i){var r,o,a,s,l,c,d,u,h=y(e),p=T(h,"top-left"),f=T(h,"top-right"),g=T(h,"bottom-left"),m=T(h,"bottom-right");return("padding"==i||"content"==i)&&(r=x(h,"top"),o=x(h,"right"),a=x(h,"bottom"),s=x(h,"left"),p.x-=s.width,p.y-=r.width,f.x-=o.width,f.y-=r.width,m.x-=o.width,m.y-=a.width,g.x-=s.width,g.y-=a.width,"content"==i&&(l=t(b(h,"padding-top")),c=t(b(h,"padding-right")),d=t(b(h,"padding-bottom")),u=t(b(h,"padding-left")),p.x-=u,p.y-=l,f.x-=c,f.y-=l,m.x-=c,m.y-=d,g.x-=u,g.y-=d)),"number"==typeof i&&(p.x-=i,p.y-=i,f.x-=i,f.y-=i,m.x-=i,m.y-=i,g.x-=i,g.y-=i),B(n,p,f,m,g)}function B(e,t,n,i,r){var o=new tt.Path({fill:null,stroke:null});return z(t),z(n),z(i),z(r),o.moveTo(e.left,e.top+t.y),t.x&&F(o,e.left+t.x,e.top+t.y,{startAngle:-180,endAngle:-90,radiusX:t.x,radiusY:t.y}),o.lineTo(e.right-n.x,e.top),n.x&&F(o,e.right-n.x,e.top+n.y,{startAngle:-90,endAngle:0,radiusX:n.x,radiusY:n.y}),o.lineTo(e.right,e.bottom-i.y),i.x&&F(o,e.right-i.x,e.bottom-i.y,{startAngle:0,endAngle:90,radiusX:i.x,radiusY:i.y}),o.lineTo(e.left+r.x,e.bottom),r.x&&F(o,e.left+r.x,e.bottom-r.y,{startAngle:90,endAngle:180,radiusX:r.x,radiusY:r.y}),o.close()}function H(e,n){var i=t(e)+"";switch(n){case"decimal-leading-zero":return 2>i.length&&(i="0"+i),i;case"lower-roman":return p(e);case"upper-roman":return p(e).toUpperCase();case"lower-latin":case"lower-alpha":return f(e-1);case"upper-latin":case"upper-alpha":return f(e-1).toUpperCase();default:return i}}function L(e,t){function n(e,t,n){return n?(n=n.replace(/^\s*(["'])(.*)\1\s*$/,"$2"),s(e).map(function(e){return H(e,t)}).join(n)):H(a(e)||0,t)}var i,r=J(t,/^\s+/),o=[];return r.forEach(function(t){var r;(i=/^\s*(["'])(.*)\1\s*$/.exec(t))?o.push(i[2].replace(/\\([0-9a-f]{4})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})):(i=/^\s*counter\((.*?)\)\s*$/.exec(t))?(r=J(i[1]),o.push(n(r[0],r[1]))):(i=/^\s*counters\((.*?)\)\s*$/.exec(t))?(r=J(i[1]),o.push(n(r[0],r[2],r[1]))):o.push((i=/^\s*attr\((.*?)\)\s*$/.exec(t))?e.getAttribute(i[1])||"":t)}),o.join("")}function N(e){var t,n;if(e.cssText)return e.cssText;for(t=[],n=0;e.length>n;++n)t.push(e[n]+": "+b(e,e[n]));return t.join(";\n")}function O(e,n){function i(n,i){var o,a=y(e,n);a.content&&"normal"!=a.content&&"none"!=a.content&&(o=document.createElement(ot),o.style.cssText=N(a),o.textContent=L(e,a.content),e.insertBefore(o,i),":before"!=n||/absolute|fixed/.test(b(o.style,"position"))||(o.style.marginLeft=t(b(o.style,"margin-left"))-o.offsetWidth+"px"),r.push(o))}if(e.tagName==ot)return void V(e,n);var r=[];i(":before",e.firstChild),i(":after",null),V(e,n),r.forEach(function(t){e.removeChild(t)})}function V(e,i){function r(t){var n,i,r,o,a,s;if(/^td$/i.test(e.tagName)&&(n=X.table,n&&"collapse"==b(n.style,"border-collapse"))){if(i=x(n.style,"left").width,r=x(n.style,"top").width,0===i&&0===r)return t;if(o=n.element.getBoundingClientRect(),a=n.element.rows[0].cells[0],s=a.getBoundingClientRect(),s.top==o.top||s.left==o.left)return it.call(t).map(function(e){return{left:e.left+i,top:e.top+r,right:e.right+i,bottom:e.bottom+r,height:e.height,width:e.width}})}return t}function o(e,t,r,o,a,s,l,c){function d(t,i,o){var a=n.PI/2*t/(t+r),s={x:i.x-t,y:i.y-r},l=new tt.Path({fill:{color:e},stroke:null}).moveTo(0,0);P(l,o),F(l,0,i.y,{startAngle:-90,endAngle:-E(a),radiusX:i.x,radiusY:i.y}),s.x>0&&s.y>0?(l.lineTo(s.x*n.cos(a),i.y-s.y*n.sin(a)),F(l,0,i.y,{startAngle:-E(a),endAngle:-90,radiusX:s.x,radiusY:s.y,anticlockwise:!0})):s.x>0?l.lineTo(s.x,r).lineTo(0,r):l.lineTo(s.x,r).lineTo(s.x,0),h.append(l.close())}if(!(0>=r)){var u,h=new tt.Group;P(h,c),i.append(h),z(s),z(l),u=new tt.Path({fill:{color:e},stroke:null}),h.append(u),u.moveTo(s.x?n.max(s.x,o):0,0).lineTo(t-(l.x?n.max(l.x,a):0),0).lineTo(t-n.max(l.x,a),r).lineTo(n.max(s.x,o),r).close(),s.x&&d(o,s,[-1,0,0,1,s.x,0]),l.x&&d(a,l,[1,0,0,1,t-l.x,0])}}function a(e){var t,n,r,o,a,l,c,u=new tt.Group;for(M(u,B(e,V,j,$,q)),i.append(u),K&&(t=new tt.Path({fill:{color:K.toCssRgba()},stroke:null}),t.moveTo(e.left,e.top).lineTo(e.right,e.top).lineTo(e.right,e.bottom).lineTo(e.left,e.bottom).close(),u.append(t)),c=d.length;--c>=0;)n=d[c],r=h[c]||h[h.length-1],o=m[c]||m[m.length-1],a=v[c]||v[v.length-1],l=w[c]||w[w.length-1],s(u,e,n,r,o,a,l)}function s(n,i,r,o,a,s,l){function c(n,i,r,c,d){function u(){for(;m.origin.x>i.left;)m.origin.x-=r}function h(){for(;m.origin.y>i.top;)m.origin.y-=c}function p(){for(;i.right>m.origin.x;)d(n,m.clone()),m.origin.x+=r}var f,g,m,v,_=r/c,w=i;if("content-box"==s?(w=D(w,"border-*-width",e),w=D(w,"padding-*",e)):"padding-box"==s&&(w=D(w,"border-*-width",e)),/^\s*auto(\s+auto)?\s*$/.test(l)||(f=l.split(/\s+/g),r=/%$/.test(f[0])?w.width*t(f[0])/100:t(f[0]),c=1==f.length||"auto"==f[1]?r/_:/%$/.test(f[1])?w.height*t(f[1])/100:t(f[1])),g=(a+"").split(/\s+/),1==g.length&&(g[1]="50%"),g[0]=/%$/.test(g[0])?t(g[0])/100*(w.width-r):t(g[0]),g[1]=/%$/.test(g[1])?t(g[1])/100*(w.height-c):t(g[1]),m=new nt.Rect([w.left+g[0],w.top+g[1]],[r,c]),"no-repeat"==o)d(n,m);else if("repeat-x"==o)u(),p();else if("repeat-y"==o)for(h();i.bottom>m.origin.y;)d(n,m.clone()),m.origin.y+=c;else if("repeat"==o)for(u(),h(),v=m.origin.clone();i.bottom>m.origin.y;)m.origin.x=v.x,p(),m.origin.y+=c}var d,u,h;r&&"none"!=r&&(/^url\(\"data:image\/svg/i.test(r)||(d=g(r),d?(u=at[d],u&&u.width>0&&u.height>0&&c(n,i,u.width,u.height,function(e,t){e.append(new tt.Image(d,t))})):(h=Z(r),h&&c(n,i,i.width,i.height,U(h)))))}function l(){function t(t){C(e,function(){e.style.position="relative";var n=document.createElement(ot);n.style.position="absolute",n.style.boxSizing="border-box","outside"==o?(n.style.width="6em",n.style.left="-6.8em",n.style.textAlign="right"):n.style.left="0px",t(n),e.insertBefore(n,e.firstChild),Q(n,i),e.removeChild(n)})}function n(t){var n,i=e.parentNode.children;for(n=0;i.length>n;++n)if(i[n]===e)return t(n,i.length)}var r,o,a=b(I,"list-style-type");if("none"!=a)switch(r=b(I,"list-style-image"),o=b(I,"list-style-position"),a){case"circle":case"disc":case"square":t(function(e){e.style.fontSize="70%",e.style.lineHeight="150%",e.style.paddingRight="0.5em",e.style.fontFamily="ZapfDingbats",e.innerHTML={disc:"l",circle:"m",square:"n"}[a]});break;case"decimal":case"decimal-leading-zero":t(function(e){n(function(t){++t,"decimal-leading-zero"==a&&2>(t+"").length&&(t="0"+t),e.innerHTML=t+"."})});break;case"lower-roman":case"upper-roman":t(function(e){n(function(t){t=p(t+1),"upper-roman"==a&&(t=t.toUpperCase()),e.innerHTML=t+"."})});break;case"lower-latin":case"lower-alpha":case"upper-latin":case"upper-alpha":t(function(e){n(function(t){t=f(t),/^upper/i.test(a)&&(t=t.toUpperCase()),e.innerHTML=t+"."})})}}function c(t,n,r){function s(e){return{x:e.y,y:e.x}}var l,c,d;if(0!==t.width&&0!==t.height&&(a(t),l=O.width>0&&(n&&"ltr"==Y||r&&"rtl"==Y),c=L.width>0&&(r&&"ltr"==Y||n&&"rtl"==Y),0!==H.width||0!==O.width||0!==L.width||0!==N.width)){if(H.color==L.color&&H.color==N.color&&H.color==O.color&&H.width==L.width&&H.width==N.width&&H.width==O.width&&l&&c)return t=D(t,H.width/2),d=R(e,t,H.width/2),d.options.stroke={color:H.color,width:H.width},void i.append(d);if(0===V.x&&0===j.x&&0===$.x&&0===q.x&&2>H.width&&2>O.width&&2>L.width&&2>N.width)return H.width>0&&i.append(new tt.Path({stroke:{width:H.width,color:H.color}}).moveTo(t.left,t.top+H.width/2).lineTo(t.right,t.top+H.width/2)),N.width>0&&i.append(new tt.Path({stroke:{width:N.width,color:N.color}}).moveTo(t.left,t.bottom-N.width/2).lineTo(t.right,t.bottom-N.width/2)),l&&i.append(new tt.Path({stroke:{width:O.width,color:O.color}}).moveTo(t.left+O.width/2,t.top).lineTo(t.left+O.width/2,t.bottom)),void(c&&i.append(new tt.Path({stroke:{width:L.width,color:L.color}}).moveTo(t.right-L.width/2,t.top).lineTo(t.right-L.width/2,t.bottom)));o(H.color,t.width,H.width,O.width,L.width,V,j,[1,0,0,1,t.left,t.top]),o(N.color,t.width,N.width,L.width,O.width,$,q,[-1,0,0,-1,t.right,t.bottom]),o(O.color,t.height,O.width,N.width,H.width,s(q),s(V),[0,-1,1,0,t.left,t.bottom]),o(L.color,t.height,L.width,H.width,N.width,s(j),s($),[0,1,-1,0,t.right,t.top])}}var d,h,m,v,w,k,S,A,I=y(e),H=x(I,"top"),L=x(I,"right"),N=x(I,"bottom"),O=x(I,"left"),V=T(I,"top-left"),j=T(I,"top-right"),q=T(I,"bottom-left"),$=T(I,"bottom-right"),Y=b(I,"direction"),K=b(I,"background-color");for(K=u(K),d=J(b(I,"background-image")),h=J(b(I,"background-repeat")),m=J(b(I,"background-position")),v=J(b(I,"background-origin")),w=J(b(I,"background-size")),rt.msie&&10>rt.version&&(m=J(e.currentStyle.backgroundPosition)),k=D(e.getBoundingClientRect(),"border-*-width",e),function(){var e,n,r,o,a,s,l,c=b(I,"clip"),d=/^\s*rect\((.*)\)\s*$/.exec(c);d&&(e=d[1].split(/[ ,]+/g),n="auto"==e[0]?k.top:t(e[0])+k.top,r="auto"==e[1]?k.right:t(e[1])+k.left,o="auto"==e[2]?k.bottom:t(e[2])+k.top,a="auto"==e[3]?k.left:t(e[3])+k.left,s=new tt.Group,l=(new tt.Path).moveTo(a,n).lineTo(r,n).lineTo(r,o).lineTo(a,o).close(),M(s,l),i.append(s),i=s,_(l))}(),S=e.getClientRects(),1==S.length&&(S=[e.getBoundingClientRect()]),S=r(S),A=0;S.length>A;++A)c(S[A],0===A,A==S.length-1);return S.length>0&&"list-item"==b(I,"display")&&l(S[0]),function(){function t(){var t=R(e,k,"padding"),n=new tt.Group;M(n,t),i.append(n),i=n,_(t)}/^(hidden|auto|scroll)/.test(b(I,"overflow"))?t():/^(hidden|auto|scroll)/.test(b(I,"overflow-x"))?t():/^(hidden|auto|scroll)/.test(b(I,"overflow-y"))&&t()}(),W(e,i)||G(e,i),i}function U(e){return function(i,r){{var o,a,s,l,c,d,u,h,p,f,g,m,v,_=r.width(),w=r.height();r.topLeft()}switch(e.type){case"linear":switch(o=null!=e.angle?e.angle:n.PI,e.to){case"top":o=0;break;case"left":o=-n.PI/2;break;case"bottom":o=n.PI;break;case"right":o=n.PI/2;break;case"top left":case"left top":o=-n.atan2(w,_);break;case"top right":case"right top":o=n.atan2(w,_);break;case"bottom left":case"left bottom":o=n.PI+n.atan2(w,_);break;case"bottom right":case"right bottom":o=n.PI-n.atan2(w,_)}e.reverse&&(o-=n.PI),o%=2*n.PI,0>o&&(o+=2*n.PI),a=n.abs(_*n.sin(o))+n.abs(w*n.cos(o)),s=n.atan(_*n.tan(o)/w),l=n.sin(s),c=n.cos(s),d=n.abs(l)+n.abs(c),u=d/2*l,h=d/2*c,o>n.PI/2&&3*n.PI/2>=o&&(u=-u,h=-h),p=[],f=0,g=e.stops.map(function(n,i){var r,o=n.percent;return o?o=t(o)/100:n.length?o=t(n.length)/a:0===i?o=0:i==e.stops.length-1&&(o=1),r={color:n.color.toCssRgba(),offset:o},null!=o?(f=o,p.forEach(function(e,t){var n=e.stop;n.offset=e.left+(f-e.left)*(t+1)/(p.length+1)}),p=[]):p.push({left:f,stop:r}),r}),m=[.5-u,.5+h],v=[.5+u,.5-h],i.append(tt.Path.fromRect(r).stroke(null).fill(new tt.LinearGradient({start:m,end:v,stops:g,userSpace:!1})));break;case"radial":window.console&&window.console.log&&window.console.log("Radial gradients are not yet supported in HTML renderer")}}}function W(t,n){var i,r,o,a;return t.getAttribute(kendo.attr("role"))&&(i=kendo.widgetInstance(e(t)),i&&(i.exportDOMVisual||i.exportVisual))?(r=i.exportDOMVisual?i.exportDOMVisual():i.exportVisual(),o=new tt.Group,o.children.push(r),a=t.getBoundingClientRect(),o.transform(nt.transform().translate(a.left,a.top)),n.append(o),!0):void 0}function j(e,t,n){var i=S(e),r=new nt.Rect([i.left,i.top],[i.width,i.height]),o=new tt.Image(t,r);M(o,R(e,i,"content")),n.append(o)}function q(e,n){var i=y(e),r=y(n),o=t(b(i,"z-index")),a=t(b(r,"z-index")),s=b(i,"position"),l=b(r,"position");return isNaN(o)&&isNaN(a)?/static|absolute/.test(s)&&/static|absolute/.test(l)?0:"static"==s?-1:"static"==l?1:0:isNaN(o)?0===a?0:a>0?-1:1:isNaN(a)?0===o?0:o>0?1:-1:t(o)-t(a)}function G(e,t){var n,i,r,o,a,s,l,c,d;switch(e.tagName.toLowerCase()){case"img":j(e,e.src,t);break;case"canvas":try{j(e,e.toDataURL("image/jpeg"),t)}catch(u){}break;case"textarea":case"input":break;default:for(n=[],i=[],r=[],o=[],a=e.firstChild;a;a=a.nextSibling)switch(a.nodeType){case 3:/\S/.test(a.data)&&$(e,a,t);break;case 1:s=y(a),l=b(s,"display"),c=b(s,"float"),d=b(s,"position"),"static"!=d?o.push(a):"inline"!=l?"none"!=c?i.push(a):n.push(a):r.push(a)}n.sort(q).forEach(function(e){Q(e,t)}),i.sort(q).forEach(function(e){Q(e,t)}),r.sort(q).forEach(function(e){Q(e,t)}),o.sort(q).forEach(function(e){Q(e,t)})}}function $(e,n,i){function r(){for(var e,t,i;!/\S/.test(s.charAt(u));){if(u>=h)return!0;u++}for(l.setStart(n,u),e=0;++u<=h;)if(++e,l.setEnd(n,u),e>1&&(d&&/\s/.test(s.charAt(u-1))||l.getClientRects().length>1)){l.setEnd(n,--u);break}t=l.getClientRects()[0],i=(""+l).replace(/\s+$/,""),o(i,t)}function o(e,t){var n,r,o;e=e.replace(/[\r\n ]+/g," "),rt.msie&&!isNaN(f)&&(n=tt.util.measureText(e,{font:g}),r=(t.top+t.bottom-n.height)/2,t={top:r,right:t.right,bottom:r+n.height,left:t.left,height:n.height,width:t.right-t.left}),o=new tt.Text(e,new nt.Point(t.left,t.top),{font:g,fill:{color:m}}),i.append(o),a(t)}function a(e){function t(t,n){var r,o;t&&(r=p/12,o=new tt.Path({stroke:{width:r,color:t}}),n-=r,o.moveTo(e.left,n).lineTo(e.right,n),i.append(o))}t(X.underline,e.bottom),t(X["line-through"],e.bottom-e.height/2.7),t(X.overline,e.top)}var s,l,c,d,u,h,p,f,g,m,v=y(e);if(!(t(b(v,"text-indent"))<-500)&&(s=n.data,l=e.ownerDocument.createRange(),c=b(v,"text-align"),d="justify"==c,u=0,h=/\S\s*$/.exec(n.data).index+1,p=b(v,"font-size"),f=b(v,"line-height"),g=[b(v,"font-style"),b(v,"font-variant"),b(v,"font-weight"),p,b(v,"font-family")].join(" "),p=t(p),f=t(f),0!==p))for(m=b(v,"color");!r(););}function Y(e,t){var n,i,r=X._stackingContext.group,o=r.children;for(n=0;o.length>n&&!(null!=o[n]._dom_zIndex&&o[n]._dom_zIndex>t);++n);return i=new tt.Group,r.insertAt(i,n),i._dom_zIndex=t,X._clipbox&&i.clip(tt.Path.fromRect(X._clipbox)),i}function Q(n,i){var r,o,a,s,u,h,p,f=y(n),g=b(f,"counter-reset");g&&d(J(g,/^\s+/),c,0),r=b(f,"counter-increment"),r&&d(J(r,/^\s+/),l,1),/^(style|script|link|meta|iframe|svg|col|colgroup)$/i.test(n.tagName)||null!=X._clipbox&&(o=t(b(f,"opacity")),a=b(f,"visibility"),s=b(f,"display"),0!==o&&"hidden"!=a&&"none"!=s&&(u=A(f),p=b(f,"z-index"),(u||1>o)&&"auto"==p&&(p=0),"auto"!=p?h=Y(i,p):(h=new tt.Group,i.append(h)),h.DEBUG=e(n).data("debug"),1>o&&h.opacity(o*h.opacity()),m(n,f,h),u?C(n,function(){var e,t,i,r;k(n.style,"transform","none","important"),k(n.style,"transition","none","important"),"static"==b(f,"position")&&k(n.style,"position","relative","important"),e=n.getBoundingClientRect(),t=e.left+u.origin[0],i=e.top+u.origin[1],r=[1,0,0,1,-t,-i],r=K(r,u.matrix),r=K(r,[1,0,0,1,t,i]),r=P(h,r),X._matrix=X._matrix.multiplyCopy(r),O(n,h)}):O(n,h),v()))}function K(e,t){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=t[0],c=t[1],d=t[2],u=t[3],h=t[4],p=t[5];return[n*l+i*d,n*c+i*u,r*l+o*d,r*c+o*u,a*l+s*d+h,a*c+s*u+p]}var X,Z,J,et,tt=kendo.drawing,nt=kendo.geometry,it=Array.prototype.slice,rt=kendo.support.browser,ot="KENDO-PSEUDO-ELEMENT",at={};tt.drawDOM=i,i.getFontFaces=r,X={},X._root=X,Z=function(){var e=/^((-webkit-|-moz-|-o-|-ms-)?linear-gradient\s*)\(/,t=/^([-0-9.]+%)/,n=/^([-0-9.]+px)/,i=/^(left|right|top|bottom|to|center)\W/,r=/^([-0-9.]+(deg|grad|rad|turn))/,a=/^(\s+)/,s=/^(\()/,l=/^(\))/,c=/^(,)/,d={};return function(u){function h(){var e=a.exec(u);e&&(u=u.substr(e[1].length))}function p(e){h();var t=e.exec(u);return t?(u=u.substr(t[1].length),t[1]):void 0}function f(){var e,i,r=kendo.parseColor(u,!0);return r?(u=u.substr(r.match[0].length),r=r.toRGB(),(e=p(n))||(i=p(t)),{color:r,length:e,percent:i}):void 0}function g(e){var n,o,a,d,h,g,m=[],_=!1;if(p(s)){for(n=p(r),n?(n=I(n),p(c)):(o=p(i),"to"==o?o=p(i):o&&/^-/.test(e)&&(_=!0),a=p(i),p(c)),/-moz-/.test(e)&&null==n&&null==o&&(d=p(t),h=p(t),_=!0,"0%"==d?o="left":"100%"==d&&(o="right"),"0%"==h?a="top":"100%"==h&&(a="bottom"),p(c));u&&!p(l)&&(g=f());)m.push(g),p(c);return{type:"linear",angle:n,to:o&&a?o+" "+a:o?o:a?a:null,stops:m,reverse:_,orig:v}}}var m,v=u;return o(d,v)?d[v]:(m=p(e),m&&(m=g(m)),d[v]=m)}}(),J=function(){var e={};return function(t,n){function i(e){return h=e.exec(t.substr(c))}function r(e){return e.replace(/^\s+|\s+$/g,"")}var a,s,l,c,d,u,h;if(n||(n=/^\s*,\s*/),a=t+n,o(e,a))return e[a];for(s=[],l=0,c=0,d=0,u=!1;t.length>c;)!u&&i(/^[\(\[\{]/)?(d++,c++):!u&&i(/^[\)\]\}]/)?(d--,c++):!u&&i(/^[\"\']/)?(u=h[0],c++):"'"==u&&i(/^\\\'/)?c+=2:'"'==u&&i(/^\\\"/)?c+=2:"'"==u&&i(/^\'/)?(u=!1,c++):'"'==u&&i(/^\"/)?(u=!1,c++):i(n)?(!u&&!d&&c>l&&(s.push(r(t.substring(l,c))),l=c+h[0].length),c+=h[0].length):c++;return c>l&&s.push(r(t.substring(l,c))),e[a]=s}}(),et=function(){var e={};return function(t){var n,i=e[t];return i||((n=/url\((['"]?)([^'")]*?)\1\)\s+format\((['"]?)truetype\3\)/.exec(t))?i=e[t]=n[2]:(n=/url\((['"]?)([^'")]*?\.ttf)\1\)/.exec(t))&&(i=e[t]=n[2])),i}}()}(window.kendo.jQuery,parseFloat,Math),function(e){var t=e.noop,n=window.kendo,i=n.Class,r=n.util,o=n.animationFrame,a=n.deepExtend,s=i.extend({init:function(e,t){var n=this;n.options=a({},n.options,t),n.element=e},options:{duration:500,easing:"swing"},setup:t,step:t,play:function(){var t=this,n=t.options,i=e.easing[n.easing],a=n.duration,s=n.delay||0,l=r.now()+s,c=l+a;0===a?(t.step(1),t.abort()):setTimeout(function(){var e=function(){var n,s,d,u;
t._stopped||(n=r.now(),s=r.limitValue(n-l,0,a),d=s/a,u=i(d,s,0,1,a),t.step(u),c>n?o(e):t.abort())};e()},s)},abort:function(){this._stopped=!0},destroy:function(){this.abort()}}),l=function(){this._items=[]};l.prototype={register:function(e,t){this._items.push({name:e,type:t})},create:function(e,t){var n,i,r,o=this._items;if(t&&t.type)for(i=t.type.toLowerCase(),r=0;o.length>r;r++)if(o[r].name.toLowerCase()===i){n=o[r];break}return n?new n.type(e,t):void 0}},l.current=new l,s.create=function(e,t,n){return l.current.create(e,t,n)},a(n.drawing,{Animation:s,AnimationFactory:l})}(window.kendo.jQuery,Math),function(e){function t(t){var n,i=s.ui.validator.ruleResolvers||{},r={};for(n in i)e.extend(!0,r,i[n].resolve(t));return r}function n(e){return e.replace(/&amp/g,"&amp;").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">")}function i(e){return e=(e+"").split("."),e.length>1?e[1].length:0}function r(t){return e(e.parseHTML?e.parseHTML(t):t)}function o(t,n){var i,r,o,a,l=e();for(o=0,a=t.length;a>o;o++)i=t[o],u.test(i.className)&&(r=i.getAttribute(s.attr("for")),r===n&&(l=l.add(i)));return l}var a,s=window.kendo,l=s.ui.Widget,c=".kendoValidator",d="k-invalid-msg",u=RegExp(d,"i"),h="k-invalid",p=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,f=/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,g=":input:not(:button,[type=submit],[type=reset],[disabled],[readonly])",m=":checkbox:not([disabled],[readonly])",v="[type=number],[type=range]",_="blur",w="name",y="form",b="novalidate",k=e.proxy,x=function(e,t){return"string"==typeof t&&(t=RegExp("^(?:"+t+")$")),t.test(e)},C=function(e,t,n){var i=e.val();return e.filter(t).length&&""!==i?x(i,n):!0},T=function(e,t){return e.length?null!=e[0].attributes[t]:!1};s.ui.validator||(s.ui.validator={rules:{},messages:{}}),a=l.extend({init:function(n,i){var r=this,o=t(n),a="["+s.attr("validate")+"!=false]";i=i||{},i.rules=e.extend({},s.ui.validator.rules,o.rules,i.rules),i.messages=e.extend({},s.ui.validator.messages,o.messages,i.messages),l.fn.init.call(r,n,i),r._errorTemplate=s.template(r.options.errorTemplate),r.element.is(y)&&r.element.attr(b,b),r._inputSelector=g+a,r._checkboxSelector=m+a,r._errors={},r._attachEvents(),r._isValidated=!1},events:["validate","change"],options:{name:"Validator",errorTemplate:'<span class="k-widget k-tooltip k-tooltip-validation"><span class="k-icon k-warning"> </span> #=message#</span>',messages:{required:"{0} is required",pattern:"{0} is not valid",min:"{0} should be greater than or equal to {1}",max:"{0} should be smaller than or equal to {1}",step:"{0} is not valid",email:"{0} is not valid email",url:"{0} is not valid URL",date:"{0} is not valid date"},rules:{required:function(e){var t=e.filter("[type=checkbox]").length&&!e.is(":checked"),n=e.val();return!(T(e,"required")&&(""===n||!n||t))},pattern:function(e){return e.filter("[type=text],[type=email],[type=url],[type=tel],[type=search],[type=password]").filter("[pattern]").length&&""!==e.val()?x(e.val(),e.attr("pattern")):!0},min:function(e){if(e.filter(v+",["+s.attr("type")+"=number]").filter("[min]").length&&""!==e.val()){var t=parseFloat(e.attr("min"))||0,n=s.parseFloat(e.val());return n>=t}return!0},max:function(e){if(e.filter(v+",["+s.attr("type")+"=number]").filter("[max]").length&&""!==e.val()){var t=parseFloat(e.attr("max"))||0,n=s.parseFloat(e.val());return t>=n}return!0},step:function(e){if(e.filter(v+",["+s.attr("type")+"=number]").filter("[step]").length&&""!==e.val()){var t,n=parseFloat(e.attr("min"))||0,r=parseFloat(e.attr("step"))||1,o=parseFloat(e.val()),a=i(r);return a?(t=Math.pow(10,a),Math.floor((o-n)*t)%(r*t)/Math.pow(100,a)===0):(o-n)%r===0}return!0},email:function(e){return C(e,"[type=email],["+s.attr("type")+"=email]",p)},url:function(e){return C(e,"[type=url],["+s.attr("type")+"=url]",f)},date:function(e){return e.filter("[type^=date],["+s.attr("type")+"=date]").length&&""!==e.val()?null!==s.parseDate(e.val(),e.attr(s.attr("format"))):!0}},validateOnBlur:!0},destroy:function(){l.fn.destroy.call(this),this.element.off(c)},value:function(){return this._isValidated?0===this.errors().length:!1},_submit:function(e){return this.validate()?!0:(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),!1)},_checkElement:function(e){var t=this.value();this.validateInput(e),this.value()!==t&&this.trigger("change")},_attachEvents:function(){var t=this;t.element.is(y)&&t.element.on("submit"+c,k(t._submit,t)),t.options.validateOnBlur&&(t.element.is(g)?(t.element.on(_+c,function(){t._checkElement(t.element)}),t.element.is(m)&&t.element.on("click"+c,function(){t._checkElement(t.element)})):(t.element.on(_+c,t._inputSelector,function(){t._checkElement(e(this))}),t.element.on("click"+c,t._checkboxSelector,function(){t._checkElement(e(this))})))},validate:function(){var e,t,n,i,r=!1,o=this.value();if(this._errors={},this.element.is(g))r=this.validateInput(this.element);else{for(i=!1,e=this.element.find(this._inputSelector),t=0,n=e.length;n>t;t++)this.validateInput(e.eq(t))||(i=!0);r=!i}return this.trigger("validate",{valid:r}),o!==r&&this.trigger("change"),r},validateInput:function(t){var i,o,a,l,c,u,p,f,g;return t=e(t),this._isValidated=!0,i=this,o=i._errorTemplate,a=i._checkValidity(t),l=a.valid,c="."+d,u=t.attr(w)||"",p=i._findMessageContainer(u).add(t.next(c).filter(function(){var t=e(this);return t.filter("["+s.attr("for")+"]").length?t.attr(s.attr("for"))===u:!0})).hide(),t.removeAttr("aria-invalid"),l?delete i._errors[u]:(f=i._extractMessage(t,a.key),i._errors[u]=f,g=r(o({message:n(f)})),i._decorateMessageContainer(g,u),p.replaceWith(g).length||g.insertAfter(t),g.show(),t.attr("aria-invalid",!0)),t.toggleClass(h,!l),l},hideMessages:function(){var e=this,t="."+d,n=e.element;n.is(g)?n.next(t).hide():n.find(t).hide()},_findMessageContainer:function(t){var n,i,r,a=s.ui.validator.messageLocators,l=e();for(i=0,r=this.element.length;r>i;i++)l=l.add(o(this.element[i].getElementsByTagName("*"),t));for(n in a)l=l.add(a[n].locate(this.element,t));return l},_decorateMessageContainer:function(e,t){var n,i=s.ui.validator.messageLocators;e.addClass(d).attr(s.attr("for"),t||"");for(n in i)i[n].decorate(e,t);e.attr("role","alert")},_extractMessage:function(e,t){var n=this,i=n.options.messages[t],r=e.attr(w);return i=s.isFunction(i)?i(e):i,s.format(e.attr(s.attr(t+"-msg"))||e.attr("validationMessage")||e.attr("title")||i||"",r,e.attr(t))},_checkValidity:function(e){var t,n=this.options.rules;for(t in n)if(!n[t].call(this,e))return{valid:!1,key:t};return{valid:!0}},errors:function(){var e,t=[],n=this._errors;for(e in n)t.push(n[e]);return t}}),s.ui.plugin(a)}(window.kendo.jQuery),function(e){function t(e,t){var n=e.x.location,i=e.y.location,r=t.x.location,o=t.y.location,a=n-r,s=i-o;return{center:{x:(n+r)/2,y:(i+o)/2},distance:Math.sqrt(a*a+s*s)}}function n(e){var t,n,i,r=[],a=e.originalEvent,s=e.currentTarget,l=0;if(e.api)r.push({id:2,event:e,target:e.target,currentTarget:e.target,location:e,type:"api"});else if(e.type.match(/touch/))for(n=a?a.changedTouches:[],t=n.length;t>l;l++)i=n[l],r.push({location:i,event:e,target:i.target,currentTarget:s,id:i.identifier,type:"touch"});else r.push(o.pointers||o.msPointers?{location:a,event:e,target:e.target,currentTarget:s,id:a.pointerId,type:"pointer"}:{id:1,event:e,target:e.target,currentTarget:s,location:e,type:"mouse"});return r}function i(e){for(var t=r.eventMap.up.split(" "),n=0,i=t.length;i>n;n++)e(t[n])}var r=window.kendo,o=r.support,a=window.document,s=r.Class,l=r.Observable,c=e.now,d=e.extend,u=o.mobileOS,h=u&&u.android,p=800,f=o.browser.msie?5:0,g="press",m="hold",v="select",_="start",w="move",y="end",b="cancel",k="tap",x="release",C="gesturestart",T="gesturechange",S="gestureend",D="gesturetap",A={api:0,touch:0,mouse:9,pointer:9},E=!o.touch||o.mouseAndTouchPresent,I=s.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=c()},move:function(e){var t=this,n=e["page"+t.axis],i=c(),r=i-t.timeStamp||1;(n||!h)&&(t.delta=n-t.location,t._updateLocationData(e),t.initialDelta=n-t.startLocation,t.velocity=t.delta/r,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]}}),P=s.extend({init:function(e,t,n){d(this,{x:new I("X",n.location),y:new I("Y",n.location),type:n.type,threshold:e.threshold||A[n.type],userEvents:e,target:t,currentTarget:n.currentTarget,initialTouch:n.target,id:n.id,pressEvent:n,_moved:!1,_finished:!1})},press:function(){this._holdTimeout=setTimeout(e.proxy(this,"_hold"),this.userEvents.minHold),this._trigger(g,this.pressEvent)},_hold:function(){this._trigger(m,this.pressEvent)},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(M.current&&M.current!==t.userEvents)return t.dispose();t._start(e)}t._finished||t._trigger(w,e)}},end:function(e){var t=this;t.endTime=c(),t._finished||(t._finished=!0,t._trigger(x,e),t._moved?t._trigger(y,e):t._trigger(k,e),clearTimeout(t._holdTimeout),t.dispose())},dispose:function(){var t=this.userEvents,n=t.touches;this._finished=!0,this.pressEvent=null,clearTimeout(this._holdTimeout),n.splice(e.inArray(this,n),1)},skip:function(){this.dispose()},cancel:function(){this.dispose()},isMoved:function(){return this._moved},_start:function(e){clearTimeout(this._holdTimeout),this.startTime=c(),this._moved=!0,this._trigger(_,e)},_trigger:function(e,t){var n=this,i=t.event,r={touch:n,x:n.x,y:n.y,target:n.target,event:i};n.userEvents.notify(e,r)&&i.preventDefault()},_withinIgnoreThreshold:function(){var e=this.x.initialDelta,t=this.y.initialDelta;return Math.sqrt(e*e+t*t)<=this.threshold}}),M=l.extend({init:function(t,n){var s,c,u,h=this,A=r.guid();n=n||{},s=h.filter=n.filter,h.threshold=n.threshold||f,h.minHold=n.minHold||p,h.touches=[],h._maxTouches=n.multiTouch?2:1,h.allowSelection=n.allowSelection,h.captureUpIfMoved=n.captureUpIfMoved,h.eventNS=A,t=e(t).handler(h),l.fn.init.call(h),d(h,{element:t,surface:e(n.global&&E?a.documentElement:n.surface||t),stopPropagation:n.stopPropagation,pressed:!1}),h.surface.handler(h).on(r.applyEventMap("move",A),"_move").on(r.applyEventMap("up cancel",A),"_end"),t.on(r.applyEventMap("down",A),s,"_start"),(o.pointers||o.msPointers)&&t.css("-ms-touch-action","pinch-zoom double-tap-zoom"),n.preventDragEvent&&t.on(r.applyEventMap("dragstart",A),r.preventDefault),t.on(r.applyEventMap("mousedown",A),s,{root:t},"_select"),h.captureUpIfMoved&&o.eventCapture&&(c=h.surface[0],u=e.proxy(h.preventIfMoving,h),i(function(e){c.addEventListener(e,u,!0)})),h.bind([g,m,k,_,w,y,x,b,C,T,S,D,v],n)},preventIfMoving:function(e){this._isMoved()&&e.preventDefault()},destroy:function(){var e,t=this;t._destroyed||(t._destroyed=!0,t.captureUpIfMoved&&o.eventCapture&&(e=t.surface[0],i(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,delete t.currentTarget)},capture:function(){M.current=this},cancel:function(){this._disposeAll(),this.trigger(b)},notify:function(e,n){var i=this,r=i.touches;if(this._isMultiTouch()){switch(e){case w:e=T;break;case y:e=S;break;case k:e=D}d(n,{touches:r},t(r[0],r[1]))}return this.trigger(e,d(n,{type:e}))},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(){for(var e=this.touches;e.length>0;)e.pop().dispose()},_isMoved:function(){return e.grep(this.touches,function(e){return e.isMoved()}).length},_select:function(e){(!this.allowSelection||this.trigger(v,{event:e}))&&e.preventDefault()},_start:function(t){var i,r,o=this,a=0,s=o.filter,l=n(t),c=l.length,d=t.which;if(!(d&&d>1||o._maxTouchesReached()))for(M.current=null,o.currentTarget=t.currentTarget,o.stopPropagation&&t.stopPropagation();c>a&&!o._maxTouchesReached();a++)r=l[a],i=s?e(r.currentTarget):o.element,i.length&&(r=new P(o,i,r),o.touches.push(r),r.press(),o._isMultiTouch()&&o.notify("gesturestart",{}))},_move:function(e){this._eachTouch("move",e)},_end:function(e){this._eachTouch("end",e)},_eachTouch:function(e,t){var i,r,o,a,s=this,l={},c=n(t),d=s.touches;for(i=0;d.length>i;i++)r=d[i],l[r.id]=r;for(i=0;c.length>i;i++)o=c[i],a=l[o.id],a&&a[e](o)},_apiCall:function(t,n,i,r){this[t]({api:!0,pageX:n,pageY:i,clientX:n,clientY:i,target:e(r||this.element)[0],stopPropagation:e.noop,preventDefault:e.noop})}});M.defaultThreshold=function(e){f=e},M.minHold=function(e){p=e},r.getTouches=n,r.touchDelta=t,r.UserEvents=M}(window.kendo.jQuery),function(e,t){function n(t,n){try{return e.contains(t,n)||t==n}catch(i){return!1}}function i(e,t){return parseInt(e.css(t),10)||0}function r(e,t){return Math.min(Math.max(e,t.min),t.max)}function o(e,t){var n=x(e),r=n.left+i(e,"borderLeftWidth")+i(e,"paddingLeft"),o=n.top+i(e,"borderTopWidth")+i(e,"paddingTop"),a=r+e.width()-t.outerWidth(!0),s=o+e.height()-t.outerHeight(!0);return{x:{min:r,max:a},y:{min:o,max:s}}}function a(e,n,i){for(var r,o,a=0,s=n&&n.length,l=i&&i.length;e&&e.parentNode;){for(a=0;s>a;a++)if(r=n[a],r.element[0]===e)return{target:r,targetElement:e};for(a=0;l>a;a++)if(o=i[a],g.matchesSelector.call(e,o.options.filter))return{target:o,targetElement:e};e=e.parentNode}return t}function s(e,t){var n,i=t.options.group,r=e[i];if(_.fn.destroy.call(t),r.length>1){for(n=0;r.length>n;n++)if(r[n]==t){r.splice(n,1);break}}else r.length=0,delete e[i]}var l,c,d,u,h,p,f=window.kendo,g=f.support,m=window.document,v=f.Class,_=f.ui.Widget,w=f.Observable,y=f.UserEvents,b=e.proxy,k=e.extend,x=f.getOffset,C={},T={},S={},D=f.elementUnderCursor,A="keyup",E="change",I="dragstart",P="hold",M="drag",F="dragend",z="dragcancel",R="hintDestroyed",B="dragenter",H="dragleave",L="drop",N=w.extend({init:function(t,n){var i=this,r=t[0];i.capture=!1,r.addEventListener?(e.each(f.eventMap.down.split(" "),function(){r.addEventListener(this,b(i._press,i),!0)}),e.each(f.eventMap.up.split(" "),function(){r.addEventListener(this,b(i._release,i),!0)})):(e.each(f.eventMap.down.split(" "),function(){r.attachEvent(this,b(i._press,i))}),e.each(f.eventMap.up.split(" "),function(){r.attachEvent(this,b(i._release,i))})),w.fn.init.call(i),i.bind(["press","release"],n||{})},captureNext:function(){this.capture=!0},cancelCapture:function(){this.capture=!1},_press:function(e){var t=this;t.trigger("press"),t.capture&&e.preventDefault()},_release:function(e){var t=this;t.trigger("release"),t.capture&&(e.preventDefault(),t.cancelCapture())}}),O=w.extend({init:function(t){var n=this;w.fn.init.call(n),n.forcedEnabled=!1,e.extend(n,t),n.scale=1,n.horizontal?(n.measure="offsetWidth",n.scrollSize="scrollWidth",n.axis="x"):(n.measure="offsetHeight",n.scrollSize="scrollHeight",n.axis="y")},makeVirtual:function(){e.extend(this,{virtual:!0,forcedEnabled:!0,_virtualMin:0,_virtualMax:0})},virtualSize:function(e,t){(this._virtualMin!==e||this._virtualMax!==t)&&(this._virtualMin=e,this._virtualMax=t,this.update())},outOfBounds:function(e){return e>this.max||this.min>e},forceEnabled:function(){this.forcedEnabled=!0},getSize:function(){return this.container[0][this.measure]},getTotal:function(){return this.element[0][this.scrollSize]},rescale:function(e){this.scale=e},update:function(e){var t=this,n=t.virtual?t._virtualMax:t.getTotal(),i=n*t.scale,r=t.getSize();(0!==n||t.forcedEnabled)&&(t.max=t.virtual?-t._virtualMin:0,t.size=r,t.total=i,t.min=Math.min(t.max,r-i),t.minScale=r/n,t.centerOffset=(i-r)/2,t.enabled=t.forcedEnabled||i>r,e||t.trigger(E,t))}}),V=w.extend({init:function(e){var t=this;w.fn.init.call(t),t.x=new O(k({horizontal:!0},e)),t.y=new O(k({horizontal:!1},e)),t.container=e.container,t.forcedMinScale=e.minScale,t.maxScale=e.maxScale||100,t.bind(E,e)},rescale:function(e){this.x.rescale(e),this.y.rescale(e),this.refresh()},centerCoordinates:function(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}},refresh:function(){var e=this;e.x.update(),e.y.update(),e.enabled=e.x.enabled||e.y.enabled,e.minScale=e.forcedMinScale||Math.min(e.x.minScale,e.y.minScale),e.fitScale=Math.max(e.x.minScale,e.y.minScale),e.trigger(E)}}),U=w.extend({init:function(e){var t=this;k(t,e),w.fn.init.call(t)},outOfBounds:function(){return this.dimension.outOfBounds(this.movable[this.axis])},dragMove:function(e){var t=this,n=t.dimension,i=t.axis,r=t.movable,o=r[i]+e;n.enabled&&((n.min>o&&0>e||o>n.max&&e>0)&&(e*=t.resistance),r.translateAxis(i,e),t.trigger(E,t))}}),W=v.extend({init:function(e){var t,n,i,r,o=this;k(o,{elastic:!0},e),i=o.elastic?.5:0,r=o.movable,o.x=t=new U({axis:"x",dimension:o.dimensions.x,resistance:i,movable:r}),o.y=n=new U({axis:"y",dimension:o.dimensions.y,resistance:i,movable:r}),o.userEvents.bind(["move","end","gesturestart","gesturechange"],{gesturestart:function(e){o.gesture=e,o.offset=o.dimensions.container.offset()},gesturechange:function(e){var i,a,s,l=o.gesture,c=l.center,d=e.center,u=e.distance/l.distance,h=o.dimensions.minScale,p=o.dimensions.maxScale;h>=r.scale&&1>u&&(u+=.8*(1-u)),r.scale*u>=p&&(u=p/r.scale),a=r.x+o.offset.left,s=r.y+o.offset.top,i={x:(a-c.x)*u+d.x-a,y:(s-c.y)*u+d.y-s},r.scaleWith(u),t.dragMove(i.x),n.dragMove(i.y),o.dimensions.rescale(r.scale),o.gesture=e,e.preventDefault()},move:function(e){e.event.target.tagName.match(/textarea|input/i)||(t.dimension.enabled||n.dimension.enabled?(t.dragMove(e.x.delta),n.dragMove(e.y.delta),e.preventDefault()):e.touch.skip())},end:function(e){e.preventDefault()}})}}),j=g.transitions.prefix+"Transform";c=g.hasHW3D?function(e,t,n){return"translate3d("+e+"px,"+t+"px,0) scale("+n+")"}:function(e,t,n){return"translate("+e+"px,"+t+"px) scale("+n+")"},d=w.extend({init:function(t){var n=this;w.fn.init.call(n),n.element=e(t),n.element[0].style.webkitTransformOrigin="left top",n.x=0,n.y=0,n.scale=1,n._saveCoordinates(c(n.x,n.y,n.scale))},translateAxis:function(e,t){this[e]+=t,this.refresh()},scaleTo:function(e){this.scale=e,this.refresh()},scaleWith:function(e){this.scale*=e,this.refresh()},translate:function(e){this.x+=e.x,this.y+=e.y,this.refresh()},moveAxis:function(e,t){this[e]=t,this.refresh()},moveTo:function(e){k(this,e),this.refresh()},refresh:function(){var e,t=this,n=t.x,i=t.y;t.round&&(n=Math.round(n),i=Math.round(i)),e=c(n,i,t.scale),e!=t.coordinates&&(f.support.browser.msie&&10>f.support.browser.version?(t.element[0].style.position="absolute",t.element[0].style.left=t.x+"px",t.element[0].style.top=t.y+"px"):t.element[0].style[j]=e,t._saveCoordinates(e),t.trigger(E))},_saveCoordinates:function(e){this.coordinates=e}}),u=_.extend({init:function(e,t){var n,i=this;_.fn.init.call(i,e,t),n=i.options.group,n in T?T[n].push(i):T[n]=[i]},events:[B,H,L],options:{name:"DropTarget",group:"default"},destroy:function(){s(T,this)},_trigger:function(e,n){var i=this,r=C[i.options.group];return r?i.trigger(e,k({},n.event,{draggable:r,dropTarget:n.dropTarget})):t},_over:function(e){this._trigger(B,e)},_out:function(e){this._trigger(H,e)},_drop:function(e){var t=this,n=C[t.options.group];n&&(n.dropped=!t._trigger(L,e))}}),u.destroyGroup=function(e){var t,n=T[e]||S[e];if(n){for(t=0;n.length>t;t++)_.fn.destroy.call(n[t]);n.length=0,delete T[e],delete S[e]}},u._cache=T,h=u.extend({init:function(e,t){var n,i=this;_.fn.init.call(i,e,t),n=i.options.group,n in S?S[n].push(i):S[n]=[i]},destroy:function(){s(S,this)},options:{name:"DropTargetArea",group:"default",filter:null}}),p=_.extend({init:function(e,t){var n=this;_.fn.init.call(n,e,t),n._activated=!1,n.userEvents=new y(n.element,{global:!0,allowSelection:!0,filter:n.options.filter,threshold:n.options.distance,start:b(n._start,n),hold:b(n._hold,n),move:b(n._drag,n),end:b(n._end,n),cancel:b(n._cancel,n),select:b(n._select,n)}),n._afterEndHandler=b(n._afterEnd,n),n._captureEscape=b(n._captureEscape,n)},events:[P,I,M,F,z,R],options:{name:"Draggable",distance:f.support.touch?0:5,group:"default",cursorOffset:null,axis:null,container:null,filter:null,ignore:null,holdToDrag:!1,dropped:!1},cancelHold:function(){this._activated=!1},_captureEscape:function(e){var t=this;e.keyCode===f.keys.ESC&&(t._trigger(z,{event:e}),t.userEvents.cancel())},_updateHint:function(t){var n,i=this,o=i.options,a=i.boundaries,s=o.axis,l=i.options.cursorOffset;l?n={left:t.x.location+l.left,top:t.y.location+l.top}:(i.hintOffset.left+=t.x.delta,i.hintOffset.top+=t.y.delta,n=e.extend({},i.hintOffset)),a&&(n.top=r(n.top,a.y),n.left=r(n.left,a.x)),"x"===s?delete n.top:"y"===s&&delete n.left,i.hint.css(n)},_shouldIgnoreTarget:function(t){var n=this.options.ignore;return n&&e(t).is(n)},_select:function(e){this._shouldIgnoreTarget(e.event.target)||e.preventDefault()},_start:function(n){var i,r=this,a=r.options,s=a.container,l=a.hint;return this._shouldIgnoreTarget(n.touch.initialTouch)||a.holdToDrag&&!r._activated?(r.userEvents.cancel(),t):(r.currentTarget=n.target,r.currentTargetOffset=x(r.currentTarget),l&&(r.hint&&r.hint.stop(!0,!0).remove(),r.hint=f.isFunction(l)?e(l.call(r,r.currentTarget)):l,i=x(r.currentTarget),r.hintOffset=i,r.hint.css({position:"absolute",zIndex:2e4,left:i.left,top:i.top}).appendTo(m.body),r.angular("compile",function(){return r.hint.removeAttr("ng-repeat"),{elements:r.hint.get(),scopeFrom:n.target}})),C[a.group]=r,r.dropped=!1,s&&(r.boundaries=o(s,r.hint)),r._trigger(I,n)&&(r.userEvents.cancel(),r._afterEnd()),r.userEvents.capture(),e(m).on(A,r._captureEscape),t)},_hold:function(e){this.currentTarget=e.target,this._trigger(P,e)?this.userEvents.cancel():this._activated=!0},_drag:function(n){var i=this;n.preventDefault(),i._withDropTarget(n,function(i,r){if(!i)return l&&(l._trigger(H,k(n,{dropTarget:e(l.targetElement)})),l=null),t;if(l){if(r===l.targetElement)return;l._trigger(H,k(n,{dropTarget:e(l.targetElement)}))}i._trigger(B,k(n,{dropTarget:e(r)})),l=k(i,{targetElement:r})}),i._trigger(M,k(n,{dropTarget:l})),i.hint&&i._updateHint(n)},_end:function(t){var n=this;n._withDropTarget(t,function(n,i){n&&(n._drop(k({},t,{dropTarget:e(i)})),l=null)}),n._trigger(F,t),n._cancel(t.event)},_cancel:function(){var e=this;e._activated=!1,e.hint&&!e.dropped?setTimeout(function(){e.hint.stop(!0,!0).animate(e.currentTargetOffset,"fast",e._afterEndHandler)},0):e._afterEnd()},_trigger:function(e,t){var n=this;return n.trigger(e,k({},t.event,{x:t.x,y:t.y,currentTarget:n.currentTarget,dropTarget:t.dropTarget}))},_withDropTarget:function(e,t){var i,r,o=this,s=o.options,l=T[s.group],c=S[s.group];(l&&l.length||c&&c.length)&&(i=D(e),o.hint&&n(o.hint[0],i)&&(o.hint.hide(),i=D(e),i||(i=D(e)),o.hint.show()),r=a(i,l,c),r?t(r.target,r.targetElement):t())},destroy:function(){var e=this;_.fn.destroy.call(e),e._afterEnd(),e.userEvents.destroy(),e.currentTarget=null},_afterEnd:function(){var t=this;t.hint&&t.hint.remove(),delete C[t.options.group],t.trigger("destroy"),t.trigger(R),e(m).off(A,t._captureEscape)}}),f.ui.plugin(u),f.ui.plugin(h),f.ui.plugin(p),f.TapCapture=N,f.containerBoundaries=o,k(f.ui,{Pane:W,PaneDimensions:V,Movable:d})}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.mobile,r=n.effects,o=i.ui,a=e.proxy,s=e.extend,l=o.Widget,c=n.Class,d=n.ui.Movable,u=n.ui.Pane,h=n.ui.PaneDimensions,p=r.Transition,f=r.Animation,g=Math.abs,m=500,v=.7,_=.96,w=10,y=55,b=.5,k=5,x="km-scroller-release",C="km-scroller-refresh",T="pull",S="change",D="resize",A="scroll",E=2,I=f.extend({init:function(e){var t=this;f.fn.init.call(t),s(t,e),t.userEvents.bind("gestureend",a(t.start,t)),t.tapCapture.bind("press",a(t.cancel,t))},enabled:function(){return this.dimensions.minScale>this.movable.scale},done:function(){return.01>this.dimensions.minScale-this.movable.scale},tick:function(){var e=this.movable;e.scaleWith(1.1),this.dimensions.rescale(e.scale)},onEnd:function(){var e=this.movable;e.scaleTo(this.dimensions.minScale),this.dimensions.rescale(e.scale)}}),P=f.extend({init:function(e){var t=this;f.fn.init.call(t),s(t,e,{transition:new p({axis:e.axis,movable:e.movable,onEnd:function(){t._end()}})}),t.tapCapture.bind("press",function(){t.cancel()}),t.userEvents.bind("end",a(t.start,t)),t.userEvents.bind("gestureend",a(t.start,t)),t.userEvents.bind("tap",a(t.onEnd,t))},onCancel:function(){this.transition.cancel()},freeze:function(e){var t=this;t.cancel(),t._moveTo(e)},onEnd:function(){var e=this;e.paneAxis.outOfBounds()?e._snapBack():e._end()},done:function(){return g(this.velocity)<1},start:function(e){var t,n=this;n.dimension.enabled&&(n.paneAxis.outOfBounds()?n._snapBack():(t=e.touch.id===E?0:e.touch[n.axis].velocity,n.velocity=Math.max(Math.min(t*n.velocityMultiplier,y),-y),n.tapCapture.captureNext(),f.fn.start.call(n)))},tick:function(){var e=this,t=e.dimension,n=e.paneAxis.outOfBounds()?b:e.friction,i=e.velocity*=n,r=e.movable[e.axis]+i;!e.elastic&&t.outOfBounds(r)&&(r=Math.max(Math.min(r,t.max),t.min),e.velocity=0),e.movable.moveAxis(e.axis,r)},_end:function(){this.tapCapture.cancelCapture(),this.end()},_snapBack:function(){var e=this,t=e.dimension,n=e.movable[e.axis]>t.max?t.max:t.min;e._moveTo(n)},_moveTo:function(e){this.transition.moveTo({location:e,duration:m,ease:p.easeOutExpo})}}),M=f.extend({init:function(e){var t=this;n.effects.Animation.fn.init.call(this),s(t,e,{origin:{},destination:{},offset:{}})},tick:function(){this._updateCoordinates(),this.moveTo(this.origin)},done:function(){return g(this.offset.y)<k&&g(this.offset.x)<k},onEnd:function(){this.moveTo(this.destination),this.callback&&this.callback.call()},setCoordinates:function(e,t){this.offset={},this.origin=e,this.destination=t},setCallback:function(e){e&&n.isFunction(e)?this.callback=e:e=t},_updateCoordinates:function(){this.offset={x:(this.destination.x-this.origin.x)/4,y:(this.destination.y-this.origin.y)/4},this.origin={y:this.origin.y+this.offset.y,x:this.origin.x+this.offset.x}}}),F=c.extend({init:function(t){var n=this,i="x"===t.axis,r=e('<div class="km-touch-scrollbar km-'+(i?"horizontal":"vertical")+'-scrollbar" />');s(n,t,{element:r,elementSize:0,movable:new d(r),scrollMovable:t.movable,alwaysVisible:t.alwaysVisible,size:i?"width":"height"}),n.scrollMovable.bind(S,a(n.refresh,n)),n.container.append(r),t.alwaysVisible&&n.show()},refresh:function(){var e=this,t=e.axis,n=e.dimension,i=n.size,r=e.scrollMovable,o=i/n.total,a=Math.round(-r[t]*o),s=Math.round(i*o);o>=1?this.element.css("display","none"):this.element.css("display",""),a+s>i?s=i-a:0>a&&(s+=a,a=0),e.elementSize!=s&&(e.element.css(e.size,s+"px"),e.elementSize=s),e.movable.moveAxis(t,a)},show:function(){this.element.css({opacity:v,visibility:"visible"})},hide:function(){this.alwaysVisible||this.element.css({opacity:0})}}),z=l.extend({init:function(i,r){var o,c,p,f,m,v,_,w,y,b=this;return l.fn.init.call(b,i,r),i=b.element,(b._native=b.options.useNative&&n.support.hasNativeScrolling)?(i.addClass("km-native-scroller").prepend('<div class="km-scroll-header"/>'),s(b,{scrollElement:i,fixedContainer:i.children().first()}),t):(i.css("overflow","hidden").addClass("km-scroll-wrapper").wrapInner('<div class="km-scroll-container"/>').prepend('<div class="km-scroll-header"/>'),o=i.children().eq(1),c=new n.TapCapture(i),p=new d(o),f=new h({element:o,container:i,forcedEnabled:b.options.zoom}),m=this.options.avoidScrolling,v=new n.UserEvents(i,{allowSelection:!0,preventDragEvent:!0,captureUpIfMoved:!0,multiTouch:b.options.zoom,start:function(t){f.refresh();var n=g(t.x.velocity),i=g(t.y.velocity),r=2*n>=i,o=e.contains(b.fixedContainer[0],t.event.target),a=2*i>=n;!o&&!m(t)&&b.enabled&&(f.x.enabled&&r||f.y.enabled&&a)?v.capture():v.cancel()}}),_=new u({movable:p,dimensions:f,userEvents:v,elastic:b.options.elastic}),w=new I({movable:p,dimensions:f,userEvents:v,tapCapture:c}),y=new M({moveTo:function(e){b.scrollTo(e.x,e.y)}}),p.bind(S,function(){b.scrollTop=-p.y,b.scrollLeft=-p.x,b.trigger(A,{scrollTop:b.scrollTop,scrollLeft:b.scrollLeft})}),b.options.mousewheelScrolling&&i.on("DOMMouseScroll mousewheel",a(this,"_wheelScroll")),s(b,{movable:p,dimensions:f,zoomSnapBack:w,animatedScroller:y,userEvents:v,pane:_,tapCapture:c,pulled:!1,enabled:!0,scrollElement:o,scrollTop:0,scrollLeft:0,fixedContainer:i.children().first()}),b._initAxis("x"),b._initAxis("y"),b._wheelEnd=function(){b._wheel=!1,b.userEvents.end(0,b._wheelY)},f.refresh(),b.options.pullToRefresh&&b._initPullToRefresh(),t)},_wheelScroll:function(e){this._wheel||(this._wheel=!0,this._wheelY=0,this.userEvents.press(0,this._wheelY)),clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(this._wheelEnd,50);var t=n.wheelDeltaY(e);t&&(this._wheelY+=t,this.userEvents.move(0,this._wheelY)),e.preventDefault()},makeVirtual:function(){this.dimensions.y.makeVirtual()},virtualSize:function(e,t){this.dimensions.y.virtualSize(e,t)},height:function(){return this.dimensions.y.size},scrollHeight:function(){return this.scrollElement[0].scrollHeight},scrollWidth:function(){return this.scrollElement[0].scrollWidth},options:{name:"Scroller",zoom:!1,pullOffset:140,visibleScrollHints:!1,elastic:!0,useNative:!1,mousewheelScrolling:!0,avoidScrolling:function(){return!1},pullToRefresh:!1,messages:{pullTemplate:"Pull to refresh",releaseTemplate:"Release to refresh",refreshTemplate:"Refreshing"}},events:[T,A,D],_resize:function(){this._native||this.contentResized()},setOptions:function(e){var t=this;l.fn.setOptions.call(t,e),e.pullToRefresh&&t._initPullToRefresh()},reset:function(){this._native?this.scrollElement.scrollTop(0):(this.movable.moveTo({x:0,y:0}),this._scale(1))},contentResized:function(){this.dimensions.refresh(),this.pane.x.outOfBounds()&&this.movable.moveAxis("x",this.dimensions.x.min),this.pane.y.outOfBounds()&&this.movable.moveAxis("y",this.dimensions.y.min)},zoomOut:function(){var e=this.dimensions;e.refresh(),this._scale(e.fitScale),this.movable.moveTo(e.centerCoordinates())},enable:function(){this.enabled=!0
},disable:function(){this.enabled=!1},scrollTo:function(e,t){this._native?(this.scrollElement.scrollLeft(g(e)),this.scrollElement.scrollTop(g(t))):(this.dimensions.refresh(),this.movable.moveTo({x:e,y:t}))},animatedScrollTo:function(e,t,n){var i,r;this._native?this.scrollTo(e,t):(i={x:this.movable.x,y:this.movable.y},r={x:e,y:t},this.animatedScroller.setCoordinates(i,r),this.animatedScroller.setCallback(n),this.animatedScroller.start())},pullHandled:function(){var e=this;e.refreshHint.removeClass(C),e.hintContainer.html(e.pullTemplate({})),e.yinertia.onEnd(),e.xinertia.onEnd(),e.userEvents.cancel()},destroy:function(){l.fn.destroy.call(this),this.userEvents&&this.userEvents.destroy()},_scale:function(e){this.dimensions.rescale(e),this.movable.scaleTo(e)},_initPullToRefresh:function(){var e=this;e.dimensions.y.forceEnabled(),e.pullTemplate=n.template(e.options.messages.pullTemplate),e.releaseTemplate=n.template(e.options.messages.releaseTemplate),e.refreshTemplate=n.template(e.options.messages.refreshTemplate),e.scrollElement.prepend('<span class="km-scroller-pull"><span class="km-icon"></span><span class="km-loading-left"></span><span class="km-loading-right"></span><span class="km-template">'+e.pullTemplate({})+"</span></span>"),e.refreshHint=e.scrollElement.children().first(),e.hintContainer=e.refreshHint.children(".km-template"),e.pane.y.bind("change",a(e._paneChange,e)),e.userEvents.bind("end",a(e._dragEnd,e))},_dragEnd:function(){var e=this;e.pulled&&(e.pulled=!1,e.refreshHint.removeClass(x).addClass(C),e.hintContainer.html(e.refreshTemplate({})),e.yinertia.freeze(e.options.pullOffset/2),e.trigger("pull"))},_paneChange:function(){var e=this;e.movable.y/b>e.options.pullOffset?e.pulled||(e.pulled=!0,e.refreshHint.removeClass(C).addClass(x),e.hintContainer.html(e.releaseTemplate({}))):e.pulled&&(e.pulled=!1,e.refreshHint.removeClass(x),e.hintContainer.html(e.pullTemplate({})))},_initAxis:function(e){var t=this,n=t.movable,i=t.dimensions[e],r=t.tapCapture,o=t.pane[e],a=new F({axis:e,movable:n,dimension:i,container:t.element,alwaysVisible:t.options.visibleScrollHints});i.bind(S,function(){a.refresh()}),o.bind(S,function(){a.show()}),t[e+"inertia"]=new P({axis:e,paneAxis:o,movable:n,tapCapture:r,userEvents:t.userEvents,dimension:i,elastic:t.options.elastic,friction:t.options.friction||_,velocityMultiplier:t.options.velocityMultiplier||w,end:function(){a.hide(),t.trigger("scrollEnd",{axis:e,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})}})}});o.plugin(z)}(window.kendo.jQuery),function(e,t){function n(e){return e.position().top+3}var i=window.kendo,r=i.ui.Widget,o=e.proxy,a=!1,s=".kendoGroupable",l="change",c=i.template('<div class="k-group-indicator" data-#=data.ns#field="${data.field}" data-#=data.ns#title="${data.title || ""}" data-#=data.ns#dir="${data.dir || "asc"}"><a href="\\#" class="k-link"><span class="k-icon k-si-arrow-${(data.dir || "asc") == "asc" ? "n" : "s"}">(sorted ${(data.dir || "asc") == "asc" ? "ascending": "descending"})</span>${data.title ? data.title: data.field}</a><a class="k-button k-button-icon k-button-bare"><span class="k-icon k-group-delete"></span></a></div>',{useWithBlock:!1}),d=function(t){return e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(i.attr("title"))||t.attr(i.attr("field"))).prepend('<span class="k-icon k-drag-status k-denied" />')},u=e('<div class="k-grouping-dropclue"/>'),h=r.extend({init:function(c,h){var p,f,g=this,m=i.guid(),v=o(g._intializePositions,g),_=g._dropCuePositions=[];r.fn.init.call(g,c,h),a=i.support.isRtl(c),f=a?"right":"left",g.draggable=p=g.options.draggable||new i.ui.Draggable(g.element,{filter:g.options.draggableElements,hint:d,group:m}),g.groupContainer=e(g.options.groupContainer,g.element).kendoDropTarget({group:p.options.group,dragenter:function(e){g._canDrag(e.draggable.currentTarget)&&(e.draggable.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add"),u.css("top",n(g.groupContainer)).css(f,0).appendTo(g.groupContainer))},dragleave:function(e){e.draggable.hint.find(".k-drag-status").removeClass("k-add").addClass("k-denied"),u.remove()},drop:function(t){var n,r=t.draggable.currentTarget,o=r.attr(i.attr("field")),s=r.attr(i.attr("title")),l=g.indicator(o),c=g._dropCuePositions,d=c[c.length-1];(r.hasClass("k-group-indicator")||g._canDrag(r))&&(d?(n=g._dropCuePosition(i.getOffset(u).left+parseInt(d.element.css("marginLeft"),10)*(a?-1:1)+parseInt(d.element.css("marginRight"),10)),n&&g._canDrop(e(l),n.element,n.left)&&(n.before?n.element.before(l||g.buildIndicator(o,s)):n.element.after(l||g.buildIndicator(o,s)),g._change())):(g.groupContainer.append(g.buildIndicator(o,s)),g._change()))}}).kendoDraggable({filter:"div.k-group-indicator",hint:d,group:p.options.group,dragcancel:o(g._dragCancel,g),dragstart:function(e){var t=e.currentTarget,i=parseInt(t.css("marginLeft"),10),r=t.position(),o=a?r.left-i:r.left+t.outerWidth();v(),u.css({top:n(g.groupContainer),left:o}).appendTo(g.groupContainer),this.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add")},dragend:function(){g._dragEnd(this)},drag:o(g._drag,g)}).on("click"+s,".k-button",function(t){t.preventDefault(),g._removeIndicator(e(this).parent())}).on("click"+s,".k-link",function(t){var n=e(this).parent(),r=g.buildIndicator(n.attr(i.attr("field")),n.attr(i.attr("title")),"asc"==n.attr(i.attr("dir"))?"desc":"asc");n.before(r).remove(),g._change(),t.preventDefault()}),p.bind(["dragend","dragcancel","dragstart","drag"],{dragend:function(){g._dragEnd(this)},dragcancel:o(g._dragCancel,g),dragstart:function(e){var n,i,r;return g.options.allowDrag||g._canDrag(e.currentTarget)?(v(),_.length?(n=_[_.length-1].element,i=parseInt(n.css("marginRight"),10),r=n.position().left+n.outerWidth()+i):r=0,t):(e.preventDefault(),t)},drag:o(g._drag,g)}),g.dataSource=g.options.dataSource,g.dataSource&&g._refreshHandler?g.dataSource.unbind(l,g._refreshHandler):g._refreshHandler=o(g.refresh,g),g.dataSource&&(g.dataSource.bind("change",g._refreshHandler),g.refresh())},refresh:function(){var t=this,n=t.dataSource;t.groupContainer&&t.groupContainer.empty().append(e.map(n.group()||[],function(n){var r=n.field,o=i.attr("field"),a=t.element.find(t.options.filter).filter(function(){return e(this).attr(o)===r});return t.buildIndicator(n.field,a.attr(i.attr("title")),n.dir)}).join("")),t._invalidateGroupContainer()},destroy:function(){var e=this;r.fn.destroy.call(e),e.groupContainer.off(s),e.groupContainer.data("kendoDropTarget")&&e.groupContainer.data("kendoDropTarget").destroy(),e.groupContainer.data("kendoDraggable")&&e.groupContainer.data("kendoDraggable").destroy(),e.options.draggable||e.draggable.destroy(),e.dataSource&&e._refreshHandler&&(e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=null),e.groupContainer=e.element=e.draggable=null},options:{name:"Groupable",filter:"th",draggableElements:"th",messages:{empty:"Drag a column header and drop it here to group by that column"}},indicator:function(t){var n=e(".k-group-indicator",this.groupContainer);return e.grep(n,function(n){return e(n).attr(i.attr("field"))===t})[0]},buildIndicator:function(e,t,n){return c({field:e.replace(/"/g,"'"),dir:n,title:t,ns:i.ns})},descriptors:function(){var t,n,r,o,a,s=this,l=e(".k-group-indicator",s.groupContainer);return t=s.element.find(s.options.filter).map(function(){var t=e(this),r=t.attr(i.attr("aggregates")),s=t.attr(i.attr("field"));if(r&&""!==r)for(n=r.split(","),r=[],o=0,a=n.length;a>o;o++)r.push({field:s,aggregate:n[o]});return r}).toArray(),e.map(l,function(n){return n=e(n),r=n.attr(i.attr("field")),{field:r,dir:n.attr(i.attr("dir")),aggregates:t||[]}})},_removeIndicator:function(e){var t=this;e.remove(),t._invalidateGroupContainer(),t._change()},_change:function(){var e=this;e.dataSource&&e.dataSource.group(e.descriptors())},_dropCuePosition:function(t){var n,i,r,o,s,l=this._dropCuePositions;if(u.is(":visible")&&0!==l.length)return t=Math.ceil(t),n=l[l.length-1],i=n.left,r=n.right,o=parseInt(n.element.css("marginLeft"),10),s=parseInt(n.element.css("marginRight"),10),t>=r&&!a||i>t&&a?t={left:n.element.position().left+(a?-o:n.element.outerWidth()+s),element:n.element,before:!1}:(t=e.grep(l,function(e){return t>=e.left&&e.right>=t||a&&t>e.right})[0],t&&(t={left:a?t.element.position().left+t.element.outerWidth()+s:t.element.position().left-o,element:t.element,before:!0})),t},_drag:function(e){var t=this._dropCuePosition(e.x.location);t&&u.css({left:t.left,right:"auto"})},_canDrag:function(e){var t=e.attr(i.attr("field"));return"false"!=e.attr(i.attr("groupable"))&&t&&(e.hasClass("k-group-indicator")||!this.indicator(t))},_canDrop:function(e,t,n){var i=e.next(),r=e[0]!==t[0]&&(!i[0]||t[0]!==i[0]||!a&&n>i.position().left||a&&n<i.position().left);return r},_dragEnd:function(t){var n=this,r=t.currentTarget.attr(i.attr("field")),o=n.indicator(r);t!==n.options.draggable&&!t.dropped&&o&&n._removeIndicator(e(o)),n._dragCancel()},_dragCancel:function(){u.remove(),this._dropCuePositions=[]},_intializePositions:function(){var t,n=this,r=e(".k-group-indicator",n.groupContainer);n._dropCuePositions=e.map(r,function(n){return n=e(n),t=i.getOffset(n).left,{left:parseInt(t,10),right:parseInt(t+n.outerWidth(),10),element:n}})},_invalidateGroupContainer:function(){var e=this.groupContainer;e&&e.is(":empty")&&e.html(this.options.messages.empty)}});i.ui.plugin(h)}(window.kendo.jQuery),function(e){function t(t,n){t=e(t),n?t.find(".k-drag-status").removeClass("k-add").addClass("k-denied"):t.find(".k-drag-status").removeClass("k-denied").addClass("k-add")}var n=window.kendo,i=n.getOffset,r=n.ui.Widget,o="change",a="k-reorderable",s=r.extend({init:function(s,l){var c,d=this,u=n.guid()+"-reorderable";r.fn.init.call(d,s,l),s=d.element.addClass(a),l=d.options,d.draggable=c=l.draggable||new n.ui.Draggable(s,{group:u,filter:l.filter,hint:l.hint}),d.reorderDropCue=e('<div class="k-reorder-cue"><div class="k-icon k-i-arrow-s"></div><div class="k-icon k-i-arrow-n"></div></div>'),s.find(c.options.filter).kendoDropTarget({group:c.options.group,dragenter:function(e){var n,r,o,a;d._draggable&&(n=this.element,o=!d._dropTargetAllowed(n)||d._isLastDraggable(),t(e.draggable.hint,o),o||(r=i(n),a=r.left,l.inSameContainer&&!l.inSameContainer({source:n,target:d._draggable,sourceIndex:d._index(n),targetIndex:d._index(d._draggable)})?d._dropTarget=n:d._index(n)>d._index(d._draggable)&&(a+=n.outerWidth()),d.reorderDropCue.css({height:n.outerHeight(),top:r.top,left:a}).appendTo(document.body)))},dragleave:function(e){t(e.draggable.hint,!0),d.reorderDropCue.remove(),d._dropTarget=null},drop:function(){var e,t,n;d._dropTarget=null,d._draggable&&(e=this.element,t=d._draggable,n=!1,d._dropTargetAllowed(e)&&!d._isLastDraggable()&&d.trigger(o,{element:d._draggable,target:e,oldIndex:d._index(t),newIndex:d._index(e),position:i(d.reorderDropCue).left>i(e).left?"after":"before"}))}}),c.bind(["dragcancel","dragend","dragstart","drag"],{dragcancel:function(){d.reorderDropCue.remove(),d._draggable=null,d._elements=null},dragend:function(){d.reorderDropCue.remove(),d._draggable=null,d._elements=null},dragstart:function(e){d._draggable=e.currentTarget,d._elements=d.element.find(d.draggable.options.filter)},drag:function(e){var t,n;d._dropTarget&&!this.hint.find(".k-drag-status").hasClass("k-denied")&&(t=i(d._dropTarget).left,n=d._dropTarget.outerWidth(),d.reorderDropCue.css(e.pageX>t+n/2?{left:t+n}:{left:t}))}})},options:{name:"Reorderable",filter:"*"},events:[o],_isLastDraggable:function(){var e,t=this.options.inSameContainer,n=this._draggable[0],i=this._elements.get(),r=!1;if(!t)return!1;for(;!r&&i.length>0;)e=i.pop(),r=n!==e&&t({source:n,target:e,sourceIndex:this._index(n),targetIndex:this._index(e)});return!r},_dropTargetAllowed:function(e){var t=this.options.inSameContainer,n=this.options.dragOverContainers,i=this._draggable;return i[0]===e[0]?!1:t&&n?t({source:i,target:e,sourceIndex:this._index(i),targetIndex:this._index(e)})?!0:n(this._index(i),this._index(e)):!0},_index:function(e){return this._elements.index(e)},destroy:function(){var t=this;r.fn.destroy.call(t),t.element.find(t.draggable.options.filter).each(function(){var t=e(this);t.data("kendoDropTarget")&&t.data("kendoDropTarget").destroy()}),t.draggable&&(t.draggable.destroy(),t.draggable.element=t.draggable=null),t.elements=t.reorderDropCue=t._elements=t._draggable=null}});n.ui.plugin(s)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui,r=i.Widget,o=e.proxy,a=n.isFunction,s=e.extend,l="horizontal",c="vertical",d="start",u="resize",h="resizeend",p=r.extend({init:function(e,t){var n=this;r.fn.init.call(n,e,t),n.orientation=n.options.orientation.toLowerCase()!=c?l:c,n._positionMouse=n.orientation==l?"x":"y",n._position=n.orientation==l?"left":"top",n._sizingDom=n.orientation==l?"outerWidth":"outerHeight",n.draggable=new i.Draggable(e,{distance:0,filter:t.handle,drag:o(n._resize,n),dragcancel:o(n._cancel,n),dragstart:o(n._start,n),dragend:o(n._stop,n)}),n.userEvents=n.draggable.userEvents},events:[u,h,d],options:{name:"Resizable",orientation:l},resize:function(){},_max:function(e){var n=this,i=n.hint?n.hint[n._sizingDom]():0,r=n.options.max;return a(r)?r(e):r!==t?n._initialElementPosition+r-i:r},_min:function(e){var n=this,i=n.options.min;return a(i)?i(e):i!==t?n._initialElementPosition+i:i},_start:function(t){var n=this,i=n.options.hint,r=e(t.currentTarget);n._initialElementPosition=r.position()[n._position],n._initialMousePosition=t[n._positionMouse].startLocation,i&&(n.hint=a(i)?e(i(r)):i,n.hint.css({position:"absolute"}).css(n._position,n._initialElementPosition).appendTo(n.element)),n.trigger(d,t),n._maxPosition=n._max(t),n._minPosition=n._min(t),e(document.body).css("cursor",r.css("cursor"))},_resize:function(e){var n,i=this,r=i._maxPosition,o=i._minPosition,a=i._initialElementPosition+(e[i._positionMouse].location-i._initialMousePosition);n=o!==t?Math.max(o,a):a,i.position=n=r!==t?Math.min(r,n):n,i.hint&&i.hint.toggleClass(i.options.invalidClass||"",n==r||n==o).css(i._position,n),i.resizing=!0,i.trigger(u,s(e,{position:n}))},_stop:function(t){var n=this;n.hint&&n.hint.remove(),n.resizing=!1,n.trigger(h,s(t,{position:n.position})),e(document.body).css("cursor","")},_cancel:function(e){var n=this;n.hint&&(n.position=t,n.hint.css(n._position,n._initialElementPosition),n._stop(e))},destroy:function(){var e=this;r.fn.destroy.call(e),e.draggable&&e.draggable.destroy()},press:function(e){if(e){var t=e.position(),n=this;n.userEvents.press(t.left,t.top,e[0]),n.targetPosition=t,n.target=e}},move:function(e){var n=this,i=n._position,r=n.targetPosition,o=n.position;o===t&&(o=r[i]),r[i]=o+e,n.userEvents.move(r.left,r.top)},end:function(){this.userEvents.end(),this.target=this.position=t}});n.ui.plugin(p)}(window.kendo.jQuery),function(e,t){function n(t,n){try{return e.contains(t,n)||t==n}catch(i){return!1}}function i(e){return e.clone()}function r(e){return e.clone().removeAttr("id").css("visibility","hidden")}var o=window.kendo,a=o.ui.Widget,s="start",l="beforeMove",c="move",d="end",u="change",h="cancel",p="sort",f="remove",g="receive",m=">*",v=-1,_=a.extend({init:function(e,t){var n=this;a.fn.init.call(n,e,t),n.options.placeholder||(n.options.placeholder=r),n.options.hint||(n.options.hint=i),n._draggable=n._createDraggable()},events:[s,l,c,d,u,h],options:{name:"Sortable",hint:null,placeholder:null,filter:m,holdToDrag:!1,disabled:null,container:null,connectWith:null,handler:null,cursorOffset:null,axis:null,ignore:null,cursor:"auto"},destroy:function(){this._draggable.destroy(),a.fn.destroy.call(this)},_createDraggable:function(){var t=this,n=t.element,i=t.options;return new o.ui.Draggable(n,{filter:i.filter,hint:o.isFunction(i.hint)?i.hint:e(i.hint),holdToDrag:i.holdToDrag,container:i.container?e(i.container):null,cursorOffset:i.cursorOffset,axis:i.axis,ignore:i.ignore,dragstart:e.proxy(t._dragstart,t),dragcancel:e.proxy(t._dragcancel,t),drag:e.proxy(t._drag,t),dragend:e.proxy(t._dragend,t)})},_dragstart:function(t){var n=this.draggedElement=t.currentTarget,i=t.target||o.elementUnderCursor(t),r=this.options.disabled,a=this.options.handler,l=this.options.placeholder,c=this.placeholder=e(o.isFunction(l)?l.call(this,n):l);r&&n.is(r)?t.preventDefault():a&&!e(i).is(a)?t.preventDefault():this.trigger(s,{item:n,draggableEvent:t})?t.preventDefault():(n.css("display","none"),n.before(c),this._setCursor())},_dragcancel:function(){this._cancel(),this.trigger(h,{item:this.draggedElement}),this._resetCursor()},_drag:function(n){var i,r,o,a,s,l=this.draggedElement,c=this._findTarget(n),d={left:n.x.location,top:n.y.location},u={x:n.x.delta,y:n.y.delta},h=this.options.axis,p={item:l,list:this,draggableEvent:n};if("x"===h||"y"===h)return this._movementByAxis(h,d,u[h],p),t;if(c){if(i=this._getElementCenter(c.element),r={left:Math.round(d.left-i.left),top:Math.round(d.top-i.top)},e.extend(p,{target:c.element}),c.appendToBottom)return this._movePlaceholder(c,null,p),t;if(c.appendAfterHidden&&this._movePlaceholder(c,"next",p),this._isFloating(c.element)?0>u.x&&0>r.left?o="prev":u.x>0&&r.left>0&&(o="next"):0>u.y&&0>r.top?o="prev":u.y>0&&r.top>0&&(o="next"),o){for(s="prev"===o?jQuery.fn.prev:jQuery.fn.next,a=s.call(c.element);a.length&&!a.is(":visible");)a=s.call(a);a[0]!=this.placeholder[0]&&this._movePlaceholder(c,o,p)}}},_dragend:function(n){var i,r,o,a,s=this.placeholder,l=this.draggedElement,c=this.indexOf(l),h=this.indexOf(s),m=this.options.connectWith;return this._resetCursor(),o={action:p,item:l,oldIndex:c,newIndex:h,draggableEvent:n},h>=0?r=this.trigger(d,o):(i=s.parents(m).getKendoSortable(),o.action=f,a=e.extend({},o,{action:g,oldIndex:v,newIndex:i.indexOf(s)}),r=!(!this.trigger(d,o)&&!i.trigger(d,a))),r||h===c?(this._cancel(),t):(s.replaceWith(l),l.show(),this._draggable.dropped=!0,o={action:this.indexOf(l)!=v?p:f,item:l,oldIndex:c,newIndex:this.indexOf(l),draggableEvent:n},this.trigger(u,o),i&&(a=e.extend({},o,{action:g,oldIndex:v,newIndex:i.indexOf(l)}),i.trigger(u,a)),t)},_findTarget:function(n){var i,r,o=this._findElementUnderCursor(n),a=this.options.connectWith;return e.contains(this.element[0],o)?(i=this.items(),r=i.filter(o)[0]||i.has(o)[0],r?{element:e(r),sortable:this}:null):this.element[0]==o&&this._isEmpty()?{element:this.element,sortable:this,appendToBottom:!0}:this.element[0]==o&&this._isLastHidden()?(r=this.items().eq(0),{element:r,sortable:this,appendAfterHidden:!0}):a?this._searchConnectedTargets(o,n):t},_findElementUnderCursor:function(e){{var t=o.elementUnderCursor(e),i=e.sender;this.items()}return n(i.hint[0],t)&&(i.hint.hide(),t=o.elementUnderCursor(e),t||(t=o.elementUnderCursor(e)),i.hint.show()),t},_searchConnectedTargets:function(t,n){var i,r,o,a,s=e(this.options.connectWith);for(a=0;s.length>a;a++)if(i=s.eq(a).getKendoSortable(),e.contains(s[a],t)){if(i)return r=i.items(),o=r.filter(t)[0]||r.has(t)[0],o?(i.placeholder=this.placeholder,{element:e(o),sortable:i}):null}else if(s[a]==t){if(i&&i._isEmpty())return{element:s.eq(a),sortable:i,appendToBottom:!0};if(this._isCursorAfterLast(i,n))return o=i.items().last(),{element:o,sortable:i}}},_isCursorAfterLast:function(e,t){var n,i,r=e.items().last(),a={left:t.x.location,top:t.y.location};return n=o.getOffset(r),n.top+=r.outerHeight(),n.left+=r.outerWidth(),i=this._isFloating(r)?n.left-a.left:n.top-a.top,0>i?!0:!1},_movementByAxis:function(t,n,i,r){var o,a="x"===t?n.left:n.top,s=0>i?this.placeholder.prev():this.placeholder.next();s.length&&!s.is(":visible")&&(s=0>i?s.prev():s.next()),e.extend(r,{target:s}),o=this._getElementCenter(s),o&&(o="x"===t?o.left:o.top),s.length&&0>i&&0>a-o?this._movePlaceholder({element:s,sortable:this},"prev",r):s.length&&i>0&&a-o>0&&this._movePlaceholder({element:s,sortable:this},"next",r)},_movePlaceholder:function(e,t,n){var i=this.placeholder;e.sortable.trigger(l,n)||(t?"prev"===t?e.element.before(i):"next"===t&&e.element.after(i):e.element.append(i),e.sortable.trigger(c,n))},_setCursor:function(){var t,n=this.options.cursor;n&&"auto"!==n&&(t=e(document.body),this._originalCursorType=t.css("cursor"),t.css({cursor:n}),this._cursorStylesheet||(this._cursorStylesheet=e("<style>* { cursor: "+n+" !important; }</style>")),this._cursorStylesheet.appendTo(t))},_resetCursor:function(){this._originalCursorType&&(e(document.body).css("cursor",this._originalCursorType),this._originalCursorType=null,this._cursorStylesheet.remove())},_getElementCenter:function(e){var t=e.length?o.getOffset(e):null;return t&&(t.top+=e.outerHeight()/2,t.left+=e.outerWidth()/2),t},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_cancel:function(){this.draggedElement.show(),this.placeholder.remove()},_items:function(){var e,t=this.options.filter;return e=t?this.element.find(t):this.element.children()},indexOf:function(e){var t=this._items(),n=this.placeholder,i=this.draggedElement;return n&&e[0]==n[0]?t.not(i).index(e):t.not(n).index(e)},items:function(){var e=this.placeholder,t=this._items();return e&&(t=t.not(e)),t},_isEmpty:function(){return!this.items().length},_isLastHidden:function(){return 1===this.items().length&&this.items().is(":hidden")}});o.ui.plugin(_)}(window.kendo.jQuery),function(e,t){function n(e,t){if(!e.is(":visible"))return!1;var n=r.getOffset(e),i=t.left+t.width,o=t.top+t.height;return n.right=n.left+e.outerWidth(),n.bottom=n.top+e.outerHeight(),!(n.left>i||t.left>n.right||n.top>o||t.top>n.bottom)}var i,r=window.kendo,o=r.ui.Widget,a=e.proxy,s=Math.abs,l="aria-selected",c="k-state-selected",d="k-state-selecting",u="k-selectable",h="change",p=".kendoSelectable",f="k-state-unselecting",g="input,a,textarea,.k-multiselect-wrap,select,button,a.k-button>.k-icon,span.k-icon.k-i-expand,span.k-icon.k-i-collapse",m=r.support.browser.msie,v=!1;!function(e){!function(){e('<div class="parent"><span /></div>').on("click",">*",function(){v=!0}).find("span").click().end().off()}()}(e),i=o.extend({init:function(t,n){var i,s=this;o.fn.init.call(s,t,n),s._marquee=e("<div class='k-marquee'><div class='k-marquee-color'></div></div>"),s._lastActive=null,s.element.addClass(u),s.relatedTarget=s.options.relatedTarget,i=s.options.multiple,this.options.aria&&i&&s.element.attr("aria-multiselectable",!0),s.userEvents=new r.UserEvents(s.element,{global:!0,allowSelection:!0,filter:(v?"":"."+u+" ")+s.options.filter,tap:a(s._tap,s)}),i&&s.userEvents.bind("start",a(s._start,s)).bind("move",a(s._move,s)).bind("end",a(s._end,s)).bind("select",a(s._select,s))},events:[h],options:{name:"Selectable",filter:">*",multiple:!1,relatedTarget:e.noop},_isElement:function(e){var t,n=this.element,i=n.length,r=!1;for(e=e[0],t=0;i>t;t++)if(n[t]===e){r=!0;break}return r},_tap:function(t){var n,i=e(t.target),r=this,o=t.event.ctrlKey||t.event.metaKey,a=r.options.multiple,s=a&&t.event.shiftKey,l=t.event.which,d=t.event.button;!r._isElement(i.closest("."+u))||l&&3==l||d&&2==d||this._allowSelection(t.event.target)&&(n=i.hasClass(c),a&&o||r.clear(),i=i.add(r.relatedTarget(i)),s?r.selectRange(r._firstSelectee(),i):(n&&o?(r._unselect(i),r._notify(h)):r.value(i),r._lastActive=r._downTarget=i))},_start:function(n){var i,r=this,o=e(n.target),a=o.hasClass(c),s=n.event.ctrlKey||n.event.metaKey;if(this._allowSelection(n.event.target)){if(r._downTarget=o,!r._isElement(o.closest("."+u)))return r.userEvents.cancel(),t;r.options.useAllItems?r._items=r.element.find(r.options.filter):(i=o.closest(r.element),r._items=i.find(r.options.filter)),n.sender.capture(),r._marquee.appendTo(document.body).css({left:n.x.client+1,top:n.y.client+1,width:0,height:0}),s||r.clear(),o=o.add(r.relatedTarget(o)),a&&(r._selectElement(o,!0),s&&o.addClass(f))}},_move:function(e){var t=this,n={left:e.x.startLocation>e.x.location?e.x.location:e.x.startLocation,top:e.y.startLocation>e.y.location?e.y.location:e.y.startLocation,width:s(e.x.initialDelta),height:s(e.y.initialDelta)};t._marquee.css(n),t._invalidateSelectables(n,e.event.ctrlKey||e.event.metaKey),e.preventDefault()},_end:function(){var e,t=this;t._marquee.remove(),t._unselect(t.element.find(t.options.filter+"."+f)).removeClass(f),e=t.element.find(t.options.filter+"."+d),e=e.add(t.relatedTarget(e)),t.value(e),t._lastActive=t._downTarget,t._items=null},_invalidateSelectables:function(e,t){var i,r,o,a,s=this._downTarget[0],l=this._items;for(i=0,r=l.length;r>i;i++)a=l.eq(i),o=a.add(this.relatedTarget(a)),n(a,e)?a.hasClass(c)?t&&s!==a[0]&&o.removeClass(c).addClass(f):a.hasClass(d)||a.hasClass(f)||o.addClass(d):a.hasClass(d)?o.removeClass(d):t&&a.hasClass(f)&&o.removeClass(f).addClass(c)},value:function(e){var n=this,i=a(n._selectElement,n);return e?(e.each(function(){i(this)}),n._notify(h),t):n.element.find(n.options.filter+"."+c)},_firstSelectee:function(){var e,t=this;return null!==t._lastActive?t._lastActive:(e=t.value(),e.length>0?e[0]:t.element.find(t.options.filter)[0])},_selectElement:function(t,n){var i=e(t),r=!n&&this._notify("select",{element:t});i.removeClass(d),r||(i.addClass(c),this.options.aria&&i.attr(l,!0))},_notify:function(e,t){return t=t||{},this.trigger(e,t)},_unselect:function(e){return e.removeClass(c),this.options.aria&&e.attr(l,!1),e},_select:function(t){this._allowSelection(t.event.target)&&(!m||m&&!e(r._activeElement()).is(g))&&t.preventDefault()},_allowSelection:function(t){return e(t).is(g)?(this.userEvents.cancel(),this._downTarget=null,!1):!0},resetTouchEvents:function(){this.userEvents.cancel()},clear:function(){var e=this.element.find(this.options.filter+"."+c);this._unselect(e)},selectRange:function(t,n){var i,r,o,a=this;for(a.clear(),a.element.length>1&&(o=a.options.continuousItems()),o&&o.length||(o=a.element.find(a.options.filter)),t=e.inArray(e(t)[0],o),n=e.inArray(e(n)[0],o),t>n&&(r=t,t=n,n=r),a.options.useAllItems||(n+=a.element.length-1),i=t;n>=i;i++)a._selectElement(o[i]);a._notify(h)},destroy:function(){var e=this;o.fn.destroy.call(e),e.element.off(p),e.userEvents.destroy(),e._marquee=e._lastActive=e.element=e.userEvents=null}}),i.parseOptions=function(e){var t="string"==typeof e&&e.toLowerCase();return{multiple:t&&t.indexOf("multiple")>-1,cell:t&&t.indexOf("cell")>-1}},r.ui.plugin(i)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui.Widget,r=e.proxy,o=n.keys,a="click",s="k-button",l="k-button-icon",c="k-button-icontext",d=".kendoButton",u="disabled",h="k-state-disabled",p="k-state-focused",f="k-state-selected",g=i.extend({init:function(e,t){var o=this;i.fn.init.call(o,e,t),e=o.wrapper=o.element,t=o.options,e.addClass(s).attr("role","button"),t.enable=t.enable&&!e.attr(u),o.enable(t.enable),o._tabindex(),o._graphics(),e.on(a+d,r(o._click,o)).on("focus"+d,r(o._focus,o)).on("blur"+d,r(o._blur,o)).on("keydown"+d,r(o._keydown,o)).on("keyup"+d,r(o._keyup,o)),n.notify(o)},destroy:function(){var e=this;e.wrapper.off(d),i.fn.destroy.call(e)},events:[a],options:{name:"Button",icon:"",spriteCssClass:"",imageUrl:"",enable:!0},_isNativeButton:function(){return"button"==this.element.prop("tagName").toLowerCase()},_click:function(e){this.options.enable&&this.trigger(a,{event:e})&&e.preventDefault()},_focus:function(){this.options.enable&&this.element.addClass(p)},_blur:function(){this.element.removeClass(p)},_keydown:function(e){var t=this;t._isNativeButton()||(e.keyCode==o.ENTER||e.keyCode==o.SPACEBAR)&&(e.keyCode==o.SPACEBAR&&(e.preventDefault(),t.options.enable&&t.element.addClass(f)),t._click(e))},_keyup:function(){this.element.removeClass(f)},_graphics:function(){var t,n,i,r=this,o=r.element,a=r.options,s=a.icon,d=a.spriteCssClass,u=a.imageUrl;(d||u||s)&&(i=!0,o.contents().not("span.k-sprite").not("span.k-icon").not("img.k-image").each(function(t,n){(1==n.nodeType||3==n.nodeType&&e.trim(n.nodeValue).length>0)&&(i=!1)}),o.addClass(i?l:c)),s?(t=o.children("span.k-icon").first(),t[0]||(t=e('<span class="k-icon"></span>').prependTo(o)),t.addClass("k-i-"+s)):d?(t=o.children("span.k-sprite").first(),t[0]||(t=e('<span class="k-sprite"></span>').prependTo(o)),t.addClass(d)):u&&(n=o.children("img.k-image").first(),n[0]||(n=e('<img alt="icon" class="k-image" />').prependTo(o)),n.attr("src",u))},enable:function(e){var n=this,i=n.element;e===t&&(e=!0),e=!!e,n.options.enable=e,i.toggleClass(h,!e).attr("aria-disabled",!e).attr(u,!e);try{i.blur()}catch(r){}}});n.ui.plugin(g)}(window.kendo.jQuery),function(e,t){function n(e,t,n,i,r){return e({idx:t,text:n,ns:c.ns,numeric:i,title:r||""})}function i(e,t,n){return k({className:e.substring(1),text:t,wrapClassName:n||""})}function r(e,t,n,i){e.find(t).parent().attr(c.attr("page"),n).attr("tabindex",-1).toggleClass("k-state-disabled",i)}function o(e,t){r(e,p,1,1>=t)}function a(e,t){r(e,g,Math.max(1,t-1),1>=t)}function s(e,t,n){r(e,m,Math.min(n,t+1),t>=n)}function l(e,t,n){r(e,f,n,t>=n)}var c=window.kendo,d=c.ui,u=d.Widget,h=e.proxy,p=".k-i-seek-w",f=".k-i-seek-e",g=".k-i-arrow-w",m=".k-i-arrow-e",v="change",_=".kendoPager",w="click",y="keydown",b="disabled",k=c.template('<a href="\\#" title="#=text#" class="k-link k-pager-nav #= wrapClassName #"><span class="k-icon #= className #">#=text#</span></a>'),x=u.extend({init:function(t,n){var r,d,b=this;u.fn.init.call(b,t,n),n=b.options,b.dataSource=c.data.DataSource.create(n.dataSource),b.linkTemplate=c.template(b.options.linkTemplate),b.selectTemplate=c.template(b.options.selectTemplate),r=b.page(),d=b.totalPages(),b._refreshHandler=h(b.refresh,b),b.dataSource.bind(v,b._refreshHandler),n.previousNext&&(b.element.find(p).length||(b.element.append(i(p,n.messages.first,"k-pager-first")),o(b.element,r,d)),b.element.find(g).length||(b.element.append(i(g,n.messages.previous)),a(b.element,r,d))),n.numeric&&(b.list=b.element.find(".k-pager-numbers"),b.list.length||(b.list=e('<ul class="k-pager-numbers k-reset" />').appendTo(b.element))),n.input&&(b.element.find(".k-pager-input").length||b.element.append('<span class="k-pager-input k-label">'+n.messages.page+'<input class="k-textbox">'+c.format(n.messages.of,d)+"</span>"),b.element.on(y+_,".k-pager-input input",h(b._keydown,b))),n.previousNext&&(b.element.find(m).length||(b.element.append(i(m,n.messages.next)),s(b.element,r,d)),b.element.find(f).length||(b.element.append(i(f,n.messages.last,"k-pager-last")),l(b.element,r,d))),n.pageSizes&&(b.element.find(".k-pager-sizes").length||e('<span class="k-pager-sizes k-label"><select/>'+n.messages.itemsPerPage+"</span>").appendTo(b.element).find("select").html(e.map(e.isArray(n.pageSizes)?n.pageSizes:[5,10,20],function(e){return"<option>"+e+"</option>"}).join("")).end().appendTo(b.element),b.element.find(".k-pager-sizes select").val(b.pageSize()),c.ui.DropDownList&&b.element.find(".k-pager-sizes select").show().kendoDropDownList(),b.element.on(v+_,".k-pager-sizes select",h(b._change,b))),n.refresh&&(b.element.find(".k-pager-refresh").length||b.element.append('<a href="#" class="k-pager-refresh k-link" title="'+n.messages.refresh+'"><span class="k-icon k-i-refresh">'+n.messages.refresh+"</span></a>"),b.element.on(w+_,".k-pager-refresh",h(b._refreshClick,b))),n.info&&(b.element.find(".k-pager-info").length||b.element.append('<span class="k-pager-info k-label" />')),b.element.on(w+_,"a",h(b._click,b)).addClass("k-pager-wrap k-widget"),n.autoBind&&b.refresh(),c.notify(b)},destroy:function(){var e=this;u.fn.destroy.call(e),e.element.off(_),e.dataSource.unbind(v,e._refreshHandler),e._refreshHandler=null,c.destroy(e.element),e.element=e.list=null},events:[v],options:{name:"Pager",selectTemplate:'<li><span class="k-state-selected">#=text#</span></li>',linkTemplate:'<li><a tabindex="-1" href="\\#" class="k-link" data-#=ns#page="#=idx#" #if (title !== "") {# title="#=title#" #}#>#=text#</a></li>',buttonCount:10,autoBind:!0,numeric:!0,info:!0,input:!1,previousNext:!0,pageSizes:!1,refresh:!1,messages:{display:"{0} - {1} of {2} items",empty:"No items to display",page:"Page",of:"of {0}",itemsPerPage:"items per page",first:"Go to the first page",previous:"Go to the previous page",next:"Go to the next page",last:"Go to the last page",refresh:"Refresh",morePages:"More pages"}},setDataSource:function(e){var t=this;
t.dataSource.unbind(v,t._refreshHandler),t.dataSource=t.options.dataSource=e,e.bind(v,t._refreshHandler),t.options.autoBind&&e.fetch()},refresh:function(e){var t,i,r,d=this,u=1,h="",p=d.page(),f=d.options,g=d.pageSize(),m=d.dataSource.total(),v=d.totalPages(),_=d.linkTemplate,w=f.buttonCount;if(!e||"itemchange"!=e.action){if(f.numeric){for(p>w&&(r=p%w,u=0===r?p-w+1:p-r+1),i=Math.min(u+w-1,v),u>1&&(h+=n(_,u-1,"...",!1,f.messages.morePages)),t=u;i>=t;t++)h+=n(t==p?d.selectTemplate:_,t,t,!0);v>i&&(h+=n(_,t,"...",!1,f.messages.morePages)),""===h&&(h=d.selectTemplate({text:0})),d.list.html(h)}f.info&&(h=m>0?c.format(f.messages.display,(p-1)*g+1,Math.min(p*g,m),m):f.messages.empty,d.element.find(".k-pager-info").html(h)),f.input&&d.element.find(".k-pager-input").html(d.options.messages.page+'<input class="k-textbox">'+c.format(f.messages.of,v)).find("input").val(p).attr(b,1>m).toggleClass("k-state-disabled",1>m),f.previousNext&&(o(d.element,p,v),a(d.element,p,v),s(d.element,p,v),l(d.element,p,v)),f.pageSizes&&d.element.find(".k-pager-sizes select").val(g).filter("["+c.attr("role")+"=dropdownlist]").kendoDropDownList("value",g).kendoDropDownList("text",g)}},_keydown:function(e){if(e.keyCode===c.keys.ENTER){var t=this.element.find(".k-pager-input").find("input"),n=parseInt(t.val(),10);(isNaN(n)||1>n||n>this.totalPages())&&(n=this.page()),t.val(n),this.page(n)}},_refreshClick:function(e){e.preventDefault(),this.dataSource.read()},_change:function(e){var t=parseInt(e.currentTarget.value,10);isNaN(t)||this.dataSource.pageSize(t)},_click:function(t){var n=e(t.currentTarget);t.preventDefault(),n.is(".k-state-disabled")||this.page(n.attr(c.attr("page")))},totalPages:function(){return Math.ceil((this.dataSource.total()||0)/this.pageSize())},pageSize:function(){return this.dataSource.pageSize()||this.dataSource.total()},page:function(e){return e===t?this.dataSource.total()>0?this.dataSource.page():0:(this.dataSource.page(e),this.trigger(v,{index:e}),t)}});d.plugin(x)}(window.kendo.jQuery),function(e){function t(t,n){return t===n||e.contains(t,n)}var n=window.kendo,i=n.ui,r=i.Widget,o=n.support,a=n.getOffset,s="open",l="close",c="deactivate",d="activate",u="center",h="left",p="right",f="top",g="bottom",m="absolute",v="hidden",_="body",w="location",y="position",b="visible",k="effects",x="k-state-active",C="k-state-border",T=/k-state-border-(\w+)/,S=".k-picker-wrap, .k-dropdown-wrap, .k-link",D="down",A=e(document.documentElement),E=e(window),I="scroll",P="resize scroll",M=o.transitions.css,F=M+"transform",z=e.extend,R=".kendoPopup",B=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],H=r.extend({init:function(t,i){var o,a=this;i=i||{},i.isRtl&&(i.origin=i.origin||g+" "+p,i.position=i.position||f+" "+p),r.fn.init.call(a,t,i),t=a.element,i=a.options,a.collisions=i.collision?i.collision.split(" "):[],a.downEvent=n.applyEventMap(D,n.guid()),1===a.collisions.length&&a.collisions.push(a.collisions[0]),o=e(a.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])"),i.appendTo=e(e(i.appendTo)[0]||o[0]||_),a.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl",!!i.isRtl).css({position:m}).appendTo(i.appendTo).on("mouseenter"+R,function(){a._hovered=!0}).on("mouseleave"+R,function(){a._hovered=!1}),a.wrapper=e(),i.animation===!1&&(i.animation={open:{effects:{}},close:{hide:!0,effects:{}}}),z(i.animation.open,{complete:function(){a.wrapper.css({overflow:b}),a._activated=!0,a._trigger(d)}}),z(i.animation.close,{complete:function(){a._animationClose()}}),a._mousedownProxy=function(e){a._mousedown(e)},a._resizeProxy=function(e){a._resize(e)},i.toggleTarget&&e(i.toggleTarget).on(i.toggleEvent+R,e.proxy(a.toggle,a))},events:[s,d,l,c],options:{name:"Popup",toggleEvent:"click",origin:g+" "+h,position:f+" "+h,anchor:_,appendTo:null,collision:"flip fit",viewport:window,copyAnchorStyles:!0,autosize:!1,modal:!1,animation:{open:{effects:"slideIn:down",transition:!0,duration:200},close:{duration:100,hide:!0}}},_animationClose:function(){var t,i,r,o,a=this,s=a.options;a.wrapper.hide(),t=a.wrapper.data(w),i=e(s.anchor),t&&a.wrapper.css(t),s.anchor!=_&&(r=((i.attr("class")||"").match(T)||["","down"])[1],o=C+"-"+r,i.removeClass(o).children(S).removeClass(x).removeClass(o),a.element.removeClass(C+"-"+n.directions[r].reverse)),a._closing=!1,a._trigger(c)},destroy:function(){var t,i=this,o=i.options,a=i.element.off(R);r.fn.destroy.call(i),o.toggleTarget&&e(o.toggleTarget).off(R),o.modal||(A.unbind(i.downEvent,i._mousedownProxy),i._scrollableParents().unbind(I,i._resizeProxy),E.unbind(P,i._resizeProxy)),n.destroy(i.element.children()),a.removeData(),o.appendTo[0]===document.body&&(t=a.parent(".k-animation-container"),t[0]?t.remove():a.remove())},open:function(t,i){var r,a,l,c=this,d={isFixed:!isNaN(parseInt(i,10)),x:t,y:i},u=c.element,h=c.options,p="down",g=e(h.anchor),w=u[0]&&u.hasClass("km-widget");if(!c.visible()){if(h.copyAnchorStyles&&(w&&"font-size"==B[0]&&B.shift(),u.css(n.getComputedStyles(g[0],B))),u.data("animating")||c._trigger(s))return;c._activated=!1,h.modal||(A.unbind(c.downEvent,c._mousedownProxy).bind(c.downEvent,c._mousedownProxy),o.mobileOS.ios||o.mobileOS.android||(c._scrollableParents().unbind(I,c._resizeProxy).bind(I,c._resizeProxy),E.unbind(P,c._resizeProxy).bind(P,c._resizeProxy))),c.wrapper=a=n.wrap(u,h.autosize).css({overflow:v,display:"block",position:m}),o.mobileOS.android&&a.css(F,"translatez(0)"),a.css(y),e(h.appendTo)[0]==document.body&&a.css(f,"-10000px"),r=z(!0,{},h.animation.open),c.flipped=c._position(d),r.effects=n.parseEffects(r.effects,c.flipped),p=r.effects.slideIn?r.effects.slideIn.direction:p,h.anchor!=_&&(l=C+"-"+p,u.addClass(C+"-"+n.directions[p].reverse),g.addClass(l).children(S).addClass(x).addClass(l)),u.data(k,r.effects).kendoStop(!0).kendoAnimate(r)}},toggle:function(){var e=this;e[e.visible()?l:s]()},visible:function(){return this.element.is(":"+b)},close:function(t){var i,r,o,a,s=this,c=s.options;if(s.visible()){if(i=s.wrapper[0]?s.wrapper:n.wrap(s.element).hide(),s._closing||s._trigger(l))return;s.element.find(".k-popup").each(function(){var n=e(this),i=n.data("kendoPopup");i&&i.close(t)}),A.unbind(s.downEvent,s._mousedownProxy),s._scrollableParents().unbind(I,s._resizeProxy),E.unbind(P,s._resizeProxy),t?r={hide:!0,effects:{}}:(r=z(!0,{},c.animation.close),o=s.element.data(k),a=r.effects,!a&&!n.size(a)&&o&&n.size(o)&&(r.effects=o,r.reverse=!0),s._closing=!0),s.element.kendoStop(!0),i.css({overflow:v}),s.element.kendoAnimate(r)}},_trigger:function(e){return this.trigger(e,{type:e})},_resize:function(e){var t=this;"resize"===e.type?(clearTimeout(t._resizeTimeout),t._resizeTimeout=setTimeout(function(){t._position(),t._resizeTimeout=null},50)):(!t._hovered||t._activated&&t.element.hasClass("k-list-container"))&&t.close()},_mousedown:function(i){var r=this,o=r.element[0],a=r.options,s=e(a.anchor)[0],l=a.toggleTarget,c=n.eventTarget(i),d=e(c).closest(".k-popup"),u=d.parent().parent(".km-shim").length;d=d[0],(u||!d||d===r.element[0])&&"popover"!==e(i.target).closest("a").data("rel")&&(t(o,c)||t(s,c)||l&&t(e(l)[0],c)||r.close())},_fit:function(e,t,n){var i=0;return e+t>n&&(i=n-(e+t)),0>e&&(i=-e),i},_flip:function(e,t,n,i,r,o,a){var s=0;return a=a||t,o!==r&&o!==u&&r!==u&&(e+a>i&&(s+=-(n+t)),0>e+s&&(s+=n+t)),s},_scrollableParents:function(){return e(this.options.anchor).parentsUntil("body").filter(function(e,t){var i=n.getComputedStyles(t,["overflow"]);return"visible"!=i.overflow})},_position:function(t){var n,i,r,s,l,c,d,u,h,p=this,f=p.element.css(y,""),g=p.wrapper,v=p.options,_=e(v.viewport),b=_.offset(),k=e(v.anchor),x=v.origin.toLowerCase().split(" "),C=v.position.toLowerCase().split(" "),T=p.collisions,S=o.zoomLevel(),D=10002,A=!!(_[0]==window&&window.innerWidth&&1.02>=S),E=0,I=A?window.innerWidth:_.width(),P=A?window.innerHeight:_.height(),M=k.parents().filter(g.siblings());if(M[0])if(i=Math.max(+M.css("zIndex"),0))D=i+10;else for(n=k.parentsUntil(M),r=n.length;r>E;E++)i=+e(n[E]).css("zIndex"),i&&i>D&&(D=i+10);return g.css("zIndex",D),g.css(t&&t.isFixed?{left:t.x,top:t.y}:p._align(x,C)),s=a(g,y,k[0]===g.offsetParent()[0]),l=a(g),c=k.offsetParent().parent(".k-animation-container,.k-popup,.k-group"),c.length&&(s=a(g,y,!0),l=a(g)),_[0]===window?(l.top-=window.pageYOffset||document.documentElement.scrollTop||0,l.left-=window.pageXOffset||document.documentElement.scrollLeft||0):(l.top-=b.top,l.left-=b.left),p.wrapper.data(w)||g.data(w,z({},s)),d=z({},l),u=z({},s),"fit"===T[0]&&(u.top+=p._fit(d.top,g.outerHeight(),P/S)),"fit"===T[1]&&(u.left+=p._fit(d.left,g.outerWidth(),I/S)),h=z({},u),"flip"===T[0]&&(u.top+=p._flip(d.top,f.outerHeight(),k.outerHeight(),P/S,x[0],C[0],g.outerHeight())),"flip"===T[1]&&(u.left+=p._flip(d.left,f.outerWidth(),k.outerWidth(),I/S,x[1],C[1],g.outerWidth())),f.css(y,m),g.css(u),u.left!=h.left||u.top!=h.top},_align:function(t,n){var i,r=this,o=r.wrapper,s=e(r.options.anchor),l=t[0],c=t[1],d=n[0],h=n[1],f=a(s),m=e(r.options.appendTo),v=o.outerWidth(),_=o.outerHeight(),w=s.outerWidth(),y=s.outerHeight(),b=f.top,k=f.left,x=Math.round;return m[0]!=document.body&&(i=a(m),b-=i.top,k-=i.left),l===g&&(b+=y),l===u&&(b+=x(y/2)),d===g&&(b-=_),d===u&&(b-=x(_/2)),c===p&&(k+=w),c===u&&(k+=x(w/2)),h===p&&(k-=v),h===u&&(k-=x(v/2)),{top:b,left:k}}});i.plugin(H)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui.Widget,r=e.proxy,o=e.extend,a=window.setTimeout,s="click",l="show",c="hide",d="k-notification",u=".k-notification-wrap .k-i-close",h="info",p="success",f="warning",g="error",m="top",v="left",_="bottom",w="right",y="up",b=".kendoNotification",k='<div class="k-widget k-notification"></div>',x='<div class="k-notification-wrap"><span class="k-icon k-i-note">#=typeIcon#</span>#=content#<span class="k-icon k-i-close">Hide</span></div>',C=i.extend({init:function(t,r){var o=this;i.fn.init.call(o,t,r),r=o.options,r.appendTo&&e(r.appendTo).is(t)||o.element.hide(),o._compileTemplates(r.templates),o._guid="_"+n.guid(),o._isRtl=n.support.isRtl(t),o._compileStacking(r.stacking,r.position.top),n.notify(o)},events:[l,c],options:{name:"Notification",position:{pinned:!0,top:null,left:null,bottom:20,right:20},stacking:"default",hideOnClick:!0,button:!1,allowHideAfter:0,autoHideAfter:5e3,appendTo:null,width:null,height:null,templates:[],animation:{open:{effects:"fade:in",duration:300},close:{effects:"fade:out",duration:600,hide:!0}}},_compileTemplates:function(t){var i=this,r=n.template;i._compiled={},e.each(t,function(t,n){i._compiled[n.type]=r(n.template||e("#"+n.templateId).html())}),i._defaultCompiled=r(x)},_getCompiled:function(e){var t=this,n=t._defaultCompiled;return e?t._compiled[e]||n:n},_compileStacking:function(e,t){var n,i,r=this,o={paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0};switch(e){case"down":n=_+" "+v,i=m+" "+v,delete o.paddingBottom;break;case w:n=m+" "+w,i=m+" "+v,delete o.paddingRight;break;case v:n=m+" "+v,i=m+" "+w,delete o.paddingLeft;break;case y:n=m+" "+v,i=_+" "+v,delete o.paddingTop;break;default:null!==t?(n=_+" "+v,i=m+" "+v,delete o.paddingBottom):(n=m+" "+v,i=_+" "+v,delete o.paddingTop)}r._popupOrigin=n,r._popupPosition=i,r._popupPaddings=o},_attachPopupEvents:function(e,t){function n(e){e.on(s+b,function(){t.close()})}var i,r=e.allowHideAfter,o=!isNaN(r)&&r>0;e.hideOnClick?t.bind("activate",function(){o?a(function(){n(t.element)},r):n(t.element)}):e.button&&(i=t.element.find(u),o?a(function(){n(i)},r):n(i))},_showPopup:function(t,i){var r,s,l=this,c=i.autoHideAfter,d=i.position.left,h=i.position.top;s=e("."+l._guid).last(),r=new n.ui.Popup(t,{anchor:s[0]?s:document.body,origin:l._popupOrigin,position:l._popupPosition,animation:i.animation,modal:!0,collision:"",isRtl:l._isRtl,close:function(){l._triggerHide(this.element)},deactivate:function(e){e.sender.element.off(b),e.sender.element.find(u).off(b),e.sender.destroy()}}),l._attachPopupEvents(i,r),s[0]?r.open():(null===d&&(d=e(window).width()-t.width()-i.position.right),null===h&&(h=e(window).height()-t.height()-i.position.bottom),r.open(d,h)),r.wrapper.addClass(l._guid).css(o({margin:0},l._popupPaddings)),i.position.pinned?(r.wrapper.css("position","fixed"),s[0]&&l._togglePin(r.wrapper,!0)):s[0]||l._togglePin(r.wrapper,!1),c>0&&a(function(){r.close()},c)},_togglePin:function(t,n){var i=e(window),r=n?-1:1;t.css({top:parseInt(t.css(m),10)+r*i.scrollTop(),left:parseInt(t.css(v),10)+r*i.scrollLeft()})},_attachStaticEvents:function(e,t){function n(e){e.on(s+b,r(i._hideStatic,i,t))}var i=this,o=e.allowHideAfter,l=!isNaN(o)&&o>0;e.hideOnClick?l?a(function(){n(t)},o):n(t):e.button&&(l?a(function(){n(t.find(u))},o):n(t.find(u)))},_showStatic:function(e,t){var n=this,i=t.autoHideAfter,r=t.animation,o=t.stacking==y||t.stacking==v?"prependTo":"appendTo";e.addClass(n._guid)[o](t.appendTo).hide().kendoAnimate(r.open||!1),n._attachStaticEvents(t,e),i>0&&a(function(){n._hideStatic(e)},i)},_hideStatic:function(e){e.kendoAnimate(o(this.options.animation.close||!1,{complete:function(){e.off(b).find(u).off(b),e.remove()}})),this._triggerHide(e)},_triggerHide:function(e){this.trigger(c,{element:e}),this.angular("cleanup",function(){return{elements:e}})},show:function(i,r){var a,s,c=this,u=c.options,p=e(k);return r||(r=h),null!==i&&i!==t&&""!==i&&(n.isFunction(i)&&(i=i()),s={typeIcon:r,content:""},a=e.isPlainObject(i)?o(s,i):o(s,{content:i}),p.addClass(d+"-"+r).toggleClass(d+"-button",u.button).attr("data-role","alert").css({width:u.width,height:u.height}).append(c._getCompiled(r)(a)),c.angular("compile",function(){return{elements:p,data:[{dataItem:a}]}}),e(u.appendTo)[0]?c._showStatic(p,u):c._showPopup(p,u),c.trigger(l,{element:p})),c},info:function(e){return this.show(e,h)},success:function(e){return this.show(e,p)},warning:function(e){return this.show(e,f)},error:function(e){return this.show(e,g)},hide:function(){var t=this,n=t.getNotifications();return n.each(t.options.appendTo?function(n,i){t._hideStatic(e(i))}:function(t,n){var i=e(n).data("kendoPopup");i&&i.close()}),t},getNotifications:function(){var t=this,n=e("."+t._guid);return t.options.appendTo?n:n.children("."+d)},setOptions:function(e){var n,r=this;i.fn.setOptions.call(r,e),n=r.options,e.templates!==t&&r._compileTemplates(n.templates),(e.stacking!==t||e.position!==t)&&r._compileStacking(n.stacking,n.position.top)},destroy:function(){i.fn.destroy.call(this),this.getNotifications().off(b).find(u).off(b)}});n.ui.plugin(C)}(window.kendo.jQuery),function(e){function t(e){for(;e.length;)n(e),e=e.parent()}function n(e){var t=e.data(o.ns+"title");t&&(e.attr("title",t),e.removeData(o.ns+"title"))}function i(e){var t=e.attr("title");t&&(e.data(o.ns+"title",t),e.attr("title",""))}function r(e){for(;e.length&&!e.is("body");)i(e),e=e.parent()}var o=window.kendo,a=o.ui.Widget,s=o.ui.Popup,l=o.isFunction,c=e.isPlainObject,d=e.extend,u=e.proxy,h=e(document),p=o.isLocalUrl,f="_tt_active",g="aria-describedby",m="show",v="hide",_="error",w="contentLoad",y="requestStart",b="k-content-frame",k='<div role="tooltip" class="k-widget k-tooltip#if (!autoHide) {# k-tooltip-closable#}#">#if (!autoHide) {# <div class="k-tooltip-button"><a href="\\#" class="k-icon k-i-close">close</a></div> #}#<div class="k-tooltip-content"></div>#if (callout){ #<div class="k-callout k-callout-#=dir#"></div>#}#</div>',x=o.template("<iframe frameborder='0' class='"+b+"' src='#= content.url #'>This page requires frames in order to show content</iframe>"),C=".kendoTooltip",T={bottom:{origin:"bottom center",position:"top center"},top:{origin:"top center",position:"bottom center"},left:{origin:"center left",position:"center right",collision:"fit flip"},right:{origin:"center right",position:"center left",collision:"fit flip"},center:{position:"center center",origin:"center center"}},S={top:"bottom",bottom:"top",left:"right",right:"left",center:"center"},D={bottom:"n",top:"s",left:"e",right:"w",center:"n"},A={horizontal:{offset:"top",size:"outerHeight"},vertical:{offset:"left",size:"outerWidth"}},E=function(e){return e.target.data(o.ns+"title")},I=a.extend({init:function(e,t){var n,i=this;a.fn.init.call(i,e,t),n=i.options.position.match(/left|right/)?"horizontal":"vertical",i.dimensions=A[n],i._documentKeyDownHandler=u(i._documentKeyDown,i),i.element.on(i.options.showOn+C,i.options.filter,u(i._showOn,i)).on("mouseenter"+C,i.options.filter,u(i._mouseenter,i)),this.options.autoHide&&i.element.on("mouseleave"+C,i.options.filter,u(i._mouseleave,i))},options:{name:"Tooltip",filter:"",content:E,showAfter:100,callout:!0,position:"bottom",showOn:"mouseenter",autoHide:!0,width:null,height:null,animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:40,hide:!0}}},events:[m,v,w,_,y],_mouseenter:function(t){r(e(t.currentTarget))},_showOn:function(t){var n=this,i=e(t.currentTarget);n.options.showOn&&n.options.showOn.match(/click|focus/)?n._show(i):(clearTimeout(n.timeout),n.timeout=setTimeout(function(){n._show(i)},n.options.showAfter))},_appendContent:function(e){var t,n=this,i=n.options.content,r=n.content,a=n.options.iframe;c(i)&&i.url?("iframe"in n.options||(a=!p(i.url)),n.trigger(y,{options:i,target:e}),a?(r.hide(),t=r.find("."+b)[0],t?t.src=i.url||t.src:r.html(x({content:i})),r.find("."+b).off("load"+C).on("load"+C,function(){n.trigger(w),r.show()})):(r.empty(),o.ui.progress(r,!0),n._ajaxRequest(i))):i&&l(i)?(i=i({sender:this,target:e}),r.html(i||"")):r.html(i),n.angular("compile",function(){return{elements:r}})},_ajaxRequest:function(e){var t=this;jQuery.ajax(d({type:"GET",dataType:"html",cache:!1,error:function(e,n){o.ui.progress(t.content,!1),t.trigger(_,{status:n,xhr:e})},success:u(function(e){o.ui.progress(t.content,!1),t.content.html(e),t.trigger(w)},t)},e))},_documentKeyDown:function(e){e.keyCode===o.keys.ESC&&this.hide()},refresh:function(){var e=this,t=e.popup;t&&t.options.anchor&&e._appendContent(t.options.anchor)},hide:function(){this.popup&&this.popup.close()},show:function(e){e=e||this.element,r(e),this._show(e)},_show:function(e){var n=this,i=n.target();n.popup||n._initPopup(),i&&i[0]!=e[0]&&(n.popup.close(),n.popup.element.kendoStop(!0,!0)),i&&i[0]==e[0]||(n._appendContent(e),n.popup.options.anchor=e),n.popup.one("deactivate",function(){t(e),e.removeAttr(g),this.element.removeAttr("id").attr("aria-hidden",!0),h.off("keydown"+C,n._documentKeyDownHandler)}),n.popup.open()},_initPopup:function(){var t=this,n=t.options,i=e(o.template(k)({callout:n.callout&&"center"!==n.position,dir:D[n.position],autoHide:n.autoHide}));t.popup=new s(i,d({activate:function(){var e=this.options.anchor,i=e[0].id||t.element[0].id;i&&(e.attr(g,i+f),this.element.attr("id",i+f)),n.callout&&t._positionCallout(),this.element.removeAttr("aria-hidden"),h.on("keydown"+C,t._documentKeyDownHandler),t.trigger(m)},close:function(){t.trigger(v)},copyAnchorStyles:!1,animation:n.animation},T[n.position])),i.css({width:n.width,height:n.height}),t.content=i.find(".k-tooltip-content"),t.arrow=i.find(".k-callout"),n.autoHide?i.on("mouseleave"+C,u(t._mouseleave,t)):i.on("click"+C,".k-tooltip-button",u(t._closeButtonClick,t))},_closeButtonClick:function(e){e.preventDefault(),this.hide()},_mouseleave:function(n){if(this.popup){var i=e(n.currentTarget),r=i.offset(),o=n.pageX,a=n.pageY;if(r.right=r.left+i.outerWidth(),r.bottom=r.top+i.outerHeight(),o>r.left&&r.right>o&&a>r.top&&r.bottom>a)return;this.popup.close()}else t(e(n.currentTarget));clearTimeout(this.timeout)},_positionCallout:function(){var t=this,n=t.options.position,i=t.dimensions,r=i.offset,o=t.popup,a=o.options.anchor,s=e(a).offset(),l=parseInt(t.arrow.css("border-top-width"),10),c=e(o.element).offset(),d=D[o.flipped?S[n]:n],u=s[r]-c[r]+e(a)[i.size]()/2-l;t.arrow.removeClass("k-callout-n k-callout-s k-callout-w k-callout-e").addClass("k-callout-"+d).css(r,u)},target:function(){return this.popup?this.popup.options.anchor:null},destroy:function(){var e=this.popup;e&&(e.element.off(C),e.destroy()),this.element.off(C),h.off("keydown"+C,this._documentKeyDownHandler),a.fn.destroy.call(this)}});o.ui.plugin(I)}(window.kendo.jQuery),function(e,t){function n(t,i){var r,o=!1;return t.filters&&(r=e.grep(t.filters,function(e){return o=n(e,i),e.filters?e.filters.length:e.field!=i}),o||t.filters.length===r.length||(o=!0),t.filters=r),o}var i=window.kendo,r=i.ui,o=r.Widget,a=i.keys,s=i.support,l=i.htmlEncode,c=i._activeElement,d="id",u="li",h="change",p="k-state-focused",f="k-state-hover",g="k-loading",m="open",v="close",_="select",w="selected",y="progress",b="requestEnd",k="width",x=e.extend,C=e.proxy,T=s.browser,S=T.msie&&9>T.version,D=/"/g,A={ComboBox:"DropDownList",DropDownList:"ComboBox"},E=i.ui.DataBoundWidget.extend({init:function(t,n){var i,r=this,a=r.ns;o.fn.init.call(r,t,n),t=r.element,r._isSelect=t.is(_),r._template(),r.ul=e('<ul unselectable="on" class="k-list k-reset"/>').css({overflow:s.kineticScrollNeeded?"":"auto"}).on("mouseenter"+a,u,function(){e(this).addClass(f)}).on("mouseleave"+a,u,function(){e(this).removeClass(f)}).on("click"+a,u,C(r._click,r)).attr({tabIndex:-1,role:"listbox","aria-hidden":!0}),r.list=e("<div class='k-list-container'/>").append(r.ul).on("mousedown"+a,C(r._listMousedown,r)),i=t.attr(d),i&&(r.list.attr(d,i+"-list"),r.ul.attr(d,i+"_listbox"),r._optionID=i+"_option_selected"),r._header(),r._accessors(),r._initValue()},options:{valuePrimitive:!1,headerTemplate:""},setOptions:function(e){o.fn.setOptions.call(this,e),e&&e.enable!==t&&(e.enabled=e.enable)},focus:function(){this._focused.focus()},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},_listMousedown:function(e){this.filterInput&&this.filterInput[0]===e.target||e.preventDefault()},_filterSource:function(e,t){var i=this,r=i.options,o=i.dataSource,a=x({},o.filter()||{}),s=n(a,r.dataTextField);(e||s)&&i.trigger("filtering",{filter:e})||(e&&(a=a.filters||[],a.push(e)),t?o.read(a):o.filter(a))},_header:function(){var t,n=this,i=n.options.headerTemplate;e.isFunction(i)&&(i=i({})),i&&(n.list.prepend(i),t=n.ul.prev(),n.header=t[0]?t:null,n.header&&n.angular("compile",function(){return{elements:n.header}}))},_initValue:function(){var e=this,t=e.options.value;null!==t?e.element.val(t):(t=e._accessor(),e.options.value=t),e._old=t},_ignoreCase:function(){var e,t=this,n=t.dataSource.reader.model;n&&n.fields&&(e=n.fields[t.options.dataTextField],e&&e.type&&"string"!==e.type&&(t.options.ignoreCase=!1))},items:function(){return this.ul[0].children},current:function(e){var n=this,i=n._focused.add(n.filterInput),r=n._optionID;return e===t?n._current:(n._current&&(n._current.removeClass(p).removeAttr("aria-selected").removeAttr(d),i.removeAttr("aria-activedescendant")),e&&(e.addClass(p),n._scroll(e),r&&(e.attr("id",r),i.attr("aria-activedescendant",r))),n._current=e,t)},destroy:function(){var e=this,t=e.ns;o.fn.destroy.call(e),e._unbindDataSource(),e.ul.off(t),e.list.off(t),e._touchScroller&&e._touchScroller.destroy(),e.popup.destroy(),e._form&&e._form.off("reset",e._resetHandler)},dataItem:function(n){var i=this;return n===t?n=i.selectedIndex:"number"!=typeof n&&(n=e(i.items()).index(n)),i._data()[n]},_accessors:function(){var e=this,t=e.element,n=e.options,r=i.getter,o=t.attr(i.attr("text-field")),a=t.attr(i.attr("value-field"));!n.dataTextField&&o&&(n.dataTextField=o),!n.dataValueField&&a&&(n.dataValueField=a),e._text=r(n.dataTextField),e._value=r(n.dataValueField)},_aria:function(e){var n=this,i=n.options,r=n._focused.add(n.filterInput);i.suggest!==t&&r.attr("aria-autocomplete",i.suggest?"both":"list"),e=e?e+" "+n.ul[0].id:n.ul[0].id,r.attr("aria-owns",e),n.ul.attr("aria-live",i.filter&&"none"!==i.filter?"polite":"off")},_blur:function(){var e=this;e._change(),e.close()},_change:function(){var e,n=this,i=n.selectedIndex,r=n.options.value,o=n.value();n._isSelect&&!n._bound&&r&&(o=r),o!==n._old?e=!0:i!==t&&i!==n._oldIndex&&(e=!0),e&&(n._old=o,n._oldIndex=i,n.element.trigger(h),n.trigger(h))},_click:function(t){t.isDefaultPrevented()||this._accept(e(t.currentTarget))},_data:function(){return this.dataSource.view()},_enable:function(){var e=this,n=e.options,i=e.element.is("[disabled]");n.enable!==t&&(n.enabled=n.enable),!n.enabled||i?e.enable(!1):e.readonly(e.element.is("[readonly]"))},_focus:function(e){var n=this,i=!0;return n.popup.visible()&&e&&n.trigger(_,{item:e})?(n.close(),t):(n._select(e),n._triggerCascade(i),n._blur(),t)},_index:function(e){var t,n,i=this,r=i._data();for(t=0,n=r.length;n>t;t++)if(i._dataValue(r[t])==e)return t;return-1},_dataValue:function(e){var n=this._value(e);return n===t&&(n=this._text(e)),n},_height:function(e){if(e){var t,n,i=this,r=i.list,o=i.options.height,a=i.popup.visible();n=r.add(r.parent(".k-animation-container")).show(),o=i.ul[0].scrollHeight>o?o:"auto",n.height(o),"auto"!==o&&(t=i.ul[0].offsetTop,t&&(o=r.height()-t)),i.ul.height(o),a||n.hide()}},_adjustListWidth:function(){var e,t,n=this.list,i=n[0].style.width,r=this.wrapper;if(n.data(k)||!i)return e=window.getComputedStyle?window.getComputedStyle(r[0],null):0,t=e?parseFloat(e.width):r.outerWidth(),e&&T.msie&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),i="border-box"!==n.css("box-sizing")?t-(n.outerWidth()-n.width()):t,n.css({fontFamily:r.css("font-family"),width:i}).data(k,i),!0},_openHandler:function(e){this._adjustListWidth(),this.trigger(m)?e.preventDefault():(this._focused.attr("aria-expanded",!0),this.ul.attr("aria-hidden",!1))},_closeHandler:function(e){this.trigger(v)?e.preventDefault():(this._focused.attr("aria-expanded",!1),this.ul.attr("aria-hidden",!0))},_firstOpen:function(){this._height(this._data().length)},_popup:function(){var e=this;e.popup=new r.Popup(e.list,x({},e.options.popup,{anchor:e.wrapper,open:C(e._openHandler,e),close:C(e._closeHandler,e),animation:e.options.animation,isRtl:s.isRtl(e.wrapper)})),e.popup.one(m,C(e._firstOpen,e)),e._touchScroller=i.touchScroller(e.popup.element)},_makeUnselectable:function(){S&&this.list.find("*").not(".k-textbox").attr("unselectable","on")},_toggleHover:function(t){e(t.currentTarget).toggleClass(f,"mouseenter"===t.type)},_toggle:function(e,n){var i=this,r=s.touch&&s.MSPointers&&s.pointers;e=e!==t?e:!i.popup.visible(),n||r||i._focused[0]===c()||i._focused.focus(),i[e?m:v]()},_scroll:function(e){if(e){e[0]&&(e=e[0]);var t,n,i=this.ul[0],r=e.offsetTop,o=e.offsetHeight,a=i.scrollTop,s=i.clientHeight,l=r+o,c=this._touchScroller;c?(t=c.dimensions.y,t.enabled&&r>t.size&&(r=r-t.size+o+4,c.scrollTo(0,-r))):(n=this.header?this.header.outerHeight():0,n+=this.filterInput?this.filterInput.outerHeight():0,i.scrollTop=a>r?r-n:l>a+s?l-s-n:a)}},_template:function(){var e=this,t=e.options,n=t.template,r=t.dataSource;e._isSelect&&e.element[0].length&&(r||(t.dataTextField=t.dataTextField||"text",t.dataValueField=t.dataValueField||"value")),n?(n=i.template(n),e.template=function(e){return'<li tabindex="-1" role="option" unselectable="on" class="k-item">'+n(e)+"</li>"}):e.template=i.template('<li tabindex="-1" role="option" unselectable="on" class="k-item">${'+i.expr(t.dataTextField,"data")+"}</li>",{useWithBlock:!1})},_triggerCascade:function(e){var t=this,n=t.value();(!t._bound&&n||t._old!==n)&&t.trigger("cascade",{userTriggered:e})},_unbindDataSource:function(){var e=this;e.dataSource.unbind(h,e._refreshHandler).unbind(y,e._progressHandler).unbind(b,e._requestEndHandler).unbind("error",e._errorHandler)}});x(E,{inArray:function(e,t){var n,i,r=t.children;if(!e||e.parentNode!==t)return-1;for(n=0,i=r.length;i>n;n++)if(e===r[n])return n;return-1}}),i.ui.List=E,r.Select=E.extend({init:function(e,t){E.fn.init.call(this,e,t),this._initial=this.element.val()},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this._bound=!1,this.options.autoBind&&this.dataSource.fetch()},close:function(){this.popup.close()},select:function(e){var n=this;return e===t?n.selectedIndex:(n._select(e),n._triggerCascade(),n._old=n._accessor(),n._oldIndex=n.selectedIndex,t)},search:function(e){var t,n,i,r,o,a;e="string"==typeof e?e:this.text(),t=this,n=e.length,i=t.options,r=i.ignoreCase,o=i.filter,a=i.dataTextField,clearTimeout(t._typing),(!n||n>=i.minLength)&&(t._state="filter","none"===o?t._filter(e):(t._open=!0,t._filterSource({value:r?e.toLowerCase():e,field:a,operator:o,ignoreCase:r})))},_accessor:function(e,n){var i,r=this.element[0],o=this._isSelect,a=r.selectedIndex;return e===t?(o?a>-1&&(i=r.options[a],i&&(e=i.value)):e=r.value,e):(o?(a>-1&&r.options[a].removeAttribute(w),r.selectedIndex=n,i=r.options[n],i&&i.setAttribute(w,w)):r.value=e,t)},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._arrow.removeClass(g),e._focused.attr("aria-busy",!1),e._busy=null},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(function(){e._arrow&&(e._focused.attr("aria-busy",!0),e._arrow.addClass(g))},100))},_requestEnd:function(){this._request=!1},_dataSource:function(){var t,n=this,r=n.element,o=n.options,a=o.dataSource||{};a=e.isArray(a)?{data:a}:a,n._isSelect&&(t=r[0].selectedIndex,t>-1&&(o.index=t),a.select=r,a.fields=[{field:o.dataTextField},{field:o.dataValueField}]),n.dataSource&&n._refreshHandler?n._unbindDataSource():(n._refreshHandler=C(n.refresh,n),n._progressHandler=C(n._showBusy,n),n._requestEndHandler=C(n._requestEnd,n),n._errorHandler=C(n._hideBusy,n)),n.dataSource=i.data.DataSource.create(a).bind(h,n._refreshHandler).bind(y,n._progressHandler).bind(b,n._requestEndHandler).bind("error",n._errorHandler)},_get:function(t){var n,i,r=this,o=r._data();if("function"==typeof t)for(n=0,i=o.length;i>n;n++)if(t(o[n])){t=n;break}if("number"==typeof t){if(0>t)return e();t=e(r.ul[0].children[t])}return t&&t.nodeType&&(t=e(t)),t},_move:function(e){var t,n,i=this,r=e.keyCode,o=i.ul[0],s=i.popup.visible()?"_select":"_accept",l=i._current,c=r===a.DOWN;if(r===a.UP||c){if(e.altKey)i.toggle(c);else{if(t=o.firstChild,!t&&!i._accessor()&&"filter"!==i._state)return i._fetch||(i.dataSource.one(h,function(){i._move(e),i._fetch=!1}),i._fetch=!0,i._filterSource()),e.preventDefault(),!0;c?(!l||-1===i.selectedIndex&&!i.value()&&l[0]===t?l=t:(l=l[0].nextSibling,l||t!==o.lastChild||(l=t)),i[s](l)):(l=l?l[0].previousSibling:o.lastChild,l||t!==o.lastChild||(l=t),i[s](l))}e.preventDefault(),n=!0}else r===a.ENTER||r===a.TAB?(i.popup.visible()&&e.preventDefault(),i.popup.visible()||l&&l.hasClass("k-state-selected")||(l=null),i._accept(l,r),n=!0):r===a.ESC&&(i.popup.visible()&&e.preventDefault(),i.close(),n=!0);return n},_selectItem:function(){var e,n,i=this,r=i._bound===t,o=i.options;e=i._isSelect&&!i._initial&&!o.value&&o.index&&!i._bound,e||(n=i._selectedValue||r&&o.value||i._accessor()),n?i.value(n):r&&i.select(o.index)},_fetchItems:function(e){var n=this,i=n.ul[0].firstChild;return n._request?!0:n._bound||n._fetch||i?t:n.options.cascadeFrom?!i:(n.dataSource.one(h,function(){n._old=t,n.value(e),n._fetch=!1}),n._fetch=!0,n.dataSource.fetch(),!0)},_options:function(e,n){var i,r,o,a,s=this,c=s.element,d=e.length,u="",h=0;for(n&&(h=1,u=n);d>h;h++)i="<option",r=e[h],o=s._text(r),a=s._value(r),a!==t&&(a+="",-1!==a.indexOf('"')&&(a=a.replace(D,"&quot;")),i+=' value="'+a+'"'),i+=">",o!==t&&(i+=l(o)),i+="</option>",u+=i;c.html(u)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initial)})},t._form=r.on("reset",t._resetHandler))},_cascade:function(){var t,i,r,o,a,s=this,l=s.options,c=l.cascadeFrom;if(c){if(s._selectedValue=l.value||s._accessor(),i=e("#"+c),t=i.data("kendo"+l.name),t||(t=i.data("kendo"+A[l.name])),!t)return;l.autoBind=!1,o=l.cascadeFromField||t.options.dataValueField,a=function(){s.dataSource.unbind(h,a);var e=s._selectedValue||s.value();s._userTriggered?s._clearSelection(t,!0):e?(s.value(e),s.dataSource.view()[0]&&-1!==s.selectedIndex||s._clearSelection(t,!0)):s.select(l.index),s.enable(),s._triggerCascade(s._userTriggered),s._userTriggered=!1},r=function(){var e,i,r,l=t.dataItem(),c=l?t._value(l):null;c||0===c?(e=s.dataSource.filter()||{},n(e,o),i=e.filters||[],i.push({field:o,operator:"eq",value:c}),r=function(){s.unbind("dataBound",r),a.apply(s,arguments)
},s.first("dataBound",r),s.dataSource.filter(i)):(s.enable(!1),s._clearSelection(t),s._triggerCascade(s._userTriggered),s._userTriggered=!1)},t.first("cascade",function(e){s._userTriggered=e.userTriggered,r()}),t._bound?r():t.value()||s.enable(!1)}}})}(window.kendo.jQuery),function(e,t){function n(e,t,n,i){var r,o=e.getFullYear(),a=t.getFullYear(),s=n.getFullYear();return o-=o%i,r=o+(i-1),a>o&&(o=a),r>s&&(r=s),o+"-"+r}function i(e){for(var t,n=0,i=e.min,r=e.max,o=e.start,a=e.setter,l=e.build,c=e.cells||12,d=e.perRow||4,u=e.content||P,h=e.empty||M,p=e.html||'<table tabindex="0" role="grid" class="k-content k-meta-view" cellspacing="0"><tbody><tr role="row">';c>n;n++)n>0&&n%d===0&&(p+='</tr><tr role="row">'),t=l(o,n),p+=s(o,i,r)?u(t):h(t),a(o,1);return p+"</tr></tbody></table>"}function r(e,t,n){var i=e.getFullYear(),r=t.getFullYear(),o=r,a=0;return n&&(r-=r%n,o=r-r%n+n-1),i>o?a=1:r>i&&(a=-1),a}function o(){var e=new ft;return new ft(e.getFullYear(),e.getMonth(),e.getDate())}function a(e,t,n){var i=o();return e&&(i=new ft(+e)),t>i?i=new ft(+t):i>n&&(i=new ft(+n)),i}function s(e,t,n){return+e>=+t&&+n>=+e}function l(e,t){return e.slice(t).concat(e.slice(0,t))}function c(e,t,n){t=t instanceof ft?t.getFullYear():e.getFullYear()+n*t,e.setFullYear(t)}function d(t){e(this).toggleClass($,it.indexOf(t.type)>-1||t.type==tt)}function u(e){e.preventDefault()}function h(e){return A(e).calendars.standard}function p(e){var n=gt[e.start],i=gt[e.depth],r=A(e.culture);e.format=S(e.format||r.calendars.standard.patterns.d),isNaN(n)&&(n=0,e.start=U),(i===t||i>n)&&(e.depth=U),e.dates||(e.dates=[])}function f(e){z&&e.find("*").attr("unselectable","on")}function g(e,t){for(var n=0,i=t.length;i>n;n++)if(e===+t[n])return!0;return!1}function m(e,t){return e?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate():!1}function v(e,t){return e?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth():!1}var _,w=window.kendo,y=w.support,b=w.ui,k=b.Widget,x=w.keys,C=w.parseDate,T=w.date.adjustDST,S=w._extractFormat,D=w.template,A=w.getCulture,E=w.support.transitions,I=E?E.css+"transform-origin":"",P=D('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link" href="\\#" data-#=data.ns#value="#=data.dateString#">#=data.value#</a></td>',{useWithBlock:!1}),M=D('<td role="gridcell">&nbsp;</td>',{useWithBlock:!1}),F=w.support.browser,z=F.msie&&9>F.version,R=".kendoCalendar",B="click"+R,H="keydown"+R,L="id",N="min",O="left",V="slideIn",U="month",W="century",j="change",q="navigate",G="value",$="k-state-hover",Y="k-state-disabled",Q="k-state-focused",K="k-other-month",X=' class="'+K+'"',Z="k-nav-today",J="td:has(.k-link)",et="blur"+R,tt="focus",nt=tt+R,it=y.touch?"touchstart":"mouseenter",rt=y.touch?"touchstart"+R:"mouseenter"+R,ot=y.touch?"touchend"+R+" touchmove"+R:"mouseleave"+R,at=6e4,st=864e5,lt="_prevArrow",ct="_nextArrow",dt="aria-disabled",ut="aria-selected",ht=e.proxy,pt=e.extend,ft=Date,gt={month:0,year:1,decade:2,century:3},mt=k.extend({init:function(t,n){var i,r,o=this;k.fn.init.call(o,t,n),t=o.wrapper=o.element,n=o.options,n.url=window.unescape(n.url),o._templates(),o._header(),o._footer(o.footer),r=t.addClass("k-widget k-calendar").on(rt+" "+ot,J,d).on(H,"table.k-content",ht(o._move,o)).on(B,J,function(t){var n=t.currentTarget.firstChild;-1!=n.href.indexOf("#")&&t.preventDefault(),o._click(e(n))}).on("mouseup"+R,"table.k-content, .k-footer",function(){o._focusView(o.options.focusOnNav!==!1)}).attr(L),r&&(o._cellID=r+"_cell_selected"),p(n),i=C(n.value,n.format,n.culture),o._index=gt[n.start],o._current=new ft(+a(i,n.min,n.max)),o._addClassProxy=function(){o._active=!0,o._cell.addClass(Q)},o._removeClassProxy=function(){o._active=!1,o._cell.removeClass(Q)},o.value(i),w.notify(o)},options:{name:"Calendar",value:null,min:new ft(1900,0,1),max:new ft(2099,11,31),dates:[],url:"",culture:"",footer:"",format:"",month:{},start:U,depth:U,animation:{horizontal:{effects:V,reverse:!0,duration:500,divisor:2},vertical:{effects:"zoomIn",duration:400}}},events:[j,q],setOptions:function(e){var t=this;p(e),e.dates[0]||(e.dates=t.options.dates),k.fn.setOptions.call(t,e),t._templates(),t._footer(t.footer),t._index=gt[t.options.start],t.navigate()},destroy:function(){var e=this,t=e._today;e.element.off(R),e._title.off(R),e[lt].off(R),e[ct].off(R),w.destroy(e._table),t&&w.destroy(t.off(R)),k.fn.destroy.call(e)},current:function(){return this._current},view:function(){return this._view},focus:function(e){e=e||this._table,this._bindTable(e),e.focus()},min:function(e){return this._option(N,e)},max:function(e){return this._option("max",e)},navigateToPast:function(){this._navigate(lt,-1)},navigateToFuture:function(){this._navigate(ct,1)},navigateUp:function(){var e=this,t=e._index;e._title.hasClass(Y)||e.navigate(e._current,++t)},navigateDown:function(e){var n=this,i=n._index,r=n.options.depth;if(e)return i===gt[r]?(+n._value!=+e&&(n.value(e),n.trigger(j)),t):(n.navigate(e,--i),t)},navigate:function(n,i){i=isNaN(i)?gt[i]:i;var r,o,s,l,c=this,d=c.options,u=d.culture,h=d.min,p=d.max,g=c._title,m=c._table,v=c._oldTable,w=c._value,y=c._current,b=n&&+n>+y,k=i!==t&&i!==c._index;n||(n=y),c._current=n=new ft(+a(n,h,p)),i===t?i=c._index:c._index=i,c._view=o=_.views[i],s=o.compare,l=i===gt[W],g.toggleClass(Y,l).attr(dt,l),l=s(n,h)<1,c[lt].toggleClass(Y,l).attr(dt,l),l=s(n,p)>-1,c[ct].toggleClass(Y,l).attr(dt,l),m&&v&&v.data("animating")&&(v.kendoStop(!0,!0),m.kendoStop(!0,!0)),c._oldTable=m,(!m||c._changeView)&&(g.html(o.title(n,h,p,u)),c._table=r=e(o.content(pt({min:h,max:p,date:n,url:d.url,dates:d.dates,format:d.format,culture:u},c[o.name]))),f(r),c._animate({from:m,to:r,vertical:k,future:b}),c._focus(n),c.trigger(q)),i===gt[d.depth]&&w&&c._class("k-state-selected",o.toDateString(w)),c._class(Q,o.toDateString(n)),!m&&c._cell&&c._cell.removeClass(Q),c._changeView=!0},value:function(e){var n=this,i=n._view,r=n.options,o=n._view,a=r.min,l=r.max;return e===t?n._value:(e=C(e,r.format,r.culture),null!==e&&(e=new ft(+e),s(e,a,l)||(e=null)),n._value=e,o&&null===e&&n._cell?n._cell.removeClass("k-state-selected"):(n._changeView=!e||i&&0!==i.compare(e,n._current),n.navigate(e)),t)},_move:function(t){var n,i,r,o,s=this,l=s.options,c=t.keyCode,d=s._view,u=s._index,h=new ft(+s._current),p=w.support.isRtl(s.wrapper);return t.target===s._table[0]&&(s._active=!0),t.ctrlKey?c==x.RIGHT&&!p||c==x.LEFT&&p?(s.navigateToFuture(),i=!0):c==x.LEFT&&!p||c==x.RIGHT&&p?(s.navigateToPast(),i=!0):c==x.UP?(s.navigateUp(),i=!0):c==x.DOWN&&(s._click(e(s._cell[0].firstChild)),i=!0):(c==x.RIGHT&&!p||c==x.LEFT&&p?(n=1,i=!0):c==x.LEFT&&!p||c==x.RIGHT&&p?(n=-1,i=!0):c==x.UP?(n=0===u?-7:-4,i=!0):c==x.DOWN?(n=0===u?7:4,i=!0):c==x.ENTER?(s._click(e(s._cell[0].firstChild)),i=!0):c==x.HOME||c==x.END?(r=c==x.HOME?"first":"last",o=d[r](h),h=new ft(o.getFullYear(),o.getMonth(),o.getDate(),h.getHours(),h.getMinutes(),h.getSeconds(),h.getMilliseconds()),i=!0):c==x.PAGEUP?(i=!0,s.navigateToPast()):c==x.PAGEDOWN&&(i=!0,s.navigateToFuture()),(n||r)&&(r||d.setDate(h,n),s._focus(a(h,l.min,l.max)))),i&&t.preventDefault(),s._current},_animate:function(e){var t=this,n=e.from,i=e.to,r=t._active;n?n.parent().data("animating")?(n.off(R),n.parent().kendoStop(!0,!0).remove(),n.remove(),i.insertAfter(t.element[0].firstChild),t._focusView(r)):n.is(":visible")&&t.options.animation!==!1?t[e.vertical?"_vertical":"_horizontal"](n,i,e.future):(i.insertAfter(n),n.off(R).remove(),t._focusView(r)):(i.insertAfter(t.element[0].firstChild),t._bindTable(i))},_horizontal:function(e,t,n){var i=this,r=i._active,o=i.options.animation.horizontal,a=o.effects,s=e.outerWidth();a&&-1!=a.indexOf(V)&&(e.add(t).css({width:s}),e.wrap("<div/>"),i._focusView(r,e),e.parent().css({position:"relative",width:2*s,"float":O,"margin-left":n?0:-s}),t[n?"insertAfter":"insertBefore"](e),pt(o,{effects:V+":"+(n?"right":O),complete:function(){e.off(R).remove(),i._oldTable=null,t.unwrap(),i._focusView(r)}}),e.parent().kendoStop(!0,!0).kendoAnimate(o))},_vertical:function(e,t){var n,i,r=this,o=r.options.animation.vertical,a=o.effects,s=r._active;a&&-1!=a.indexOf("zoom")&&(t.css({position:"absolute",top:e.prev().outerHeight(),left:0}).insertBefore(e),I&&(n=r._cellByDate(r._view.toDateString(r._current)),i=n.position(),i=i.left+parseInt(n.width()/2,10)+"px "+(i.top+parseInt(n.height()/2,10)+"px"),t.css(I,i)),e.kendoStop(!0,!0).kendoAnimate({effects:"fadeOut",duration:600,complete:function(){e.off(R).remove(),r._oldTable=null,t.css({position:"static",top:0,left:0}),r._focusView(s)}}),t.kendoStop(!0,!0).kendoAnimate(o))},_cellByDate:function(t){return this._table.find("td:not(."+K+")").filter(function(){return e(this.firstChild).attr(w.attr(G))===t})},_class:function(t,n){var i=this,r=i._cellID,o=i._cell;o&&o.removeAttr(ut).removeAttr("aria-label").removeAttr(L),o=i._table.find("td:not(."+K+")").removeClass(t).filter(function(){return e(this.firstChild).attr(w.attr(G))===n}).attr(ut,!0),t!==Q||i._active||i.options.focusOnNav===!1||(t=""),o.addClass(t),o[0]&&(i._cell=o),r&&(o.attr(L,r),i._table.removeAttr("aria-activedescendant").attr("aria-activedescendant",r))},_bindTable:function(e){e.on(nt,this._addClassProxy).on(et,this._removeClassProxy)},_click:function(e){var t=this,n=t.options,i=new Date(+t._current),r=e.attr(w.attr(G)).split("/");r=new ft(r[0],r[1],r[2]),T(r,0),t._view.setDate(i,r),t.navigateDown(a(i,n.min,n.max))},_focus:function(e){var t=this,n=t._view;0!==n.compare(e,t._current)?t.navigate(e):(t._current=e,t._class(Q,n.toDateString(e)))},_focusView:function(e,t){e&&this.focus(t)},_footer:function(n){var i=this,r=o(),a=i.element,s=a.find(".k-footer");return n?(s[0]||(s=e('<div class="k-footer"><a href="#" class="k-link k-nav-today"></a></div>').appendTo(a)),i._today=s.show().find(".k-link").html(n(r)).attr("title",w.toString(r,"D",i.options.culture)),i._toggle(),t):(i._toggle(!1),s.hide(),t)},_header:function(){var e,t=this,n=t.element;n.find(".k-header")[0]||n.html('<div class="k-header"><a href="#" role="button" class="k-link k-nav-prev"><span class="k-icon k-i-arrow-w"></span></a><a href="#" role="button" aria-live="assertive" aria-atomic="true" class="k-link k-nav-fast"></a><a href="#" role="button" class="k-link k-nav-next"><span class="k-icon k-i-arrow-e"></span></a></div>'),e=n.find(".k-link").on(rt+" "+ot+" "+nt+" "+et,d).click(!1),t._title=e.eq(1).on(B,function(){t._active=t.options.focusOnNav!==!1,t.navigateUp()}),t[lt]=e.eq(0).on(B,function(){t._active=t.options.focusOnNav!==!1,t.navigateToPast()}),t[ct]=e.eq(2).on(B,function(){t._active=t.options.focusOnNav!==!1,t.navigateToFuture()})},_navigate:function(e,t){var n=this,i=n._index+1,r=new ft(+n._current);e=n[e],e.hasClass(Y)||(i>3?r.setFullYear(r.getFullYear()+100*t):_.views[i].setDate(r,t),n.navigate(r))},_option:function(e,n){var i,r=this,o=r.options,a=r._value||r._current;return n===t?o[e]:(n=C(n,o.format,o.culture),n&&(o[e]=new ft(+n),i=e===N?n>a:a>n,(i||v(a,n))&&(i&&(r._value=null),r._changeView=!0),r._changeView||(r._changeView=!(!o.month.content&&!o.month.empty)),r.navigate(r._value),r._toggle()),t)},_toggle:function(e){var n=this,i=n.options,r=n._today;e===t&&(e=s(o(),i.min,i.max)),r&&(r.off(B),e?r.addClass(Z).removeClass(Y).on(B,ht(n._todayClick,n)):r.removeClass(Z).addClass(Y).on(B,u))},_todayClick:function(e){var t=this,n=gt[t.options.depth],i=o();e.preventDefault(),0===t._view.compare(t._current,i)&&t._index==n&&(t._changeView=!1),t._value=i,t.navigate(i,n),t.trigger(j)},_templates:function(){var e=this,t=e.options,n=t.footer,i=t.month,r=i.content,o=i.empty;e.month={content:D('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link#=data.linkClass#" href="#=data.url#" '+w.attr("value")+'="#=data.dateString#" title="#=data.title#">'+(r||"#=data.value#")+"</a></td>",{useWithBlock:!!r}),empty:D('<td role="gridcell">'+(o||"&nbsp;")+"</td>",{useWithBlock:!!o})},e.footer=n!==!1?D(n||'#= kendo.toString(data,"D","'+t.culture+'") #',{useWithBlock:!1}):null}});b.plugin(mt),_={firstDayOfMonth:function(e){return new ft(e.getFullYear(),e.getMonth(),1)},firstVisibleDay:function(e,t){t=t||w.culture().calendar;for(var n=t.firstDay,i=new ft(e.getFullYear(),e.getMonth(),0,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());i.getDay()!=n;)_.setTime(i,-1*st);return i},setTime:function(e,t){var n=e.getTimezoneOffset(),i=new ft(e.getTime()+t),r=i.getTimezoneOffset()-n;e.setTime(i.getTime()+r*at)},views:[{name:U,title:function(e,t,n,i){return h(i).months.names[e.getMonth()]+" "+e.getFullYear()},content:function(e){for(var t=this,n=0,r=e.min,o=e.max,a=e.date,s=e.dates,c=e.format,d=e.culture,u=e.url,p=u&&s[0],f=h(d),m=f.firstDay,v=f.days,y=l(v.names,m),b=l(v.namesShort,m),k=_.firstVisibleDay(a,f),x=t.first(a),C=t.last(a),S=t.toDateString,D=new ft,A='<table tabindex="0" role="grid" class="k-content" cellspacing="0"><thead><tr role="row">';7>n;n++)A+='<th scope="col" title="'+y[n]+'">'+b[n]+"</th>";return D=new ft(D.getFullYear(),D.getMonth(),D.getDate()),T(D,0),D=+D,i({cells:42,perRow:7,html:A+='</tr></thead><tbody><tr role="row">',start:new ft(k.getFullYear(),k.getMonth(),k.getDate()),min:new ft(r.getFullYear(),r.getMonth(),r.getDate()),max:new ft(o.getFullYear(),o.getMonth(),o.getDate()),content:e.content,empty:e.empty,setter:t.setDate,build:function(e){var t=[],n=e.getDay(),i="",r="#";return(x>e||e>C)&&t.push(K),+e===D&&t.push("k-today"),(0===n||6===n)&&t.push("k-weekend"),p&&g(+e,s)&&(r=u.replace("{0}",w.toString(e,c,d)),i=" k-action-link"),{date:e,dates:s,ns:w.ns,title:w.toString(e,"D",d),value:e.getDate(),dateString:S(e),cssClass:t[0]?' class="'+t.join(" ")+'"':"",linkClass:i,url:r}}})},first:function(e){return _.firstDayOfMonth(e)},last:function(e){var t=new ft(e.getFullYear(),e.getMonth()+1,0),n=_.firstDayOfMonth(e),i=Math.abs(t.getTimezoneOffset()-n.getTimezoneOffset());return i&&t.setHours(n.getHours()+i/60),t},compare:function(e,t){var n,i=e.getMonth(),r=e.getFullYear(),o=t.getMonth(),a=t.getFullYear();return n=r>a?1:a>r?-1:i==o?0:i>o?1:-1},setDate:function(e,t){var n=e.getHours();t instanceof ft?e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()):_.setTime(e,t*st),T(e,n)},toDateString:function(e){return e.getFullYear()+"/"+e.getMonth()+"/"+e.getDate()}},{name:"year",title:function(e){return e.getFullYear()},content:function(e){var t=h(e.culture).months.namesAbbr,n=this.toDateString,r=e.min,o=e.max;return i({min:new ft(r.getFullYear(),r.getMonth(),1),max:new ft(o.getFullYear(),o.getMonth(),1),start:new ft(e.date.getFullYear(),0,1),setter:this.setDate,build:function(e){return{value:t[e.getMonth()],ns:w.ns,dateString:n(e),cssClass:""}}})},first:function(e){return new ft(e.getFullYear(),0,e.getDate())},last:function(e){return new ft(e.getFullYear(),11,e.getDate())},compare:function(e,t){return r(e,t)},setDate:function(e,t){var n,i=e.getHours();t instanceof ft?(n=t.getMonth(),e.setFullYear(t.getFullYear(),n,e.getDate()),n!==e.getMonth()&&e.setDate(0)):(n=e.getMonth()+t,e.setMonth(n),n>11&&(n-=12),n>0&&e.getMonth()!=n&&e.setDate(0)),T(e,i)},toDateString:function(e){return e.getFullYear()+"/"+e.getMonth()+"/1"}},{name:"decade",title:function(e,t,i){return n(e,t,i,10)},content:function(e){var t=e.date.getFullYear(),n=this.toDateString;return i({start:new ft(t-t%10-1,0,1),min:new ft(e.min.getFullYear(),0,1),max:new ft(e.max.getFullYear(),0,1),setter:this.setDate,build:function(e,t){return{value:e.getFullYear(),ns:w.ns,dateString:n(e),cssClass:0===t||11==t?X:""}}})},first:function(e){var t=e.getFullYear();return new ft(t-t%10,e.getMonth(),e.getDate())},last:function(e){var t=e.getFullYear();return new ft(t-t%10+9,e.getMonth(),e.getDate())},compare:function(e,t){return r(e,t,10)},setDate:function(e,t){c(e,t,1)},toDateString:function(e){return e.getFullYear()+"/0/1"}},{name:W,title:function(e,t,i){return n(e,t,i,100)},content:function(e){var t=e.date.getFullYear(),n=e.min.getFullYear(),r=e.max.getFullYear(),o=this.toDateString,a=n,s=r;return a-=a%10,s-=s%10,10>s-a&&(s=a+9),i({start:new ft(t-t%100-10,0,1),min:new ft(a,0,1),max:new ft(s,0,1),setter:this.setDate,build:function(e,t){var i=e.getFullYear(),a=i+9;return n>i&&(i=n),a>r&&(a=r),{ns:w.ns,value:i+" - "+a,dateString:o(e),cssClass:0===t||11==t?X:""}}})},first:function(e){var t=e.getFullYear();return new ft(t-t%100,e.getMonth(),e.getDate())},last:function(e){var t=e.getFullYear();return new ft(t-t%100+99,e.getMonth(),e.getDate())},compare:function(e,t){return r(e,t,100)},setDate:function(e,t){c(e,t,10)},toDateString:function(e){var t=e.getFullYear();return t-t%10+"/0/1"}}]},_.isEqualDatePart=m,_.makeUnselectable=f,_.restrictValue=a,_.isInRange=s,_.normalize=p,_.viewsEnum=gt,w.calendar=_}(window.kendo.jQuery),function(e,t){function n(t){var n=t.parseFormats,i=t.format;B.normalize(t),n=e.isArray(n)?n:[n],-1===e.inArray(i,n)&&n.splice(0,0,t.format),t.parseFormats=n}function i(e){e.preventDefault()}var r,o=window.kendo,a=o.ui,s=a.Widget,l=o.parseDate,c=o.keys,d=o.template,u=o._activeElement,h="<div />",p="<span />",f=".kendoDatePicker",g="click"+f,m="open",v="close",_="change",w="disabled",y="readonly",b="k-state-default",k="k-state-focused",x="k-state-selected",C="k-state-disabled",T="k-state-hover",S="mouseenter"+f+" mouseleave"+f,D="mousedown"+f,A="id",E="min",I="max",P="month",M="aria-disabled",F="aria-expanded",z="aria-hidden",R="aria-readonly",B=o.calendar,H=B.isInRange,L=B.restrictValue,N=B.isEqualDatePart,O=e.extend,V=e.proxy,U=Date,W=function(t){var n,i=this,r=document.body,s=e(h).attr(z,"true").addClass("k-calendar-container").appendTo(r);i.options=t=t||{},n=t.id,n&&(n+="_dateview",s.attr(A,n),i._dateViewID=n),i.popup=new a.Popup(s,O(t.popup,t,{name:"Popup",isRtl:o.support.isRtl(t.anchor)})),i.div=s,i.value(t.value)};W.prototype={_calendar:function(){var t,n=this,r=n.calendar,s=n.options;r||(t=e(h).attr(A,o.guid()).appendTo(n.popup.element).on(D,i).on(g,"td:has(.k-link)",V(n._click,n)),n.calendar=r=new a.Calendar(t),n._setOptions(s),o.calendar.makeUnselectable(r.element),r.navigate(n._value||n._current,s.start),n.value(n._value))},_setOptions:function(e){this.calendar.setOptions({focusOnNav:!1,change:e.change,culture:e.culture,dates:e.dates,depth:e.depth,footer:e.footer,format:e.format,max:e.max,min:e.min,month:e.month,start:e.start})},setOptions:function(e){var t=this.options;this.options=O(t,e,{change:t.change,close:t.close,open:t.open}),this.calendar&&this._setOptions(this.options)},destroy:function(){this.popup.destroy()},open:function(){var e=this;e._calendar(),e.popup.open()},close:function(){this.popup.close()},min:function(e){this._option(E,e)},max:function(e){this._option(I,e)},toggle:function(){var e=this;e[e.popup.visible()?v:m]()},move:function(e){var n=this,i=e.keyCode,r=n.calendar,o=e.ctrlKey&&i==c.DOWN||i==c.ENTER;if(i==c.ESC)return n.close(),t;if(e.altKey)return i==c.DOWN?(n.open(),e.preventDefault()):i==c.UP&&(n.close(),e.preventDefault()),t;if(n.popup.visible())return o&&r._cell.hasClass(x)?(n.close(),e.preventDefault(),t):(n._current=r._move(e),t)},current:function(e){this._current=e,this.calendar._focus(e)},value:function(e){var t=this,n=t.calendar,i=t.options;t._value=e,t._current=new U(+L(e,i.min,i.max)),n&&n.value(e)},_click:function(e){-1!==e.currentTarget.className.indexOf(x)&&this.close()},_option:function(e,t){var n=this,i=n.calendar;n.options[e]=t,i&&i[e](t)}},W.normalize=n,o.DateView=W,r=s.extend({init:function(e,t){var i,r,a=this;s.fn.init.call(a,e,t),e=a.element,t=a.options,t.min=l(e.attr("min"))||l(t.min),t.max=l(e.attr("max"))||l(t.max),n(t),a._wrapper(),a.dateView=new W(O({},t,{id:e.attr(A),anchor:a.wrapper,change:function(){a._change(this.value()),a.close()},close:function(t){a.trigger(v)?t.preventDefault():(e.attr(F,!1),r.attr(z,!0))},open:function(t){var n,i=a.options;a.trigger(m)?t.preventDefault():(a.element.val()!==a._oldText&&(n=l(e.val(),i.parseFormats,i.culture),a.dateView[n?"current":"value"](n)),e.attr(F,!0),r.attr(z,!1),a._updateARIA(n))}})),r=a.dateView.div,a._icon();try{e[0].setAttribute("type","text")}catch(c){e[0].type="text"}e.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":a.dateView._dateViewID}),a._reset(),a._template(),i=e.is("[disabled]"),i?a.enable(!1):a.readonly(e.is("[readonly]")),a._old=a._update(t.value||a.element.val()),a._oldText=e.val(),o.notify(a)},events:[m,v,_],options:{name:"DatePicker",value:null,footer:"",format:"",culture:"",parseFormats:[],min:new Date(1900,0,1),max:new Date(2099,11,31),start:P,depth:P,animation:{},month:{},dates:[],ARIATemplate:'Current focused date is #=kendo.toString(data.current, "D")#'},setOptions:function(e){var t=this,i=t._value;s.fn.setOptions.call(t,e),e=t.options,e.min=l(e.min),e.max=l(e.max),n(e),t.dateView.setOptions(e),i&&(t.element.val(o.toString(i,e.format,e.culture)),t._updateARIA(i))},_editable:function(e){var t=this,n=t._dateIcon.off(f),r=t.element.off(f),o=t._inputWrapper.off(f),a=e.readonly,s=e.disable;a||s?(o.addClass(s?C:b).removeClass(s?b:C),r.attr(w,s).attr(y,a).attr(M,s).attr(R,a)):(o.addClass(b).removeClass(C).on(S,t._toggleHover),r.removeAttr(w).removeAttr(y).attr(M,!1).attr(R,!1).on("keydown"+f,V(t._keydown,t)).on("focusout"+f,V(t._blur,t)).on("focus"+f,function(){t._inputWrapper.addClass(k)}),n.on(g,V(t._click,t)).on(D,i))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;s.fn.destroy.call(e),e.dateView.destroy(),e.element.off(f),e._dateIcon.off(f),e._inputWrapper.off(f),e._form&&e._form.off("reset",e._resetHandler)},open:function(){this.dateView.open()},close:function(){this.dateView.close()},min:function(e){return this._option(E,e)},max:function(e){return this._option(I,e)},value:function(e){var n=this;return e===t?n._value:(n._old=n._update(e),null===n._old&&n.element.val(""),n._oldText=n.element.val(),t)},_toggleHover:function(t){e(t.currentTarget).toggleClass(T,"mouseenter"===t.type)},_blur:function(){var e=this,t=e.element.val();e.close(),t!==e._oldText&&e._change(t),e._inputWrapper.removeClass(k)},_click:function(){var e=this,t=e.element;e.dateView.toggle(),o.support.touch||t[0]===u()||t.focus()},_change:function(e){var t=this;e=t._update(e),+t._old!=+e&&(t._old=e,t._oldText=t.element.val(),t.element.trigger(_),t.trigger(_))},_keydown:function(e){var t=this,n=t.dateView,i=t.element.val();n.popup.visible()||e.keyCode!=c.ENTER||i===t._oldText?(n.move(e),t._updateARIA(n._current)):t._change(i)},_icon:function(){var t,n=this,i=n.element;t=i.next("span.k-select"),t[0]||(t=e('<span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-calendar">select</span></span>').insertAfter(i)),n._dateIcon=t.attr({role:"button","aria-controls":n.dateView._dateViewID})},_option:function(e,n){var i=this,r=i.options;return n===t?r[e]:(n=l(n,r.parseFormats,r.culture),n&&(r[e]=new U(+n),i.dateView[e](n)),t)},_update:function(e){var t,n=this,i=n.options,r=i.min,a=i.max,s=n._value,c=l(e,i.parseFormats,i.culture),d=null===c&&null===s||c instanceof Date&&s instanceof Date;return+c===+s&&d?(t=o.toString(c,i.format,i.culture),t!==e&&n.element.val(null===c?e:t),c):(null!==c&&N(c,r)?c=L(c,r,a):H(c,r,a)||(c=null),n._value=c,n.dateView.value(c),n.element.val(c?o.toString(c,i.format,i.culture):e),n._updateARIA(c),c)},_wrapper:function(){var t,n=this,i=n.element;t=i.parents(".k-datepicker"),t[0]||(t=i.wrap(p).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(p).parent()),t[0].style.cssText=i[0].style.cssText,i.css({width:"100%",height:i[0].style.height}),n.wrapper=t.addClass("k-widget k-datepicker k-header").addClass(i[0].className),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue)},t._form=r.on("reset",t._resetHandler))},_template:function(){this._ariaTemplate=d(this.options.ARIATemplate)},_updateARIA:function(e){var t,n=this,i=n.dateView.calendar;n.element.removeAttr("aria-activedescendant"),i&&(t=i._cell,t.attr("aria-label",n._ariaTemplate({current:e||i.current()})),n.element.attr("aria-activedescendant",t.attr("id")))}}),a.plugin(r)}(window.kendo.jQuery),function(e,t){function n(e,t,n){return n?t.substring(0,e).split(n).length-1:0}function i(e,t,i){return t.split(i)[n(e,t,i)]}function r(e,t,i,r){var o=t.split(r);return o.splice(n(e,t,r),1,i),r&&""!==o[o.length-1]&&o.push(""),o.join(r)}var o=window.kendo,a=o.support,s=o.caret,l=o._activeElement,c=a.placeholder,d=o.ui,u=d.List,h=o.keys,p=o.data.DataSource,f="aria-disabled",g="aria-readonly",m="k-state-default",v="disabled",_="readonly",w="k-state-focused",y="k-state-selected",b="k-state-disabled",k="k-state-hover",x=".kendoAutoComplete",C="mouseenter"+x+" mouseleave"+x,T=e.proxy,S=u.extend({init:function(t,n){var i,r=this;r.ns=x,n=e.isArray(n)?{dataSource:n}:n,u.fn.init.call(r,t,n),t=r.element,n=r.options,n.placeholder=n.placeholder||t.attr("placeholder"),c&&t.attr("placeholder",n.placeholder),r._wrapper(),r._loader(),r._dataSource(),r._ignoreCase(),t[0].type="text",i=r.wrapper,r._popup(),t.addClass("k-input").on("keydown"+x,T(r._keydown,r)).on("paste"+x,T(r._search,r)).on("focus"+x,function(){r._prev=r._accessor(),r._placeholder(!1),i.addClass(w)}).on("focusout"+x,function(){r._change(),r._placeholder(),i.removeClass(w)}).attr({autocomplete:"off",role:"textbox","aria-haspopup":!0}),r._enable(),r._old=r._accessor(),t[0].id&&t.attr("aria-owns",r.ul[0].id),r._aria(),r._placeholder(),o.notify(r)},options:{name:"AutoComplete",enabled:!0,suggest:!1,template:"",dataTextField:"",minLength:1,delay:200,height:200,filter:"startswith",ignoreCase:!0,highlightFirst:!1,separator:null,placeholder:"",animation:{},value:null},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=T(e.refresh,e),e._progressHandler=T(e._showBusy,e)),e.dataSource=p.create(e.options.dataSource).bind("change",e._refreshHandler).bind("progress",e._progressHandler)},setDataSource:function(e){this.options.dataSource=e,this._dataSource()},events:["open","close","change","select","filtering","dataBinding","dataBound"],setOptions:function(e){u.fn.setOptions.call(this,e),this._template(),this._accessors(),this._aria()},_editable:function(e){var t=this,n=t.element,i=t.wrapper.off(x),r=e.readonly,o=e.disable;r||o?(i.addClass(o?b:m).removeClass(o?m:b),n.attr(v,o).attr(_,r).attr(f,o).attr(g,r)):(i.addClass(m).removeClass(b).on(C,t._toggleHover),n.removeAttr(v).removeAttr(_).attr(f,!1).attr(g,!1))},close:function(){var e=this,t=e._current;t&&t.removeClass(y),e.current(null),e.popup.close()},destroy:function(){var e=this;e.element.off(x),e.wrapper.off(x),u.fn.destroy.call(e)},refresh:function(){var n,i=this,r=i.ul[0],a=i.popup,s=i.options,c=i._data(),d=c.length,u=i.element[0]===l();i._angularItems("cleanup"),i.trigger("dataBinding"),r.innerHTML=o.render(i.template,c),i._height(d),a.visible()&&a._position(),d&&(s.highlightFirst&&i.current(e(r.firstChild)),s.suggest&&u&&i.suggest(e(r.firstChild))),i._open&&(i._open=!1,n=d?"open":"close",i._typing&&!u&&(n="close"),a[n](),i._typing=t),i._touchScroller&&i._touchScroller.reset(),i._makeUnselectable(),i._hideBusy(),i._angularItems("compile"),i.trigger("dataBound")},select:function(e){this._select(e)},search:function(e){var t,n=this,r=n.options,o=r.ignoreCase,a=r.separator;e=e||n._accessor(),n._current=null,clearTimeout(n._typing),a&&(e=i(s(n.element)[0],e,a)),t=e.length,(!t||t>=r.minLength)&&(n._open=!0,n._filterSource({value:o?e.toLowerCase():e,operator:r.filter,field:r.dataTextField,ignoreCase:o}))},suggest:function(e){var i,r=this,o=r._last,a=r._accessor(),c=r.element[0],d=s(c)[0],p=r.options.separator,f=a.split(p),g=n(d,a,p),m=d;return o==h.BACKSPACE||o==h.DELETE?(r._last=t,t):(e=e||"","string"!=typeof e&&(i=u.inArray(e[0],r.ul[0]),e=i>-1?r._text(r._data()[i]):""),0>=d&&(d=a.toLowerCase().indexOf(e.toLowerCase())+1),i=a.substring(0,d).lastIndexOf(p),i=i>-1?d-(i+p.length):d,a=f[g].substring(0,i),e&&(i=e.toLowerCase().indexOf(a.toLowerCase()),i>-1&&(e=e.substring(i+a.length),m=d+e.length,a+=e),p&&""!==f[f.length-1]&&f.push("")),f[g]=a,r._accessor(f.join(p||"")),c===l()&&s(c,d,m),t)},value:function(e){return e===t?this._accessor():(this._accessor(e),this._old=this._accessor(),t)},_accessor:function(e){var n=this,i=n.element[0];return e===t?(e=i.value,i.className.indexOf("k-readonly")>-1&&e===n.options.placeholder?"":e):(i.value=null===e?"":e,n._placeholder(),t)},_accept:function(e){var t=this.element;this._focus(e),s(t,t.val().length)},_keydown:function(t){var n=this,i=n.ul[0],r=t.keyCode,o=n._current,a=n.popup.visible();n._last=r,r===h.DOWN?(a&&n._move(o?o.next():e(i.firstChild)),t.preventDefault()):r===h.UP?(a&&n._move(o?o.prev():e(i.lastChild)),t.preventDefault()):r===h.ENTER||r===h.TAB?(r===h.ENTER&&n.popup.visible()&&t.preventDefault(),n._accept(o)):r===h.ESC?(n.popup.visible()&&t.preventDefault(),n.close()):n._search()},_move:function(e){var t=this;e=e[0]?e:null,t.current(e),t.options.suggest&&t.suggest(e)},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._loading.hide(),e.element.attr("aria-busy",!1),e._busy=null},_showBusy:function(){var e=this;e._busy||(e._busy=setTimeout(function(){e.element.attr("aria-busy",!0),e._loading.show()},100))},_placeholder:function(e){if(!c){var n,i=this,r=i.element,o=i.options.placeholder;if(o){if(n=r.val(),e===t&&(e=!n),e||(o=n!==o?n:""),n===i._old&&!e)return;r.toggleClass("k-readonly",e).val(o),o||r[0]!==document.activeElement||s(r[0],0,0)}}},_search:function(){var e=this;clearTimeout(e._typing),e._typing=setTimeout(function(){e._prev!==e._accessor()&&(e._prev=e._accessor(),e.search())},e.options.delay)},_select:function(t){var n,i,o=this,a=o.options.separator,l=o._data();t=e(t),t[0]&&!t.hasClass(y)&&(i=u.inArray(t[0],o.ul[0]),i>-1&&(l=l[i],n=o._text(l),a&&(n=r(s(o.element)[0],o._accessor(),n,a)),o._accessor(n),o._prev=o._accessor(),o.current(t.addClass(y))))},_loader:function(){this._loading=e('<span class="k-icon k-loading" style="display:none"></span>').insertAfter(this.element)},_toggleHover:function(t){e(t.currentTarget).toggleClass(k,"mouseenter"===t.type)},_wrapper:function(){var e,t=this,n=t.element,i=n[0];e=n.parent(),e.is("span.k-widget")||(e=n.wrap("<span />").parent()),e.attr("tabindex",-1),e.attr("role","presentation"),e[0].style.cssText=i.style.cssText,n.css({width:"100%",height:i.style.height}),t._focused=t.element,t.wrapper=e.addClass("k-widget k-autocomplete k-header").addClass(i.className)}});d.plugin(S)}(window.kendo.jQuery),function(e,t){function n(e,t,n){for(var i,r=0,o=t.length-1;o>r;++r)i=t[r],i in e||(e[i]={}),e=e[i];e[t[o]]=n}var i=window.kendo,r=i.ui,o=r.Select,a=i.support.mobileOS,s=i._activeElement,l=i.keys,c=".kendoDropDownList",d="disabled",u="readonly",h="change",p="k-state-focused",f="k-state-default",g="k-state-disabled",m="aria-disabled",v="aria-readonly",_="k-state-selected",w="mouseenter"+c+" mouseleave"+c,y="tabindex",b="filter",k="accept",x=e.proxy,C=o.extend({init:function(n,r){var a,s,l,d=this,u=r&&r.index;d.ns=c,r=e.isArray(r)?{dataSource:r}:r,o.fn.init.call(d,n,r),r=d.options,n=d.element.on("focus"+c,x(d._focusHandler,d)),d._inputTemplate(),d._reset(),d._prev="",d._word="",d._wrapper(),d._tabindex(),d.wrapper.data(y,d.wrapper.attr(y)),d._span(),d._popup(),d._mobile(),d._dataSource(),d._ignoreCase(),d._filterHeader(),d._aria(),d._enable(),d._oldIndex=d.selectedIndex=-1,d._cascade(),u!==t&&(r.index=u),r.autoBind?d.dataSource.fetch():-1===d.selectedIndex&&(l=r.text||"",l||(a=r.optionLabel,s=a&&0===r.index,d._isSelect?l=s?a:n.children(":selected").text():!n[0].value&&s&&(l=a)),d._textAccessor(l)),i.notify(d)},options:{name:"DropDownList",enabled:!0,autoBind:!0,index:0,text:null,value:null,template:"",valueTemplate:"",delay:500,height:200,dataTextField:"",dataValueField:"",optionLabel:"",cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{},filter:"none",minLength:1},events:["open","close",h,"select","filtering","dataBinding","dataBound","cascade"],setOptions:function(e){o.fn.setOptions.call(this,e),this._template(),this._inputTemplate(),this._accessors(),this._filterHeader(),this._enable(),this._aria()
},destroy:function(){var e=this;e.wrapper.off(c),e.element.off(c),e._inputWrapper.off(c),e._arrow.off(),e._arrow=null,o.fn.destroy.call(e)},open:function(){var e=this;e.popup.visible()||(e.ul[0].firstChild&&e._state!==k?(e.popup.open(),e._focusElement(e.filterInput),e._scroll(e._current)):(e._open=!0,e._state="rebind",e.filterInput&&e.filterInput.val(""),e._filterSource()))},toggle:function(e){this._toggle(e,!0)},refresh:function(){var t,n,r=this,o=r._data(),a=o.length,s=r.options.optionLabel,l=r._state===b,c=r.element[0];r.trigger("dataBinding"),r._current&&r.current(null),r._angularItems("cleanup"),r.ul[0].innerHTML=i.render(r.template,o),r._angularItems("compile"),r._height(l?a||1:a),r.popup.visible()&&r.popup._position(),r._isSelect&&(t=c.selectedIndex,n=r.value(),a?s&&(s=r._option("",r._optionLabelText(s))):n&&(t=0,s=r._option(n,r.text())),r._options(o,s),c.selectedIndex=-1===t?0:t),r._hideBusy(),r._makeUnselectable(),l?r.current(e(r.ul[0].firstChild)):(r._open&&r.toggle(!!a),r._open=!1,r._fetch||(a?r._selectItem():r._textAccessor()!==s&&(r.element.val(""),r._textAccessor("")))),r._bound=!!a,r.trigger("dataBound")},text:function(e){var n,i,r=this,o=r.options.ignoreCase;return e=null===e?"":e,e===t?r._textAccessor():("string"==typeof e&&(i=o?e.toLowerCase():e,n=r._select(function(e){return e=r._text(e),o&&(e=(e+"").toLowerCase()),e===i}),n&&(e=n)),r._textAccessor(e),t)},value:function(e){var n,i,r=this;return e===t?r._accessor():(null!==e&&(e=""+e),r._selectedValue=e,i=e||r.options.optionLabel&&!r.element[0].disabled&&""===e,i&&r._fetchItems(e)||(n=r._index(e),r.select(n>-1?n:0)),t)},_focusHandler:function(){this.wrapper.focus()},_focusinHandler:function(){this._inputWrapper.addClass(p),this._prevent=!1},_focusoutHandler:function(){var e=this,t=e._state===b,n=window.self!==window.top;e._prevent||(t&&e._select(e._current),(!t||e.dataItem())&&e._triggerCascade(),i.support.mobileOS.ios&&n?e._change():e._blur(),e._inputWrapper.removeClass(p),e._prevent=!0,e._open=!1,e.element.blur())},_wrapperMousedown:function(){this._prevent=!!this.filterInput},_wrapperClick:function(e){e.preventDefault(),this._focused=this.wrapper,this._toggle()},_editable:function(e){var t=this,n=t.element,i=e.disable,r=e.readonly,o=t.wrapper.add(t.filterInput).off(c),a=t._inputWrapper.off(w);r||i?i?(o.removeAttr(y),a.addClass(g).removeClass(f)):(a.addClass(f).removeClass(g),o.on("focusin"+c,x(t._focusinHandler,t)).on("focusout"+c,x(t._focusoutHandler,t))):(n.removeAttr(d).removeAttr(u),a.addClass(f).removeClass(g).on(w,t._toggleHover),o.attr(y,o.data(y)).attr(m,!1).attr(v,!1).on("keydown"+c,x(t._keydown,t)).on("focusin"+c,x(t._focusinHandler,t)).on("focusout"+c,x(t._focusoutHandler,t)).on("mousedown"+c,x(t._wrapperMousedown,t)),t.wrapper.on("click"+c,x(t._wrapperClick,t)),t.filterInput||o.on("keypress"+c,x(t._keypress,t))),n.attr(d,i).attr(u,r),o.attr(m,i).attr(v,r)},_accept:function(e,t){var n=this,i=n.filterInput&&n.filterInput[0]===s();n._focus(e),n._focusElement(n.wrapper),i&&t===l.TAB&&n.wrapper.focusout()},_option:function(e,t){return'<option value="'+e+'">'+t+"</option>"},_optionLabelText:function(){var e=this.options,t=e.dataTextField,n=e.optionLabel;return n&&t&&"object"==typeof n?this._text(n):n},_data:function(){var e=this,t=e.options,r=t.optionLabel,o=t.dataTextField,a=t.dataValueField,s=e.dataSource.view(),l=s.length,c=r,d=0;if(r&&l){for("object"==typeof r?c=r:o&&(c={},o=o.split("."),a=a.split("."),n(c,a,""),n(c,o,r)),c=new i.data.ObservableArray([c]);l>d;d++)c.push(s[d]);s=c}return s},_selectItem:function(){o.fn._selectItem.call(this),this.current()||this.select(0)},_keydown:function(e){var t,n=this,i=e.keyCode,r=e.altKey,o=n.ul[0];i===l.LEFT?i=l.UP:i===l.RIGHT&&(i=l.DOWN),e.keyCode=i,t=n._move(e),n.popup.visible()&&n.filterInput||(i===l.HOME?(t=!0,e.preventDefault(),n._select(o.firstChild)):i===l.END&&(t=!0,e.preventDefault(),n._select(o.lastChild))),r&&i===l.UP&&n._focusElement(n.wrapper),r||t||!n.filterInput||n._search()},_selectNext:function(e,n){for(var i,r=this,o=n,a=r._data(),s=a.length,l=r.options.ignoreCase,c=function(n,i){return n+="",l&&(n=n.toLowerCase()),0===n.indexOf(e)?(r._select(i),r._triggerEvents(),!0):t};s>n;n++)if(i=r._text(a[n]),i&&c(i,n))return!0;if(o>0&&s>o)for(n=0;o>=n;n++)if(i=r._text(a[n]),i&&c(i,n))return!0;return!1},_keypress:function(e){var t,n,r,o=this;0!==e.which&&e.keyCode!==i.keys.ENTER&&(t=String.fromCharCode(e.charCode||e.keyCode),n=o.selectedIndex,r=o._word,o.options.ignoreCase&&(t=t.toLowerCase())," "===t&&e.preventDefault(),o._last===t&&1>=r.length&&n>-1&&(r||(r=t),o._selectNext(r,n+1))||(o._word=r+t,o._last=t,o._search()))},_popupOpen:function(){var e=this.popup;e.wrapper=i.wrap(e.element),e.element.closest(".km-root")[0]&&(e.wrapper.addClass("km-popup km-widget"),this.wrapper.addClass("km-widget"))},_popup:function(){o.fn._popup.call(this),this.popup.one("open",x(this._popupOpen,this))},_focusElement:function(e){var t=s(),n=this.wrapper,i=this.filterInput,r=e===i?n:i;i&&r[0]===t&&(this._prevent=!0,this._focused=e.focus())},_filter:function(e){var n,i;e&&(n=this,i=n.options.ignoreCase,i&&(e=e.toLowerCase()),n._select(function(r){var o=n._text(r);return o!==t?(o+="",i&&(o=o.toLowerCase()),0===o.indexOf(e)):t}))},_search:function(){var e=this,n=e.dataSource,i=e.selectedIndex,r=e._word;if(clearTimeout(e._typing),"none"!==e.options.filter)e._typing=setTimeout(function(){var t=e.filterInput.val();e._prev!==t&&(e._prev=t,e.search(t)),e._typing=null},e.options.delay);else{if(e._typing=setTimeout(function(){e._word=""},e.options.delay),-1===i&&(i=0),!e.ul[0].firstChild)return n.one(h,function(){n.data()[0]&&i>-1&&e._selectNext(r,i)}).fetch(),t;e._selectNext(r,i),e._triggerEvents()}},_select:function(e){var n,i,o=this,a=o._current,s=null;return e=o._get(e),e&&e[0]&&!e.hasClass(_)&&(o._state===b&&(o._state=k),a&&a.removeClass(_),i=r.List.inArray(e[0],o.ul[0]),i>-1&&(o.selectedIndex=i,s=o._data()[i],n=o._value(s),null===n&&(n=""),o._textAccessor(s),o._accessor(n!==t?n:o._text(s),i),o._selectedValue=o._accessor(),o.current(e.addClass(_)),o._optionID&&o._current.attr("aria-selected",!0))),s},_triggerEvents:function(){this.popup.visible()||(this._triggerCascade(),this._change())},_mobile:function(){var e=this,t=e.popup,n=t.element.parents(".km-root").eq(0);n.length&&a&&(t.options.animation.open.effects=a.android||a.meego?"fadeIn":a.ios||a.wp?"slideIn:up":t.options.animation.open.effects)},_filterHeader:function(){var t,n=this.options,i="none"!==n.filter;this.filterInput&&(this.filterInput.off(c).parent().remove(),this.filterInput=null),i&&(t='<span unselectable="on" class="k-icon k-i-search">select</span>',this.filterInput=e('<input class="k-textbox"/>').attr({role:"listbox","aria-haspopup":!0,"aria-expanded":!1}),this.list.prepend(e('<span class="k-list-filter" />').append(this.filterInput.add(t))))},_span:function(){var t,n=this,i=n.wrapper,r="span.k-input";t=i.find(r),t[0]||(i.append('<span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">&nbsp;</span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span>').append(n.element),t=i.find(r)),n.span=t,n._inputWrapper=e(i[0].firstChild),n._arrow=i.find(".k-icon")},_wrapper:function(){var e,t=this,n=t.element,i=n[0];e=n.parent(),e.is("span.k-widget")||(e=n.wrap("<span />").parent(),e[0].style.cssText=i.style.cssText),n.hide(),t._focused=t.wrapper=e.addClass("k-widget k-dropdown k-header").addClass(i.className).css("display","").attr({unselectable:"on",role:"listbox","aria-haspopup":!0,"aria-expanded":!1})},_clearSelection:function(){var e=this,n=e.options.optionLabel;return e.options.value="",e._selectedValue="",e.dataSource.view()[0]&&(n||e._userTriggered)?(e.select(0),t):(e.selectedIndex=-1,e.element.val(""),e._textAccessor(e.options.optionLabel),t)},_inputTemplate:function(){var t=this,n=t.options.valueTemplate;n=n?i.template(n):e.proxy(i.template("#:this._text(data)#",{useWithBlock:!1}),t),t.valueTemplate=n},_textAccessor:function(r){var o,a=this.dataItem(),s=this.options,l=this.span;return r===t?l.text():(e.isPlainObject(r)||r instanceof i.data.ObservableObject?a=r:a&&this._text(a)===r||(s.dataTextField?(a={},n(a,s.dataTextField.split("."),r),n(a,s.dataValueField.split("."),this._accessor())):a=r),o=function(){return{elements:l.get(),data:[{dataItem:a}]}},this.angular("cleanup",o),l.html(this.valueTemplate(a)),this.angular("compile",o),t)}});r.plugin(C)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui,r=i.List,o=i.Select,a=n.caret,s=n.support,l=s.placeholder,c=n._activeElement,d=n.keys,u=".kendoComboBox",h="click"+u,p="mousedown"+u,f="disabled",g="readonly",m="change",v="k-state-default",_="k-state-focused",w="k-state-disabled",y="aria-disabled",b="aria-readonly",k="k-state-selected",x="filter",C="accept",T="rebind",S="mouseenter"+u+" mouseleave"+u,D=null,A=e.proxy,E=o.extend({init:function(t,i){var r,a=this;a.ns=u,i=e.isArray(i)?{dataSource:i}:i,o.fn.init.call(a,t,i),i=a.options,t=a.element.on("focus"+u,A(a._focusHandler,a)),i.placeholder=i.placeholder||t.attr("placeholder"),a._reset(),a._wrapper(),a._input(),a._tabindex(a.input),a._popup(),a._dataSource(),a._ignoreCase(),a._enable(),a._oldIndex=a.selectedIndex=-1,a._cascade(),a._aria(),i.autoBind?a._filterSource():(r=i.text,!r&&a._isSelect&&(r=t.children(":selected").text()),r&&(a.input.val(r),a._prev=r)),r||a._placeholder(),n.notify(a)},options:{name:"ComboBox",enabled:!0,index:-1,text:null,value:null,autoBind:!0,delay:200,dataTextField:"",dataValueField:"",minLength:0,height:200,highlightFirst:!0,template:"",filter:"none",placeholder:"",suggest:!1,cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{}},events:["open","close",m,"select","filtering","dataBinding","dataBound","cascade"],setOptions:function(e){o.fn.setOptions.call(this,e),this._template(),this._accessors(),this._aria()},current:function(e){var n=this,i=n._current;return e===t?i:(i&&i.removeClass(k),o.fn.current.call(n,e),t)},destroy:function(){var e=this;e.input.off(u),e.element.off(u),e._inputWrapper.off(u),o.fn.destroy.call(e)},_focusHandler:function(){this.input.focus()},_arrowClick:function(){this._toggle()},_inputFocus:function(){this._inputWrapper.addClass(_),this._placeholder(!1)},_inputFocusout:function(){var e=this;e._inputWrapper.removeClass(_),clearTimeout(e._typing),e._typing=null,e.options.text!==e.input.val()&&e.text(e.text()),e._placeholder(),e._blur(),e.element.blur()},_editable:function(e){var t=this,n=e.disable,i=e.readonly,r=t._inputWrapper.off(u),o=t.element.add(t.input.off(u)),a=t._arrow.parent().off(h+" "+p);i||n?(r.addClass(n?w:v).removeClass(n?v:w),o.attr(f,n).attr(g,i).attr(y,n).attr(b,i)):(r.addClass(v).removeClass(w).on(S,t._toggleHover),o.removeAttr(f).removeAttr(g).attr(y,!1).attr(b,!1),a.on(h,A(t._arrowClick,t)).on(p,function(e){e.preventDefault()}),t.input.on("keydown"+u,A(t._keydown,t)).on("focus"+u,A(t._inputFocus,t)).on("focusout"+u,A(t._inputFocusout,t)))},open:function(){var e=this,t=e._state,n=e.dataSource.options.serverFiltering;e.popup.visible()||(!e.ul[0].firstChild&&t!==x||t===C&&!n?(e._open=!0,e._state=T,e._filterSource()):(e.popup.open(),e._scroll(e._current)))},refresh:function(){var i,r,o=this,a=o.ul[0],s=o.options,l=o._state,d=o._data(),u=d.length,h=!0;o._angularItems("cleanup"),o.trigger("dataBinding"),a.innerHTML=n.render(o.template,d),o._height(u),o.popup.visible()&&o.popup._position(),o._isSelect&&(i=o.element[0].children[0],l===T&&(o._state=""),r=o._option,o._option=t,o._options(d),r&&r[0].selected?o._custom(r.val(),h):o._bound||i||o._custom("",h)),u&&(s.highlightFirst&&o.current(e(a.firstChild)),s.suggest&&o.input.val()&&o._request!==t&&o.suggest(e(a.firstChild))),l===x||o._fetch||o._selectItem(),o._open&&(o._open=!1,o._typing&&o.input[0]!==c()?o.popup.close():o.toggle(!!u),o._typing=null),o._touchScroller&&o._touchScroller.reset(),o._makeUnselectable(),o._hideBusy(),o._bound=!0,o._angularItems("compile"),o.trigger("dataBound")},suggest:function(e){var n,i=this,o=i.input[0],s=i.text(),l=a(o)[0],u=i._last;return u==d.BACKSPACE||u==d.DELETE?(i._last=t,t):(e=e||"","string"!=typeof e&&(n=r.inArray(e[0],i.ul[0]),e=n>-1?i._text(i.dataSource.view()[n]):""),0>=l&&(l=s.toLowerCase().indexOf(e.toLowerCase())+1),e?(n=e.toLowerCase().indexOf(s.toLowerCase()),n>-1&&(s+=e.substring(n+s.length))):s=s.substring(0,l),s.length===l&&e||(o.value=s,o===c()&&a(o,l,s.length)),t)},text:function(e){var n,i,r,o,a,s;return e=null===e?"":e,n=this,i=n.input[0],r=n.options.ignoreCase,o=e,e===t?i.value:(a=n.dataItem(),a&&n._text(a)===e&&(s=n._value(a),null===s?s="":s+="",s===n._old)?(n._triggerCascade(),t):(r&&(o=o.toLowerCase()),n._select(function(e){return e=n._text(e),r&&(e=(e+"").toLowerCase()),e===o}),0>n.selectedIndex&&(n._custom(e),i.value=e),n._prev=i.value,n._triggerCascade(),t))},toggle:function(e){this._toggle(e,!0)},value:function(e){var n,i=this,r=i.options;return e===t?i._accessor():(null!==e&&(e=""+e),i._selectedValue=e,!i._open&&e&&i._fetchItems(e)||(n=i._index(e),n>-1?i.select(n):(i.current(D),i._custom(e),(r.value!==e||r.text!==i.input.val())&&(i.text(e),i._placeholder())),i._old=i._accessor(),i._oldIndex=i.selectedIndex),t)},_accept:function(e){var t=this;e?t._focus(e):(t.text(t.text()),t._change())},_custom:function(t,n){var i=this,r=i.element,o=i._option;i._state!==x||n||(i._state=C),i._isSelect?(o||(o=i._option=e("<option/>"),r.append(o)),o.text(t),o[0].selected=!0):r.val(t),i._selectedValue=t},_filter:function(e){var n=this,i=n.options,r=n.dataSource,o=i.ignoreCase,a=function(i){var r=n._text(i);return r!==t?(r+="",""!==r&&""===e?!1:(o&&(r=r.toLowerCase()),0===r.indexOf(e))):t};return o&&(e=e.toLowerCase()),n.ul[0].firstChild?(-1!==n._highlight(a)&&(i.suggest&&n._current&&n.suggest(n._current),n.open()),n._hideBusy(),t):(r.one(m,function(){r.view()[0]&&n.search(e)}).fetch(),t)},_highlight:function(n){var i,o=this;return n===t||null===n?-1:(n=o._get(n),i=r.inArray(n[0],o.ul[0]),-1==i&&(o.options.highlightFirst&&!o.text()?(n=o.ul[0].firstChild,n&&(n=e(n))):n=D),o.current(n),i)},_input:function(){var t,n=this,i=n.element.removeClass("k-input")[0],r=i.accessKey,o=n.wrapper,a="input.k-input",s=i.name||"";s&&(s='name="'+s+'_input" '),t=o.find(a),t[0]||(o.append('<span tabindex="-1" unselectable="on" class="k-dropdown-wrap k-state-default"><input '+s+'class="k-input" type="text" autocomplete="off"/><span tabindex="-1" unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span>').append(n.element),t=o.find(a)),t[0].style.cssText=i.style.cssText,i.maxLength>-1&&(t[0].maxLength=i.maxLength),t.addClass(i.className).val(this.options.text||i.value).css({width:"100%",height:i.style.height}).attr({role:"combobox","aria-expanded":!1}).show(),l&&t.attr("placeholder",n.options.placeholder),r&&(i.accessKey="",t[0].accessKey=r),n._focused=n.input=t,n._inputWrapper=e(o[0].firstChild),n._arrow=o.find(".k-icon").attr({role:"button",tabIndex:-1}),i.id&&n._arrow.attr("aria-controls",n.ul[0].id)},_keydown:function(e){var t=this,n=e.keyCode;t._last=n,clearTimeout(t._typing),t._typing=null,n==d.TAB||t._move(e)||t._search()},_placeholder:function(e){if(!l){var n,i=this,r=i.input,o=i.options.placeholder;if(o){if(n=i.value(),e===t&&(e=!n),r.toggleClass("k-readonly",e),!e){if(n)return;o=""}r.val(o),o||r[0]!==c()||a(r[0],0,0)}}},_search:function(){var e=this;e._typing=setTimeout(function(){var t=e.text();e._prev!==t&&(e._prev=t,e.search(t)),e._typing=null},e.options.delay)},_select:function(e){var n,i,r=this,o=r._data(),a=r._highlight(e);r.selectedIndex=a,-1!==a&&(r._state===x&&(r._state=C),r._current.addClass(k),o=o[a],n=r._text(o),i=r._value(o),null===i&&(i=""),r._prev=r.input[0].value=n,r._accessor(i!==t?i:n,a),r._selectedValue=r._accessor(),r._placeholder(),r._optionID&&r._current.attr("aria-selected",!0))},_wrapper:function(){var e=this,t=e.element,n=t.parent();n.is("span.k-widget")||(n=t.hide().wrap("<span />").parent(),n[0].style.cssText=t[0].style.cssText),e.wrapper=n.addClass("k-widget k-combobox k-header").addClass(t[0].className).css("display","")},_clearSelection:function(e,t){var n=this,i=e._selectedValue||e.value(),r=i&&-1===e.selectedIndex;(t||!i||r)&&(n.value(""),n.options.value="")}});i.plugin(E)}(window.kendo.jQuery),function(e,t){function n(e,t){var n;if(null===e&&null!==t||null!==e&&null===t)return!1;if(n=e.length,n!==t.length)return!1;for(;n--;)if(e[n]!==t[n])return!1;return!0}function i(t){var n=t.firstChild;return n&&"none"===n.style.display&&(n=o(n,k)),n?e(n):n}function r(t){var n=t.lastChild;return n&&"none"===n.style.display&&(n=o(n,x)),n?e(n):n}function o(e,t){return e=e[t],e&&"none"===e.style.display&&(e=o(e,t)),e}var a=window.kendo,s=a.ui,l=s.List,c=a.keys,d=a._activeElement,u=a.data.ObservableArray,h=e.proxy,p="id",f="li",g="accept",m="filter",v="open",_="close",w="change",y="progress",b="select",k="nextSibling",x="previousSibling",C=' style="display:none"',T="aria-disabled",S="aria-readonly",D="k-state-focused",A="k-loading-hidden",E="k-state-hover",I="k-state-disabled",P="disabled",M="readonly",F=".kendoMultiSelect",z="click"+F,R="keydown"+F,B="mouseenter"+F,H="mouseleave"+F,L=B+" "+H,N=/"/g,O=e.isArray,V=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],U=l.extend({init:function(t,n){var i,r,o=this;o.ns=F,l.fn.init.call(o,t,n),o._wrapper(),o._tagList(),o._input(),o._textContainer(),o._loader(),o._tabindex(o.input),t=o.element.attr("multiple","multiple").hide(),n=o.options,r=n.value,n.placeholder||(n.placeholder=t.data("placeholder")),i=t.attr(p),i&&(o._tagID=i+"_tag_active",i+="_taglist",o.tagList.attr(p,i)),o._aria(i),o._dataSource(),o._ignoreCase(),o._popup(),o._values=[],o._dataItems=[],o._reset(),o._enable(),o._placeholder(),n.autoBind?o.dataSource.fetch():r&&(O(r)||(r=[r]),(e.isPlainObject(r[0])||!n.dataValueField)&&(o._retrieveData=!0,o.dataSource.data(r),o.value(o._initialValues))),a.notify(o)},options:{name:"MultiSelect",enabled:!0,autoBind:!0,autoClose:!0,highlightFirst:!0,dataTextField:"",dataValueField:"",filter:"startswith",ignoreCase:!0,minLength:0,delay:100,value:null,maxSelectedItems:null,itemTemplate:"",tagTemplate:"",placeholder:"",height:200,animation:{}},events:[v,_,w,b,"filtering","dataBinding","dataBound"],setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&this.dataSource.fetch()},setOptions:function(e){l.fn.setOptions.call(this,e),this._template(),this._accessors(),this._aria(this.tagList.attr(p))},current:function(e){return this.currentTag(null),l.fn.current.call(this,e)},currentTag:function(e){var n=this;return e===t?n._currentTag:(n._currentTag&&(n._currentTag.removeClass(D).removeAttr(p),n.input.removeAttr("aria-activedescendant")),e&&(e.addClass(D).attr(p,n._tagID),n.input.attr("aria-activedescendant",n._tagID)),n._currentTag=e,t)},dataItems:function(){return this._dataItems},destroy:function(){var e=this,t=e.ns;clearTimeout(e._busy),clearTimeout(e._typing),e.wrapper.off(t),e.tagList.off(t),e.input.off(t),l.fn.destroy.call(e)},_wrapperMousedown:function(e){var t=this,n="input"!==e.target.nodeName.toLowerCase();n&&e.preventDefault(),-1===e.target.className.indexOf("k-delete")&&(t.input[0]!==d()&&n&&t.input.focus(),0===t.options.minLength&&t.open())},_inputFocus:function(){this._placeholder(!1),this.wrapper.addClass(D)},_inputFocusout:function(){var e=this;clearTimeout(e._typing),e.wrapper.removeClass(D),e._placeholder(!e._dataItems[0],!0),e.close(),e._state===m&&(e._state=g),e.element.blur()},_tagListClick:function(t){this._unselect(e(t.target).closest(f)),this._change(),this.close()},_editable:function(t){var n=this,i=t.disable,r=t.readonly,o=n.wrapper.off(F),a=n.tagList.off(F),s=n.element.add(n.input.off(F));r||i?(i?o.addClass(I):o.removeClass(I),s.attr(P,i).attr(M,r).attr(T,i).attr(S,r)):(o.removeClass(I).on(L,n._toggleHover).on("mousedown"+F+" touchend"+F,h(n._wrapperMousedown,n)),n.input.on(R,h(n._keydown,n)).on("paste"+F,h(n._search,n)).on("focus"+F,h(n._inputFocus,n)).on("focusout"+F,h(n._inputFocusout,n)),s.removeAttr(P).removeAttr(M).attr(T,!1).attr(S,!1),a.on(B,f,function(){e(this).addClass(E)}).on(H,f,function(){e(this).removeClass(E)}).on(z,".k-delete",h(n._tagListClick,n)))},_close:function(){var e=this;e.options.autoClose||!e._visibleItems?e.close():(e.current(e.options.highlightFirst?i(e.ul[0]):null),e.popup._position())},close:function(){this.popup.close(),this.current(null)},open:function(){var e=this;e._request&&(e._retrieveData=!1),!e.ul[0].firstChild||e._state===g||e._retrieveData?(e._state="",e._open=!0,e._retrieveData=!1,e._filterSource()):e._visibleItems&&e._allowSelection()&&(e.popup.open(),e.current(e.options.highlightFirst?i(e.ul[0]):null))},toggle:function(e){e=e!==t?e:!this.popup.visible(),this[e?v:_]()},refresh:function(){var e,t=this,n=null;t.trigger("dataBinding"),e=t._render(t.dataSource.view()),t._height(e),t._setInitialValues&&(t._setInitialValues=!1,t.value(t._initialValues)),t._open&&(t._open=!1,t.toggle(e)),t.popup.visible()&&(t.popup._position(),t.options.highlightFirst&&(n=i(t.ul[0]))),t.current(n),t._touchScroller&&t._touchScroller.reset(),t._makeUnselectable(),t._hideBusy(),t.trigger("dataBound")},search:function(e){var t,n,i=this,r=i.options,o=r.ignoreCase,a=r.filter,s=r.dataTextField,l=i.input.val();r.placeholder===l&&(l=""),clearTimeout(i._typing),e="string"==typeof e?e:l,n=e.length,(!n||n>=r.minLength)&&(i._state=m,i._open=!0,t={value:o?e.toLowerCase():e,field:s,operator:a,ignoreCase:o},i._filterSource(t,i._retrieveData),i._retrieveData=!1)},value:function(n){var i,r=this,o=e(r.tagList[0].children),a=o.length,s=0;if(n===t)return r._values;if(!r._fetchItems(n)){for(;a>s;s++)r._unselect(o.eq(s));if(null!==n){for(n=O(n)||n instanceof u?n:[n],s=0,a=n.length;a>s;s++)i=r._index(n[s]),i>-1&&r._select(i);r._old=r._values.slice()}}},_dataSource:function(){var e=this,t=e.element,n=e.options,i=n.dataSource||{};i=O(i)?{data:i}:i,i.select=t,i.fields=[{field:n.dataTextField},{field:n.dataValueField}],e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=h(e.refresh,e),e._progressHandler=h(e._showBusy,e)),e.dataSource=a.data.DataSource.create(i).bind(w,e._refreshHandler).bind(y,e._progressHandler)},_fetchItems:function(n){var i=this,r=e.isArray(n)&&0===n.length;if(!r&&n)return i._fetch||i.ul[0].firstChild?t:(i.dataSource.one(w,function(){i.value(n),i._fetch=!1}),i._fetch=!0,i.dataSource.fetch(),!0)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initialValues),t._placeholder()})},t._form=r.on("reset",t._resetHandler))},_initValue:function(){var e=this,n=e.options.value||e.element.val();null===n?n=[]:(O(n)||(n=[n]),n=e._mapValues(n)),e._old=e._initialValues=n,e._setInitialValues=n[0]!==t},_mapValues:function(t){var n=this;return t&&e.isPlainObject(t[0])&&(t=e.map(t,function(e){return n._value(e)})),t},_change:function(){var e=this,t=e.value();n(t,e._old)||(e._old=t.slice(),e.trigger(w),e.element.trigger(w))},_click:function(n){var i=this,r=e(n.currentTarget);if(!n.isDefaultPrevented()){if(i.trigger(b,{item:r}))return i._close(),t;i._select(r),i._change(),i._close()}},_item:function(e,t){return e=e[t](),e[0]&&!e.is(":visible")&&(e=this._item(e,t)),e},_keydown:function(n){var s=this,l=n.keyCode,d=s._currentTag,u=s._current,h=s.input.val(),p=a.support.isRtl(s.wrapper),f=s.popup.visible();if(l===c.DOWN){if(n.preventDefault(),!f)return s.open(),t;u=u?o(u[0],k):i(s.ul[0]),u&&s.current(e(u))}else if(l===c.UP)f&&(u=u?o(u[0],x):r(s.ul[0]),s.current(e(u)),s._current[0]||s.close()),n.preventDefault();else if(l===c.LEFT&&!p||l===c.RIGHT&&p)h||(d=d?d.prev():e(s.tagList[0].lastChild),d[0]&&s.currentTag(d));else if(l===c.RIGHT&&!p||l===c.LEFT&&p)!h&&d&&(d=d.next(),s.currentTag(d[0]?d:null));else if(l===c.ENTER&&f){if(u){if(s.trigger(b,{item:u}))return s._close(),t;s._select(u)}s._change(),s._close(),n.preventDefault()}else l===c.ESC?(f?n.preventDefault():s.currentTag(null),s.close()):l===c.HOME?f?s.current(i(s.ul[0])):h||(d=s.tagList[0].firstChild,d&&s.currentTag(e(d))):l===c.END?f?s.current(r(s.ul[0])):h||(d=s.tagList[0].lastChild,d&&s.currentTag(e(d))):l!==c.DELETE&&l!==c.BACKSPACE||h?(clearTimeout(s._typing),setTimeout(function(){s._scale()}),s._search()):(l!==c.BACKSPACE||d||(d=e(s.tagList[0].lastChild)),d&&d[0]&&(s._unselect(d),s._change(),s._close()))},_hideBusy:function(){var e=this;clearTimeout(e._busy),e.input.attr("aria-busy",!1),e._loading.addClass(A),e._request=!1,e._busy=null},_showBusyHandler:function(){this.input.attr("aria-busy",!0),this._loading.removeClass(A)},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(h(e._showBusyHandler,e),100))},_placeholder:function(e,n){var i=this,r=i.input,o=d();e===t&&(e=!1,r[0]!==o&&(e=!i._dataItems[0])),i._prev="",r.toggleClass("k-readonly",e).val(e?i.options.placeholder:""),r[0]!==o||n||a.caret(r[0],0,0),i._scale()},_scale:function(){var e,t=this,n=t.wrapper,i=n.width(),r=t._span.text(t.input.val());n.is(":visible")?e=r.width()+25:(r.appendTo(document.documentElement),i=e=r.width()+25,r.appendTo(n)),t.input.width(e>i?i:e)},_option:function(e,n){var i="<option",r=this._text(e),o=this._value(e);return o!==t&&(o+="",-1!==o.indexOf('"')&&(o=o.replace(N,"&quot;")),i+=' value="'+o+'"'),n&&(i+=' selected="selected"'),i+=">",r!==t&&(i+=a.htmlEncode(r)),i+="</option>"},_render:function(e){for(var t,n,i=this,r=e.length,o=i.itemTemplate,a=i._dataItems.slice(0),s=0,l=0,c="",d="";r>l;l++)t=e[l],n=i._selected(a,t),d+=o(t,l,n),c+=i._option(t,n),n||(s+=1);if(r=a.length)for(l=0;r>l;l++)c+=i._option(a[l],!0);return i.ul[0].innerHTML=d,i.element.html(c),i._visibleItems=s,s},_selected:function(e,n){var i,r=this,o=r._text,a=r._value,s=a(n),l=e.length,c=!1,d=0;for(s===t&&(s=o(n));l>d;d++)if(n=e[d],i=a(n),i===t&&(i=o(n)),i!==t&&i===s){c=!0;break}return c&&e.splice(d,1),c},_search:function(){var e=this;e._typing=setTimeout(function(){var t=e.input.val();e._prev!==t&&(e._prev=t,e.search(t))},e.options.delay)},_allowSelection:function(){var e=this.options.maxSelectedItems;return null===e||e>this._values.length},_select:function(e){var t,n,i=this,r=i._values;i._allowSelection()&&(isNaN(e)?n=e.hide().data("idx"):(n=e,i.ul[0].children[n].style.display="none"),i.element[0].children[n].selected=!0,t=i.dataSource.view()[n],i.tagList.append(i.tagTemplate(t)),i._dataItems.push(t),r.push(i._dataValue(t)),i._visibleItems-=1,i.currentTag(null),i._placeholder(),i._height(i._visibleItems),i._state===m&&(i._state=g))},_unselect:function(t){var n,i,r,o,a,s=this,l=t.index();if(t.remove(),s.currentTag(null),s._values.splice(l,1),n=s._dataItems.splice(l,1)[0],i=s._dataValue(n),l=s._index(i),-1!==l)e(s.ul[0].children[l]).show(),s.element[0].children[l].selected=!1,s._visibleItems+=1,s._height(s._visibleItems);else for(l=s.dataSource.view().length,r=s.element[0].children,a=r.length;a>l;l++)if(o=r[l],o.value==i){o.selected=!1;break}s._placeholder()},_template:function(){var e,t=this,n=t.options,i=n.itemTemplate,r=n.tagTemplate,o=n.dataSource;t.element[0].length&&!o&&(n.dataTextField=n.dataTextField||"text",n.dataValueField=n.dataValueField||"value"),e=a.template("#:"+a.expr(n.dataTextField,"data")+"#",{useWithBlock:!1}),i=i?a.template(i):e,r=r?a.template(r):e,t.itemTemplate=function(e,t,n){return'<li tabindex="-1" role="option" data-idx="'+t+'" unselectable="on" class="k-item"'+(n?C:"")+">"+i(e)+"</li>"},t.tagTemplate=function(e){return'<li class="k-button" unselectable="on"><span unselectable="on">'+r(e)+'</span><span unselectable="on" class="k-icon k-delete">delete</span></li>'}},_input:function(){var t=this,n=t.element[0].accessKey,i=t._innerWrapper.children("input.k-input");i[0]||(i=e('<input class="k-input" style="width: 25px" />').appendTo(t._innerWrapper)),t.element.removeAttr("accesskey"),t._focused=t.input=i.attr({accesskey:n,autocomplete:"off",role:"listbox","aria-expanded":!1})},_tagList:function(){var t=this,n=t._innerWrapper.children("ul");n[0]||(n=e('<ul role="listbox" unselectable="on" class="k-reset"/>').appendTo(t._innerWrapper)),t.tagList=n},_loader:function(){this._loading=e('<span class="k-icon k-loading '+A+'"></span>').insertAfter(this.input)},_textContainer:function(){var t=a.getComputedStyles(this.input[0],V);t.position="absolute",t.visibility="hidden",t.top=-3333,t.left=-3333,this._span=e("<span/>").css(t).appendTo(this.wrapper)},_wrapper:function(){var t=this,n=t.element,i=n.parent("span.k-multiselect");i[0]||(i=n.wrap('<div class="k-widget k-multiselect k-header" unselectable="on" />').parent(),i[0].style.cssText=n[0].style.cssText,e('<div class="k-multiselect-wrap k-floatwrap" unselectable="on" />').insertBefore(n)),t.wrapper=i.addClass(n[0].className).css("display",""),t._innerWrapper=e(i[0].firstChild)}});s.plugin(U)}(window.kendo.jQuery),function(e,t){function n(e,t,n){var i=n?" k-slider-horizontal":" k-slider-vertical",r=e.style?e.style:t.attr("style"),o=t.attr("class")?" "+t.attr("class"):"",a="";return"bottomRight"==e.tickPlacement?a=" k-slider-bottomright":"topLeft"==e.tickPlacement&&(a=" k-slider-topleft"),r=r?" style='"+r+"'":"","<div class='k-widget k-slider"+i+o+"'"+r+"><div class='k-slider-wrap"+(e.showButtons?" k-slider-buttons":"")+a+"'></div></div>"}function i(e,t,n){var i="";return i="increase"==t?n?"k-i-arrow-e":"k-i-arrow-n":n?"k-i-arrow-w":"k-i-arrow-s","<a class='k-button k-button-"+t+"'><span class='k-icon "+i+"' title='"+e[t+"ButtonTitle"]+"'>"+e[t+"ButtonTitle"]+"</span></a>"}function r(e,t){var n,i="<ul class='k-reset k-slider-items'>",r=k.floor(c(t/e.smallStep))+1;for(n=0;r>n;n++)i+="<li class='k-tick' role='presentation'>&nbsp;</li>";return i+="</ul>"}function o(e,t){var n=t.is("input")?1:2,i=2==n?e.leftDragHandleTitle:e.dragHandleTitle;return"<div class='k-slider-track'><div class='k-slider-selection'><!-- --></div><a href='#' class='k-draghandle' title='"+i+"' role='slider' aria-valuemin='"+e.min+"' aria-valuemax='"+e.max+"' aria-valuenow='"+(n>1?e.selectionStart||e.min:e.value||e.min)+"'>Drag</a>"+(n>1?"<a href='#' class='k-draghandle' title='"+e.rightDragHandleTitle+"'role='slider' aria-valuemin='"+e.min+"' aria-valuemax='"+e.max+"' aria-valuenow='"+(e.selectionEnd||e.max)+"'>Drag</a>":"")+"</div>"}function a(e){return function(t){return t+e}}function s(e){return function(){return e}}function l(e){return(e+"").replace(".",f.cultures.current.numberFormat["."])}function c(e){e=parseFloat(e,10);var t=k.pow(10,G||0);return k.round(e*t)/t}function d(e,n){var i=w(e.getAttribute(n));return null===i&&(i=t),i}function u(e){return typeof e!==Y}function h(e){return 1e4*e}var p,f=window.kendo,g=f.ui.Widget,m=f.ui.Draggable,v=e.extend,_=f.format,w=f.parseFloat,y=e.proxy,b=e.isArray,k=Math,x=f.support,C=x.pointers,T=x.msPointers,S="change",D="slide",A=".slider",E="touchstart"+A+" mousedown"+A,I=C?"pointerdown"+A:T?"MSPointerDown"+A:E,P="touchend"+A+" mouseup"+A,M=C?"pointerup":T?"MSPointerUp"+A:P,F="moveSelection",z="keydown"+A,R="click"+A,B="mouseover"+A,H="focus"+A,L="blur"+A,N=".k-draghandle",O=".k-slider-track",V=".k-tick",U="k-state-selected",W="k-state-focused",j="k-state-default",q="k-state-disabled",G=3,$="disabled",Y="undefined",Q="tabindex",K=f.getTouches,X=g.extend({init:function(e,t){var n,i=this;g.fn.init.call(i,e,t),t=i.options,i._distance=c(t.max-t.min),i._isHorizontal="horizontal"==t.orientation,i._isRtl=i._isHorizontal&&f.support.isRtl(e),i._position=i._isHorizontal?"left":"bottom",i._sizeFn=i._isHorizontal?"width":"height",i._outerSize=i._isHorizontal?"outerWidth":"outerHeight",t.tooltip.format=t.tooltip.enabled?t.tooltip.format||"{0}":"{0}",i._createHtml(),i.wrapper=i.element.closest(".k-slider"),i._trackDiv=i.wrapper.find(O),i._setTrackDivWidth(),i._maxSelection=i._trackDiv[i._sizeFn](),i._sliderItemsInit(),i._reset(),i._tabindex(i.wrapper.find(N)),i[t.enabled?"enable":"disable"](),n=f.support.isRtl(i.wrapper)?-1:1,i._keyMap={37:a(-1*n*t.smallStep),40:a(-t.smallStep),39:a(1*n*t.smallStep),38:a(+t.smallStep),35:s(t.max),36:s(t.min),33:a(+t.largeStep),34:a(-t.largeStep)},f.notify(i)
},events:[S,D],options:{enabled:!0,min:0,max:10,smallStep:1,largeStep:5,orientation:"horizontal",tickPlacement:"both",tooltip:{enabled:!0,format:"{0}"}},_resize:function(){this._setTrackDivWidth(),this.wrapper.find(".k-slider-items").remove(),this._maxSelection=this._trackDiv[this._sizeFn](),this._sliderItemsInit(),this._refresh()},_sliderItemsInit:function(){var e=this,t=e.options,n=e._maxSelection/((t.max-t.min)/t.smallStep),i=e._calculateItemsWidth(k.floor(e._distance/t.smallStep));"none"!=t.tickPlacement&&n>=2&&(e._trackDiv.before(r(t,e._distance)),e._setItemsWidth(i),e._setItemsTitle()),e._calculateSteps(i),"none"!=t.tickPlacement&&n>=2&&t.largeStep>=t.smallStep&&e._setItemsLargeTick()},getSize:function(){return f.dimensions(this.wrapper)},_setTrackDivWidth:function(){var e=this,t=2*parseFloat(e._trackDiv.css(e._isRtl?"right":e._position),10);e._trackDiv[e._sizeFn](e.wrapper[e._sizeFn]()-2-t)},_setItemsWidth:function(t){var n,i=this,r=i.options,o=0,a=t.length-1,s=i.wrapper.find(V),l=0,c=2,d=s.length,u=0;for(n=0;d-2>n;n++)e(s[n+1])[i._sizeFn](t[n]);if(i._isHorizontal?(e(s[o]).addClass("k-first")[i._sizeFn](t[a-1]),e(s[a]).addClass("k-last")[i._sizeFn](t[a])):(e(s[a]).addClass("k-first")[i._sizeFn](t[a]),e(s[o]).addClass("k-last")[i._sizeFn](t[a-1])),i._distance%r.smallStep!==0&&!i._isHorizontal){for(n=0;t.length>n;n++)u+=t[n];l=i._maxSelection-u,l+=parseFloat(i._trackDiv.css(i._position),10)+c,i.wrapper.find(".k-slider-items").css("padding-top",l)}},_setItemsTitle:function(){for(var t=this,n=t.options,i=t.wrapper.find(V),r=n.min,o=i.length,a=t._isHorizontal&&!t._isRtl?0:o-1,s=t._isHorizontal&&!t._isRtl?o:-1,l=t._isHorizontal&&!t._isRtl?1:-1;a-s!==0;a+=l)e(i[a]).attr("title",_(n.tooltip.format,c(r))),r+=n.smallStep},_setItemsLargeTick:function(){var t,n,i,r=this,o=r.options,a=r.wrapper.find(V),s=0;if(h(o.largeStep)%h(o.smallStep)===0||r._distance/o.largeStep>=3)for(r._isHorizontal||r._isRtl||(a=e.makeArray(a).reverse()),s=0;a.length>s;s++)t=e(a[s]),n=r._values[s],i=c(h(n-this.options.min)),i%h(o.smallStep)===0&&i%h(o.largeStep)===0&&(t.addClass("k-tick-large").html("<span class='k-label'>"+t.attr("title")+"</span>"),0!==s&&s!==a.length-1&&t.css("line-height",t[r._sizeFn]()+"px"))},_calculateItemsWidth:function(e){var t,n,i,r=this,o=r.options,a=parseFloat(r._trackDiv.css(r._sizeFn))+1,s=a/r._distance;for(r._distance/o.smallStep-k.floor(r._distance/o.smallStep)>0&&(a-=r._distance%o.smallStep*s),t=a/e,n=[],i=0;e-1>i;i++)n[i]=t;return n[e-1]=n[e]=t/2,r._roundWidths(n)},_roundWidths:function(e){var t,n=0,i=e.length;for(t=0;i>t;t++)n+=e[t]-k.floor(e[t]),e[t]=k.floor(e[t]);return n=k.round(n),this._addAdditionalSize(n,e)},_addAdditionalSize:function(e,t){if(0===e)return t;var n,i=parseFloat(t.length-1)/parseFloat(1==e?e:e-1);for(n=0;e>n;n++)t[parseInt(k.round(i*n),10)]+=1;return t},_calculateSteps:function(e){var t,n=this,i=n.options,r=i.min,o=0,a=k.ceil(n._distance/i.smallStep),s=1;if(a+=n._distance/i.smallStep%1===0?1:0,e.splice(0,0,2*e[a-2]),e.splice(a-1,1,2*e.pop()),n._pixelSteps=[o],n._values=[r],0!==a){for(;a>s;)o+=(e[s-1]+e[s])/2,n._pixelSteps[s]=o,r+=i.smallStep,n._values[s]=c(r),s++;t=n._distance%i.smallStep===0?a-1:a,n._pixelSteps[t]=n._maxSelection,n._values[t]=i.max,n._isRtl&&(n._pixelSteps.reverse(),n._values.reverse())}},_getValueFromPosition:function(e,t){var n,i=this,r=i.options,o=k.max(r.smallStep*(i._maxSelection/i._distance),0),a=0,s=o/2;if(i._isHorizontal?(a=e-t.startPoint,i._isRtl&&(a=i._maxSelection-a)):a=t.startPoint-e,i._maxSelection-(parseInt(i._maxSelection%o,10)-3)/2<a)return r.max;for(n=0;i._pixelSteps.length>n;n++)if(k.abs(i._pixelSteps[n]-a)-1<=s)return c(i._values[n])},_getFormattedValue:function(e,t){var n,i,r,o=this,a="",s=o.options.tooltip;return b(e)?(i=e[0],r=e[1]):t&&t.type&&(i=t.selectionStart,r=t.selectionEnd),t&&(n=t.tooltipTemplate),!n&&s.template&&(n=f.template(s.template)),b(e)||t&&t.type?n?a=n({selectionStart:i,selectionEnd:r}):(i=_(s.format,i),r=_(s.format,r),a=i+" - "+r):(t&&(t.val=e),a=n?n({value:e}):_(s.format,e)),a},_getDraggableArea:function(){var e=this,t=f.getOffset(e._trackDiv);return{startPoint:e._isHorizontal?t.left:t.top+e._maxSelection,endPoint:e._isHorizontal?t.left+e._maxSelection:t.top}},_createHtml:function(){var e=this,t=e.element,r=e.options,a=t.find("input");2==a.length?(a.eq(0).prop("value",l(r.selectionStart)),a.eq(1).prop("value",l(r.selectionEnd))):t.prop("value",l(r.value)),t.wrap(n(r,t,e._isHorizontal)).hide(),r.showButtons&&t.before(i(r,"increase",e._isHorizontal)).before(i(r,"decrease",e._isHorizontal)),t.before(o(r,t))},_focus:function(t){var n=this,i=t.target,r=n.value(),o=n._drag;o||(i==n.wrapper.find(N).eq(0)[0]?(o=n._firstHandleDrag,n._activeHandle=0):(o=n._lastHandleDrag,n._activeHandle=1),r=r[n._activeHandle]),e(i).addClass(W+" "+U),o&&(n._activeHandleDrag=o,o.selectionStart=n.options.selectionStart,o.selectionEnd=n.options.selectionEnd,o._updateTooltip(r))},_focusWithMouse:function(t){t=e(t);var n=this,i=t.is(N)?t.index():0;window.setTimeout(function(){n.wrapper.find(N)[2==i?1:0].focus()},1),n._setTooltipTimeout()},_blur:function(t){var n=this,i=n._activeHandleDrag;e(t.target).removeClass(W+" "+U),i&&(i._removeTooltip(),delete n._activeHandleDrag,delete n._activeHandle)},_setTooltipTimeout:function(){var e=this;e._tooltipTimeout=window.setTimeout(function(){var t=e._drag||e._activeHandleDrag;t&&t._removeTooltip()},300)},_clearTooltipTimeout:function(){var e,t=this;window.clearTimeout(this._tooltipTimeout),e=t._drag||t._activeHandleDrag,e&&e.tooltipDiv&&e.tooltipDiv.stop(!0,!1).css("opacity",1)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._form=r.on("reset",y(t._formResetHandler,t)))},destroy:function(){this._form&&this._form.off("reset",this._formResetHandler),g.fn.destroy.call(this)}}),Z=X.extend({init:function(n,i){var r,o=this;n.type="text",i=v({},{value:d(n,"value"),min:d(n,"min"),max:d(n,"max"),smallStep:d(n,"step")},i),n=e(n),i&&i.enabled===t&&(i.enabled=!n.is("[disabled]")),X.fn.init.call(o,n,i),i=o.options,u(i.value)&&null!==i.value||(i.value=i.min,n.prop("value",l(i.min))),i.value=k.max(k.min(i.value,i.max),i.min),r=o.wrapper.find(N),new Z.Selection(r,o,i),o._drag=new Z.Drag(r,"",o,i)},options:{name:"Slider",showButtons:!0,increaseButtonTitle:"Increase",decreaseButtonTitle:"Decrease",dragHandleTitle:"drag",tooltip:{format:"{0:#,#.##}"},value:null},enable:function(n){var i,r,o,a=this,s=a.options;a.disable(),n!==!1&&(a.wrapper.removeClass(q).addClass(j),a.wrapper.find("input").removeAttr($),i=function(n){var i,r,o,s=K(n)[0];if(s){if(i=a._isHorizontal?s.location.pageX:s.location.pageY,r=a._getDraggableArea(),o=e(n.target),o.hasClass("k-draghandle"))return o.addClass(W+" "+U),t;a._update(a._getValueFromPosition(i,r)),a._focusWithMouse(n.target),a._drag.dragstart(n),n.preventDefault()}},a.wrapper.find(V+", "+O).on(I,i).end().on(I,function(){e(document.documentElement).one("selectstart",f.preventDefault)}).on(M,function(){a._drag._end()}),a.wrapper.find(N).attr(Q,0).on(P,function(){a._setTooltipTimeout()}).on(R,function(e){a._focusWithMouse(e.target),e.preventDefault()}).on(H,y(a._focus,a)).on(L,y(a._blur,a)),r=y(function(e){var t=a._nextValueByIndex(a._valueIndex+1*e);a._setValueInRange(t),a._drag._updateTooltip(t)},a),s.showButtons&&(o=y(function(e,t){this._clearTooltipTimeout(),(1===e.which||x.touch&&0===e.which)&&(r(t),this.timeout=setTimeout(y(function(){this.timer=setInterval(function(){r(t)},60)},this),200))},a),a.wrapper.find(".k-button").on(P,y(function(e){this._clearTimer(),a._focusWithMouse(e.target)},a)).on(B,function(t){e(t.currentTarget).addClass("k-state-hover")}).on("mouseout"+A,y(function(t){e(t.currentTarget).removeClass("k-state-hover"),this._clearTimer()},a)).eq(0).on(E,y(function(e){o(e,1)},a)).click(!1).end().eq(1).on(E,y(function(e){o(e,-1)},a)).click(f.preventDefault)),a.wrapper.find(N).off(z,!1).on(z,y(this._keydown,a)),s.enabled=!0)},disable:function(){var t=this;t.wrapper.removeClass(j).addClass(q),e(t.element).prop($,$),t.wrapper.find(".k-button").off(E).on(E,f.preventDefault).off(P).on(P,f.preventDefault).off("mouseleave"+A).on("mouseleave"+A,f.preventDefault).off(B).on(B,f.preventDefault),t.wrapper.find(V+", "+O).off(I).off(M),t.wrapper.find(N).attr(Q,-1).off(P).off(z).off(R).off(H).off(L),t.options.enabled=!1},_update:function(e){var t=this,n=t.value()!=e;t.value(e),n&&t.trigger(S,{value:t.options.value})},value:function(e){var n=this,i=n.options;return e=c(e),isNaN(e)?i.value:(e>=i.min&&i.max>=e&&i.value!=e&&(n.element.prop("value",l(e)),i.value=e,n._refreshAriaAttr(e),n._refresh()),t)},_refresh:function(){this.trigger(F,{value:this.options.value})},_refreshAriaAttr:function(e){var t,n=this,i=n._drag;t=i&&i._tooltipDiv?i._tooltipDiv.text():n._getFormattedValue(e,null),this.wrapper.find(N).attr("aria-valuenow",e).attr("aria-valuetext",t)},_clearTimer:function(){clearTimeout(this.timeout),clearInterval(this.timer)},_keydown:function(e){var t=this;e.keyCode in t._keyMap&&(t._clearTooltipTimeout(),t._setValueInRange(t._keyMap[e.keyCode](t.options.value)),t._drag._updateTooltip(t.value()),e.preventDefault())},_setValueInRange:function(e){var n=this,i=n.options;return e=c(e),isNaN(e)?(n._update(i.min),t):(e=k.max(k.min(e,i.max),i.min),n._update(e),t)},_nextValueByIndex:function(e){var t=this._values.length;return this._isRtl&&(e=t-1-e),this._values[k.max(0,k.min(e,t-1))]},_formResetHandler:function(){var e=this,t=e.options.min;setTimeout(function(){var n=e.element[0].value;e.value(""===n||isNaN(n)?t:n)})},destroy:function(){var e=this;X.fn.destroy.call(e),e.wrapper.off(A).find(".k-button").off(A).end().find(N).off(A).end().find(V+", "+O).off(A).end(),e._drag.draggable.destroy(),e._drag._removeTooltip(!0)}});Z.Selection=function(e,t,n){function i(i){var r=i-n.min,o=t._valueIndex=k.ceil(c(r/n.smallStep)),a=parseInt(t._pixelSteps[o],10),s=t._trackDiv.find(".k-slider-selection"),l=parseInt(e[t._outerSize]()/2,10),d=t._isRtl?2:0;s[t._sizeFn](t._isRtl?t._maxSelection-a:a),e.css(t._position,a-l-d)}i(n.value),t.bind([S,D,F],function(e){i(parseFloat(e.value,10))})},Z.Drag=function(e,t,n,i){var r=this;r.owner=n,r.options=i,r.element=e,r.type=t,r.draggable=new m(e,{distance:0,dragstart:y(r._dragstart,r),drag:y(r.drag,r),dragend:y(r.dragend,r),dragcancel:y(r.dragcancel,r)}),e.click(!1)},Z.Drag.prototype={dragstart:function(e){this.owner._activeDragHandle=this,this.draggable.userEvents.cancel(),this.draggable.userEvents._start(e)},_dragstart:function(n){var i=this,r=i.owner,o=i.options;return o.enabled?(this.owner._activeDragHandle=this,r.element.off(B),r.wrapper.find("."+W).removeClass(W+" "+U),i.element.addClass(W+" "+U),e(document.documentElement).css("cursor","pointer"),i.dragableArea=r._getDraggableArea(),i.step=k.max(o.smallStep*(r._maxSelection/r._distance),0),i.type?(i.selectionStart=o.selectionStart,i.selectionEnd=o.selectionEnd,r._setZIndex(i.type)):i.oldVal=i.val=o.value,i._removeTooltip(!0),i._createTooltip(),t):(n.preventDefault(),t)},_createTooltip:function(){var t,n,i=this,r=i.owner,o=i.options.tooltip,a="",s=e(window);o.enabled&&(o.template&&(t=i.tooltipTemplate=f.template(o.template)),e(".k-slider-tooltip").remove(),i.tooltipDiv=e("<div class='k-widget k-tooltip k-slider-tooltip'><!-- --></div>").appendTo(document.body),a=r._getFormattedValue(i.val||r.value(),i),i.type||(n="k-callout-"+(r._isHorizontal?"s":"e"),i.tooltipInnerDiv="<div class='k-callout "+n+"'><!-- --></div>",a+=i.tooltipInnerDiv),i.tooltipDiv.html(a),i._scrollOffset={top:s.scrollTop(),left:s.scrollLeft()},i.moveTooltip())},drag:function(e){var t,n=this,i=n.owner,r=e.x.location,o=e.y.location,a=n.dragableArea.startPoint,s=n.dragableArea.endPoint;e.preventDefault(),n.val=i._isHorizontal?i._isRtl?n.constrainValue(r,a,s,s>r):n.constrainValue(r,a,s,r>=s):n.constrainValue(o,s,a,s>=o),n.oldVal!=n.val&&(n.oldVal=n.val,n.type?("firstHandle"==n.type?n.selectionStart=n.selectionEnd>n.val?n.val:n.selectionEnd=n.val:n.val>n.selectionStart?n.selectionEnd=n.val:n.selectionStart=n.selectionEnd=n.val,t={values:[n.selectionStart,n.selectionEnd],value:[n.selectionStart,n.selectionEnd]}):t={value:n.val},i.trigger(D,t)),n._updateTooltip(n.val)},_updateTooltip:function(e){var t=this,n=t.options,i=n.tooltip,r="";i.enabled&&(t.tooltipDiv||t._createTooltip(),r=t.owner._getFormattedValue(c(e),t),t.type||(r+=t.tooltipInnerDiv),t.tooltipDiv.html(r),t.moveTooltip())},dragcancel:function(){return this.owner._refresh(),e(document.documentElement).css("cursor",""),this._end()},dragend:function(){var t=this,n=t.owner;return e(document.documentElement).css("cursor",""),t.type?n._update(t.selectionStart,t.selectionEnd):(n._update(t.val),t.draggable.userEvents._disposeAll()),t._end()},_end:function(){var e=this,t=e.owner;return t._focusWithMouse(e.element),t.element.on(B),!1},_removeTooltip:function(t){var n=this,i=n.owner;n.tooltipDiv&&i.options.tooltip.enabled&&i.options.enabled&&(t?(n.tooltipDiv.remove(),n.tooltipDiv=null):n.tooltipDiv.fadeOut("slow",function(){e(this).remove(),n.tooltipDiv=null}))},moveTooltip:function(){var t,n,i,r,o=this,a=o.owner,s=0,l=0,c=o.element,d=f.getOffset(c),u=8,h=e(window),p=o.tooltipDiv.find(".k-callout"),g=o.tooltipDiv.outerWidth(),m=o.tooltipDiv.outerHeight();o.type?(t=a.wrapper.find(N),d=f.getOffset(t.eq(0)),n=f.getOffset(t.eq(1)),a._isHorizontal?(s=n.top,l=d.left+(n.left-d.left)/2):(s=d.top+(n.top-d.top)/2,l=n.left),r=t.eq(0).outerWidth()+2*u):(s=d.top,l=d.left,r=c.outerWidth()+2*u),a._isHorizontal?(l-=parseInt((g-c[a._outerSize]())/2,10),s-=m+p.height()+u):(s-=parseInt((m-c[a._outerSize]())/2,10),l-=g+p.width()+u),a._isHorizontal?(i=o._flip(s,m,r,h.outerHeight()+o._scrollOffset.top),s+=i,l+=o._fit(l,g,h.outerWidth()+o._scrollOffset.left)):(i=o._flip(l,g,r,h.outerWidth()+o._scrollOffset.left),s+=o._fit(s,m,h.outerHeight()+o._scrollOffset.top),l+=i),i>0&&p&&(p.removeClass(),p.addClass("k-callout k-callout-"+(a._isHorizontal?"n":"w"))),o.tooltipDiv.css({top:s,left:l})},_fit:function(e,t,n){var i=0;return e+t>n&&(i=n-(e+t)),0>e&&(i=-e),i},_flip:function(e,t,n,i){var r=0;return e+t>i&&(r+=-(n+t)),0>e+r&&(r+=n+t),r},constrainValue:function(e,t,n,i){var r=this,o=0;return o=e>t&&n>e?r.owner._getValueFromPosition(e,r.dragableArea):i?r.options.max:r.options.min}},f.ui.plugin(Z),p=X.extend({init:function(n,i){var r,o=this,a=e(n).find("input"),s=a.eq(0)[0],c=a.eq(1)[0];s.type="text",c.type="text",i=v({},{selectionStart:d(s,"value"),min:d(s,"min"),max:d(s,"max"),smallStep:d(s,"step")},{selectionEnd:d(c,"value"),min:d(c,"min"),max:d(c,"max"),smallStep:d(c,"step")},i),i&&i.enabled===t&&(i.enabled=!a.is("[disabled]")),X.fn.init.call(o,n,i),i=o.options,u(i.selectionStart)&&null!==i.selectionStart||(i.selectionStart=i.min,a.eq(0).prop("value",l(i.min))),u(i.selectionEnd)&&null!==i.selectionEnd||(i.selectionEnd=i.max,a.eq(1).prop("value",l(i.max))),r=o.wrapper.find(N),new p.Selection(r,o,i),o._firstHandleDrag=new Z.Drag(r.eq(0),"firstHandle",o,i),o._lastHandleDrag=new Z.Drag(r.eq(1),"lastHandle",o,i)},options:{name:"RangeSlider",leftDragHandleTitle:"drag",rightDragHandleTitle:"drag",tooltip:{format:"{0:#,#.##}"},selectionStart:null,selectionEnd:null},enable:function(n){var i,r=this,o=r.options;r.disable(),n!==!1&&(r.wrapper.removeClass(q).addClass(j),r.wrapper.find("input").removeAttr($),i=function(n){var i,a,s,l,c,d,u,h=K(n)[0];if(h){if(i=r._isHorizontal?h.location.pageX:h.location.pageY,a=r._getDraggableArea(),s=r._getValueFromPosition(i,a),l=e(n.target),l.hasClass("k-draghandle"))return r.wrapper.find("."+W).removeClass(W+" "+U),l.addClass(W+" "+U),t;o.selectionStart>s?(c=s,d=o.selectionEnd,u=r._firstHandleDrag):s>r.selectionEnd?(c=o.selectionStart,d=s,u=r._lastHandleDrag):o.selectionEnd-s>=s-o.selectionStart?(c=s,d=o.selectionEnd,u=r._firstHandleDrag):(c=o.selectionStart,d=s,u=r._lastHandleDrag),u.dragstart(n),r._setValueInRange(c,d),r._focusWithMouse(u.element)}},r.wrapper.find(V+", "+O).on(I,i).end().on(I,function(){e(document.documentElement).one("selectstart",f.preventDefault)}).on(M,function(){r._activeDragHandle&&r._activeDragHandle._end()}),r.wrapper.find(N).attr(Q,0).on(P,function(){r._setTooltipTimeout()}).on(R,function(e){r._focusWithMouse(e.target),e.preventDefault()}).on(H,y(r._focus,r)).on(L,y(r._blur,r)),r.wrapper.find(N).off(z,f.preventDefault).eq(0).on(z,y(function(e){this._keydown(e,"firstHandle")},r)).end().eq(1).on(z,y(function(e){this._keydown(e,"lastHandle")},r)),r.options.enabled=!0)},disable:function(){var e=this;e.wrapper.removeClass(j).addClass(q),e.wrapper.find("input").prop($,$),e.wrapper.find(V+", "+O).off(I).off(M),e.wrapper.find(N).attr(Q,-1).off(P).off(z).off(R).off(H).off(L),e.options.enabled=!1},_keydown:function(e,t){var n,i,r,o=this,a=o.options.selectionStart,s=o.options.selectionEnd;e.keyCode in o._keyMap&&(o._clearTooltipTimeout(),"firstHandle"==t?(r=o._activeHandleDrag=o._firstHandleDrag,a=o._keyMap[e.keyCode](a),a>s&&(s=a)):(r=o._activeHandleDrag=o._lastHandleDrag,s=o._keyMap[e.keyCode](s),a>s&&(a=s)),o._setValueInRange(a,s),n=Math.max(a,o.options.selectionStart),i=Math.min(s,o.options.selectionEnd),r.selectionEnd=Math.max(i,o.options.selectionStart),r.selectionStart=Math.min(n,o.options.selectionEnd),r._updateTooltip(o.value()[o._activeHandle]),e.preventDefault())},_update:function(e,t){var n=this,i=n.value(),r=i[0]!=e||i[1]!=t;n.value([e,t]),r&&n.trigger(S,{values:[e,t],value:[e,t]})},value:function(e){return e&&e.length?this._value(e[0],e[1]):this._value()},_value:function(e,n){var i=this,r=i.options,o=r.selectionStart,a=r.selectionEnd;return isNaN(e)&&isNaN(n)?[o,a]:(e=c(e),n=c(n),e>=r.min&&r.max>=e&&n>=r.min&&r.max>=n&&n>=e&&(o!=e||a!=n)&&(i.element.find("input").eq(0).prop("value",l(e)).end().eq(1).prop("value",l(n)),r.selectionStart=e,r.selectionEnd=n,i._refresh(),i._refreshAriaAttr(e,n)),t)},values:function(e,t){return b(e)?this._value(e[0],e[1]):this._value(e,t)},_refresh:function(){var e=this,t=e.options;e.trigger(F,{values:[t.selectionStart,t.selectionEnd],value:[t.selectionStart,t.selectionEnd]}),t.selectionStart==t.max&&t.selectionEnd==t.max&&e._setZIndex("firstHandle")},_refreshAriaAttr:function(e,t){var n,i=this,r=i.wrapper.find(N),o=i._activeHandleDrag;n=i._getFormattedValue([e,t],o),r.eq(0).attr("aria-valuenow",e),r.eq(1).attr("aria-valuenow",t),r.attr("aria-valuetext",n)},_setValueInRange:function(e,t){var n=this.options;e=k.max(k.min(e,n.max),n.min),t=k.max(k.min(t,n.max),n.min),e==n.max&&t==n.max&&this._setZIndex("firstHandle"),this._update(k.min(e,t),k.max(e,t))},_setZIndex:function(t){this.wrapper.find(N).each(function(n){e(this).css("z-index","firstHandle"==t?1-n:n)})},_formResetHandler:function(){var e=this,t=e.options;setTimeout(function(){var n=e.element.find("input"),i=n[0].value,r=n[1].value;e.values(""===i||isNaN(i)?t.min:i,""===r||isNaN(r)?t.max:r)})},destroy:function(){var e=this;X.fn.destroy.call(e),e.wrapper.off(A).find(V+", "+O).off(A).end().find(N).off(A),e._firstHandleDrag.draggable.destroy(),e._lastHandleDrag.draggable.destroy()}}),p.Selection=function(e,t,n){function i(i){i=i||[];var o=i[0]-n.min,a=i[1]-n.min,s=k.ceil(c(o/n.smallStep)),l=k.ceil(c(a/n.smallStep)),d=t._pixelSteps[s],u=t._pixelSteps[l],h=parseInt(e.eq(0)[t._outerSize]()/2,10),p=t._isRtl?2:0;e.eq(0).css(t._position,d-h-p).end().eq(1).css(t._position,u-h-p),r(d,u)}function r(e,n){var i,r,o=t._trackDiv.find(".k-slider-selection");i=k.abs(e-n),o[t._sizeFn](i),t._isRtl?(r=k.max(e,n),o.css("right",t._maxSelection-r-1)):(r=k.min(e,n),o.css(t._position,r-1))}i(t.value()),t.bind([S,D,F],function(e){i(e.values)})},f.ui.plugin(p)}(window.kendo.jQuery),function(e,t,n){function i(e,t,n){n=d(n),n&&!n.equals(e.color())&&("change"==t&&(e._value=n),n=1!=n.a?n.toCssRgba():n.toCss(),e.trigger(t,{value:n}))}function r(e,t,n){var i,r;return e=Array.prototype.slice.call(e),i=e.length,r=e.indexOf(t),0>r?0>n?e[i-1]:e[0]:(r+=n,0>r?r+=i:r%=i,e[r])}function o(e){e.preventDefault()}function a(e,t){return function(){return e.apply(t,arguments)}}var s=window.kendo,l=s.ui,c=l.Widget,d=s.parseColor,u=s.Color,h=s.keys,p="background-color",f="k-state-selected",g="000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7",m="FFFFFF,FFCCFF,FF99FF,FF66FF,FF33FF,FF00FF,CCFFFF,CCCCFF,CC99FF,CC66FF,CC33FF,CC00FF,99FFFF,99CCFF,9999FF,9966FF,9933FF,9900FF,FFFFCC,FFCCCC,FF99CC,FF66CC,FF33CC,FF00CC,CCFFCC,CCCCCC,CC99CC,CC66CC,CC33CC,CC00CC,99FFCC,99CCCC,9999CC,9966CC,9933CC,9900CC,FFFF99,FFCC99,FF9999,FF6699,FF3399,FF0099,CCFF99,CCCC99,CC9999,CC6699,CC3399,CC0099,99FF99,99CC99,999999,996699,993399,990099,FFFF66,FFCC66,FF9966,FF6666,FF3366,FF0066,CCFF66,CCCC66,CC9966,CC6666,CC3366,CC0066,99FF66,99CC66,999966,996666,993366,990066,FFFF33,FFCC33,FF9933,FF6633,FF3333,FF0033,CCFF33,CCCC33,CC9933,CC6633,CC3333,CC0033,99FF33,99CC33,999933,996633,993333,990033,FFFF00,FFCC00,FF9900,FF6600,FF3300,FF0000,CCFF00,CCCC00,CC9900,CC6600,CC3300,CC0000,99FF00,99CC00,999900,996600,993300,990000,66FFFF,66CCFF,6699FF,6666FF,6633FF,6600FF,33FFFF,33CCFF,3399FF,3366FF,3333FF,3300FF,00FFFF,00CCFF,0099FF,0066FF,0033FF,0000FF,66FFCC,66CCCC,6699CC,6666CC,6633CC,6600CC,33FFCC,33CCCC,3399CC,3366CC,3333CC,3300CC,00FFCC,00CCCC,0099CC,0066CC,0033CC,0000CC,66FF99,66CC99,669999,666699,663399,660099,33FF99,33CC99,339999,336699,333399,330099,00FF99,00CC99,009999,006699,003399,000099,66FF66,66CC66,669966,666666,663366,660066,33FF66,33CC66,339966,336666,333366,330066,00FF66,00CC66,009966,006666,003366,000066,66FF33,66CC33,669933,666633,663333,660033,33FF33,33CC33,339933,336633,333333,330033,00FF33,00CC33,009933,006633,003333,000033,66FF00,66CC00,669900,666600,663300,660000,33FF00,33CC00,339900,336600,333300,330000,00FF00,00CC00,009900,006600,003300,000000",v={apply:"Apply",cancel:"Cancel"},_=".kendoColorTools",w="click"+_,y="keydown"+_,b=s.support.browser,k=b.msie&&9>b.version,x=c.extend({init:function(e,t){var n,i=this;c.fn.init.call(i,e,t),e=i.element,t=i.options,i._value=t.value=d(t.value),i._tabIndex=e.attr("tabIndex")||0,n=i._ariaId=t.ariaId,n&&e.attr("aria-labelledby",n),t._standalone&&(i._triggerSelect=i._triggerChange)},options:{name:"ColorSelector",value:null,_standalone:!0},events:["change","select","cancel"],color:function(e){return e!==n&&(this._value=d(e),this._updateUI(this._value)),this._value},value:function(e){return e=this.color(e),e&&(e=this.options.opacity?e.toCssRgba():e.toCss()),e||null},enable:function(t){0===arguments.length&&(t=!0),e(".k-disabled-overlay",this.wrapper).remove(),t||this.wrapper.append("<div class='k-disabled-overlay'></div>"),this._onEnable(t)},_select:function(e,t){var n=this._value;e=this.color(e),t||(this.element.trigger("change"),e.equals(n)?this._standalone||this.trigger("cancel"):this.trigger("change",{value:this.value()}))},_triggerSelect:function(e){i(this,"select",e)},_triggerChange:function(e){i(this,"change",e)},destroy:function(){this.element&&this.element.off(_),this.wrapper&&this.wrapper.off(_).find("*").off(_),this.wrapper=null,c.fn.destroy.call(this)},_updateUI:e.noop,_selectOnHide:function(){return null},_cancel:function(){this.trigger("cancel")}}),C=x.extend({init:function(t,n){var i,r,o,l,c=this;if(x.fn.init.call(c,t,n),t=c.wrapper=c.element,n=c.options,i=n.palette,"websafe"==i?(i=m,n.columns=18):"basic"==i&&(i=g),"string"==typeof i&&(i=i.split(",")),e.isArray(i)&&(i=e.map(i,function(e){return d(e)})),c._selectedID=(n.ariaId||s.guid())+"_selected",t.addClass("k-widget k-colorpalette").attr("role","grid").attr("aria-readonly","true").append(e(c._template({colors:i,columns:n.columns,tileSize:n.tileSize,value:c._value,id:n.ariaId}))).on(w,".k-item",function(t){c._select(e(t.currentTarget).css(p))}).attr("tabIndex",c._tabIndex).on(y,a(c._keydown,c)),r=n.tileSize){if(/number|string/.test(typeof r))o=l=parseFloat(r);else{if("object"!=typeof r)throw Error("Unsupported value for the 'tileSize' argument");o=parseFloat(r.width),l=parseFloat(r.height)}t.find(".k-item").css({width:o,height:l})}},focus:function(){this.wrapper.focus()},options:{name:"ColorPalette",columns:10,tileSize:null,palette:"basic"},_onEnable:function(e){e?this.wrapper.attr("tabIndex",this._tabIndex):this.wrapper.removeAttr("tabIndex")},_keydown:function(t){var n,i,a=this.wrapper,s=a.find(".k-item"),l=s.filter("."+f).get(0),c=t.keyCode;if(c==h.LEFT?n=r(s,l,-1):c==h.RIGHT?n=r(s,l,1):c==h.DOWN?n=r(s,l,this.options.columns):c==h.UP?n=r(s,l,-this.options.columns):c==h.ENTER?(o(t),l&&this._select(e(l).css(p))):c==h.ESC&&this._cancel(),n){o(t),this._current(n);try{i=d(n.css(p)),this._triggerSelect(i)}catch(u){}}},_current:function(t){this.wrapper.find("."+f).removeClass(f).attr("aria-selected",!1).removeAttr("id"),e(t).addClass(f).attr("aria-selected",!0).attr("id",this._selectedID),this.element.removeAttr("aria-activedescendant").attr("aria-activedescendant",this._selectedID)},_updateUI:function(t){var i=null;this.wrapper.find(".k-item").each(function(){var r=d(e(this).css(p));return r&&r.equals(t)?(i=this,!1):n}),this._current(i)},_template:s.template('<table class="k-palette k-reset" role="presentation"><tr role="row"># for (var i = 0; i < colors.length; ++i) { ## var selected = colors[i].equals(value); ## if (i && i % columns == 0) { # </tr><tr role="row"> # } #<td role="gridcell" unselectable="on" style="background-color:#= colors[i].toCss() #"#= selected ? " aria-selected=true" : "" # #=(id && i === 0) ? "id=\\""+id+"\\" " : "" # class="k-item#= selected ? " '+f+'" : "" #" aria-label="#= colors[i].toCss() #"></td># } #</tr></table>')}),T=x.extend({init:function(t,n){var i=this;x.fn.init.call(i,t,n),n=i.options,t=i.element,i.wrapper=t.addClass("k-widget k-flatcolorpicker").append(i._template(n)),i._hueElements=e(".k-hsv-rectangle, .k-transparency-slider .k-slider-track",t),i._selectedColor=e(".k-selected-color-display",t),i._colorAsText=e("input.k-color-value",t),i._sliders(),i._hsvArea(),i._updateUI(i._value||d("#f00")),t.find("input.k-color-value").on(y,function(t){var n,r,o=this;if(t.keyCode==h.ENTER)try{n=d(o.value),r=i.color(),i._select(n,n.equals(r))}catch(a){e(o).addClass("k-state-error")}else i.options.autoupdate&&setTimeout(function(){var e=d(o.value,!0);e&&i._updateUI(e,!0)},10)}).end().on(w,".k-controls button.apply",function(){i._select(i._getHSV())}).on(w,".k-controls button.cancel",function(){i._updateUI(i.color()),i._cancel()}),k&&i._applyIEFilter()},destroy:function(){this._hueSlider.destroy(),this._opacitySlider&&this._opacitySlider.destroy(),this._hueSlider=this._opacitySlider=this._hsvRect=this._hsvHandle=this._hueElements=this._selectedColor=this._colorAsText=null,x.fn.destroy.call(this)},options:{name:"FlatColorPicker",opacity:!1,buttons:!1,input:!0,preview:!0,autoupdate:!0,messages:v},_applyIEFilter:function(){var e=this.element.find(".k-hue-slider .k-slider-track")[0],t=e.currentStyle.backgroundImage;t=t.replace(/^url\([\'\"]?|[\'\"]?\)$/g,""),e.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+t+"', sizingMethod='scale')"},_sliders:function(){function e(e){n._updateUI(n._getHSV(e.value,null,null,null))}function t(e){n._updateUI(n._getHSV(null,null,null,e.value/100))}var n=this,i=n.element;n._hueSlider=i.find(".k-hue-slider").kendoSlider({min:0,max:359,tickPlacement:"none",showButtons:!1,slide:e,change:e}).data("kendoSlider"),n._opacitySlider=i.find(".k-transparency-slider").kendoSlider({min:0,max:100,tickPlacement:"none",showButtons:!1,slide:t,change:t}).data("kendoSlider")},_hsvArea:function(){function e(e,n){var i=this.offset,r=e-i.left,o=n-i.top,a=this.width,s=this.height;r=0>r?0:r>a?a:r,o=0>o?0:o>s?s:o,t._svChange(r/a,1-o/s)}var t=this,n=t.element,i=n.find(".k-hsv-rectangle"),r=i.find(".k-draghandle").attr("tabIndex",0).on(y,a(t._keydown,t));t._hsvEvents=new s.UserEvents(i,{global:!0,press:function(t){this.offset=s.getOffset(i),this.width=i.width(),this.height=i.height(),r.focus(),e.call(this,t.x.location,t.y.location)},start:function(){i.addClass("k-dragging"),r.focus()},move:function(t){t.preventDefault(),e.call(this,t.x.location,t.y.location)},end:function(){i.removeClass("k-dragging")}}),t._hsvRect=i,t._hsvHandle=r},_onEnable:function(e){this._hueSlider.enable(e),this._opacitySlider&&this._opacitySlider.enable(e),this.wrapper.find("input").attr("disabled",!e);var t=this._hsvRect.find(".k-draghandle");e?t.attr("tabIndex",this._tabIndex):t.removeAttr("tabIndex")},_keydown:function(e){function t(t,n){var r=i._getHSV();r[t]+=n*(e.shiftKey?.01:.05),0>r[t]&&(r[t]=0),r[t]>1&&(r[t]=1),i._updateUI(r),o(e)}function n(t){var n=i._getHSV();n.h+=t*(e.shiftKey?1:5),0>n.h&&(n.h=0),n.h>359&&(n.h=359),i._updateUI(n),o(e)}var i=this;switch(e.keyCode){case h.LEFT:e.ctrlKey?n(-1):t("s",-1);break;case h.RIGHT:e.ctrlKey?n(1):t("s",1);break;case h.UP:t(e.ctrlKey&&i._opacitySlider?"a":"v",1);break;case h.DOWN:t(e.ctrlKey&&i._opacitySlider?"a":"v",-1);break;case h.ENTER:i._select(i._getHSV());break;case h.F2:i.wrapper.find("input.k-color-value").focus().select();break;case h.ESC:i._cancel()}},focus:function(){this._hsvHandle.focus()},_getHSV:function(e,t,n,i){var r=this._hsvRect,o=r.width(),a=r.height(),s=this._hsvHandle.position();return null==e&&(e=this._hueSlider.value()),null==t&&(t=s.left/o),null==n&&(n=1-s.top/a),null==i&&(i=this._opacitySlider?this._opacitySlider.value()/100:1),u.fromHSV(e,t,n,i)},_svChange:function(e,t){var n=this._getHSV(null,e,t,null);this._updateUI(n)},_updateUI:function(e,t){var n=this,i=n._hsvRect;e&&(this._colorAsText.removeClass("k-state-error"),n._selectedColor.css(p,e.toDisplay()),t||n._colorAsText.val(n._opacitySlider?e.toCssRgba():e.toCss()),n._triggerSelect(e),e=e.toHSV(),n._hsvHandle.css({left:e.s*i.width()+"px",top:(1-e.v)*i.height()+"px"}),n._hueElements.css(p,u.fromHSV(e.h,1,1,1).toCss()),n._hueSlider.value(e.h),n._opacitySlider&&n._opacitySlider.value(100*e.a))},_selectOnHide:function(){return this.options.buttons?null:this._getHSV()},_template:s.template('# if (preview) { #<div class="k-selected-color"><div class="k-selected-color-display"><input class="k-color-value" #= !data.input ? \'style="visibility: hidden;"\' : "" #></div></div># } #<div class="k-hsv-rectangle"><div class="k-hsv-gradient"></div><div class="k-draghandle"></div></div><input class="k-hue-slider" /># if (opacity) { #<input class="k-transparency-slider" /># } ## if (buttons) { #<div unselectable="on" class="k-controls"><button class="k-button k-primary apply">#: messages.apply #</button> <button class="k-button cancel">#: messages.cancel #</button></div># } #')}),S=c.extend({init:function(t,n){var i,r,o,a,s,l=this;c.fn.init.call(l,t,n),n=l.options,t=l.element,i=t.attr("value")||t.val(),i=i?d(i,!0):d(n.value,!0),l._value=n.value=i,r=l.wrapper=e(l._template(n)),t.hide().after(r),t.is("input")&&(t.appendTo(r),o=t.closest("label"),a=t.attr("id"),a&&(o=o.add('label[for="'+a+'"]')),o.click(function(e){l.open(),e.preventDefault()})),l._tabIndex=t.attr("tabIndex")||0,l.enable(!t.attr("disabled")),s=t.attr("accesskey"),s&&(t.attr("accesskey",null),r.attr("accesskey",s)),l.bind("activate",function(e){e.isDefaultPrevented()||l.toggle()}),l._updateUI(i)},destroy:function(){this.wrapper.off(_).find("*").off(_),this._popup&&(this._selector.destroy(),this._popup.destroy()),this._selector=this._popup=this.wrapper=null,c.fn.destroy.call(this)},enable:function(e){var t=this,n=t.wrapper,i=n.children(".k-picker-wrap"),r=i.find(".k-select");0===arguments.length&&(e=!0),t.element.attr("disabled",!e),n.attr("aria-disabled",!e),r.off(_).on("mousedown"+_,o),n.addClass("k-state-disabled").removeAttr("tabIndex").add("*",n).off(_),e&&n.removeClass("k-state-disabled").attr("tabIndex",t._tabIndex).on("mouseenter"+_,function(){i.addClass("k-state-hover")}).on("mouseleave"+_,function(){i.removeClass("k-state-hover")}).on("focus"+_,function(){i.addClass("k-state-focused")}).on("blur"+_,function(){i.removeClass("k-state-focused")}).on(y,a(t._keydown,t)).on(w,".k-icon",a(t.toggle,t)).on(w,t.options.toolIcon?".k-tool-icon":".k-selected-color",function(){t.trigger("activate")})},_template:s.template('<span role="textbox" aria-haspopup="true" class="k-widget k-colorpicker k-header"><span class="k-picker-wrap k-state-default"># if (toolIcon) { #<span class="k-tool-icon #= toolIcon #"><span class="k-selected-color"></span></span># } else { #<span class="k-selected-color"></span># } #<span class="k-select" unselectable="on"><span class="k-icon k-i-arrow-s" unselectable="on"></span></span></span></span>'),options:{name:"ColorPicker",palette:null,columns:10,toolIcon:null,value:null,messages:v,opacity:!1,buttons:!0,preview:!0,ARIATemplate:'Current selected color is #=data || ""#'},events:["activate","change","select","open","close"],open:function(){this._getPopup().open()
},close:function(){this._getPopup().close()},toggle:function(){this._getPopup().toggle()},color:x.fn.color,value:x.fn.value,_select:x.fn._select,_triggerSelect:x.fn._triggerSelect,_isInputTypeColor:function(){var e=this.element[0];return/^input$/i.test(e.tagName)&&/^color$/i.test(e.type)},_updateUI:function(e){var t="";e&&(t=this._isInputTypeColor()||1==e.a?e.toCss():e.toCssRgba(),this.element.val(t)),this._ariaTemplate||(this._ariaTemplate=s.template(this.options.ARIATemplate)),this.wrapper.attr("aria-label",this._ariaTemplate(t)),this._triggerSelect(e),this.wrapper.find(".k-selected-color").css(p,e?e.toDisplay():"transparent")},_keydown:function(e){var t=e.keyCode;this._getPopup().visible()?(t==h.ESC?this._selector._cancel():this._selector._keydown(e),o(e)):(t==h.ENTER||t==h.DOWN)&&(this.open(),o(e))},_getPopup:function(){var t,i,r,o,a=this,l=a._popup;return l||(t=a.options,i=t.palette?C:T,t._standalone=!1,delete t.select,delete t.change,delete t.cancel,r=s.guid(),o=a._selector=new i(e('<div id="'+r+'"/>').appendTo(document.body),t),a.wrapper.attr("aria-owns",r),a._popup=l=o.wrapper.kendoPopup({anchor:a.wrapper}).data("kendoPopup"),o.bind({select:function(e){a._updateUI(d(e.value))},change:function(){a._select(o.color()),a.close()},cancel:function(){a.close()}}),l.bind({close:function(e){if(a.trigger("close"))return e.preventDefault(),n;a.wrapper.children(".k-picker-wrap").removeClass("k-state-focused");var t=o._selectOnHide();t?a._select(t):(a.wrapper.focus(),a._updateUI(a.color()))},open:function(e){a.trigger("open")?e.preventDefault():a.wrapper.children(".k-picker-wrap").addClass("k-state-focused")},activate:function(){o._select(a.color(),!0),o.focus(),a.wrapper.children(".k-picker-wrap").addClass("k-state-focused")}})),l}});l.plugin(C),l.plugin(T),l.plugin(S)}(jQuery,parseInt),function(e,t){function n(e,t){return'<span unselectable="on" class="k-link"><span unselectable="on" class="k-icon k-i-arrow-'+e+'" title="'+t+'">'+t+"</span></span>"}var i=window.kendo,r=i.caret,o=i.keys,a=i.ui,s=a.Widget,l=i._activeElement,c=i._extractFormat,d=i.parseFloat,u=i.support.placeholder,h=i.getCulture,p=i._round,f="change",g="disabled",m="readonly",v="k-input",_="spin",w=".kendoNumericTextBox",y="touchend",b="mouseleave"+w,k="mouseenter"+w+" "+b,x="k-state-default",C="k-state-focused",T="k-state-hover",S="focus",D=".",A="k-state-selected",E="k-state-disabled",I="aria-disabled",P="aria-readonly",M=/^(-)?(\d*)$/,F=null,z=e.proxy,R=s.extend({init:function(e,n){var r,o,a,l,d,u=this,h=n&&n.step!==t;s.fn.init.call(u,e,n),n=u.options,e=u.element.on("focusout"+w,z(u._focusout,u)).attr("role","spinbutton"),n.placeholder=n.placeholder||e.attr("placeholder"),u._reset(),u._wrapper(),u._arrows(),u._input(),i.support.mobileOS?u._text.on(y+w+" "+S+w,function(){u._toggleText(!1),e.focus()}):u._text.on(S+w,z(u._click,u)),r=u.min(e.attr("min")),o=u.max(e.attr("max")),a=u._parse(e.attr("step")),n.min===F&&r!==F&&(n.min=r),n.max===F&&o!==F&&(n.max=o),h||a===F||(n.step=a),e.attr("aria-valuemin",n.min).attr("aria-valuemax",n.max),n.format=c(n.format),l=n.value,u.value(l!==F?l:e.val()),d=e.is("[disabled]"),d?u.enable(!1):u.readonly(e.is("[readonly]")),i.notify(u)},options:{name:"NumericTextBox",decimals:F,min:F,max:F,value:F,step:1,culture:"",format:"n",spinners:!0,placeholder:"",upArrowText:"Increase value",downArrowText:"Decrease value"},events:[f,_],_editable:function(e){var t=this,n=t.element,i=e.disable,r=e.readonly,o=t._text.add(n),a=t._inputWrapper.off(k);t._toggleText(!0),t._upArrowEventHandler.unbind("press"),t._downArrowEventHandler.unbind("press"),n.off("keydown"+w).off("keypress"+w).off("paste"+w),r||i?(a.addClass(i?E:x).removeClass(i?x:E),o.attr(g,i).attr(m,r).attr(I,i).attr(P,r)):(a.addClass(x).removeClass(E).on(k,t._toggleHover),o.removeAttr(g).removeAttr(m).attr(I,!1).attr(P,!1),t._upArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(1),t._upArrow.addClass(A)}),t._downArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(-1),t._downArrow.addClass(A)}),t.element.on("keydown"+w,z(t._keydown,t)).on("keypress"+w,z(t._keypress,t)).on("paste"+w,z(t._paste,t)))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;e.element.add(e._text).add(e._upArrow).add(e._downArrow).add(e._inputWrapper).off(w),e._upArrowEventHandler.destroy(),e._downArrowEventHandler.destroy(),e._form&&e._form.off("reset",e._resetHandler),s.fn.destroy.call(e)},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},step:function(e){return this._option("step",e)},value:function(e){var n,i=this;return e===t?i._value:(e=i._parse(e),n=i._adjust(e),e===n&&(i._update(e),i._old=i._value),t)},focus:function(){this._focusin()},_adjust:function(e){var t=this,n=t.options,i=n.min,r=n.max;return e===F?e:(i!==F&&i>e?e=i:r!==F&&e>r&&(e=r),e)},_arrows:function(){var t,r=this,o=function(){clearTimeout(r._spinning),t.removeClass(A)},a=r.options,s=a.spinners,l=r.element;t=l.siblings(".k-icon"),t[0]||(t=e(n("n",a.upArrowText)+n("s",a.downArrowText)).insertAfter(l),t.wrapAll('<span class="k-select"/>')),s||(t.parent().toggle(s),r._inputWrapper.addClass("k-expand-padding")),r._upArrow=t.eq(0),r._upArrowEventHandler=new i.UserEvents(r._upArrow,{release:o}),r._downArrow=t.eq(1),r._downArrowEventHandler=new i.UserEvents(r._downArrow,{release:o})},_blur:function(){var e=this;e._toggleText(!0),e._change(e.element.val())},_click:function(e){var t=this;clearTimeout(t._focusing),t._focusing=setTimeout(function(){var n,i,o,a=e.target,s=r(a)[0],l=a.value.substring(0,s),c=t._format(t.options.format),d=c[","],u=0;d&&(i=RegExp("\\"+d,"g"),o=RegExp("([\\d\\"+d+"]+)(\\"+c[D]+")?(\\d+)?")),o&&(n=o.exec(l)),n&&(u=n[0].replace(i,"").length,-1!=l.indexOf("(")&&0>t._value&&u++),t._focusin(),r(t.element[0],u)})},_change:function(e){var t=this;t._update(e),e=t._value,t._old!=e&&(t._old=e,t.element.trigger(f),t.trigger(f))},_culture:function(e){return e||h(this.options.culture)},_focusin:function(){var e=this;e._inputWrapper.addClass(C),e._toggleText(!1),e.element[0].focus()},_focusout:function(){var e=this;clearTimeout(e._focusing),e._inputWrapper.removeClass(C).removeClass(T),e._blur()},_format:function(e,t){var n=this._culture(t).numberFormat;return e=e.toLowerCase(),e.indexOf("c")>-1?n=n.currency:e.indexOf("p")>-1&&(n=n.percent),n},_input:function(){var t,n=this,i="k-formatted-value",r=n.element.addClass(v).show()[0],o=r.accessKey,a=n.wrapper;t=a.find(D+i),t[0]||(t=e('<input type="text"/>').insertBefore(r).addClass(i));try{r.setAttribute("type","text")}catch(s){r.type="text"}t[0].tabIndex=r.tabIndex,t[0].style.cssText=r.style.cssText,t.prop("placeholder",n.options.placeholder),o&&(t.attr("accesskey",o),r.accessKey=""),n._text=t.addClass(r.className)},_keydown:function(e){var t=this,n=e.keyCode;t._key=n,n==o.DOWN?t._step(-1):n==o.UP?t._step(1):n==o.ENTER&&t._change(t.element.val())},_keypress:function(e){var t,n,i,a,s,l,c,d,u,h,p;0===e.which||e.ctrlKey||e.keyCode===o.BACKSPACE||e.keyCode===o.ENTER||(t=this,n=t.options.min,i=t.element,a=r(i),s=a[0],l=a[1],c=String.fromCharCode(e.which),d=t._format(t.options.format),u=t._key===o.NUMPAD_DOT,h=i.val(),u&&(c=d[D]),h=h.substring(0,s)+c+h.substring(l),p=t._numericRegex(d).test(h),p&&u?(i.val(h),r(i,s+c.length),e.preventDefault()):(null!==n&&n>=0&&"-"===h.charAt(0)||!p)&&e.preventDefault(),t._key=0)},_numericRegex:function(e){var t=this,n=e[D],i=t.options.decimals;return n===D&&(n="\\"+n),i===F&&(i=e.decimals),0===i?M:(t._separator!==n&&(t._separator=n,t._floatRegExp=RegExp("^(-)?(((\\d+("+n+"\\d*)?)|("+n+"\\d*)))?$")),t._floatRegExp)},_paste:function(e){var t=this,n=e.target,i=n.value;setTimeout(function(){t._parse(n.value)===F&&t._update(i)})},_option:function(e,n){var i=this,r=i.options;return n===t?r[e]:(n=i._parse(n),(n||"step"!==e)&&(r[e]=n,i.element.attr("aria-value"+e,n).attr(e,n)),t)},_spin:function(e,t){var n=this;t=t||500,clearTimeout(n._spinning),n._spinning=setTimeout(function(){n._spin(e,50)},t),n._step(e)},_step:function(e){var t=this,n=t.element,i=t._parse(n.val())||0;l()!=n[0]&&t._focusin(),i+=t.options.step*e,t._update(t._adjust(i)),t.trigger(_)},_toggleHover:function(t){e(t.currentTarget).toggleClass(T,"mouseenter"===t.type)},_toggleText:function(e){var t=this;t._text.toggle(e),t.element.toggle(!e)},_parse:function(e,t){return d(e,this._culture(t),this.options.format)},_update:function(e){var t,n=this,r=n.options,o=r.format,a=r.decimals,s=n._culture(),l=n._format(o,s);a===F&&(a=l.decimals),e=n._parse(e,s),t=e!==F,t&&(e=parseFloat(p(e,a))),n._value=e=n._adjust(e),n._placeholder(i.toString(e,o,s)),t?(e=""+e,-1!==e.indexOf("e")&&(e=p(+e,a)),e=e.replace(D,l[D])):e="",n.element.val(e).attr("aria-valuenow",e)},_placeholder:function(e){this._text.val(e),u||e||this._text.val(this.options.placeholder)},_wrapper:function(){var t,n=this,i=n.element,r=i[0];t=i.parents(".k-numerictextbox"),t.is("span.k-numerictextbox")||(t=i.hide().wrap('<span class="k-numeric-wrap k-state-default" />').parent(),t=t.wrap("<span/>").parent()),t[0].style.cssText=r.style.cssText,r.style.width="",n.wrapper=t.addClass("k-widget k-numerictextbox").addClass(r.className).css("display",""),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(n[0].value)})},t._form=r.on("reset",t._resetHandler))}});a.plugin(R)}(window.kendo.jQuery),function(e){function t(n,i){n.filters&&(n.filters=e.grep(n.filters,function(e){return t(e,i),e.filters?e.filters.length:e.field!=i}))}function n(e){var t,n,i,r,o,a;if(e&&e.length)for(a=[],t=0,n=e.length;n>t;t++)i=e[t],o=i.text||i.value||i,r=null==i.value?i.text||i:i.value,a[t]={text:o,value:r};return a}function i(t,n){return e.grep(t,function(t){return t.filters?(t.filters=e.grep(t.filters,function(e){return e.field!=n}),t.filters.length):t.field!=n})}var r=window.kendo,o=r.ui,a=e.proxy,s="kendoPopup",l="init",c=".kendoFilterMenu",d="Is equal to",u="Is not equal to",h={number:"numerictextbox",date:"datepicker"},p={string:"text",number:"number",date:"date"},f=r.isFunction,g=o.Widget,m='<div><div class="k-filter-help-text">#=messages.info#</div><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label><div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',v='<div><div class="k-filter-help-text">#=messages.info#</div><select data-#=ns#bind="value: filters[0].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[0].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#"></select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}##if(extra){#<select class="k-filter-and" data-#=ns#bind="value: logic" data-#=ns#role="dropdownlist"><option value="and">#=messages.and#</option><option value="or">#=messages.or#</option></select><select data-#=ns#bind="value: filters[1].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[1].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#"></select>#}else{#<input data-#=ns#bind="value: filters[1].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""#/>#}##}#<div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',_='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=field#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[0].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[0].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#if(extra){#</ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="and" />#=messages.and#</label></li><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="or" />#=messages.or#</label></li></ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[1].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[1].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[1].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#}#</ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></div></form></div>',w='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=field#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label></li><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label></li></ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></form></div>',y=g.extend({init:function(t,n){var i,o,s,l,d=this,u="string";g.fn.init.call(d,t,n),i=d.operators=n.operators||{},t=d.element,n=d.options,n.appendToElement||(s=t.addClass("k-with-icon k-filterable").find(".k-grid-filter"),s[0]||(s=t.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-filter"/></a>').find(".k-grid-filter")),s.attr("tabindex",-1).on("click"+c,a(d._click,d))),d.link=s||e(),d.dataSource=n.dataSource,d.field=n.field||t.attr(r.attr("field")),d.model=d.dataSource.reader.model,d._parse=function(e){return e+""},d.model&&d.model.fields&&(l=d.model.fields[d.field],l&&(u=l.type||"string",l.parse&&(d._parse=a(l.parse,l)))),n.values&&(u="enums"),d.type=u,i=i[u]||n.operators[u];for(o in i)break;d._defaultFilter=function(){return{field:d.field,operator:o||"eq",value:""}},d._refreshHandler=a(d.refresh,d),d.dataSource.bind("change",d._refreshHandler),n.appendToElement?d._init():d.refresh()},_init:function(){var t,n=this,i=n.options.ui,o=f(i);n.pane=n.options.pane,n.pane&&(n._isMobile=!0),o||(t=i||h[n.type]),n._isMobile?n._createMobileForm(t):n._createForm(t),n.form.on("submit"+c,a(n._submit,n)).on("reset"+c,a(n._reset,n)),o&&n.form.find(".k-textbox").removeClass("k-textbox").each(function(){i(e(this))}),n.form.find("["+r.attr("role")+"=numerictextbox]").removeClass("k-textbox").end().find("["+r.attr("role")+"=datetimepicker]").removeClass("k-textbox").end().find("["+r.attr("role")+"=timepicker]").removeClass("k-textbox").end().find("["+r.attr("role")+"=datepicker]").removeClass("k-textbox"),n.refresh(),n.trigger(l,{field:n.field,container:n.form})},_createForm:function(t){var i=this,o=i.options,l=i.operators||{},d=i.type;l=l[d]||o.operators[d],i.form=e('<form class="k-filter-menu"/>').html(r.template("boolean"===d?m:v)({field:i.field,format:o.format,ns:r.ns,messages:o.messages,extra:o.extra,operators:l,type:d,role:t,values:n(o.values)})),o.appendToElement?(i.element.append(i.form),i.popup=i.element.closest(".k-popup").data(s)):i.popup=i.form[s]({anchor:i.link,open:a(i._open,i),activate:a(i._activate,i),close:function(){i.options.closeCallback&&i.options.closeCallback(i.element)}}).data(s),i.form.on("keydown"+c,a(i._keydown,i))},_createMobileForm:function(t){var i=this,o=i.options,a=i.operators||{},s=i.type;a=a[s]||o.operators[s],i.form=e("<div />").html(r.template("boolean"===s?w:_)({field:i.field,format:o.format,ns:r.ns,messages:o.messages,extra:o.extra,operators:a,type:s,role:t,useRole:!r.support.input.date&&"date"===s||"number"===s,inputType:p[s],values:n(o.values)})),i.view=i.pane.append(i.form.html()),i.form=i.view.element.find("form"),i.view.element.on("click",".k-submit",function(e){i.form.submit(),e.preventDefault()}).on("click",".k-cancel",function(e){i._closeForm(),e.preventDefault()})},refresh:function(){var e=this,t=e.dataSource.filter()||{filters:[],logic:"and"};e.filterModel=r.observable({logic:"and",filters:[e._defaultFilter(),e._defaultFilter()]}),e.form&&r.bind(e.form.children().first(),e.filterModel),e._bind(t)?e.link.addClass("k-state-active"):e.link.removeClass("k-state-active")},destroy:function(){var e=this;g.fn.destroy.call(e),e.form&&(r.unbind(e.form),r.destroy(e.form),e.form.unbind(c),e.popup&&(e.popup.destroy(),e.popup=null),e.form=null),e.view&&(e.view.purge(),e.view=null),e.link.unbind(c),e._refreshHandler&&(e.dataSource.unbind("change",e._refreshHandler),e.dataSource=null),e.element=e.link=e._refreshHandler=e.filterModel=null},_bind:function(e){var t,n,i,r,o=this,a=e.filters,s=!1,l=0,c=o.filterModel;for(t=0,n=a.length;n>t;t++)r=a[t],r.field==o.field?(c.set("logic",e.logic),i=c.filters[l],i||(c.filters.push({field:o.field}),i=c.filters[l]),i.set("value",o._parse(r.value)),i.set("operator",r.operator),l++,s=!0):r.filters&&(s=s||o._bind(r));return s},_merge:function(n){var i,r,o,a=this,s=n.logic||"and",l=n.filters,c=a.dataSource.filter()||{filters:[],logic:"and"};for(t(c,a.field),l=e.grep(l,function(e){return""!==e.value&&null!=e.value}),r=0,o=l.length;o>r;r++)i=l[r],i.value=a._parse(i.value);return l.length&&(c.filters.length?(n.filters=l,"and"!==c.logic&&(c.filters=[{logic:c.logic,filters:c.filters}],c.logic="and"),c.filters.push(l.length>1?n:l[0])):(c.filters=l,c.logic=s)),c},filter:function(e){e=this._merge(e),e.filters.length&&this.dataSource.filter(e)},clear:function(){var t=this,n=t.dataSource.filter()||{filters:[]};n.filters=e.grep(n.filters,function(e){return e.filters?(e.filters=i(e.filters,t.field),e.filters.length):e.field!=t.field}),n.filters.length||(n=null),t.dataSource.filter(n)},_submit:function(e){e.preventDefault(),e.stopPropagation(),this.filter(this.filterModel.toJSON()),this._closeForm()},_reset:function(){this.clear(),this._closeForm()},_closeForm:function(){this._isMobile?this.pane.navigate("",this.options.animations.right):this.popup.close()},_click:function(e){e.preventDefault(),e.stopPropagation(),this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle()},_open:function(){var t;e(".k-filter-menu").not(this.form).each(function(){t=e(this).data(s),t&&t.close()})},_activate:function(){this.form.find(":kendoFocusable:first").focus()},_keydown:function(e){e.keyCode==r.keys.ESC&&this.popup.close()},events:[l],options:{name:"FilterMenu",extra:!0,appendToElement:!1,type:"string",operators:{string:{eq:d,neq:u,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with"},number:{eq:d,neq:u,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"},date:{eq:d,neq:u,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before"},enums:{eq:d,neq:u}},messages:{info:"Show items with value that:",isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",and:"And",or:"Or",selectValue:"-Select value-",operator:"Operator",value:"Value",cancel:"Cancel"},animations:{left:"slide",right:"slide:right"}}});o.plugin(y)}(window.kendo.jQuery),function(e,t){function n(e,t){return e=e.split(" ")[!t+0]||e,e.replace("top","up").replace("bottom","down")}function i(e,t,n){e=e.split(" ")[!t+0]||e;var i={origin:["bottom",n?"right":"left"],position:["top",n?"right":"left"]},r=/left|right/.test(e);return r?(i.origin=["top",e],i.position[1]=c.directions[e].reverse):(i.origin[0]=e,i.position[0]=c.directions[e].reverse),i.origin=i.origin.join(" "),i.position=i.position.join(" "),i}function r(t,n){try{return e.contains(t,n)}catch(i){return!1}}function o(t){t=e(t),t.addClass("k-item").children(x).addClass(P),t.children("a").addClass(S).children(x).addClass(P),t.filter(":not([disabled])").addClass(q),t.filter(".k-separator:empty").append("&nbsp;"),t.filter("li[disabled]").addClass(Y).removeAttr("disabled").attr("aria-disabled",!0),t.filter("[role]").length||t.attr("role","menuitem"),t.children("."+S).length||t.contents().filter(function(){return!(this.nodeName.match(b)||3==this.nodeType&&!e.trim(this.nodeValue))}).wrapAll("<span class='"+S+"'/>"),a(t),s(t)}function a(t){t=e(t),t.find("> .k-link > [class*=k-i-arrow]:not(.k-sprite)").remove(),t.filter(":has(.k-menu-group)").children(".k-link:not(:has([class*=k-i-arrow]:not(.k-sprite)))").each(function(){var t=e(this),n=t.parent().parent();t.append("<span class='k-icon "+(n.hasClass(T+"-horizontal")?"k-i-arrow-s":"k-i-arrow-e")+"'/>")})}function s(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(I),t.filter(".k-last:not(:last-child)").removeClass(D),t.filter(":first-child").addClass(I),t.filter(":last-child").addClass(D)}var l,c=window.kendo,d=c.ui,u=c._activeElement,h=c.support.touch&&c.support.mobileOS,p="mousedown",f="click",g=e.extend,m=e.proxy,v=e.each,_=c.template,w=c.keys,y=d.Widget,b=/^(ul|a|div)$/i,k=".kendoMenu",x="img",C="open",T="k-menu",S="k-link",D="k-last",A="close",E="timer",I="k-first",P="k-image",M="select",F="zIndex",z="activate",R="deactivate",B="touchstart"+k+" MSPointerDown"+k+" pointerdown"+k,H=c.support.pointers,L=c.support.msPointers,N=L||H,O=H?"pointerover":L?"MSPointerOver":"mouseenter",V=H?"pointerout":L?"MSPointerOut":"mouseleave",U=h||N,W=e(document.documentElement),j="kendoPopup",q="k-state-default",G="k-state-hover",$="k-state-focused",Y="k-state-disabled",Q=".k-menu",K=".k-menu-group",X=K+",.k-animation-container",Z=":not(.k-list) > .k-item",J=".k-item.k-state-disabled",et=".k-item:not(.k-state-disabled)",tt=".k-item:not(.k-state-disabled) > .k-link",nt=":not(.k-item.k-separator)",it=nt+":eq(0)",rt=nt+":last",ot="> div:not(.k-animation-container,.k-list-container)",at={2:1,touch:1},st={content:_("<div class='k-content #= groupCssClass() #' tabindex='-1'>#= content(item) #</div>"),group:_("<ul class='#= groupCssClass(group) #'#= groupAttributes(group) # role='menu' aria-hidden='true'>#= renderItems(data) #</ul>"),itemWrapper:_("<#= tag(item) # class='#= textClass(item) #'#= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:_("<li class='#= wrapperCssClass(group, item) #' role='menuitem' #=item.items ? \"aria-haspopup='true'\": \"\"##=item.enabled === false ? \"aria-disabled='true'\" : ''#>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, menu: menu, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:_("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:_("<span class='#= arrowClass(item, group) #'></span>"),sprite:_("<span class='k-sprite #= spriteCssClass #'></span>"),empty:_("")},lt={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" k-state-disabled":" k-state-default",e.firstLevel&&0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),n},textClass:function(){return S},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},arrowClass:function(e,t){var n="k-icon";return n+=t.horizontal?" k-i-arrow-s":" k-i-arrow-e"},text:function(e){return e.encoded===!1?e.text:c.htmlEncode(e.text)},tag:function(e){return e.url?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-menu-group"},content:function(e){return e.content?e.content:"&nbsp;"}},ct=y.extend({init:function(t,n){var i=this;y.fn.init.call(i,t,n),t=i.wrapper=i.element,n=i.options,i._initData(n),i._updateClasses(),i._animations(n),i.nextItemZIndex=100,i._tabindex(),i._focusProxy=m(i._focusHandler,i),t.on(B,et,i._focusProxy).on(f+k,J,!1).on(f+k,et,m(i._click,i)).on("keydown"+k,m(i._keydown,i)).on("focus"+k,m(i._focus,i)).on("focus"+k,".k-content",m(i._focus,i)).on(B+" "+p+k,".k-content",m(i._preventClose,i)).on("blur"+k,m(i._removeHoverItem,i)).on("blur"+k,"[tabindex]",m(i._checkActiveElement,i)).on(O+k,et,m(i._mouseenter,i)).on(V+k,et,m(i._mouseleave,i)).on(O+k+" "+V+k+" "+p+k+" "+f+k,tt,m(i._toggleHover,i)),n.openOnClick&&(i.clicked=!1,i._documentClickHandler=m(i._documentClick,i),e(document).click(i._documentClickHandler)),t.attr("role","menubar"),t[0].id&&(i._ariaId=c.format("{0}_mn_active",t[0].id)),c.notify(i)},events:[C,A,z,R,M],options:{name:"Menu",animation:{open:{duration:200},close:{duration:100}},orientation:"horizontal",direction:"default",openOnClick:!1,closeOnClick:!0,hoverDelay:100,popupCollision:t},_initData:function(e){var t=this;e.dataSource&&(t.angular("cleanup",function(){return{elements:t.element.children()}}),t.element.empty(),t.append(e.dataSource,t.element),t.angular("compile",function(){return{elements:t.element.children()}}))},setOptions:function(e){var t=this.options.animation;this._animations(e),e.animation=g(!0,t,e.animation),"dataSource"in e&&this._initData(e),this._updateClasses(),y.fn.setOptions.call(this,e)},destroy:function(){var t=this;y.fn.destroy.call(t),t.element.off(k),t._documentClickHandler&&e(document).unbind("click",t._documentClickHandler),c.destroy(t.element)},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},append:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.length?t.find("> .k-menu-group, > .k-animation-container > .k-menu-group"):null);return v(n.items,function(){n.group.append(this),a(this)}),a(t),s(n.group.find(".k-first, .k-last").add(n.items)),this},insertBefore:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return v(n.items,function(){t.before(this),a(this),s(this)}),s(t),this},insertAfter:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return v(n.items,function(){t.after(this),a(this),s(this)}),s(t),this},_insert:function(t,n,i){var r,a,s,l,c=this;return n&&n.length||(i=c.element),s=e.isPlainObject(t),l={firstLevel:i.hasClass(T),horizontal:i.hasClass(T+"-horizontal"),expanded:!0,length:i.children().length},n&&!i.length&&(i=e(ct.renderGroup({group:l})).appendTo(n)),s||e.isArray(t)?r=e(e.map(s?[t]:t,function(t,n){return"string"==typeof t?e(t).get():e(ct.renderItem({group:l,item:g(t,{index:n})})).get()})):(r="string"==typeof t&&"<"!=t.charAt(0)?c.element.find(t):e(t),a=r.find("> ul").addClass("k-menu-group").attr("role","menu"),r=r.filter("li"),r.add(a.find("> li")).each(function(){o(this)})),{items:r,group:i}},remove:function(e){var t,n,i,r;return e=this.element.find(e),t=this,n=e.parentsUntil(t.element,Z),i=e.parent("ul:not(.k-menu)"),e.remove(),i&&!i.children(Z).length&&(r=i.parent(".k-animation-container"),r.length?r.remove():i.remove()),n.length&&(n=n.eq(0),a(n),s(n)),t},open:function(r){var o=this,a=o.options,s="horizontal"==a.orientation,l=a.direction,d=c.support.isRtl(o.wrapper);return r=o.element.find(r),/^(top|bottom|default)$/.test(l)&&(l=d?s?(l+" left").replace("default","bottom"):"left":s?(l+" right").replace("default","bottom"):"right"),r.siblings().find(">.k-popup:visible,>.k-animation-container>.k-popup:visible").each(function(){var t=e(this).data("kendoPopup");t&&t.close()}),r.each(function(){var r=e(this);clearTimeout(r.data(E)),r.data(E,setTimeout(function(){var u,p,f,m,v,_,w,y,b=r.find(".k-menu-group:first:hidden");b[0]&&o._triggerEvent({item:r[0],type:C})===!1&&(!b.find(".k-menu-group")[0]&&b.children(".k-item").length>1?(p=e(window).height(),f=function(){b.css({maxHeight:p-(b.outerHeight()-b.height())-c.getShadows(b).bottom,overflow:"auto"})},c.support.browser.msie&&7>=c.support.browser.version?setTimeout(f,0):f()):b.css({maxHeight:"",overflow:""}),r.data(F,r.css(F)),r.css(F,o.nextItemZIndex++),u=b.data(j),m=r.parent().hasClass(T),v=m&&s,_=i(l,m,d),w=a.animation.open.effects,y=w!==t?w:"slideIn:"+n(l,m),u?(u=b.data(j),u.options.origin=_.origin,u.options.position=_.position,u.options.animation.open.effects=y):u=b.kendoPopup({activate:function(){o._triggerEvent({item:this.wrapper.parent(),type:z})},deactivate:function(e){e.sender.element.removeData("targetTransform").css({opacity:""}),o._triggerEvent({item:this.wrapper.parent(),type:R})},origin:_.origin,position:_.position,collision:a.popupCollision!==t?a.popupCollision:v?"fit":"fit flip",anchor:r,appendTo:r,animation:{open:g(!0,{effects:y},a.animation.open),close:a.animation.close},close:function(e){var t=e.sender.wrapper.parent();o._triggerEvent({item:t[0],type:A})?e.preventDefault():(t.css(F,t.data(F)),t.removeData(F),h&&(t.removeClass(G),o._removeHoverItem()))}}).data(j),b.removeAttr("aria-hidden"),u.open())},o.options.hoverDelay))}),o},close:function(t,n){var i=this,r=i.element;return t=r.find(t),t.length||(t=r.find(">.k-item")),t.each(function(){var t=e(this);!n&&i._isRootItem(t)&&(i.clicked=!1),clearTimeout(t.data(E)),t.data(E,setTimeout(function(){var e=t.find(".k-menu-group:not(.k-list-container):not(.k-calendar-container):first:visible").data(j);e&&(e.close(),e.element.attr("aria-hidden",!0))},i.options.hoverDelay))}),i},_toggleDisabled:function(t,n){this.element.find(t).each(function(){e(this).toggleClass(q,n).toggleClass(Y,!n).attr("aria-disabled",!n)})},_toggleHover:function(t){var n=e(c.eventTarget(t)||t.target).closest(Z),i=t.type==O||-1!==p.indexOf(t.type);n.parents("li."+Y).length||n.toggleClass(G,i||"mousedown"==t.type||"click"==t.type),this._removeHoverItem()},_preventClose:function(){this.options.closeOnClick||(this._closurePrevented=!0)},_checkActiveElement:function(t){var n=this,i=e(t?t.currentTarget:this._hoverItem()),o=n._findRootParent(i)[0];this._closurePrevented||setTimeout(function(){(!document.hasFocus()||!r(o,c._activeElement())&&t&&!r(o,t.currentTarget))&&n.close(o)
},0),this._closurePrevented=!1},_removeHoverItem:function(){var e=this._hoverItem();e&&e.hasClass($)&&(e.removeClass($),this._oldHoverItem=null)},_updateClasses:function(){var e,t=this.element,n=".k-menu-init div ul";t.removeClass("k-menu-horizontal k-menu-vertical"),t.addClass("k-widget k-reset k-header k-menu-init "+T).addClass(T+"-"+this.options.orientation),t.find("li > ul").filter(function(){return!c.support.matchesSelector.call(this,n)}).addClass("k-group k-menu-group").attr("role","menu").attr("aria-hidden",t.is(":visible")).end().find("li > div").addClass("k-content").attr("tabindex","-1"),e=t.find("> li,.k-menu-group > li"),t.removeClass("k-menu-init"),e.each(function(){o(this)})},_mouseenter:function(t){var n=this,i=e(t.currentTarget),o=i.children(".k-animation-container").length||i.children(K).length;t.delegateTarget==i.parents(Q)[0]&&(n.options.openOnClick&&!n.clicked||h||(H||L)&&t.originalEvent.pointerType in at&&n._isRootItem(i.closest(Z))||!r(t.currentTarget,t.relatedTarget)&&o&&n.open(i),(n.options.openOnClick&&n.clicked||U)&&i.siblings().each(m(function(e,t){n.close(t,!0)},n)))},_mouseleave:function(n){var i=this,o=e(n.currentTarget),a=o.children(".k-animation-container").length||o.children(K).length;return o.parentsUntil(".k-animation-container",".k-list-container,.k-calendar-container")[0]?(n.stopImmediatePropagation(),t):(i.options.openOnClick||h||(H||L)&&n.originalEvent.pointerType in at||r(n.currentTarget,n.relatedTarget||n.target)||!a||r(n.currentTarget,c._activeElement())||i.close(o),t)},_click:function(n){var i,r,o,a=this,s=a.options,l=e(c.eventTarget(n)),d=l[0]?l[0].nodeName.toUpperCase():"",u="INPUT"==d||"SELECT"==d||"BUTTON"==d||"LABEL"==d,h=l.closest("."+S),p=l.closest(Z),f=h.attr("href"),g=l.attr("href"),m=e("<a href='#' />").attr("href"),v=!!f&&f!==m,_=v&&!!f.match(/^#/),w=!!g&&g!==m,y=s.openOnClick&&o&&a._isRootItem(p);if(!l.closest(ot,p[0]).length){if(p.hasClass(Y))return n.preventDefault(),t;if(n.handled||!a._triggerEvent({item:p[0],type:M})||u||n.preventDefault(),n.handled=!0,r=p.children(X),o=r.is(":visible"),s.closeOnClick&&(!v||_)&&(!r.length||y))return p.removeClass(G).css("height"),a._oldHoverItem=a._findRootParent(p),a.close(h.parentsUntil(a.element,Z)),a.clicked=!1,-1!="MSPointerUp".indexOf(n.type)&&n.preventDefault(),t;v&&n.enterKey&&h[0].click(),(a._isRootItem(p)&&s.openOnClick||c.support.touch||(H||L)&&a._isRootItem(p.closest(Z)))&&(v||u||w||n.preventDefault(),a.clicked=!0,i=r.is(":visible")?A:C,(s.closeOnClick||i!=A)&&a[i](p))}},_documentClick:function(e){r(this.element[0],e.target)||(this.clicked=!1)},_focus:function(n){var i=this,r=n.target,o=i._hoverItem(),a=u();return r==i.wrapper[0]||e(r).is(":kendoFocusable")?(a===n.currentTarget&&(o.length?i._moveHover([],o):i._oldHoverItem||i._moveHover([],i.wrapper.children().first())),t):(n.stopPropagation(),e(r).closest(".k-content").closest(".k-menu-group").closest(".k-item").addClass($),i.wrapper.focus(),t)},_keydown:function(e){var n,i,r,o=this,a=e.keyCode,s=o._oldHoverItem,l=c.support.isRtl(o.wrapper);if(e.target==e.currentTarget||a==w.ESC){if(s||(s=o._oldHoverItem=o._hoverItem()),i=o._itemBelongsToVertival(s),r=o._itemHasChildren(s),a==w.RIGHT)n=o[l?"_itemLeft":"_itemRight"](s,i,r);else if(a==w.LEFT)n=o[l?"_itemRight":"_itemLeft"](s,i,r);else if(a==w.DOWN)n=o._itemDown(s,i,r);else if(a==w.UP)n=o._itemUp(s,i,r);else if(a==w.ESC)n=o._itemEsc(s,i);else if(a==w.ENTER||a==w.SPACEBAR)n=s.children(".k-link"),n.length>0&&(o._click({target:n[0],preventDefault:function(){},enterKey:!0}),o._moveHover(s,o._findRootParent(s)));else if(a==w.TAB)return n=o._findRootParent(s),o._moveHover(s,n),o._checkActiveElement(),t;n&&n[0]&&(e.preventDefault(),e.stopPropagation())}},_hoverItem:function(){return this.wrapper.find(".k-item.k-state-hover,.k-item.k-state-focused").filter(":visible")},_itemBelongsToVertival:function(e){var t=this.wrapper.hasClass("k-menu-vertical");return e.length?e.parent().hasClass("k-menu-group")||t:t},_itemHasChildren:function(e){return e.length?e.children("ul.k-menu-group, div.k-animation-container").length>0:!1},_moveHover:function(t,n){var i=this,r=i._ariaId;t.length&&n.length&&t.removeClass($),n.length&&(n[0].id&&(r=n[0].id),n.addClass($),i._oldHoverItem=n,r&&(i.element.removeAttr("aria-activedescendant"),e("#"+r).removeAttr("id"),n.attr("id",r),i.element.attr("aria-activedescendant",r)))},_findRootParent:function(e){return this._isRootItem(e)?e:e.parentsUntil(Q,"li.k-item").last()},_isRootItem:function(e){return e.parent().hasClass(T)},_itemRight:function(e,t,n){var i,r,o=this;if(!e.hasClass(Y))return t?n?(o.open(e),i=e.find(".k-menu-group").children().first()):"horizontal"==o.options.orientation&&(r=o._findRootParent(e),o.close(r),i=r.nextAll(it)):(i=e.nextAll(it),i.length||(i=e.prevAll(rt))),i&&!i.length?i=o.wrapper.children(".k-item").first():i||(i=[]),o._moveHover(e,i),i},_itemLeft:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._isRootItem(n)&&"horizontal"==i.options.orientation&&(n=n.prevAll(it))):(n=e.prevAll(it),n.length||(n=e.nextAll(rt))),n.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemDown:function(e,t,n){var i,r=this;if(t)i=e.nextAll(it);else{if(!n||e.hasClass(Y))return;r.open(e),i=e.find(".k-menu-group").children().first()}return!i.length&&e.length?i=e.parent().children().first():e.length||(i=r.wrapper.children(".k-item").first()),r._moveHover(e,i),i},_itemUp:function(e,t){var n,i=this;if(t)return n=e.prevAll(it),!n.length&&e.length?n=e.parent().children().last():e.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemEsc:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._moveHover(e,n),n):e},_triggerEvent:function(e){var t=this;return t.trigger(e.type,{type:e.type,item:e.item})},_focusHandler:function(t){var n=this,i=e(c.eventTarget(t)).closest(Z);setTimeout(function(){n._moveHover([],i),i.children(".k-content")[0]&&i.parent().closest(".k-item").removeClass($)},200)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={open:{effects:{}},close:{hide:!0,effects:{}}})}});g(ct,{renderItem:function(e){e=g({menu:{},group:{}},e);var t=st.empty,n=e.item;return st.item(g(e,{image:n.imageUrl?st.image:t,sprite:n.spriteCssClass?st.sprite:t,itemWrapper:st.itemWrapper,renderContent:ct.renderContent,arrow:n.items||n.content?st.arrow:t,subGroup:ct.renderGroup},lt))},renderGroup:function(e){return st.group(g({renderItems:function(e){for(var t="",n=0,i=e.items,r=i?i.length:0,o=g({length:r},e.group);r>n;n++)t+=ct.renderItem(g(e,{group:o,item:g({index:n},i[n])}));return t}},e,lt))},renderContent:function(e){return st.content(g(e,lt))}}),l=ct.extend({init:function(t,n){var i=this;ct.fn.init.call(i,t,n),i.target=e(i.options.target),i._popup(),i._wire()},options:{name:"ContextMenu",filter:null,showOn:"contextmenu",orientation:"vertical",alignToAnchor:!1,target:"body"},events:[C,A,z,R,M],setOptions:function(t){var n=this;ct.fn.setOptions.call(n,t),n.target.off(n.showOn+k,n._showProxy),n.userEvents&&n.userEvents.destroy(),n.target=e(n.options.target),t.orientation&&n.popup.wrapper[0]&&n.popup.element.unwrap(),n._wire(),ct.fn.setOptions.call(this,t)},destroy:function(){var e=this;e.target.off(e.options.showOn+k),W.off(c.support.mousedown+k,e._closeProxy),e.userEvents&&e.userEvents.destroy(),ct.fn.destroy.call(e)},open:function(n,i){var o=this;return n=e(n)[0],r(o.element[0],e(n)[0])?ct.fn.open.call(o,n):o._triggerEvent({item:o.element,type:C})===!1&&(o.popup.visible()&&o.options.filter&&o.popup.close(!0),i!==t?(o.popup.wrapper.hide(),o.popup.open(n,i)):(o.popup.options.anchor=(n?n:o.popup.anchor)||o.target,o.popup.open()),W.off(o.popup.downEvent,o.popup._mousedownProxy),W.on(c.support.mousedown+k,o._closeProxy)),o},close:function(){var t=this;r(t.element[0],e(arguments[0])[0])?ct.fn.close.call(t,arguments[0]):t.popup.visible()&&t._triggerEvent({item:t.element,type:A})===!1&&(t.popup.close(),W.off(c.support.mousedown+k,t._closeProxy),t.unbind(M,t._closeTimeoutProxy))},_showHandler:function(e){var t,n=e,i=this,o=i.options;e.event&&(n=e.event,n.pageX=e.x.location,n.pageY=e.y.location),r(i.element[0],e.relatedTarget||e.target)||(i._eventOrigin=n,n.preventDefault(),n.stopImmediatePropagation(),i.element.find("."+$).removeClass($),(o.filter&&c.support.matchesSelector.call(n.currentTarget,o.filter)||!o.filter)&&(o.alignToAnchor?i.open(n.currentTarget):(i.popup.options.anchor=n.currentTarget,i._targetChild?(t=i.target.offset(),i.open(n.pageX-t.left,n.pageY-t.top)):i.open(n.pageX,n.pageY))))},_closeHandler:function(t){var n=this,i=e(t.relatedTarget||t.target),o=i.closest(n.target.selector)[0]==n.target[0],a=i.closest(et).children(X),s=r(n.element[0],i[0]);n._eventOrigin=t,!n.popup.visible()||(3===t.which||!o)&&o||(!n.options.closeOnClick||h||(H||L)&&t.originalEvent.pointerType in at||a[0]||!s)&&s||(s?(this.unbind(M,this._closeTimeoutProxy),n.bind(M,n._closeTimeoutProxy)):n.close())},_wire:function(){var e=this,t=e.options,n=e.target;e._showProxy=m(e._showHandler,e),e._closeProxy=m(e._closeHandler,e),e._closeTimeoutProxy=m(e.close,e),n[0]&&(c.support.mobileOS&&"contextmenu"==t.showOn?(e.userEvents=new c.UserEvents(n,{filter:t.filter,allowSelection:!1}),n.on(t.showOn+k,!1),e.userEvents.bind("hold",e._showProxy)):t.filter?n.on(t.showOn+k,t.filter,e._showProxy):n.on(t.showOn+k,e._showProxy))},_triggerEvent:function(n){var i=this,r=e(i.popup.options.anchor)[0],o=i._eventOrigin;return i._eventOrigin=t,i.trigger(n.type,g({type:n.type,item:n.item||this.element[0],target:r},o?{event:o}:{}))},_popup:function(){var e=this;e._triggerProxy=m(e._triggerEvent,e),e.popup=e.element.addClass("k-context-menu").kendoPopup({anchor:e.target||"body",copyAnchorStyles:e.options.copyAnchorStyles,collision:e.options.popupCollision||"fit",animation:e.options.animation,activate:e._triggerProxy,deactivate:e._triggerProxy}).data("kendoPopup"),e._targetChild=r(e.target[0],e.popup.element[0])}}),d.plugin(ct),d.plugin(l)}(window.kendo.jQuery),function(e,t){function n(t){return e.trim(t).replace(/&nbsp;/gi,"")}function i(e,t){var n,i,r,o={};for(n=0,i=e.length;i>n;n++)r=e[n],o[r[t]]=r;return o}function r(e){var t,n=[];for(t=0;e.length>t;t++)e[t].columns?n=n.concat(r(e[t].columns)):n.push(e[t]);return n}var o=window.kendo,a=o.ui,s=e.proxy,l=e.extend,c=e.grep,d=e.map,u=e.inArray,h="k-state-selected",p="asc",f="desc",g="change",m="init",v="select",_="kendoPopup",w="kendoFilterMenu",y="kendoMenu",b=".kendoColumnMenu",k=a.Widget,x=k.extend({init:function(t,n){var i,r=this;k.fn.init.call(r,t,n),t=r.element,n=r.options,r.owner=n.owner,r.dataSource=n.dataSource,r.field=t.attr(o.attr("field")),r.title=t.attr(o.attr("title")),i=t.find(".k-header-column-menu"),i[0]||(i=t.addClass("k-with-icon").prepend('<a class="k-header-column-menu" href="#"><span class="k-icon k-i-arrowhead-s"/></a>').find(".k-header-column-menu")),r.link=i.attr("tabindex",-1).on("click"+b,s(r._click,r)),r.wrapper=e('<div class="k-column-menu"/>')},_init:function(){var e=this;e.pane=e.options.pane,e.pane&&(e._isMobile=!0),e._isMobile?e._createMobileMenu():e._createMenu(),e._angularItems("compile"),e._sort(),e._columns(),e._filter(),e._lockColumns(),e.trigger(m,{field:e.field,container:e.wrapper})},events:[m],options:{name:"ColumnMenu",messages:{sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filter:"Filter",columns:"Columns",done:"Done",settings:"Column Settings",lock:"Lock",unlock:"Unlock"},filter:"",columns:!0,sortable:!0,filterable:!0,animations:{left:"slide"}},_createMenu:function(){var e=this,t=e.options;e.wrapper.html(o.template(C)({ns:o.ns,messages:t.messages,sortable:t.sortable,filterable:t.filterable,columns:e._ownerColumns(),showColumns:t.columns,lockedColumns:t.lockedColumns})),e.popup=e.wrapper[_]({anchor:e.link,open:s(e._open,e),activate:s(e._activate,e),close:function(){e.options.closeCallback&&e.options.closeCallback(e.element)}}).data(_),e.menu=e.wrapper.children()[y]({orientation:"vertical",closeOnClick:!1}).data(y)},_createMobileMenu:function(){var e=this,t=e.options,n=o.template(T)({ns:o.ns,field:e.field,title:e.title||e.field,messages:t.messages,sortable:t.sortable,filterable:t.filterable,columns:e._ownerColumns(),showColumns:t.columns,lockedColumns:t.lockedColumns});e.view=e.pane.append(n),e.wrapper=e.view.element.find(".k-column-menu"),e.menu=new S(e.wrapper.children(),{pane:e.pane}),e.view.element.on("click",".k-done",function(t){e.close(),t.preventDefault()}),e.options.lockedColumns&&e.view.bind("show",function(){e._updateLockedColumns()})},_angularItems:function(t){var n=this;n.angular(t,function(){var t=n.wrapper.find(".k-columns-item input["+o.attr("field")+"]").map(function(){return e(this).closest("li")}),i=d(n._ownerColumns(),function(e){return{column:e._originalObject}});return{elements:t,data:i}})},destroy:function(){var e=this;e._angularItems("cleanup"),k.fn.destroy.call(e),e.filterMenu&&e.filterMenu.destroy(),e._refreshHandler&&e.dataSource.unbind(g,e._refreshHandler),e.options.columns&&e.owner&&e._updateColumnsMenuHandler&&(e.owner.unbind("columnShow",e._updateColumnsMenuHandler),e.owner.unbind("columnHide",e._updateColumnsMenuHandler)),e.menu&&(e.menu.element.off(b),e.menu.destroy()),e.wrapper.off(b),e.popup&&e.popup.destroy(),e.view&&e.view.purge(),e.link.off(b),e.owner=null,e.wrapper=null,e.element=null},close:function(){this.menu.close(),this.popup&&(this.popup.close(),this.popup.element.off("keydown"+b))},_click:function(e){e.preventDefault(),e.stopPropagation();var t=this.options;t.filter&&this.element.is(!t.filter)||(this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle())},_open:function(){var t=this;e(".k-column-menu").not(t.wrapper).each(function(){e(this).data(_).close()}),t.popup.element.on("keydown"+b,function(e){e.keyCode==o.keys.ESC&&t.close()}),t.options.lockedColumns&&t._updateLockedColumns()},_activate:function(){this.menu.element.focus()},_ownerColumns:function(){var e=r(this.owner.columns),t=c(e,function(e){var t=!0,i=n(e.title||"");return(e.menu===!1||!e.field&&!i.length)&&(t=!1),t});return d(t,function(t){return{originalField:t.field,field:t.field||t.title,title:t.title||t.field,hidden:t.hidden,index:u(t,e),locked:!!t.locked,_originalObject:t}})},_sort:function(){var t=this;t.options.sortable&&(t.refresh(),t._refreshHandler=s(t.refresh,t),t.dataSource.bind(g,t._refreshHandler),t.menu.bind(v,function(n){var i,r=e(n.item);r.hasClass("k-sort-asc")?i=p:r.hasClass("k-sort-desc")&&(i=f),i&&(r.parent().find(".k-sort-"+(i==p?f:p)).removeClass(h),t._sortDataSource(r,i),t.close())}))},_sortDataSource:function(e,n){var i,r,o=this,a=o.options.sortable,s=null===a.compare?t:a.compare,l=o.dataSource,c=l.sort()||[];if(e.hasClass(h)&&a&&a.allowUnsort!==!1?(e.removeClass(h),n=t):e.addClass(h),a===!0||"single"===a.mode)c=[{field:o.field,dir:n,compare:s}];else{for(i=0,r=c.length;r>i;i++)if(c[i].field===o.field){c.splice(i,1);break}c.push({field:o.field,dir:n,compare:s})}l.sort(c)},_columns:function(){var t=this;t.options.columns&&(t._updateColumnsMenu(),t._updateColumnsMenuHandler=s(t._updateColumnsMenu,t),t.owner.bind(["columnHide","columnShow"],t._updateColumnsMenuHandler),t.menu.bind(v,function(n){var i,a,s,l=e(n.item),d=r(t.owner.columns);t._isMobile&&n.preventDefault(),l.parent().closest("li.k-columns-item")[0]&&(i=l.find(":checkbox"),i.attr("disabled")||(s=i.attr(o.attr("field")),a=c(d,function(e){return e.field==s||e.title==s})[0],a.hidden===!0?t.owner.showColumn(a):t.owner.hideColumn(a)))}))},_updateColumnsMenu:function(){var e,t,n,i,r,a,s=o.attr("field"),l=o.attr("locked"),h=c(this._ownerColumns(),function(e){return!e.hidden}),p=c(h,function(e){return e.originalField}),f=c(p,function(e){return e.locked===!0}).length,g=c(p,function(e){return e.locked!==!0}).length;for(h=d(h,function(e){return e.field}),a=this.wrapper.find(".k-columns-item input["+s+"]").prop("disabled",!1).prop("checked",!1),e=0,t=a.length;t>e;e++)n=a.eq(e),r="true"===n.attr(l),i=!1,u(n.attr(s),h)>-1&&(i=!0,n.prop("checked",i)),i&&(1==f&&r&&n.prop("disabled",!0),1!=g||r||n.prop("disabled",!0))},_updateColumnsLockedState:function(){var e,t,n,r,a=o.attr("field"),s=o.attr("locked"),l=i(this._ownerColumns(),"field"),c=this.wrapper.find(".k-columns-item input[type=checkbox]");for(e=0,t=c.length;t>e;e++)n=c.eq(e),r=l[n.attr(a)],r&&n.attr(s,r.locked);this._updateColumnsMenu()},_filter:function(){var t=this,n=t.options;n.filterable!==!1&&(t.filterMenu=t.wrapper.find(".k-filterable")[w](l(!0,{},{appendToElement:!0,dataSource:n.dataSource,values:n.values,field:t.field},n.filterable)).data(w),t._isMobile&&t.menu.bind(v,function(n){var i=e(n.item);i.hasClass("k-filter-item")&&t.pane.navigate(t.filterMenu.view,t.options.animations.left)}))},_lockColumns:function(){var t=this;t.menu.bind(v,function(n){var i=e(n.item);i.hasClass("k-lock")?(t.owner.lockColumn(t.field),t.close()):i.hasClass("k-unlock")&&(t.owner.unlockColumn(t.field),t.close())})},_updateLockedColumns:function(){var e,t,n,i,r=this.field,o=this.owner.columns,a=c(o,function(e){return e.field==r||e.title==r})[0];a&&(e=a.locked===!0,t=c(o,function(t){return!t.hidden&&(t.locked&&e||!t.locked&&!e)}).length,n=this.wrapper.find(".k-lock").removeClass("k-state-disabled"),i=this.wrapper.find(".k-unlock").removeClass("k-state-disabled"),(e||1==t)&&n.addClass("k-state-disabled"),e&&1!=t||i.addClass("k-state-disabled"),this._updateColumnsLockedState())},refresh:function(){var e,t,n,i=this,r=i.options.dataSource.sort()||[],o=i.field;for(i.wrapper.find(".k-sort-asc, .k-sort-desc").removeClass(h),t=0,n=r.length;n>t;t++)e=r[t],o==e.field&&i.wrapper.find(".k-sort-"+e.dir).addClass(h)}}),C='<ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#if(showColumns || filterable){#<li class="k-separator"></li>#}##}##if(showColumns){#<li class="k-item k-columns-item"><span class="k-link"><span class="k-sprite k-i-columns"></span>${messages.columns}</span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li><input type="checkbox" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#</li>#}#</ul></li>#if(filterable || lockedColumns){#<li class="k-separator"></li>#}##}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link"><span class="k-sprite k-filter"></span>${messages.filter}</span><ul><li><div class="k-filterable"></div></li></ul></li>#if(lockedColumns){#<li class="k-separator"></li>#}##}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"></span>${messages.lock}</span></li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"></span>${messages.unlock}</span></li>#}#</ul>',T='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-column-menu"><div data-#=ns#role="header" class="k-header">${messages.settings}<button class="k-button k-done">#=messages.done#</button></div><div class="k-column-menu k-mobile-list"><ul><li><span class="k-link">${title}</span><ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"></span>${messages.lock}</span></li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"></span>${messages.unlock}</span></li>#}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link k-filterable"><span class="k-sprite k-filter"></span>${messages.filter}</span></li>#}#</ul></li>#if(showColumns){#<li class="k-columns-item"><span class="k-link">${messages.columns}</span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li class="k-item"><label class="k-label"><input type="checkbox" class="k-check" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#</label></li>#}#</ul></li>#}#</ul></div></div>',S=k.extend({init:function(e,t){k.fn.init.call(this,e,t),this.element.on("click"+b,"li.k-item:not(.k-separator):not(.k-state-disabled)","_click")},events:[v],_click:function(t){e(t.target).is("[type=checkbox]")||t.preventDefault(),this.trigger(v,{item:t.currentTarget})},close:function(){this.options.pane.navigate("")},destroy:function(){k.fn.destroy.call(this),this.element.off(b)}});a.plugin(x)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui,r=i.Widget,o="dir",a="asc",s="single",l="field",c="desc",d=".kendoColumnSorter",u=".k-link",h="aria-sort",p=e.proxy,f=r.extend({init:function(e,t){var n,i=this;r.fn.init.call(i,e,t),i._refreshHandler=p(i.refresh,i),i.dataSource=i.options.dataSource.bind("change",i._refreshHandler),n=i.element.find(u),n[0]||(n=i.element.wrapInner('<a class="k-link" href="#"/>').find(u)),i.link=n,i.element.on("click"+d,p(i._click,i))},options:{name:"ColumnSorter",mode:s,allowUnsort:!0,compare:null,filter:""},destroy:function(){var e=this;r.fn.destroy.call(e),e.element.off(d),e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=e.element=e.link=e.dataSource=null},refresh:function(){var t,i,r,s,d=this,u=d.dataSource.sort()||[],p=d.element,f=p.attr(n.attr(l));for(p.removeAttr(n.attr(o)),p.removeAttr(h),t=0,i=u.length;i>t;t++)r=u[t],f==r.field&&p.attr(n.attr(o),r.dir);s=p.attr(n.attr(o)),p.find(".k-i-arrow-n,.k-i-arrow-s").remove(),s===a?(e('<span class="k-icon k-i-arrow-n" />').appendTo(d.link),p.attr(h,"ascending")):s===c&&(e('<span class="k-icon k-i-arrow-s" />').appendTo(d.link),p.attr(h,"descending"))},_click:function(e){var i,r,d=this,u=d.element,h=u.attr(n.attr(l)),p=u.attr(n.attr(o)),f=d.options,g=null===d.options.compare?t:d.options.compare,m=d.dataSource.sort()||[];if(e.preventDefault(),!f.filter||u.is(f.filter)){if(p=p===a?c:p===c&&f.allowUnsort?t:a,f.mode===s)m=[{field:h,dir:p,compare:g}];else if("multiple"===f.mode){for(i=0,r=m.length;r>i;i++)if(m[i].field===h){m.splice(i,1);break}m.push({field:h,dir:p,compare:g})}this.dataSource.sort(m)}}});i.plugin(f)}(window.kendo.jQuery),function(e,t){function n(t){return t=null!=t?t:"",t.type||e.type(t)||"string"}function i(t){t.find(":input:not(:button, ["+s.attr("role")+"=upload], ["+s.attr("skip")+"], [type=file]), select").each(function(){var t=s.attr("bind"),n=this.getAttribute(t)||"",i="checkbox"===this.type||"radio"===this.type?"checked:":"value:",r=this.name;-1===n.indexOf(i)&&r&&(n+=(n.length?",":"")+i+r,e(this).attr(t,n))})}function r(e){var t,i,r=(e.model.fields||e.model)[e.field],o=n(r),a=r?r.validation:{},l=s.attr("type"),c=s.attr("bind"),d={name:e.field};for(t in a)i=a[t],f(t,_)>=0?d[l]=t:h(i)||(d[t]=p(i)?i.value||t:i),d[s.attr(t+"-msg")]=i.message;return f(o,_)>=0&&(d[l]=o),d[c]=("boolean"===o?"checked:":"value:")+e.field,d}function o(e){var t,n,i,r,o,a;if(e&&e.length)for(a=[],t=0,n=e.length;n>t;t++)i=e[t],o=i.text||i.value||i,r=null==i.value?i.text||i:i.value,a[t]={text:o,value:r};return a}function a(e,t){var n,i,r=e?e.validation||{}:{};for(n in r)i=r[n],p(i)&&i.value&&(i=i.value),h(i)&&(t[n]=i)}var s=window.kendo,l=s.ui,c=l.Widget,d=e.extend,u=s.support.browser.msie&&9>s.support.browser.version,h=s.isFunction,p=e.isPlainObject,f=e.inArray,g=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,m='<div class="k-widget k-tooltip k-tooltip-validation" style="margin:0.5em"><span class="k-icon k-warning"> </span>#=message#<div class="k-callout k-callout-n"></div></div>',v="change",_=["url","email","number","date","boolean"],w={number:function(t,n){var i=r(n);e('<input type="text"/>').attr(i).appendTo(t).kendoNumericTextBox({format:n.format}),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},date:function(t,n){var i=r(n),o=n.format;o&&(o=s._extractFormat(o)),i[s.attr("format")]=o,e('<input type="text"/>').attr(i).appendTo(t).kendoDatePicker({format:n.format}),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},string:function(t,n){var i=r(n);e('<input type="text" class="k-input k-textbox"/>').attr(i).appendTo(t)},"boolean":function(t,n){var i=r(n);e('<input type="checkbox" />').attr(i).appendTo(t)},values:function(t,n){var i=r(n);e("<select "+s.attr("text-field")+'="text"'+s.attr("value-field")+'="value"'+s.attr("source")+"='"+s.stringify(o(n.values)).replace(/\'/g,"&apos;")+"'"+s.attr("role")+'="dropdownlist"/>').attr(i).appendTo(t),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)}},y=c.extend({init:function(t,n){var i=this;n.target&&(n.$angular=n.target.options.$angular),c.fn.init.call(i,t,n),i._validateProxy=e.proxy(i._validate,i),i.refresh()},events:[v],options:{name:"Editable",editors:w,clearContainer:!0,errorTemplate:m},editor:function(e,t){var i=this,r=i.options.editors,o=p(e),a=o?e.field:e,l=i.options.model||{},c=o&&e.values,u=c?"values":n(t),h=o&&e.editor,f=h?e.editor:r[u],m=i.element.find("["+s.attr("container-for")+"="+a.replace(g,"\\$1")+"]");f=f?f:r.string,h&&"string"==typeof e.editor&&(f=function(t){t.append(e.editor)}),m=m.length?m:i.element,f(m,d(!0,{},o?e:{field:a},{model:l}))},_validate:function(t){var n,i=this,r=t.value,o=i._validationEventInProgress,a={},l=s.attr("bind"),c=t.field.replace(g,"\\$1"),d="checked:"+c,u="value:"+c;a[t.field]=t.value,n=e(":input["+l+'*="'+u+'"],:input['+l+'*="'+d+'"]',i.element).filter("["+s.attr("validate")+"!='false']"),n.length>1&&(n=n.filter(function(){var t=e(this),n=t.attr(l).split(","),i=f(u,n)>=0||f(d,n)>=0;return i&&(!t.is(":radio")||t.val()==r)}));try{i._validationEventInProgress=!0,(!i.validatable.validateInput(n)||!o&&i.trigger(v,{values:a}))&&t.preventDefault()}finally{i._validationEventInProgress=!1}},end:function(){return this.validatable.validate()},destroy:function(){var e=this;e.angular("cleanup",function(){return{elements:e.element}}),c.fn.destroy.call(e),e.options.model.unbind("set",e._validateProxy),s.unbind(e.element),e.validatable&&e.validatable.destroy(),s.destroy(e.element),e.element.removeData("kendoValidator")},refresh:function(){var n,r,o,l,c,d,h,f,g=this,m=g.options.fields||[],v=g.options.clearContainer?g.element.empty():g.element,_=g.options.model||{},w={};for(e.isArray(m)||(m=[m]),n=0,r=m.length;r>n;n++)o=m[n],l=p(o),c=l?o.field:o,d=(_.fields||_)[c],a(d,w),g.editor(o,d);if(g.options.target&&g.angular("compile",function(){return{elements:v,data:[{dataItem:_}]}}),!r){h=_.fields||_;for(c in h)a(h[c],w)}i(v),g.validatable&&g.validatable.destroy(),s.bind(v,g.options.model),g.options.model.unbind("set",g._validateProxy),g.options.model.bind("set",g._validateProxy),g.validatable=new s.ui.Validator(v,{validateOnBlur:!1,errorTemplate:g.options.errorTemplate||t,rules:w}),f=v.find(":kendoFocusable").eq(0).focus(),u&&f.focus()}});l.plugin(y)}(window.kendo.jQuery),function(e,t){function n(e){return t!==e}function i(e,t,n){return Math.max(Math.min(parseInt(e,10),1/0===n?n:parseInt(n,10)),parseInt(t,10))}function r(e,t){return function(){var n=this,i=n.wrapper,r=i[0].style,o=n.options;if(!o.isMaximized&&!o.isMinimized)return n.restoreOptions={width:r.width,height:r.height},i.children(x).hide().end().children(b).find(q).parent().hide().eq(0).before(J.action({name:"Restore"})),t.call(n),"maximize"==e?n.wrapper.children(b).find(Y).parent().hide():n.wrapper.children(b).find(Y).parent().show(),n}}function o(){return!this.type||this.type.toLowerCase().indexOf("script")>=0}function a(e){var t=this;t.owner=e,t._draggable=new d(e.wrapper,{filter:">"+x,group:e.wrapper.id+"-resizing",dragstart:p(t.dragstart,t),drag:p(t.drag,t),dragend:p(t.dragend,t)}),t._draggable.userEvents.bind("press",p(t.addOverlay,t)),t._draggable.userEvents.bind("release",p(t.removeOverlay,t))}function s(e,t){var n=this;n.owner=e,n._draggable=new d(e.wrapper,{filter:t,group:e.wrapper.id+"-moving",dragstart:p(n.dragstart,n),drag:p(n.drag,n),dragend:p(n.dragend,n),dragcancel:p(n.dragcancel,n)}),n._draggable.userEvents.stopPropagation=!1}var l=window.kendo,c=l.ui.Widget,d=l.ui.Draggable,u=e.isPlainObject,h=l._activeElement,p=e.proxy,f=e.extend,g=e.each,m=l.template,v="body",_=".kendoWindow",w=".k-window",y=".k-window-title",b=y+"bar",k=".k-window-content",x=".k-resize-handle",C=".k-overlay",T="k-content-frame",S="k-loading",D="k-state-hover",A="k-state-focused",E="k-window-maximized",I=":visible",P="hidden",M="cursor",F="open",z="activate",R="deactivate",B="close",H="refresh",L="resize",N="resizeEnd",O="dragstart",V="dragend",U="error",W="overflow",j="zIndex",q=".k-window-actions .k-i-minimize,.k-window-actions .k-i-maximize",G=".k-i-pin",$=".k-i-unpin",Y=G+","+$,Q=".k-window-titlebar .k-window-action",K=".k-window-titlebar .k-i-refresh",X=l.isLocalUrl,Z=c.extend({init:function(i,r){var a,s,d,h,f,g,m,v=this,x={},C=!1,T=r&&r.actions&&!r.actions.length;c.fn.init.call(v,i,r),r=v.options,h=r.position,i=v.element,f=r.content,T&&(r.actions=[]),v.appendTo=e(r.appendTo),v._animations(),f&&!u(f)&&(f=r.content={url:f}),i.find("script").filter(o).remove(),i.parent().is(v.appendTo)||h.top!==t&&h.left!==t||(i.is(I)?(x=i.offset(),C=!0):(s=i.css("visibility"),d=i.css("display"),i.css({visibility:P,display:""}),x=i.offset(),i.css({visibility:s,display:d})),h.top===t&&(h.top=x.top),h.left===t&&(h.left=x.left)),n(r.visible)&&null!==r.visible||(r.visible=i.is(I)),a=v.wrapper=i.closest(w),i.is(".k-content")&&a[0]||(i.addClass("k-window-content k-content"),v._createWindow(i,r),a=v.wrapper=i.closest(w),v._dimensions()),v._position(),r.pinned&&v.pin(!0),f&&v.refresh(f),r.visible&&v.toFront(),g=a.children(k),v._tabindex(g),r.visible&&r.modal&&v._overlay(a.is(I)).css({opacity:.5}),a.on("mouseenter"+_,Q,p(v._buttonEnter,v)).on("mouseleave"+_,Q,p(v._buttonLeave,v)).on("click"+_,"> "+Q,p(v._windowActionHandler,v)),g.on("keydown"+_,p(v._keydown,v)).on("focus"+_,p(v._focus,v)).on("blur"+_,p(v._blur,v)),this._resizable(),this._draggable(),m=i.attr("id"),m&&(m+="_wnd_title",a.children(b).children(y).attr("id",m),g.attr({role:"dialog","aria-labelledby":m})),a.add(a.children(".k-resize-handle,"+b)).on("mousedown"+_,p(v.toFront,v)),v.touchScroller=l.touchScroller(i),v._resizeHandler=p(v._onDocumentResize,v),v._marker=l.guid().substring(0,8),e(window).on("resize"+_+v._marker,v._resizeHandler),r.visible&&(v.trigger(F),v.trigger(z)),l.notify(v)},_buttonEnter:function(t){e(t.currentTarget).addClass(D)},_buttonLeave:function(t){e(t.currentTarget).removeClass(D)},_focus:function(){this.wrapper.addClass(A)},_blur:function(){this.wrapper.removeClass(A)},_dimensions:function(){var e,t,n=this.wrapper,r=this.options,o=r.width,a=r.height,s=r.maxHeight,l=["minWidth","minHeight","maxWidth","maxHeight"];for(this.title(r.title),e=0;l.length>e;e++)t=r[l[e]],t&&1/0!=t&&n.css(l[e],t);s&&1/0!=s&&this.element.css("maxHeight",s),o&&n.width((""+o).indexOf("%")>0?o:i(o,r.minWidth,r.maxWidth)),a&&n.height((""+a).indexOf("%")>0?a:i(a,r.minHeight,r.maxHeight)),r.visible||n.hide()},_position:function(){var e=this.wrapper,t=this.options.position;0===t.top&&(t.top=""+t.top),0===t.left&&(t.left=""+t.left),e.css({top:t.top||"",left:t.left||""})},_animations:function(){var e=this.options;e.animation===!1&&(e.animation={open:{effects:{}},close:{hide:!0,effects:{}}})},_resize:function(){l.resize(this.element.children())},_resizable:function(){var t=this.options.resizable,n=this.wrapper;this.resizing&&(n.off("dblclick"+_).children(x).remove(),this.resizing.destroy(),this.resizing=null),t&&(n.on("dblclick"+_,b,p(function(t){e(t.target).closest(".k-window-action").length||this.toggleMaximization()
},this)),g("n e s w se sw ne nw".split(" "),function(e,t){n.append(J.resizeHandle(t))}),this.resizing=new a(this)),n=null},_draggable:function(){var e=this.options.draggable;this.dragging&&(this.dragging.destroy(),this.dragging=null),e&&(this.dragging=new s(this,e.dragHandle||b))},_actions:function(){var t=this.options.actions,n=this.wrapper.children(b),i=n.find(".k-window-actions");t=e.map(t,function(e){return{name:e}}),i.html(l.render(J.action,t))},setOptions:function(e){c.fn.setOptions.call(this,e),this._animations(),this._dimensions(),this._position(),this._resizable(),this._draggable(),this._actions()},events:[F,z,R,B,H,L,N,O,V,U],options:{name:"Window",animation:{open:{effects:{zoom:{direction:"in"},fade:{direction:"in"}},duration:350},close:{effects:{zoom:{direction:"out",properties:{scale:.7}},fade:{direction:"out"}},duration:350,hide:!0}},title:"",actions:["Close"],autoFocus:!0,modal:!1,resizable:!0,draggable:!0,minWidth:90,minHeight:50,maxWidth:1/0,maxHeight:1/0,pinned:!1,position:{},content:null,visible:null,height:null,width:null,appendTo:"body"},_closable:function(){return e.inArray("close",e.map(this.options.actions,function(e){return e.toLowerCase()}))>-1},_keydown:function(e){var t,n,r,o,a,s,c=this,d=c.options,u=l.keys,h=e.keyCode,p=c.wrapper,f=10,g=c.options.isMaximized;e.target!=e.currentTarget||c._closing||(h==u.ESC&&c._closable()&&c._close(!1),!d.draggable||e.ctrlKey||g||(t=l.getOffset(p),h==u.UP?n=p.css("top",t.top-f):h==u.DOWN?n=p.css("top",t.top+f):h==u.LEFT?n=p.css("left",t.left-f):h==u.RIGHT&&(n=p.css("left",t.left+f))),d.resizable&&e.ctrlKey&&!g&&(h==u.UP?(n=!0,o=p.height()-f):h==u.DOWN&&(n=!0,o=p.height()+f),h==u.LEFT?(n=!0,r=p.width()-f):h==u.RIGHT&&(n=!0,r=p.width()+f),n&&(a=i(r,d.minWidth,d.maxWidth),s=i(o,d.minHeight,d.maxHeight),isNaN(a)||(p.width(a),c.options.width=a+"px"),isNaN(s)||(p.height(s),c.options.height=s+"px"),c.resize())),n&&e.preventDefault())},_overlay:function(t){var n=this.appendTo.children(C),i=this.wrapper;return n.length||(n=e("<div class='k-overlay' />")),n.insertBefore(i[0]).toggle(t).css(j,parseInt(i.css(j),10)-1),n},_actionForIcon:function(e){var t=/\bk-i-\w+\b/.exec(e[0].className)[0];return{"k-i-close":"_close","k-i-maximize":"maximize","k-i-minimize":"minimize","k-i-restore":"restore","k-i-refresh":"refresh","k-i-pin":"pin","k-i-unpin":"unpin"}[t]},_windowActionHandler:function(n){var i,r;if(!this._closing)return i=e(n.target).closest(".k-window-action").find(".k-icon"),r=this._actionForIcon(i),r?(n.preventDefault(),this[r](),!1):t},_modals:function(){var t=this,n=e(w).filter(function(){var n=e(this),i=t._object(n),r=i&&i.options;return r&&r.modal&&r.visible&&n.is(I)}).sort(function(t,n){return+e(t).css("zIndex")-+e(n).css("zIndex")});return t=null,n},_object:function(e){var t=e.children(k);return t.data("kendoWindow")||t.data("kendo"+this.options.name)},center:function(){var t,n,i=this,r=i.options.position,o=i.wrapper,a=e(window),s=0,l=0;return i.options.isMaximized?i:(i.options.pinned||(s=a.scrollTop(),l=a.scrollLeft()),n=l+Math.max(0,(a.width()-o.width())/2),t=s+Math.max(0,(a.height()-o.height()-parseInt(o.css("paddingTop"),10))/2),o.css({left:n,top:t}),r.top=t,r.left=n,i)},title:function(e){var t,n=this,i=n.wrapper,r=n.options,o=i.children(b),a=o.children(y);return arguments.length?(e===!1?(i.addClass("k-window-titleless"),o.remove()):(o.length?a.html(e):(i.prepend(J.titlebar(r)),n._actions(),o=i.children(b)),t=o.outerHeight(),i.css("padding-top",t),o.css("margin-top",-t)),n.options.title=e,n):a.text()},content:function(e,t){var i=this.wrapper.children(k),r=i.children(".km-scroll-container");return i=r[0]?r:i,n(e)?(this.angular("cleanup",function(){return{elements:i.children()}}),l.destroy(this.element.children()),i.empty().html(e),this.angular("compile",function(){var e,n=[];for(e=i.length;--e>=0;)n.push({dataItem:t});return{elements:i.children(),data:n}}),this):i.html()},open:function(){var t,n,i=this,r=i.wrapper,o=i.options,a=o.animation.open,s=r.children(k);return i.trigger(F)||(i._closing&&r.kendoStop(!0,!0),i._closing=!1,i.toFront(),o.autoFocus&&i.element.focus(),o.visible=!0,o.modal&&(t=i._overlay(!1),t.kendoStop(!0,!0),a.duration&&l.effects.Fade?(n=l.fx(t).fadeIn(),n.duration(a.duration||0),n.endValue(.5),n.play()):t.css("opacity",.5),t.show()),r.is(I)||(s.css(W,P),r.show().kendoStop().kendoAnimate({effects:a.effects,duration:a.duration,complete:p(this._activate,this)}))),o.isMaximized&&(i._documentScrollTop=e(document).scrollTop(),e("html, body").css(W,P)),i},_activate:function(){this.options.autoFocus&&this.element.focus(),this.trigger(z),this.wrapper.children(k).css(W,"")},_removeOverlay:function(n){var i,r=this._modals(),o=this.options,a=o.modal&&!r.length,s=o.modal?this._overlay(!0):e(t),c=o.animation.close;a?!n&&c.duration&&l.effects.Fade?(i=l.fx(s).fadeOut(),i.duration(c.duration||0),i.startValue(.5),i.play()):this._overlay(!1).remove():r.length&&this._object(r.last())._overlay(!0)},_close:function(t){var n=this,i=n.wrapper,r=n.options,o=r.animation.open,a=r.animation.close;if(i.is(I)&&!n.trigger(B,{userTriggered:!t})){if(n._closing)return;n._closing=!0,r.visible=!1,e(w).each(function(t,n){var r=e(n).children(k);n!=i&&r.find("> ."+T).length>0&&r.children(C).remove()}),this._removeOverlay(),i.kendoStop().kendoAnimate({effects:a.effects||o.effects,reverse:a.reverse===!0,duration:a.duration,complete:p(this._deactivate,this)})}n.options.isMaximized&&(e("html, body").css(W,""),n._documentScrollTop&&n._documentScrollTop>0&&e(document).scrollTop(n._documentScrollTop))},_deactivate:function(){this.wrapper.hide().css("opacity",""),this.trigger(R);var e=this._object(this._modals().last());e&&e.toFront()},close:function(){return this._close(!0),this},_actionable:function(t){return e(t).is(Q+","+Q+" .k-icon,:input,a")},_shouldFocus:function(t){var n=h(),i=this.element;return!(!this.options.autoFocus||e(n).is(i)||this._actionable(t)||i.find(n).length&&i.find(t).length)},toFront:function(t){var n,i,r=this,o=r.wrapper,a=o[0],s=+o.css(j),l=s,c=t&&t.target||null;return e(w).each(function(t,n){var i=e(n),r=i.css(j),o=i.children(k);isNaN(r)||(s=Math.max(+r,s)),n!=a&&o.find("> ."+T).length>0&&o.append(J.overlay)}),(!o[0].style.zIndex||s>l)&&o.css(j,s+2),r.element.find("> .k-overlay").remove(),r._shouldFocus(c)&&(r.element.focus(),n=e(window).scrollTop(),i=parseInt(o.position().top,10),i>0&&n>i&&(n>0?e(window).scrollTop(i):o.css("top",n))),o=null,r},toggleMaximization:function(){return this._closing?this:this[this.options.isMaximized?"restore":"maximize"]()},restore:function(){var t=this,n=t.options,i=n.minHeight,r=t.restoreOptions;return n.isMaximized||n.isMinimized?(i&&1/0!=i&&t.wrapper.css("min-height",i),t.wrapper.css({position:n.pinned?"fixed":"absolute",left:r.left,top:r.top,width:r.width,height:r.height}).removeClass(E).find(".k-window-content,.k-resize-handle").show().end().find(".k-window-titlebar .k-i-restore").parent().remove().end().end().find(q).parent().show().end().end().find(Y).parent().show(),t.options.width=r.width,t.options.height=r.height,e("html, body").css(W,""),this._documentScrollTop&&this._documentScrollTop>0&&e(document).scrollTop(this._documentScrollTop),n.isMaximized=n.isMinimized=!1,t.resize(),t):t},maximize:r("maximize",function(){var t=this,n=t.wrapper,i=n.position();f(t.restoreOptions,{left:i.left,top:i.top}),n.css({left:0,top:0,position:"fixed"}).addClass(E),this._documentScrollTop=e(document).scrollTop(),e("html, body").css(W,P),t.options.isMaximized=!0,t._onDocumentResize()}),minimize:r("minimize",function(){var e=this;e.wrapper.css({height:"",minHeight:""}),e.element.hide(),e.options.isMinimized=!0}),pin:function(t){var n=this,i=e(window),r=n.wrapper,o=parseInt(r.css("top"),10),a=parseInt(r.css("left"),10);(t||!n.options.pinned&&!n.options.isMaximized)&&(r.css({position:"fixed",top:o-i.scrollTop(),left:a-i.scrollLeft()}),r.children(b).find(G).addClass("k-i-unpin").removeClass("k-i-pin"),n.options.pinned=!0)},unpin:function(){var t=this,n=e(window),i=t.wrapper,r=parseInt(i.css("top"),10),o=parseInt(i.css("left"),10);t.options.pinned&&!t.options.isMaximized&&(i.css({position:"",top:r+n.scrollTop(),left:o+n.scrollLeft()}),i.children(b).find($).addClass("k-i-pin").removeClass("k-i-unpin"),t.options.pinned=!1)},_onDocumentResize:function(){var t,n,i=this,r=i.wrapper,o=e(window),a=l.support.zoomLevel();i.options.isMaximized&&(t=o.width()/a,n=o.height()/a-parseInt(r.css("padding-top"),10),r.css({width:t,height:n}),i.options.width=t,i.options.height=n,i.resize())},refresh:function(t){var i,r,o,a=this,s=a.options,l=e(a.element);return u(t)||(t={url:t}),t=f({},s.content,t),r=n(s.iframe)?s.iframe:t.iframe,o=t.url,o?(n(r)||(r=!X(o)),r?(i=l.find("."+T)[0],i?i.src=o||i.src:l.html(J.contentFrame(f({},s,{content:t}))),l.find("."+T).unbind("load"+_).on("load"+_,p(this._triggerRefresh,this))):a._ajaxRequest(t)):(t.template&&a.content(m(t.template)({})),a.trigger(H)),l.toggleClass("k-window-iframecontent",!!r),a},_triggerRefresh:function(){this.trigger(H)},_ajaxComplete:function(){clearTimeout(this._loadingIconTimeout),this.wrapper.find(K).removeClass(S)},_ajaxError:function(e,t){this.trigger(U,{status:t,xhr:e})},_ajaxSuccess:function(e){return function(t){var n=t;e&&(n=m(e)(t||{})),this.content(n,t),this.element.prop("scrollTop",0),this.trigger(H)}},_showLoading:function(){this.wrapper.find(K).addClass(S)},_ajaxRequest:function(t){this._loadingIconTimeout=setTimeout(p(this._showLoading,this),100),e.ajax(f({type:"GET",dataType:"html",cache:!1,error:p(this._ajaxError,this),complete:p(this._ajaxComplete,this),success:p(this._ajaxSuccess(t.template),this)},t))},destroy:function(){var n=this;n.resizing&&n.resizing.destroy(),n.dragging&&n.dragging.destroy(),n.wrapper.off(_).children(k).off(_).end().find(".k-resize-handle,.k-window-titlebar").off(_),e(window).off("resize"+_+n._marker),clearTimeout(n._loadingIconTimeout),c.fn.destroy.call(n),n.unbind(t),l.destroy(n.wrapper),n._removeOverlay(!0),n.wrapper.empty().remove(),n.wrapper=n.appendTo=n.element=e()},_createWindow:function(){var t,n,i=this.element,r=this.options,o=l.support.isRtl(i);r.scrollable===!1&&i.attr("style","overflow:hidden;"),n=e(J.wrapper(r)),t=i.find("iframe:not(.k-content)").map(function(){var e=this.getAttribute("src");return this.src="",e}),n.toggleClass("k-rtl",o).appendTo(this.appendTo).append(i).find("iframe:not(.k-content)").each(function(e){this.src=t[e]}),n.find(".k-window-title").css(o?"left":"right",n.find(".k-window-actions").outerWidth()+10),i.css("visibility","").show(),i.find("[data-role=editor]").each(function(){var t=e(this).data("kendoEditor");t&&t.refresh()}),n=i=null}}),J={wrapper:m("<div class='k-widget k-window' />"),action:m("<a role='button' href='\\#' class='k-window-action k-link'><span role='presentation' class='k-icon k-i-#= name.toLowerCase() #'>#= name #</span></a>"),titlebar:m("<div class='k-window-titlebar k-header'>&nbsp;<span class='k-window-title'>#= title #</span><div class='k-window-actions' /></div>"),overlay:"<div class='k-overlay' />",contentFrame:m("<iframe frameborder='0' title='#= title #' class='"+T+"' src='#= content.url #'>This page requires frames in order to show content</iframe>"),resizeHandle:m("<div class='k-resize-handle k-resize-#= data #'></div>")};a.prototype={addOverlay:function(){this.owner.wrapper.append(J.overlay)},removeOverlay:function(){this.owner.wrapper.find(C).remove()},dragstart:function(t){var n=this,i=n.owner,r=i.wrapper;n.elementPadding=parseInt(r.css("padding-top"),10),n.initialPosition=l.getOffset(r,"position"),n.resizeDirection=t.currentTarget.prop("className").replace("k-resize-handle k-resize-",""),n.initialSize={width:r.width(),height:r.height()},n.containerOffset=l.getOffset(i.appendTo,"position"),r.children(x).not(t.currentTarget).hide(),e(v).css(M,t.currentTarget.css(M))},drag:function(e){var t,n,r,o,a=this,s=a.owner,l=s.wrapper,c=s.options,d=a.resizeDirection,u=a.containerOffset,h=a.initialPosition,p=a.initialSize,f=Math.max(e.x.location,u.left),g=Math.max(e.y.location,u.top);d.indexOf("e")>=0?(t=f-h.left,l.width(i(t,c.minWidth,c.maxWidth))):d.indexOf("w")>=0&&(o=h.left+p.width,t=i(o-f,c.minWidth,c.maxWidth),l.css({left:o-t-u.left,width:t})),d.indexOf("s")>=0?(n=g-h.top-a.elementPadding,l.height(i(n,c.minHeight,c.maxHeight))):d.indexOf("n")>=0&&(r=h.top+p.height,n=i(r-g,c.minHeight,c.maxHeight),l.css({top:r-n-u.top,height:n})),t&&(s.options.width=t+"px"),n&&(s.options.height=n+"px"),s.resize()},dragend:function(t){var n=this,i=n.owner,r=i.wrapper;return r.children(x).not(t.currentTarget).show(),e(v).css(M,""),i.touchScroller&&i.touchScroller.reset(),27==t.keyCode&&r.css(n.initialPosition).css(n.initialSize),i.trigger(N),!1},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},s.prototype={dragstart:function(t){var n=this.owner,i=n.element,r=i.find(".k-window-actions"),o=l.getOffset(n.appendTo);n.trigger(O),n.initialWindowPosition=l.getOffset(n.wrapper,"position"),n.startPosition={left:t.x.client-n.initialWindowPosition.left,top:t.y.client-n.initialWindowPosition.top},n.minLeftPosition=r.length>0?r.outerWidth()+parseInt(r.css("right"),10)-i.outerWidth():20-i.outerWidth(),n.minLeftPosition-=o.left,n.minTopPosition=-o.top,n.wrapper.append(J.overlay).children(x).hide(),e(v).css(M,t.currentTarget.css(M))},drag:function(t){var n=this.owner,i=n.options.position,r=Math.max(t.y.client-n.startPosition.top,n.minTopPosition),o=Math.max(t.x.client-n.startPosition.left,n.minLeftPosition),a={left:o,top:r};e(n.wrapper).css(a),i.top=r,i.left=o},_finishDrag:function(){var t=this.owner;t.wrapper.children(x).toggle(!t.options.isMinimized).end().find(C).remove(),e(v).css(M,"")},dragcancel:function(e){this._finishDrag(),e.currentTarget.closest(w).css(this.owner.initialWindowPosition)},dragend:function(){return this._finishDrag(),this.owner.trigger(V),!1},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},l.ui.plugin(Z)}(window.kendo.jQuery),function(e,t){function n(e){var t,n,i=e.find(k("popover")),r=s.roles;for(t=0,n=i.length;n>t;t++)o.initWidget(i[t],{},r)}function i(e){o.triggeredByInput(e)||e.preventDefault()}function r(t){t.each(function(){o.initWidget(e(this),{},s.roles)})}var o=window.kendo,a=o.mobile,s=a.ui,l=o.attr,c=s.Widget,d=o.ViewClone,u="init",h='<div style="height: 100%; width: 100%; position: absolute; top: 0; left: 0; z-index: 20000; display: none" />',p="beforeShow",f="show",g="afterShow",m="beforeHide",v="transitionEnd",_="transitionStart",w="hide",y="destroy",b=o.attrValue,k=o.roleSelector,x=o.directiveSelector,C=o.compileMobileDirective,T=c.extend({init:function(t,n){c.fn.init.call(this,t,n),this.params={},e.extend(this,n),this.transition=this.transition||this.defaultTransition,this._id(),this.options.$angular?this._overlay():(this._layout(),this._overlay(),this._scroller(),this._model())},events:[u,p,f,g,m,w,y,_,v],options:{name:"View",title:"",layout:null,getLayout:e.noop,reload:!1,transition:"",defaultTransition:"",useNativeScrolling:!1,stretch:!1,zoom:!1,model:null,modelScope:window,scroller:{},initWidgets:!0},enable:function(e){t===e&&(e=!0),e?this.overlay.hide():this.overlay.show()},destroy:function(){this.layout&&this.layout.detach(this),this.trigger(y),c.fn.destroy.call(this),this.scroller&&this.scroller.destroy(),this.options.$angular&&this.element.scope().$destroy(),o.destroy(this.element)},purge:function(){this.destroy(),this.element.remove()},triggerBeforeShow:function(){return this.trigger(p,{view:this})?!1:!0},showStart:function(){var e=this.element;e.css("display",""),this.inited?this._invokeNgController():(this.inited=!0,this.trigger(u,{view:this})),this.layout&&this.layout.attach(this),this._padIfNativeScrolling(),this.trigger(f,{view:this}),o.resize(e)},showEnd:function(){this.trigger(g,{view:this}),this._padIfNativeScrolling()},hideStart:function(){this.trigger(m,{view:this})},hideEnd:function(){var e=this;e.element.hide(),e.trigger(w,{view:e}),e.layout&&e.layout.trigger(w,{view:e,layout:e.layout})},beforeTransition:function(e){this.trigger(_,{type:e})},afterTransition:function(e){this.trigger(v,{type:e})},_padIfNativeScrolling:function(){if(a.appLevelNativeScrolling()){var e=o.support.mobileOS&&o.support.mobileOS.android,t=a.application.os.android||a.application.skin()&&a.application.skin().indexOf("android")>-1,n=e||t?"footer":"header",i=e||t?"header":"footer";this.content.css({paddingTop:this[n].height(),paddingBottom:this[i].height()})}},contentElement:function(){var e=this;return e.options.stretch?e.content:e.scrollerContent},clone:function(){return new d(this)},_scroller:function(){var t=this;a.appLevelNativeScrolling()||(t.options.stretch?t.content.addClass("km-stretched-view"):(t.content.kendoMobileScroller(e.extend(t.options.scroller,{zoom:t.options.zoom,useNative:t.options.useNativeScrolling})),t.scroller=t.content.data("kendoMobileScroller"),t.scrollerContent=t.scroller.scrollElement),o.support.kineticScrollNeeded&&(e(t.element).on("touchmove",".km-header",i),t.options.useNativeScrolling||e(t.element).on("touchmove",".km-content",i)))},_model:function(){var e=this,t=e.element,i=e.options.model;"string"==typeof i&&(i=o.getter(i)(e.options.modelScope)),e.model=i,n(t),e.element.css("display",""),e.options.initWidgets&&(i?o.bind(t,i,s,o.ui,o.dataviz.ui):a.init(t.children())),e.element.css("display","none")},_id:function(){var e=this.element,t=e.attr("id")||"";this.id=b(e,"url")||"#"+t,"#"==this.id&&(this.id=o.guid(),e.attr("id",this.id))},_layout:function(){var e=k("content"),t=this.element;t.addClass("km-view"),this.header=t.children(k("header")).addClass("km-header"),this.footer=t.children(k("footer")).addClass("km-footer"),t.children(e)[0]||t.wrapInner("<div "+l("role")+'="content"></div>'),this.content=t.children(k("content")).addClass("km-content"),this.element.prepend(this.header).append(this.footer),this.layout=this.options.getLayout(this.layout),this.layout&&this.layout.setup(this)},_overlay:function(){this.overlay=e(h).appendTo(this.element)},_invokeNgController:function(){var e,t,n=this.element;this.options.$angular&&(e=n.controller(),t=n.scope(),e&&t.$apply(function(){n.injector().invoke(e.constructor,null,{$scope:t})}))}}),S=c.extend({init:function(e,t){c.fn.init.call(this,e,t),e=this.element,this.header=e.children(this._locate("header")).addClass("km-header"),this.footer=e.children(this._locate("footer")).addClass("km-footer"),this.elements=this.header.add(this.footer),n(e),this.options.$angular||o.mobile.init(this.element.children()),this.element.detach(),this.trigger(u,{layout:this})},_locate:function(e){return this.options.$angular?x(e):k(e)},options:{name:"Layout",id:null,platform:null},events:[u,f,w],setup:function(e){e.header[0]||(e.header=this.header),e.footer[0]||(e.footer=this.footer)},detach:function(e){var t=this;e.header===t.header&&t.header[0]&&e.element.prepend(t.header.detach()[0].cloneNode(!0)),e.footer===t.footer&&t.footer.length&&e.element.append(t.footer.detach()[0].cloneNode(!0))},attach:function(e){var t=this,n=t.currentView;n&&t.detach(n),e.header===t.header&&(t.header.detach(),e.element.children(k("header")).remove(),e.element.prepend(t.header)),e.footer===t.footer&&(t.footer.detach(),e.element.children(k("footer")).remove(),e.element.append(t.footer)),t.trigger(f,{layout:t,view:e}),t.currentView=e}}),D=o.Observable,A=/<body[^>]*>(([\u000a\u000d\u2028\u2029]|.)*)<\/body>/i,E="loadStart",I="loadComplete",P="showStart",M="sameViewRequested",F="viewShow",z="viewTypeDetermined",R="after",B=D.extend({init:function(t){var n,i,a,s,l=this;if(D.fn.init.call(l),e.extend(l,t),l.sandbox=e("<div />"),a=l.container,n=l._hideViews(a),l.rootView=n.first(),!l.rootView[0]&&t.rootNeeded)throw i=a[0]==o.mobile.application.element[0]?'Your kendo mobile application element does not contain any direct child elements with data-role="view" attribute set. Make sure that you instantiate the mobile application using the correct container.':'Your pane element does not contain any direct child elements with data-role="view" attribute set.',Error(i);l.layouts={},l.viewContainer=new o.ViewContainer(l.container),l.viewContainer.bind("accepted",function(e){e.view.params=l.params}),l.viewContainer.bind("complete",function(e){l.trigger(F,{view:e.view})}),l.viewContainer.bind(R,function(){l.trigger(R)}),this.getLayoutProxy=e.proxy(this,"_getLayout"),l._setupLayouts(a),s=a.children(l._locate("modalview drawer")),l.$angular?s.each(function(t,n){C(e(n),function(){})}):r(s),this.bind(this.events,t)},events:[P,R,F,E,I,M,z],destroy:function(){o.destroy(this.container);for(var e in this.layouts)this.layouts[e].destroy()},view:function(){return this.viewContainer.view},showView:function(e,t,n){if(e=e.replace(RegExp("^"+this.remoteViewURLPrefix),""),""===e&&this.remoteViewURLPrefix&&(e="/"),e.replace(/^#/,"")===this.url)return this.trigger(M),!1;this.trigger(P);var i=this,r=function(n){return i.viewContainer.show(n,t,e)},a=i._findViewElement(e),s=o.widgetInstance(a);return i.url=e.replace(/^#/,""),i.params=n,s&&s.reload&&(s.purge(),a=[]),this.trigger(z,{remote:0===a.length,url:e}),a[0]?(s||(s=i._createView(a)),r(s)):(this.serverNavigation?location.href=e:i._loadView(e,r),!0)},append:function(e,t){var n,i,o,a=this.sandbox,s=(t||"").split("?")[0],c=this.container;return A.test(e)&&(e=RegExp.$1),a[0].innerHTML=e,c.append(a.children("script, style")),n=this._hideViews(a),o=n.first(),o.length||(n=o=a.wrapInner("<div data-role=view />").children()),s&&o.hide().attr(l("url"),s),this._setupLayouts(a),i=a.children(this._locate("modalview drawer")),c.append(a.children(this._locate("layout modalview drawer")).add(n)),r(i),this._createView(o)},_locate:function(e){return this.$angular?x(e):k(e)},_findViewElement:function(e){var t,n=e.split("?")[0];return n?(t=this.container.children("["+l("url")+"='"+n+"']"),t[0]||-1!==n.indexOf("/")||(t=this.container.children("#"===n.charAt(0)?n:"#"+n)),t):this.rootView},_createView:function(e){if(this.$angular){var t=this;return C(e,function(e){e.viewOptions={defaultTransition:t.transition,loader:t.loader,container:t.container,getLayout:t.getLayoutProxy}})}return o.initWidget(e,{defaultTransition:this.transition,loader:this.loader,container:this.container,getLayout:this.getLayoutProxy,modelScope:this.modelScope,reload:b(e,"reload")},s.roles)},_getLayout:function(e){return""===e?null:e?this.layouts[e]:this.layouts[this.layout]},_loadView:function(t,n){this._xhr&&this._xhr.abort(),this.trigger(E),this._xhr=e.get(o.absoluteURL(t,this.remoteViewURLPrefix),"html").always(e.proxy(this,"_xhrComplete",n,t))},_xhrComplete:function(e,t,n){var i=!0;if("object"==typeof n&&0===n.status){if(!(n.responseText&&n.responseText.length>0))return;i=!0,n=n.responseText}this.trigger(I),i&&e(this.append(n,t))},_hideViews:function(e){return e.children(this._locate("view splitview")).hide()},_setupLayouts:function(t){var n,i=this;t.children(i._locate("layout")).each(function(){n=i.$angular?C(e(this)):o.initWidget(e(this),{},s.roles);var t=n.options.platform;t&&t!==a.application.os.name?n.destroy():i.layouts[n.options.id]=n})}});o.mobile.ViewEngine=B,s.plugin(T),s.plugin(S)}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.mobile.ui,i=n.Widget,r=e.map(t.eventMap,function(e){return e}).join(" ").split(" "),o=i.extend({init:function(t,n){var r=this,o=e('<div class="km-loader"><span class="km-loading km-spin"></span><span class="km-loading-left"></span><span class="km-loading-right"></span></div>');i.fn.init.call(r,o,n),r.container=t,r.captureEvents=!1,r._attachCapture(),o.append(r.options.loading).hide().appendTo(t)},options:{name:"Loader",loading:"<h1>Loading...</h1>",timeout:100},show:function(){var e=this;clearTimeout(e._loading),e.options.loading!==!1&&(e.captureEvents=!0,e._loading=setTimeout(function(){e.element.show()},e.options.timeout))},hide:function(){this.captureEvents=!1,clearTimeout(this._loading),this.element.hide()},changeMessage:function(e){this.options.loading=e,this.element.find(">h1").html(e)},transition:function(){this.captureEvents=!0,this.container.css("pointer-events","none")},transitionDone:function(){this.captureEvents=!1,this.container.css("pointer-events","")},_attachCapture:function(){function e(e){n.captureEvents&&e.preventDefault()}var t,n=this;for(n.captureEvents=!1,t=0;r.length>t;t++)n.container[0].addEventListener(r[t],e,!0)}});n.plugin(o)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.mobile,r=n.roleSelector,o=i.ui,a=o.Widget,s=i.ViewEngine,l=o.View,c=i.ui.Loader,d="external",u="href",h="#!",p="navigate",f="viewShow",g="sameViewRequested",m=n.support.mobileOS,v=m.ios&&!m.appMode&&m.flatVersion>=700,_=/popover|actionsheet|modalview|drawer/,w="#:back",y=n.attrValue,b="button backbutton detailbutton listview-link",k="tab",x=a.extend({init:function(e,t){var i=this;a.fn.init.call(i,e,t),t=i.options,e=i.element,e.addClass("km-pane"),i.options.collapsible&&e.addClass("km-collapsible-pane"),this.history=[],this.historyCallback=function(e,t,n){var r=i.transition;return i.transition=null,v&&n&&(r="none"),i.viewEngine.showView(e,r,t)},this._historyNavigate=function(e){if(e===w){if(1===i.history.length)return;i.history.pop(),e=i.history[i.history.length-1]}else i.history.push(e);i.historyCallback(e,n.parseQueryStringParams(e))},this._historyReplace=function(e){var t=n.parseQueryStringParams(e);i.history[i.history.length-1]=e,i.historyCallback(e,t)},i.loader=new c(e,{loading:i.options.loading}),i.viewEngine=new s({container:e,transition:t.transition,modelScope:t.modelScope,rootNeeded:!t.initial,serverNavigation:t.serverNavigation,remoteViewURLPrefix:t.root||"",layout:t.layout,$angular:t.$angular,loader:i.loader,showStart:function(){i.loader.transition(),i.closeActiveDialogs()},after:function(){i.loader.transitionDone()},viewShow:function(e){i.trigger(f,e)},loadStart:function(){i.loader.show()},loadComplete:function(){i.loader.hide()},sameViewRequested:function(){i.trigger(g)},viewTypeDetermined:function(e){e.remote&&i.options.serverNavigation||i.trigger(p,{url:e.url})}}),this._setPortraitWidth(),n.onResize(function(){i._setPortraitWidth()}),i._setupAppLinks()},closeActiveDialogs:function(){var t=this.element.find(r("actionsheet popover modalview")).filter(":visible");t.each(function(){n.widgetInstance(e(this),o).close()})},navigateToInitial:function(){var e=this.options.initial;e&&this.navigate(e)},options:{name:"Pane",portraitWidth:"",transition:"",layout:"",collapsible:!1,initial:null,modelScope:window,loading:"<h1>Loading...</h1>"},events:[p,f,g],append:function(e){return this.viewEngine.append(e)},destroy:function(){a.fn.destroy.call(this),this.viewEngine.destroy(),this.userEvents.destroy()},navigate:function(e,t){e instanceof l&&(e=e.id),this.transition=t,this._historyNavigate(e)},replace:function(e,t){e instanceof l&&(e=e.id),this.transition=t,this._historyReplace(e)},bindToRouter:function(e){var t=this,i=this.history,r=this.viewEngine;e.bind("init",function(t){var o,a=t.url,s=e.pushState?a:"/";r.rootView.attr(n.attr("url"),s),o=i.length,"/"===a&&o&&(e.navigate(i[o-1],!0),t.preventDefault())}),e.bind("routeMissing",function(e){t.historyCallback(e.url,e.params,e.backButtonPressed)||e.preventDefault()}),e.bind("same",function(){t.trigger(g)}),t._historyNavigate=function(t){e.navigate(t)},t._historyReplace=function(t){e.replace(t)}},hideLoading:function(){this.loader.hide()},showLoading:function(){this.loader.show()},changeLoadingMessage:function(e){this.loader.changeMessage(e)},view:function(){return this.viewEngine.view()},_setPortraitWidth:function(){var e,t=this.options.portraitWidth;t&&(e=n.mobile.application.element.is(".km-vertical")?t:"auto",this.element.css("width",e))},_setupAppLinks:function(){var e=this;this.element.handler(this).on("down",r(k),"_mouseup").on("click",r(k+" "+b),"_appLinkClick"),this.userEvents=new n.UserEvents(this.element,{filter:r(b),tap:function(t){t.event.currentTarget=t.touch.currentTarget,e._mouseup(t.event)}})},_appLinkClick:function(t){var n=e(t.currentTarget).attr("href"),i=n&&"#"!==n[0]&&this.options.serverNavigation;i||y(e(t.currentTarget),"rel")==d||t.preventDefault()},_mouseup:function(r){if(!(r.which>1||r.isDefaultPrevented())){var a=this,s=e(r.currentTarget),l=y(s,"transition"),c=y(s,"rel")||"",p=y(s,"target"),f=s.attr(u),g=v&&0===s[0].offsetHeight,m=f&&"#"!==f[0]&&this.options.serverNavigation;g||m||c===d||t===f||f===h||(s.attr(u,h),setTimeout(function(){s.attr(u,f)}),c.match(_)?(n.widgetInstance(e(f),o).openFor(s),("actionsheet"===c||"drawer"===c)&&r.stopPropagation()):("_top"===p?a=i.application.pane:p&&(a=e("#"+p).data("kendoMobilePane")),a.navigate(f,l)),r.preventDefault())}}});x.wrap=function(e){e.is(r("view"))||(e=e.wrap("<div data-"+n.ns+'role="view" data-stretch="true"></div>').parent());var t=e.wrap('<div class="km-pane-wrapper"><div></div></div>').parent(),i=new x(t);return i.navigate(""),i},o.plugin(x)}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.mobile,i=n.ui,r="hide",o="open",a="close",s='<div class="km-popup-wrapper" />',l='<div class="km-popup-arrow" />',c='<div class="km-popup-overlay" />',d="km-up km-down km-left km-right",u=i.Widget,h={down:{origin:"bottom center",position:"top center"},up:{origin:"top center",position:"bottom center"},left:{origin:"center left",position:"center right",collision:"fit flip"},right:{origin:"center right",position:"center left",collision:"fit flip"}},p={animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:400}}},f={horizontal:{offset:"top",size:"height"},vertical:{offset:"left",size:"width"}},g={up:"down",down:"up",left:"right",right:"left"},m=u.extend({init:function(n,i){var o,a,d=this,g=n.closest(".km-modalview-wrapper"),m=n.closest(".km-root").children(".km-pane").first(),v=g[0]?g:m;i.viewport?m=i.viewport:m[0]||(m=window),i.container?v=i.container:v[0]||(v=document.body),o={viewport:m,copyAnchorStyles:!1,autosize:!0,open:function(){d.overlay.show()},activate:e.proxy(d._activate,d),deactivate:function(){d.overlay.hide(),d._apiCall||d.trigger(r),d._apiCall=!1}},u.fn.init.call(d,n,i),n=d.element,i=d.options,n.wrap(s).addClass("km-popup").show(),a=d.options.direction.match(/left|right/)?"horizontal":"vertical",d.dimensions=f[a],d.wrapper=n.parent().css({width:i.width,height:i.height}).addClass("km-popup-wrapper km-"+i.direction).hide(),d.arrow=e(l).prependTo(d.wrapper).hide(),d.overlay=e(c).appendTo(v).hide(),o.appendTo=d.overlay,i.className&&d.overlay.addClass(i.className),d.popup=new t.ui.Popup(d.wrapper,e.extend(!0,o,p,h[i.direction]))},options:{name:"Popup",width:240,height:"",direction:"down",container:null,viewport:null},events:[r],show:function(t){this.popup.options.anchor=e(t),this.popup.open()},hide:function(){this._apiCall=!0,this.popup.close()},destroy:function(){u.fn.destroy.call(this),this.popup.destroy(),this.overlay.remove()},target:function(){return this.popup.options.anchor},_activate:function(){var t=this,n=t.options.direction,i=t.dimensions,r=i.offset,o=t.popup,a=o.options.anchor,s=e(a).offset(),l=e(o.element).offset(),c=o.flipped?g[n]:n,u=2*t.arrow[i.size](),h=t.element[i.size]()-t.arrow[i.size](),p=e(a)[i.size](),f=s[r]-l[r]+p/2;u>f&&(f=u),f>h&&(f=h),t.wrapper.removeClass(d).addClass("km-"+c),t.arrow.css(r,f).show()}}),v=u.extend({init:function(n,r){var o,s=this;s.initialOpen=!1,u.fn.init.call(s,n,r),o=e.extend({className:"km-popover-root",hide:function(){s.trigger(a)}},this.options.popup),s.popup=new m(s.element,o),s.popup.overlay.on("move",function(e){e.target==s.popup.overlay[0]&&e.preventDefault()}),s.pane=new i.Pane(s.element,e.extend(this.options.pane,{$angular:this.options.$angular})),s.pane.navigateToInitial(),t.notify(s,i)},options:{name:"PopOver",popup:{},pane:{}},events:[o,a],open:function(e){this.popup.show(e),this.initialOpen?this.pane.view()._invokeNgController():(this.pane.navigate(""),this.popup.popup._position(),this.initialOpen=!0)},openFor:function(e){this.open(e),this.trigger(o,{target:this.popup.target()})},close:function(){this.popup.hide()},destroy:function(){u.fn.destroy.call(this),this.pane.destroy(),this.popup.destroy(),t.destroy(this.element)
}});i.plugin(m),i.plugin(v)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.mobile.ui,r=n.ui.Popup,o='<div class="km-shim"/>',a="hide",s=i.Widget,l=s.extend({init:function(t,i){var l=this,c=n.mobile.application,d=n.support.mobileOS,u=c?c.os.name:d?d.name:"ios",h="ios"===u||"wp"===u||(c?c.os.skin:!1),p="blackberry"===u,f=i.align||(h?"bottom center":p?"center right":"center center"),g=i.position||(h?"bottom center":p?"center right":"center center"),m=i.effect||(h?"slideIn:up":p?"slideIn:left":"fade:in"),v=e(o).handler(l).hide();s.fn.init.call(l,t,i),l.shim=v,t=l.element,i=l.options,i.className&&l.shim.addClass(i.className),i.modal||l.shim.on("up","_hide"),(c?c.element:e(document.body)).append(v),l.popup=new r(l.element,{anchor:v,modal:!0,appendTo:v,origin:f,position:g,animation:{open:{effects:m,duration:i.duration},close:{duration:i.duration}},close:function(e){var t=!1;l._apiCall||(t=l.trigger(a)),t&&e.preventDefault(),l._apiCall=!1},deactivate:function(){v.hide()},open:function(){v.show()}}),n.notify(l)},events:[a],options:{name:"Shim",modal:!1,align:t,position:t,effect:t,duration:200},show:function(){this.popup.open()},hide:function(){this._apiCall=!0,this.popup.close()},destroy:function(){s.fn.destroy.call(this),this.shim.kendoDestroy(),this.popup.destroy(),this.shim.remove()},_hide:function(t){t&&e.contains(this.shim.children().children(".k-popup")[0],t.target)||this.popup.close()}});i.plugin(l)}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.support,i=t.mobile.ui,r=i.Shim,o=i.Popup,a=i.Widget,s="open",l="close",c="command",d="li>a",u="actionsheetContext",h='<div class="km-actionsheet-wrapper" />',p=t.template('<li class="km-actionsheet-cancel"><a href="\\#">#:cancel#</a></li>'),f=a.extend({init:function(s,l){var c,u,f,g=this,m=n.mobileOS;a.fn.init.call(g,s,l),l=g.options,f=l.type,s=g.element,u="auto"===f?m&&m.tablet:"tablet"===f,c=u?o:r,l.cancelTemplate&&(p=t.template(l.cancelTemplate)),s.addClass("km-actionsheet").append(p({cancel:g.options.cancel})).wrap(h).on("up",d,"_click").on("click",d,t.preventDefault),g.view().bind("destroy",function(){g.destroy()}),g.wrapper=s.parent().addClass(f?" km-actionsheet-"+f:""),g.shim=new c(g.wrapper,e.extend({modal:m.ios&&7>m.majorVersion,className:"km-actionsheet-root"},g.options.popup)),g._closeProxy=e.proxy(g,"_close"),g.shim.bind("hide",g._closeProxy),u&&t.onResize(g._closeProxy),t.notify(g,i)},events:[s,l,c],options:{name:"ActionSheet",cancel:"Cancel",type:"auto",popup:{height:"auto"}},open:function(t,n){var i=this;i.target=e(t),i.context=n,i.shim.show(t)},close:function(){this.context=this.target=null,this.shim.hide()},openFor:function(e){var t=this,n=e.data(u);t.open(e,n),t.trigger(s,{target:e,context:n})},destroy:function(){a.fn.destroy.call(this),t.unbindResize(this._closeProxy),this.shim.destroy()},_click:function(n){var i,r,o,a;n.isDefaultPrevented()||(i=e(n.currentTarget),r=i.data("action"),r&&(o={target:this.target,context:this.context},a=this.options.$angular,a?this.element.injector().get("$parse")(r)(a[0])(o):t.getter(r)(window)(o)),this.trigger(c,{target:this.target,context:this.context,currentTarget:i}),n.preventDefault(),this._close())},_close:function(e){this.trigger(l)?e.preventDefault():this.close()}});i.plugin(f)}(window.kendo.jQuery),function(e,t){function n(e){return Array(e+1).join('<td class="k-group-cell">&nbsp;</td>')}function i(e){var t,n=" ";if(e){if(typeof e===un)return e;for(t in e)n+=t+'="'+e[t]+'"'}return n}function r(t,n){e("th, th .k-grid-filter, th .k-link",t).add(document.body).css("cursor",n)}function o(e){var t,n,i={},r={};if(!It(e))for(Tt(e)||(e=[e]),t=0,n=e.length;n>t;t++)i[e[t].aggregate]=0,r[e[t].field]=i;return r}function a(t,n,i,r,o){var a,s=n;for(n=e(),o=o||1,a=0;o>a;a++)n=n.add(t.eq(s+a));"number"==typeof i?n[r?"insertBefore":"insertAfter"](t.eq(i)):n.appendTo(i)}function s(t,n,i){return e(t).add(n).find(i)}function l(e,t,n){var i,r,o,a;for(n=Tt(n)?n:[n],i=0,r=n.length;r>i;i++)o=n[i],bt(o)&&o.click&&(a=o.name||o.text,t.on(sn+Ot,"a.k-grid-"+(a||"").replace(/\s/g,""),{commandName:a},At(o.click,e)))}function c(e,t,n){return xt(e,function(e){e=typeof e===un?{field:e}:e;var i;return(!f(e)||n)&&(e.attributes=W(e.attributes),e.footerAttributes=W(e.footerAttributes),e.headerAttributes=W(e.headerAttributes),i=!0),e.columns&&(e.columns=c(e.columns,t,i)),kt({encoded:t,hidden:i},e)})}function d(e,t){var n=[];return u(e,t,n),n[n.length-1]}function u(e,t,n){var i,r;for(n=n||[],i=0;t.length>i;i++){if(e===t[i])return!0;if(t[i].columns){if(r=n.length,n.push(t[i]),u(e,t[i].columns,n))return!0;n.splice(r,n.length-r)}}return!1}function h(e,t){var n=t?j:W;e.hidden=!t,e.attributes=n(e.attributes),e.footerAttributes=n(e.footerAttributes),e.headerAttributes=n(e.headerAttributes)}function p(){return"none"!==this.style.display}function f(e){return g([e]).length>0}function g(e){return Ct(e,function(e){var t=!e.hidden;return t&&e.columns&&(t=g(e.columns).length>0),t})}function m(t){return e(t).map(function(){return this.toArray()})}function v(e,t,n){var i=y(F(t)),r=y(z(t)),o=e.rowSpan;e.rowSpan=n?i>r?o-(i-r)||1:o+(r-i):i>r?o+(i-r):o-(r-i)||1}function _(t,n,i,r,o,a,s){var l,c,d=y(t),u=y([n]);d>u&&(l=Array(s+1).join('<th class="k-group-cell k-header">&nbsp;</th>'),c=a.children(":not(.k-filter-row)"),e(Array(d-u+1).join("<tr>"+l+"</tr>")).insertAfter(c.last())),I(a,d-u),b(i,r,o,a)}function w(e,t,n){var i,r,o,a,s;for(n=n||0,o=t,t=L(t),a=0,s=t.length;s>a;a++)i=k(t[a],o),r=e.find(">tr:not(.k-filter-row)").eq(i.row).find(".k-header:not(.k-group-cell,.k-hierarchy-cell)").eq(i.cell),r.attr(pt.attr("index"),n+a);return t.length}function y(e){var t,n,i=1,r=0;for(t=0;e.length>t;t++)e[t].columns&&(n=y(e[t].columns),n>r&&(r=n));return i+r}function b(t,n,i,r){var o,a,s=C(t[0],n),l=i.find(">tr:not(.k-filter-row):eq("+s.row+")>th.k-header"),c=e(),d=s.cell;for(o=0;t.length>o;o++)c=c.add(l.eq(d+o));for(r.find(">tr:not(.k-filter-row)").eq(s.row).append(c),a=[],o=0;t.length>o;o++)t[o].columns&&(a=a.concat(t[o].columns));a.length&&b(a,n,i,r)}function k(e,t,n,i){var r,o;for(n=n||0,i=i||{},i[n]=i[n]||0,o=0;t.length>o;o++){if(t[o]==e){r={cell:i[n],row:n};break}if(t[o].columns&&(r=k(e,t[o].columns,n+1,i)))break;i[n]++}return r}function x(e,t,n,i){var r,o,a;return t.columns?(t=t.columns,t[i?0:t.length-1]):(r=d(t,e),o=r?r.columns:e,a=St(t,o),0===a&&i?a++:a!=o.length-1||i?(a>0||0===a&&!i)&&(a+=i?-1:1):a--,t=o[Math.max(a,0)],t&&t!=n&&t.columns?x(e,t,n,i):null)}function C(e,t,n,i){var r,o;for(n=n||0,i=i||{},i[n]=i[n]||0,o=0;t.length>o;o++){if(t[o]==e){r={cell:i[n],row:n};break}if(t[o].columns&&(r=C(e,t[o].columns,n+1,i)))break;t[o].hidden||i[n]++}return r}function T(e){var t=S(F(e));return t.concat(S(z(e)))}function S(e){var t,n=[],i=[];for(t=0;e.length>t;t++)n.push(e[t]),e[t].columns&&(i=i.concat(e[t].columns));return i.length&&(n=n.concat(S(i))),n}function D(e){var t,n,i=0;for(n=0;e.length>n;n++)t=e[n],t.columns?i+=D(t.columns):t.hidden&&i++;return i}function A(e){var t,n,i,r=0;for(n=0,i=e.length;i>n;n++)t=e[n].style.width,t&&-1==t.indexOf("%")&&(r+=parseInt(t,10));return r}function E(e,t){var n,i,r=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(i=0;r.length>i;i++)n=r[i].rowSpan,n>1&&(r[i].rowSpan=n-t||1)}function I(e,t){var n,i=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(n=0;i.length>n;n++)i[n].rowSpan+=t}function P(t){var n,i=t.find("tr:not(.k-filter-row)"),r=i.filter(function(){return!e(this).children().length}).remove().length,o=i.find("th:not(.k-group-cell,.k-hierarchy-cell)");for(n=0;o.length>n;n++)o[n].rowSpan>1&&(o[n].rowSpan-=r);return i.length-r}function M(e,t,n,i,r){var o,a,s,l=[];for(o=0,s=e.length;s>o;o++)a=n[i]||[],a.push(t.eq(r+o)),n[i]=a,e[o].columns&&(l=l.concat(e[o].columns));l.length&&M(l,t,n,i+1,r+e.length)}function F(e){return Ct(e,function(e){return e.locked})}function z(e){return Ct(e,function(e){return!e.locked})}function R(e){return Ct(e,function(e){return!e.locked&&f(e)})}function B(e){return Ct(e,function(e){return e.locked&&f(e)})}function H(e){var t,n=[];for(t=0;e.length>t;t++)e[t].hidden||(e[t].columns?n=n.concat(H(e[t].columns)):n.push(e[t]));return n}function L(e){var t,n=[];for(t=0;e.length>t;t++)e[t].columns?n=n.concat(L(e[t].columns)):n.push(e[t]);return n}function N(t){var n,i=t.find(">tr:not(.k-filter-row)"),r=e();return i.length>1&&(r=i.find("th:not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return this.rowSpan>1})),r=r.add(i.last().find("th:not(.k-group-cell,.k-hierarchy-cell)")),n=pt.attr("index"),r.sort(function(t,i){return t=parseInt(e(t).attr(n),10),i=parseInt(e(i).attr(n),10),t>i?1:i>t?-1:0}),r}function O(t){var n,i,r,o,a,s,l,c=t.closest("table"),d=e().add(t),u=t.closest("tr"),h=c.find("tr:not(.k-filter-row)"),p=h.index(u);if(p>0){for(n=h.eq(p-1),i=n.find("th:not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return!e(this).attr("rowspan")}),r=0,o=u.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(t),a=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return this.colSpan>1}),s=0;a.length>s;s++)r+=a[s].colSpan||1;for(o+=Math.max(r-1,0),r=0,s=0;i.length>s;s++)if(l=i.eq(s),r+=l.attr("colSpan")?l[0].colSpan:1,o>=s&&r>o){d=O(l).add(d);break}}return d}function V(t){var n,i,r,o,a,s,l,c,d=t.closest("table"),u=e().add(t),h=t.closest("tr"),p=d.find("tr:not(.k-filter-row)"),f=p.index(h)+t[0].rowSpan,g=pt.attr("colspan");if(p.length-1>=f){for(n=h.next(),i=h.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(t),r=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)"),r=r.filter(function(){return!this.rowSpan||1===this.rowSpan}),a=0,o=0;r.length>o;o++)a+=parseInt(r.eq(o).attr(g),10)||1;for(s=n.find("th:not(.k-group-cell,.k-hierarchy-cell)"),l=parseInt(t.attr(g),10)||1,o=0;l>o;)n=s.eq(o+a),u=u.add(V(n)),c=parseInt(n.attr(g),10),c>1&&(l-=c-1),o++}return u}function U(t,n,i){var r,o=t;return vt?t[0].innerHTML=i:(r=document.createElement("div"),r.innerHTML="<table><tbody>"+i+"</tbody></table>",t=r.firstChild.firstChild,n[0].replaceChild(t,o[0]),t=e(t)),t}function W(e){e=e||{};var t=e.style;return t?(t=t.replace(/((.*)?display)(.*)?:([^;]*)/i,"$1:none"),t===e.style&&(t=t.replace(/(.*)?/i,"display:none;$1"))):t="display:none",kt({},e,{style:t})}function j(e){e=e||{};var t=e.style;return t&&(e.style=t.replace(/(display\s*:\s*none\s*;?)*/gi,"")),e}function q(t,n,i,r){var o,a=t.find(">colgroup"),s=xt(n,function(e){return o=e.width,o&&0!==parseInt(o,10)?pt.format('<col style="width:{0}"/>',typeof o===un?o:o+"px"):"<col />"});(i||a.find(".k-hierarchy-col").length)&&s.splice(0,0,'<col class="k-hierarchy-col" />'),a.length&&a.remove(),a=e(Array(r+1).join('<col class="k-group-col">')+s.join("")),a.is("colgroup")||(a=e("<colgroup/>").append(a)),t.prepend(a),kn.msie&&8==kn.version&&(t.css("display","inline-table"),window.setTimeout(function(){t.css("display","")},1))}function G(e,t){var n,i,r=0;for(n=0,i=t.length;i>n;n++)t[n].locked&&(e.eq(n).insertBefore(e.eq(r)),r++)}function $(e){var t,n,i,r={};for(n=0,i=e.length;i>n;n++)t=e[n],r[t.value]=t.text;return r}function Y(e,t,n){var i=n&&n.length&&bt(n[0])&&"value"in n[0],r=i?$(n)[e]:e;return r=null!=r?r:"",t?pt.format(t,r):r}function Q(e,t,n){for(var i,r=0,o=e[r];o;){if(i=n?!0:"none"!==o.style.display,i&&!_n.test(o.className)&&--t<0){o.style.display=n?"":"none";break}o=e[++r]}}function K(t,n){for(var i,r,o=0,a=t.length;a>o;o+=1)r=t.eq(o),r.is(".k-grouping-row,.k-detail-row")?(i=r.children(":not(.k-group-cell):first,.k-detail-cell").last(),i.attr("colspan",parseInt(i.attr("colspan"),10)-1)):(r.hasClass("k-grid-edit-row")&&(i=r.children(".k-edit-container")[0])&&(i=e(i),i.attr("colspan",parseInt(i.attr("colspan"),10)-1),i.find("col").eq(n).remove(),r=i.find("tr:first")),Q(r[0].cells,n,!1))}function X(e){var t,n,i=[];for(n=0;e.length>n&&(t=e[n],"field"in t&&"value"in t&&"items"in t);n++)i.push(t),t.hasSubgroups&&(i=i.concat(X(t.items)));return i}function Z(t,n){for(var i,r,o,a=0,s=t.length;s>a;a+=1)r=t.eq(a),r.is(".k-grouping-row,.k-detail-row")?(i=r.children(":not(.k-group-cell):first,.k-detail-cell").last(),i.attr("colspan",parseInt(i.attr("colspan"),10)+1)):(r.hasClass("k-grid-edit-row")&&(i=r.children(".k-edit-container")[0])&&(i=e(i),i.attr("colspan",parseInt(i.attr("colspan"),10)+1),q(i.find(">form>table"),g(o),!1,0),r=i.find("tr:first")),Q(r[0].cells,n,!0))}function J(e,t,n){n=n||1;var i,r,o;for(r=0,o=e.length;o>r;r++)i=e.eq(r).children().last(),i.attr("colspan",parseInt(i.attr("colspan"),10)+n),i=t.eq(r).children().last(),i.attr("colspan",parseInt(i.attr("colspan"),10)-n)}function et(e){var t,n,i=0,r=e.find(">colgroup>col");for(t=0,n=r.length;n>t;t+=1)i+=parseInt(r[t].style.width,10);return i}function tt(e,t){var n,i,r,o;e=e[0],t=t[0],e.rows.length!==t.rows.length&&(n=e.offsetHeight,i=t.offsetHeight,n>i?(r=t.rows[t.rows.length-1],wn.test(r.className)&&(r=t.rows[t.rows.length-2]),o=n-i):(r=e.rows[e.rows.length-1],wn.test(r.className)&&(r=e.rows[e.rows.length-2]),o=i-n),r.style.height=r.offsetHeight+o+"px")}function nt(e,t){var n,i=e.offsetHeight,r=t.offsetHeight;i>r?n=i+"px":r>i&&(n=r+"px"),n&&(e.style.height=t.style.height=n)}function it(e,t){var n,i,r;if(typeof e===un&&e===t)return e;if(bt(e)&&e.name===t)return e;if(Tt(e))for(n=0,i=e.length;i>n;n++)if(r=e[n],typeof r===un&&r===t||r.name===t)return r;return null}function rt(t,n){var i,r,o,a=kn.msie;if(n===!0){if(t=e(t),i=!0,i&&(r=t.parent().scrollTop(),o=t.parent().scrollLeft()),a)try{t[0].setActive()}catch(s){t[0].focus()}else t[0].focus();i&&(t.parent().scrollTop(r),t.parent().scrollLeft(o))}else e(t).one("focusin",function(e){e.preventDefault()}).focus()}function ot(t){var n=e(t.currentTarget),i=n.is("th"),r=this.table.add(this.lockedTable),o=this.thead.parent().add(e(">table",this.lockedHeader)),a=e(t.target).is(":button,a,:input,a>.k-icon,textarea,span.k-icon,span.k-link,.k-input,.k-multiselect-wrap"),s=n.closest("table")[0];pt.support.touch||a&&n.find(pt.roleSelector("filtercell")).length||(s===r[0]||s===r[1]||s===o[0]||s===o[1])&&(e(t.target).is("a.k-i-collapse, a.k-i-expand")||(this.current(n),(i||!a)&&setTimeout(function(){Cn&&e(pt._activeElement()).hasClass("k-widget")||rt(s,!0)}),i&&t.preventDefault()))}function at(t,n,i,r){if(t=e(t),r){var o=n;n=i,i=o}return n.not(t).length!=n.length?t:n.eq(t[0]==i[0]?0:1)}function st(e,n,i,r,o){var a,s,l,c=o?"prevAll":"nextAll";if(e){if(a=e.parent()[c](Bt).first(),!a[0]&&(o||e.is("th"))||!o&&e[0].rowSpan>1){if(n=at(n,i,r,o),rt(n,!0),o&&!e.is(".k-header"))return N(n.find("thead:first")).eq(e.index());a=n.find((o?">thead>":">tbody>")+Bt).first()}!o&&e[0].colSpan>1&&e.is(".k-header")?e=V(e).eq(1):e.is(".k-header")&&o?(l=O(e),e=l.eq(l.length-2)):(s=e.attr(pt.attr("index")),(s===t||o)&&(s=e.index()),e=a.children().eq(s)),e[0]&&e.is(Ht)||(e=a.children(Ht).first())}else e=i.find(Lt);return e}function lt(e,t,n,i,r){var o=n.length>1;return e?e.prevAll(":visible")[0]?e=e.prevAll(zt).first():o&&(t==n[1]?(rt(n[0]),e=r(e.parent()).children(zt).last()):t==i[1]&&(rt(i[0]),e=i.eq(0).find("tr>"+zt).last())):e=n.find(Lt),e}function ct(e,t,n,i,r){var o=n.length>1;return e?e.nextAll(":visible")[0]?e=e.nextAll(zt).first():o&&(t==n[0]?(rt(n[1]),e=r(e.parent()).children(zt).first()):t==i[0]&&(rt(i[1]),e=i.eq(1).find("tr>"+zt).first())):e=n.find(Lt),e}function dt(e,t,n,i,r){var o=2==n.length,a=!0,s=r?e.prevAll(zt+":first"):e.nextAll(":visible:first");return s.length||(s=e.parent(),o&&(a=r&&t==n[0]||!r&&t==n[1],s=i(s)),a&&(s=s[r?"prevAll":"nextAll"]("tr:not(.k-grouping-row):not(.k-detail-row):visible:first")),s=s.children(zt+(r?":last":":first"))),s}function ut(e,t,i){return'<tr class="k-grouping-row">'+n(t)+'<td colspan="'+e+'" aria-expanded="true"><p class="k-reset"><a class="k-icon k-i-collapse" href="#" tabindex="-1"></a>'+i+"</p></td></tr>"}function ht(e){return'<tr class="k-grouping-row"><td colspan="'+e+'" aria-expanded="true"><p class="k-reset">&nbsp;</p></td></tr>'}var pt=window.kendo,ft=pt.ui,gt=pt.data.DataSource,mt=ft.Groupable,vt=pt.support.tbodyInnerHtml,_t=pt._activeElement,wt=ft.Widget,yt=pt.keys,bt=e.isPlainObject,kt=e.extend,xt=e.map,Ct=e.grep,Tt=e.isArray,St=e.inArray,Dt=Array.prototype.push,At=e.proxy,Et=pt.isFunction,It=e.isEmptyObject,Pt=Math,Mt="progress",Ft="error",zt=":not(.k-group-cell):not(.k-hierarchy-cell):visible",Rt="tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",Bt="tr:not(.k-footer-template):visible",Ht=":not(.k-group-cell):not(.k-hierarchy-cell):visible",Lt=Bt+":first>"+Ht+":first",Nt="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",Ot=".kendoGrid",Vt="edit",Ut="save",Wt="remove",jt="detailInit",qt="filterMenuInit",Gt="columnMenuInit",$t="change",Yt="columnHide",Qt="columnShow",Kt="saveChanges",Xt="dataBound",Zt="detailExpand",Jt="detailCollapse",en="k-state-focused",tn="k-state-selected",nn="columnResize",rn="columnReorder",on="columnLock",an="columnUnlock",sn="click",ln="height",cn="tabIndex",dn="function",un="string",hn="Are you sure you want to delete this record?",pn="Delete",fn="Cancel",gn=/(\}|\#)/gi,mn=/#/gi,vn="[\\x20\\t\\r\\n\\f]",_n=RegExp("(^|"+vn+")(k-group-cell|k-hierarchy-cell)("+vn+"|$)"),wn=RegExp("(^|"+vn+")(k-filter-row)("+vn+"|$)"),yn='<a class="k-button k-button-icontext #=className#" #=attr# href="\\#"><span class="#=iconClass# #=imageClass#"></span>#=text#</a>',bn=!1,kn=pt.support.browser,xn=kn.msie&&7==kn.version,Cn=kn.msie&&8==kn.version,Tn=wt.extend({init:function(e,t){var n=this;wt.fn.init.call(n,e,t),n._refreshHandler=At(n.refresh,n),n.setDataSource(t.dataSource),n.wrap()},setDataSource:function(e){var t=this;t.dataSource&&t.dataSource.unbind($t,t._refreshHandler),t.dataSource=e,t.dataSource.bind($t,t._refreshHandler)},options:{name:"VirtualScrollable",itemHeight:e.noop,prefetch:!0},destroy:function(){var e=this;wt.fn.destroy.call(e),e.dataSource.unbind($t,e._refreshHandler),e.wrapper.add(e.verticalScrollbar).off(Ot),e.drag&&(e.drag.destroy(),e.drag=null),e.wrapper=e.element=e.verticalScrollbar=null,e._refreshHandler=null},wrap:function(){var t,n=this,i=pt.support.scrollbar()+1,r=n.element;r.css({width:"auto",overflow:"hidden"}).css(bn?"padding-left":"padding-right",i),n.content=r.children().first(),t=n.wrapper=n.content.wrap('<div class="k-virtual-scrollable-wrap"/>').parent().bind("DOMMouseScroll"+Ot+" mousewheel"+Ot,At(n._wheelScroll,n)),pt.support.kineticScrollNeeded&&(n.drag=new pt.UserEvents(n.wrapper,{global:!0,start:function(e){e.sender.capture()},move:function(e){n.verticalScrollbar.scrollTop(n.verticalScrollbar.scrollTop()-e.y.delta),t.scrollLeft(t.scrollLeft()-e.x.delta),e.preventDefault()}})),n.verticalScrollbar=e('<div class="k-scrollbar k-scrollbar-vertical" />').css({width:i}).appendTo(r).bind("scroll"+Ot,At(n._scroll,n))},_wheelScroll:function(t){if(!t.ctrlKey){var n=this.verticalScrollbar.scrollTop(),i=pt.wheelDeltaY(t);i&&(t.preventDefault(),e(t.currentTarget).one("wheel"+Ot,!1),this.verticalScrollbar.scrollTop(n+-i))}},_scroll:function(e){var t=this,n=!t.options.prefetch,i=e.currentTarget.scrollTop,r=t.dataSource,o=t.itemHeight,a=r.skip()||0,s=t._rangeStart||a,l=t.element.innerHeight(),c=!!(t._scrollbarTop&&t._scrollbarTop>i),d=Pt.max(Pt.floor(i/o),0),u=Pt.max(d+Pt.floor(l/o),0);t._scrollTop=i-s*o,t._scrollbarTop=i,t._scrolling=n,t._fetch(d,u,c)||(t.wrapper[0].scrollTop=t._scrollTop),n&&(t._scrollingTimeout&&clearTimeout(t._scrollingTimeout),t._scrollingTimeout=setTimeout(function(){t._scrolling=!1,t._page(t._rangeStart,t.dataSource.take())},100))},_fetch:function(e,t,n){var i=this,r=i.dataSource,o=i.itemHeight,a=r.take(),s=i._rangeStart||r.skip()||0,l=Pt.floor(e/a)*a,c=!1,d=.33;return s>e?(c=!0,s=Pt.max(0,t-a),i._scrollTop=(e-s)*o,i._page(s,a)):t>=s+a&&!n?(c=!0,s=e,i._scrollTop=o,i._page(s,a)):!i._fetching&&i.options.prefetch&&(l+a-a*d>e&&e>a&&r.prefetch(l-a,a),t>l+a*d&&r.prefetch(l+a,a)),c},_page:function(e,t){var n=this,i=!n.options.prefetch,r=n.dataSource;clearTimeout(n._timeout),n._fetching=!0,n._rangeStart=e,r.inRange(e,t)?r.range(e,t):(i||pt.ui.progress(n.wrapper.parent(),!0),n._timeout=setTimeout(function(){n._scrolling||(i&&pt.ui.progress(n.wrapper.parent(),!0),r.range(e,t))},100))},repaintScrollbar:function(){var e,t=this,n="",i=25e4,r=t.dataSource,o=pt.support.kineticScrollNeeded?0:pt.support.scrollbar(),a=t.wrapper[0],s=t.itemHeight=t.options.itemHeight()||0,l=a.scrollWidth>a.offsetWidth?o:0,c=r.total()*s+l;for(e=0;e<Pt.floor(c/i);e++)n+='<div style="width:1px;height:'+i+'px"></div>';c%i&&(n+='<div style="width:1px;height:'+c%i+'px"></div>'),t.verticalScrollbar.html(n),a.scrollTop=t._scrollTop},refresh:function(){var e=this,t=e.dataSource,n=e._rangeStart;pt.ui.progress(e.wrapper.parent(),!1),clearTimeout(e._timeout),e.repaintScrollbar(),e.drag&&e.drag.cancel(),n&&!e._fetching&&(e._rangeStart=t.skip(),1===t.page()&&(e.verticalScrollbar[0].scrollTop=0)),e._fetching=!1}}),Sn={create:{text:"Add new record",imageClass:"k-add",className:"k-grid-add",iconClass:"k-icon"},cancel:{text:"Cancel changes",imageClass:"k-cancel",className:"k-grid-cancel-changes",iconClass:"k-icon"},save:{text:"Save changes",imageClass:"k-update",className:"k-grid-save-changes",iconClass:"k-icon"},destroy:{text:"Delete",imageClass:"k-delete",className:"k-grid-delete",iconClass:"k-icon"},edit:{text:"Edit",imageClass:"k-edit",className:"k-grid-edit",iconClass:"k-icon"},update:{text:"Update",imageClass:"k-update",className:"k-primary k-grid-update",iconClass:"k-icon"},canceledit:{text:"Cancel",imageClass:"k-cancel",className:"k-grid-cancel",iconClass:"k-icon"},excel:{text:"Export to Excel",imageClass:"k-i-excel",className:"k-grid-excel",iconClass:"k-icon"},pdf:{text:"Export to PDF",imageClass:"k-i-pdf",className:"k-grid-pdf",iconClass:"k-icon"}},Dn=pt.ui.DataBoundWidget.extend({init:function(t,n,i){var r=this;n=Tt(n)?{dataSource:n}:n,wt.fn.init.call(r,t,n),i&&(r._events=i),bn=pt.support.isRtl(t),r._element(),r._aria(),r._columns(r.options.columns),r._dataSource(),r._tbody(),r._pageable(),r._thead(),r._groupable(),r._toolbar(),r._setContentHeight(),r._templates(),r._navigatable(),r._selectable(),r._details(),r._editable(),r._attachCustomCommandsEvent(),r.options.autoBind?r.dataSource.fetch():r._footer(),r.lockedContent&&(r.wrapper.addClass("k-grid-lockedcolumns"),r._resizeHandler=function(){r.resize()},e(window).on("resize"+Ot,r._resizeHandler)),pt.notify(r)},events:[$t,"dataBinding","cancel",Xt,Zt,Jt,jt,qt,Gt,Vt,Ut,Wt,Kt,nn,rn,Qt,Yt,on,an],setDataSource:function(e){var t=this,n=t.options.scrollable;t.options.dataSource=e,t._dataSource(),t._pageable(),t._thead(),n&&(n.virtual?t.content.find(">.k-virtual-scrollable-wrap").scrollLeft(0):t.content.scrollLeft(0)),t.options.groupable&&t._groupable(),t.virtualScrollable&&t.virtualScrollable.setDataSource(t.options.dataSource),t.options.navigatable&&t._navigatable(),t.options.selectable&&t._selectable(),t.options.autoBind&&e.fetch()},options:{name:"Grid",columns:[],toolbar:null,autoBind:!0,filterable:!1,scrollable:!0,sortable:!1,selectable:!1,navigatable:!1,pageable:!1,editable:!1,groupable:!1,rowTemplate:"",altRowTemplate:"",dataSource:{},height:null,resizable:!1,reorderable:!1,columnMenu:!1,detailTemplate:null,columnResizeHandleWidth:3,mobile:"",messages:{editable:{cancelDelete:fn,confirmation:hn,confirmDelete:pn},commands:{create:Sn.create.text,cancel:Sn.cancel.text,save:Sn.save.text,destroy:Sn.destroy.text,edit:Sn.edit.text,update:Sn.update.text,canceledit:Sn.canceledit.text,excel:Sn.excel.text,pdf:Sn.pdf.text}}},destroy:function(){var t,n=this;n._destroyColumnAttachments(),wt.fn.destroy.call(n),n._resizeHandler&&e(window).off("resize"+Ot,n._resizeHandler),n.pager&&n.pager.element&&n.pager.destroy(),n.pager=null,n.groupable&&n.groupable.element&&n.groupable.element.kendoGroupable("destroy"),n.groupable=null,n.options.reorderable&&n.wrapper.data("kendoReorderable").destroy(),n.selectable&&n.selectable.element&&n.selectable.destroy(),n.selectable=null,n.resizable&&(n.resizable.destroy(),n._resizeUserEvents&&(n._resizeHandleDocumentClickHandler&&e(document).off("click",n._resizeHandleDocumentClickHandler),n._resizeUserEvents.destroy(),n._resizeUserEvents=null),n.resizable=null),n.virtualScrollable&&n.virtualScrollable.element&&n.virtualScrollable.destroy(),n.virtualScrollable=null,n._destroyEditable(),n.dataSource&&(n.dataSource.unbind($t,n._refreshHandler).unbind(Mt,n._progressHandler).unbind(Ft,n._errorHandler),n._refreshHandler=n._progressHandler=n._errorHandler=null),t=n.element.add(n.wrapper).add(n.table).add(n.thead).add(n.wrapper.find(">.k-grid-toolbar")),n.content&&(t=t.add(n.content).add(n.content.find(">.k-virtual-scrollable-wrap"))),n.lockedHeader&&n._removeLockedContainers(),n.pane&&n.pane.destroy(),n._draggableInstance&&n._draggableInstance.element&&n._draggableInstance.destroy(),n._draggableInstance=null,t.off(Ot),pt.destroy(n.wrapper),n.scrollables=n.thead=n.tbody=n.element=n.table=n.content=n.footer=n.wrapper=n._groupableClickHandler=n._setContentWidthHandler=null},getOptions:function(){var n,i=kt(!0,{},this.options);return i.columns=pt.deepExtend([],this.columns),n=this.dataSource,i.dataSource=e.extend(!0,{},n.options),i.dataSource.page=n.page(),i.dataSource.filter=n.filter(),i.dataSource.pageSize=n.pageSize(),i.dataSource.sort=n.sort(),i.dataSource.group=n.group(),i.dataSource.aggregate=n.aggregate(),i.$angular=t,i},setOptions:function(e){var t,n,i,r=this.getOptions();pt.deepExtend(r,e),e.dataSource||(r.dataSource=this.dataSource),t=this.wrapper,n=this._events,i=this.element,this.destroy(),this.options=null,t[0]!==i[0]&&(t.before(i),t.remove()),i.empty(),this.init(i,r,n),this._setEvents(r)},items:function(){return this.lockedContent?this._items(this.tbody).add(this._items(this.lockedTable.children("tbody"))):this._items(this.tbody)},_items:function(t){return t.children().filter(function(){var t=e(this);return!t.hasClass("k-grouping-row")&&!t.hasClass("k-detail-row")&&!t.hasClass("k-group-footer")})},dataItems:function(){var e,t,n,i=pt.ui.DataBoundWidget.fn.dataItems.call(this);if(this.lockedContent){for(e=i.length,t=Array(2*e),n=e;--n>=0;)t[n]=t[n+e]=i[n];i=t}return i},_destroyColumnAttachments:function(){var t=this;t.resizeHandle=null,t.thead&&(this.angular("cleanup",function(){return{elements:t.thead.get()}}),t.thead.find("th").each(function(){var t=e(this),n=t.data("kendoFilterMenu"),i=t.data("kendoColumnSorter"),r=t.data("kendoColumnMenu");n&&n.destroy(),i&&i.destroy(),r&&r.destroy()}))},_attachCustomCommandsEvent:function(){var e,t,n,i=this,r=L(i.columns||[]);for(t=0,n=r.length;n>t;t++)e=r[t].command,e&&l(i,i.wrapper,e)},_aria:function(){var e=this.element.attr("id")||"aria";e&&(this._cellId=e+"_active_cell")},_element:function(){var t=this,n=t.element;n.is("table")||(n=t.options.scrollable?t.element.find("> .k-grid-content > table"):t.element.children("table"),n.length||(n=e("<table />").appendTo(t.element))),xn&&n.attr("cellspacing",0),t.table=n.attr("role",t._hasDetails()?"treegrid":"grid"),t._wrapper()},_createResizeHandle:function(t,n){var i,r,o,a,s,l,c,d=this,u=d.options.columnResizeHandleWidth,h=d.options.scrollable,p=d.resizeHandle,f=this._groups();if(p&&d.lockedContent&&p.data("th")[0]!==n[0]&&(p.remove(),p=null),p||(p=d.resizeHandle=e('<div class="k-resize-handle"><div class="k-resize-handle-inner"></div></div>'),t.append(p)),bn)i=n.position().left,h&&(a=n.closest(".k-grid-header-wrap, .k-grid-header-locked"),s=kn.msie?a.scrollLeft():0,l=kn.webkit?a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft():0,c=kn.mozilla?a[0].scrollWidth-a[0].offsetWidth-(a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft()):0,i-=l-c+s);else{for(i=n[0].offsetWidth,r=N(n.closest("thead")),o=0;r.length>o&&r[o]!=n[0];o++)i+=r[o].offsetWidth;f>0&&(i+=t.find(".k-group-cell:first").outerWidth()*f),d._hasDetails()&&(i+=t.find(".k-hierarchy-cell:first").outerWidth())}p.css({top:n.position().top,left:i-u,height:n.outerHeight(),width:3*u}).data("th",n).show()},_positionColumnResizeHandle:function(){var t=this,n=t.options.columnResizeHandleWidth,i=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t.thead.add(i).on("mousemove"+Ot,"th",function(i){var o,a,s,l=e(this);l.hasClass("k-group-cell")||l.hasClass("k-hierarchy-cell")||(o=i.clientX,a=e(window).scrollLeft(),s=l.offset().left+(bn?0:this.offsetWidth),o+a>s-n&&s+n>o+a?t._createResizeHandle(l.closest("div"),l):t.resizeHandle?t.resizeHandle.hide():r(t.wrapper,""))})},_resizeHandleDocumentClick:function(t){e(t.target).closest(".k-column-active").length||(e(document).off(t),this._hideResizeHandle())},_hideResizeHandle:function(){this.resizeHandle&&(this.resizeHandle.data("th").removeClass("k-column-active"),this.lockedContent&&!this._isMobile?(this.resizeHandle.remove(),this.resizeHandle=null):this.resizeHandle.hide())},_positionColumnResizeHandleTouch:function(){var t=this,n=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t._resizeUserEvents=new pt.UserEvents(n.add(t.thead),{filter:"th:not(.k-group-cell):not(.k-hierarchy-cell)",threshold:10,hold:function(n){var i=e(n.target);n.preventDefault(),i.addClass("k-column-active"),t._createResizeHandle(i.closest("div"),i),t._resizeHandleDocumentClickHandler||(t._resizeHandleDocumentClickHandler=At(t._resizeHandleDocumentClick,t)),e(document).on("click",t._resizeHandleDocumentClickHandler)}})},_resizable:function(){var t,n,i,o,a,s,l,c=this,d=c.options,u=this._isMobile,h=pt.support.mobileOS?0:pt.support.scrollbar();d.resizable&&(t=d.scrollable?c.wrapper.find(".k-grid-header-wrap:first"):c.wrapper,u?c._positionColumnResizeHandleTouch(t):c._positionColumnResizeHandle(t),c.resizable&&c.resizable.destroy(),c.resizable=new ft.Resizable(t.add(c.lockedHeader),{handle:".k-resize-handle",hint:function(t){return e('<div class="k-grid-resize-indicator" />').css({height:t.data("th").outerHeight()+c.tbody.attr("clientHeight")})},start:function(t){var h,p,f,g;l=e(t.currentTarget).data("th"),u&&c._hideResizeHandle(),h=l.closest("table"),p=e.inArray(l[0],N(l.closest("thead")).filter(":visible")),a=h.parent().hasClass("k-grid-header-locked"),f=a?c.lockedTable:c.table,g=c.footer||e(),c.footer&&c.lockedContent&&(g=c.footer.children(a?".k-grid-footer-locked":".k-grid-footer-wrap")),r(c.wrapper,"col-resize"),s=d.scrollable?h.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")").add(f.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")")).add(g.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")")):f.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")"),n=t.x.location,i=l.outerWidth(),o=a?f.children("tbody").outerWidth():c.tbody.outerWidth(),kn.webkit&&c.wrapper.addClass("k-grid-column-resizing")},resize:function(t){var r,u,p,f,g,m,v=bn?-1:1,_=i+t.x.location*v-n*v;d.scrollable?(a&&c.lockedFooter?r=c.lockedFooter.children("table"):c.footer&&(r=c.footer.find(">.k-grid-footer-wrap>table")),r&&r[0]||(r=e()),u=l.closest("table"),p=a?c.lockedTable:c.table,f=!1,g=c.wrapper.width()-h,m=_,a&&o-i+m>g&&(m=i+(g-o-2*h),0>m&&(m=_),f=!0),m>10&&(s.css("width",m),o&&(m=f?g-2*h:o+t.x.location*v-n*v,p.add(u).add(r).css("width",m),a||(c._footerWidth=m)))):_>10&&s.css("width",_)},resizeend:function(){var e,t,n,o=l.outerWidth();r(c.wrapper,""),kn.webkit&&c.wrapper.removeClass("k-grid-column-resizing"),i!=o&&(t=c.lockedHeader?c.lockedHeader.find("thead:first tr:first").add(c.thead.find("tr:first")):l.parent(),n=l.attr(pt.attr("index")),n||(n=t.find("th:not(.k-group-cell):not(.k-hierarchy-cell)").index(l)),e=L(c.columns)[n],e.width=o,c.trigger(nn,{column:e,oldWidth:i,newWidth:o}),c._applyLockedContainersWidth(),c._syncLockedContentHeight(),c._syncLockedHeaderHeight()),c._hideResizeHandle(),l=null}}))},_draggable:function(){var t=this;t.options.reorderable&&(t._draggableInstance&&t._draggableInstance.destroy(),t._draggableInstance=t.wrapper.kendoDraggable({group:pt.guid(),filter:t.content?".k-grid-header:first "+Nt:"table:first>.k-grid-header "+Nt,drag:function(){t._hideResizeHandle()},hint:function(t){return e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(pt.attr("title"))||t.attr(pt.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-denied" />')
}}).data("kendoDraggable"))},_reorderable:function(){var t,n=this;n.options.reorderable&&(n.wrapper.data("kendoReorderable")&&n.wrapper.data("kendoReorderable").destroy(),t=function(e,t,i){var r=e[t],o=e[i],a=d(r,n.columns);return e=a?a.columns:n.columns,St(o,e)},n.wrapper.kendoReorderable({draggable:n._draggableInstance,dragOverContainers:function(e,i){var r=T(n.columns);return r[e].lockable!==!1&&t(r,e,i)>-1},inSameContainer:function(i){return e(i.source).parent()[0]===e(i.target).parent()[0]&&t(T(n.columns),i.sourceIndex,i.targetIndex)>-1},change:function(e){var i=T(n.columns),r=i[e.oldIndex],o=t(i,e.oldIndex,e.newIndex);n.trigger(rn,{newIndex:o,oldIndex:St(r,i),column:r}),n.reorderColumn(o,r,"before"===e.position)}}))},_reorderHeader:function(e,t,n){var i,r,o,l,c=this,d=k(e[0],c.columns),u=k(t,c.columns),h=[];for(i=0;e.length>i;i++)e[i].columns&&(h=h.concat(e[i].columns));r=s(c.lockedHeader,c.thead,"tr:eq("+d.row+")>th.k-header:not(.k-group-cell,.k-hierarchy-cell)"),o=F(e).length,l=F([t]).length,h.length?(o>0&&0===l?_(e,t,h,c.columns,c.lockedHeader.find("thead"),c.thead,this._groups()):0===o&&l>0&&_(e,t,h,c.columns,c.thead,c.lockedHeader.find("thead"),this._groups()),(t.columns||d.cell-u.cell>1||u.cell-d.cell>1)&&(t=x(c.columns,t,e[0],n),t&&c._reorderHeader(h,t,n))):o!==l&&v(r[d.cell],c.columns,o),a(r,d.cell,u.cell,n,e.length)},_reorderContent:function(t,n,i){var r,o,l,c,d=this,u=e(),h=t[0],p=g(t),f=St(h,L(d.columns)),m=St(n,L(d.columns)),v=St(h,H(d.columns)),_=St(n,H(d.columns)),w=F(d.columns).length,y=!!n.locked,b=d.footer||d.wrapper.find(".k-grid-footer"),k=r=_;for(n.hidden&&(y?(_=d.lockedTable.find("colgroup"),k=d.lockedHeader.find("colgroup"),r=e(d.lockedFooter).find(">table>colgroup")):(_=d.tbody.prev(),k=d.thead.prev(),r=b.find(".k-grid-footer-wrap").find(">table>colgroup"))),d._hasFilterRow()&&a(d.wrapper.find(".k-filter-row th:not(.k-group-cell,.k-hierarchy-cell)"),f,m,i,t.length),a(s(d.lockedHeader,d.thead.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),v,k,i,p.length),d.options.scrollable&&a(s(d.lockedTable,d.tbody.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),v,_,i,p.length),b&&b.length&&(a(s(d.lockedFooter,b.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),v,r,i,p.length),a(b.find(".k-footer-template>td:not(.k-group-cell,.k-hierarchy-cell)"),f,m,i,t.length)),o=d.tbody.children(":not(.k-grouping-row,.k-detail-row)"),d.lockedTable&&(w>m?f>=w&&J(d.lockedTable.find(">tbody>tr.k-grouping-row"),d.table.find(">tbody>tr.k-grouping-row"),t.length):w>f&&J(d.table.find(">tbody>tr.k-grouping-row"),d.lockedTable.find(">tbody>tr.k-grouping-row"),t.length),u=d.lockedTable.find(">tbody>tr:not(.k-grouping-row,.k-detail-row)")),l=0,c=o.length;c>l;l+=1)a(s(u[l],o[l],">td:not(.k-group-cell,.k-hierarchy-cell)"),f,m,i,t.length)},reorderColumn:function(e,n,i){var r,o,a=this,s=d(n,a.columns),l=s?s.columns:a.columns,c=St(n,l),u=l[e],h=!!u.locked,p=F(a.columns).length;c!==e&&(n.locked||!h||1!=z(a.columns).length)&&(!n.locked||h||1!=p)&&(a._hideResizeHandle(),i===t&&(i=c>e),o=[n],a._reorderHeader(o,u,i),a.lockedHeader&&(P(a.thead),P(a.lockedHeader)),u.columns&&(u=L(u.columns),u=u[i?0:u.length-1]),n.columns&&(o=L(n.columns)),a._reorderContent(o,u,i),r=!!n.locked,r=r!=h,n.locked=h,l.splice(i?e:e+1,0,n),l.splice(e>c?c:c+1,1),a._templates(),a._updateColumnCellIndex(),a._updateTablesWidth(),a._applyLockedContainersWidth(),a._syncLockedHeaderHeight(),a._syncLockedContentHeight(),a._updateFirstColumnClass(),r&&(h?a.trigger(on,{column:n}):a.trigger(an,{column:n})))},_updateColumnCellIndex:function(){var e,t=0;this.lockedHeader&&(e=this.lockedHeader.find("thead"),t=w(e,F(this.columns))),w(this.thead,z(this.columns),t)},lockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:Ct(n,function(t){return t.field===e})[0],!e||e.locked||e.hidden||(t=F(n).length-1,this.reorderColumn(t,e,!1))},unlockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:Ct(n,function(t){return t.field===e})[0],e&&e.locked&&!e.hidden&&(t=F(n).length,this.reorderColumn(t,e,!0))},cellIndex:function(t){var n=0;return this.lockedTable&&!e.contains(this.lockedTable[0],t[0])&&(n=L(F(this.columns)).length),e(t).parent().children("td:not(.k-group-cell,.k-hierarchy-cell)").index(t)+n},_modelForContainer:function(t){t=e(t),t.is("tr")||"popup"===this._editMode()||(t=t.closest("tr"));var n=t.attr(pt.attr("uid"));return this.dataSource.getByUid(n)},_editable:function(){var t,n=this,i=n.selectable&&n.selectable.options.multiple,r=n.options.editable,o=function(){var t=_t(),i=n._editContainer;!i||e.contains(i[0],t)||i[0]===t||e(t).closest(".k-animation-container").length||n.editable.end()&&n.closeCell()};r&&(t=n._editMode(),"incell"===t?r.update!==!1&&n.wrapper.on(sn+Ot,"tr:not(.k-grouping-row) > td",function(t){var r=e(this),o=n.lockedTable&&r.closest("table")[0]===n.lockedTable[0];r.hasClass("k-hierarchy-cell")||r.hasClass("k-detail-cell")||r.hasClass("k-group-cell")||r.hasClass("k-edit-cell")||r.has("a.k-grid-delete").length||r.has("button.k-grid-delete").length||r.closest("tbody")[0]!==n.tbody[0]&&!o||e(t.target).is(":input")||(n.editable?n.editable.end()&&(i&&e(_t()).blur(),n.closeCell(),n.editCell(r)):n.editCell(r))}).on("focusin"+Ot,function(){clearTimeout(n.timer),n.timer=null}).on("focusout"+Ot,function(){n.timer=setTimeout(o,1)}):r.update!==!1&&n.wrapper.on(sn+Ot,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible a.k-grid-edit",function(t){t.preventDefault(),n.editRow(e(this).closest("tr"))}),r.destroy!==!1?n.wrapper.on(sn+Ot,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible .k-grid-delete",function(t){t.preventDefault(),t.stopPropagation(),n.removeRow(e(this).closest("tr"))}):n.wrapper.on(sn+Ot,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible button.k-grid-delete",function(e){e.stopPropagation(),n._confirmation()||e.preventDefault()}))},editCell:function(t){var n,i,r,o;t=e(t),n=this,i=L(n.columns)[n.cellIndex(t)],r=n._modelForContainer(t),n.closeCell(),!r||r.editable&&!r.editable(i.field)||i.command||!i.field||(n._attachModelChange(r),n._editContainer=t,n.editable=t.addClass("k-edit-cell").kendoEditable({fields:{field:i.field,format:i.format,editor:i.editor,values:i.values},model:r,target:n,change:function(e){n.trigger(Ut,{values:e.values,container:t,model:r})&&e.preventDefault()}}).data("kendoEditable"),o=t.parent().addClass("k-grid-edit-row"),n.lockedContent&&nt(o[0],n._relatedRow(o).addClass("k-grid-edit-row")[0]),n.trigger(Vt,{container:t,model:r}))},_adjustLockedHorizontalScrollBar:function(){var e=this.table,t=e.parent(),n=e[0].offsetWidth>t[0].clientWidth?pt.support.scrollbar():0;this.lockedContent.height(t.height()-n)},_syncLockedContentHeight:function(){this.lockedTable&&(this.touchScroller||this._adjustLockedHorizontalScrollBar(),this._adjustRowsHeight(this.table,this.lockedTable))},_syncLockedHeaderHeight:function(){var e,t;this.lockedHeader&&(e=this.lockedHeader.children("table"),t=this.thead.parent(),this._adjustRowsHeight(e,t),tt(e,t))},_syncLockedFooterHeight:function(){this.lockedFooter&&this.footer&&this.footer.length&&this._adjustRowsHeight(this.lockedFooter.children("table"),this.footer.find(".k-grid-footer-wrap > table"))},_destroyEditable:function(){var e=this,t=function(){if(e.editable){var t=e.editView?e.editView.element:e._editContainer;t&&(t.off(sn+Ot,"a.k-grid-cancel",e._editCancelClickHandler),t.off(sn+Ot,"a.k-grid-update",e._editUpdateClickHandler)),e._detachModelChange(),e.editable.destroy(),e.editable=null,e._editContainer=null,e._destroyEditView()}};e.editable&&("popup"!==e._editMode()||e._isMobile?t():e._editContainer.data("kendoWindow").bind("deactivate",t).close()),e._actionSheet&&(e._actionSheet.destroy(),e._actionSheet=null)},_destroyEditView:function(){this.editView&&(this.editView.purge(),this.editView=null,this.pane.navigate(""))},_attachModelChange:function(e){var t=this;t._modelChangeHandler=function(e){t._modelChange({field:e.field,model:this})},e.bind("change",t._modelChangeHandler)},_detachModelChange:function(){var e=this,t=e._editContainer,n=e._modelForContainer(t);n&&n.unbind($t,e._modelChangeHandler)},closeCell:function(t){var n,i,r,o,a=this,s=a._editContainer;s&&(n=s.closest("tr").attr(pt.attr("uid")),o=a.dataSource.getByUid(n),t&&a.trigger("cancel",{container:s,model:o})||(s.removeClass("k-edit-cell"),i=L(a.columns)[a.cellIndex(s)],r=s.parent().removeClass("k-grid-edit-row"),a._destroyEditable(),a._displayCell(s,i,o),s.hasClass("k-dirty-cell")&&e('<span class="k-dirty"/>').prependTo(s),a.lockedContent&&nt(r.css("height","")[0],a._relatedRow(r).css("height","")[0])))},_displayCell:function(e,t,n){var i=this,r={storage:{},count:0},o=kt({},pt.Template,i.options.templateSettings),a=pt.template(i._cellTmpl(t,r),o);r.count>0&&(a=At(a,r.storage)),e.empty().html(a(n)),i.angular("compile",function(){return{elements:e,data:[{dataItem:n}]}})},removeRow:function(e){this._confirmation(e)&&this._removeRow(e)},_removeRow:function(t){var n,i=this,r=i._editMode();"incell"!==r&&i.cancelRow(),t=e(t).hide(),n=i._modelForContainer(t),n&&!i.trigger(Wt,{row:t,model:n})?(i.dataSource.remove(n),("inline"===r||"popup"===r)&&i.dataSource.sync()):"incell"===r&&i._destroyEditable()},_editMode:function(){var e="incell",t=this.options.editable;return t!==!0&&(e="string"==typeof t?t:t.mode||e),e},editRow:function(n){var i,r,o,a=this;n instanceof pt.data.ObservableObject?i=n:(n=e(n),i=a._modelForContainer(n)),r=a._editMode(),a.cancelRow(),i&&(a._attachModelChange(i),"popup"===r?a._createPopupEditor(i):"inline"===r?a._createInlineEditor(n,i):"incell"===r&&e(n).children(zt).each(function(){var n=e(this),r=L(a.columns)[n.index()];return i=a._modelForContainer(n),i&&(!i.editable||i.editable(r.field))&&r.field?(a.editCell(n),!1):t}),o=a.editView?a.editView.element:a._editContainer,o&&(this._editCancelClickHandler||(this._editCancelClickHandler=At(this._editCancelClick,this)),o.on(sn+Ot,"a.k-grid-cancel",this._editCancelClickHandler),this._editUpdateClickHandler||(this._editUpdateClickHandler=At(this._editUpdateClick,this)),o.on(sn+Ot,"a.k-grid-update",this._editUpdateClickHandler)))},_editUpdateClick:function(e){e.preventDefault(),e.stopPropagation(),this.saveRow()},_editCancelClick:function(t){var n,i=this,r=i.options.navigatable,o=i.editable.options.model,a=i.editView?i.editView.element:i._editContainer;t.preventDefault(),t.stopPropagation(),i.trigger("cancel",{container:a,model:o})||(n=i.items().index(e(i.current()).parent()),i.cancelRow(),r&&(i.current(i.items().eq(n).children().filter(Ht).first()),rt(i.table,!0)))},_createPopupEditor:function(n){var i,r,o,a,s,l,c,d,u,h,p,f=this,g="<div "+pt.attr("uid")+'="'+n.uid+'" class="k-popup-edit-form'+(f._isMobile?" k-mobile-list":"")+'"><div class="k-edit-form-container">',m=[],v=L(f.columns),_=f.options.editable,w=_.template,y=bt(_)?_.window:{},b=kt({},pt.Template,f.options.templateSettings);if(y=y||{},w)for(typeof w===un&&(w=window.unescape(w)),g+=pt.template(w,b)(n),o=0,a=v.length;a>o;o++)i=v[o],i.command&&(d=it(i.command,"edit"),d&&(r=d));else for(o=0,a=v.length;a>o;o++)i=v[o],i.command?i.command&&(d=it(i.command,"edit"),d&&(r=d)):(g+='<div class="k-edit-label"><label for="'+i.field+'">'+(i.title||i.field||"")+"</label></div>",n.editable&&!n.editable(i.field)||!i.field?(h={storage:{},count:0},s=pt.template(f._cellTmpl(i,h),b),h.count>0&&(s=At(s,h.storage)),g+='<div class="k-edit-field">'+s(n)+"</div>"):(m.push({field:i.field,format:i.format,editor:i.editor,values:i.values}),g+="<div "+pt.attr("container-for")+'="'+i.field+'" class="k-edit-field"></div>'));r&&bt(r)&&(r.text&&bt(r.text)&&(l=r.text.update,c=r.text.cancel),r.attr&&(u=r.attr)),f._isMobile?(g+="</div></div>",f.editView=f.pane.append("<div data-"+pt.ns+'role="view" data-'+pt.ns+'init-widgets="false" class="k-grid-edit-form"><div data-'+pt.ns+'role="header" class="k-header">'+f._createButton({name:"update",text:l,attr:u})+(y.title||"Edit")+f._createButton({name:"canceledit",text:c,attr:u})+"</div>"+g+"</div>"),p=f._editContainer=f.editView.element.find(".k-popup-edit-form")):(g+='<div class="k-edit-buttons k-state-default">',g+=f._createButton({name:"update",text:l,attr:u})+f._createButton({name:"canceledit",text:c,attr:u}),g+="</div></div></div>",p=f._editContainer=e(g).appendTo(f.wrapper).eq(0).kendoWindow(kt({modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1,close:function(i){if(i.userTriggered){if(i.sender.element.focus(),f.trigger("cancel",{container:p,model:n}))return i.preventDefault(),t;var r=f.items().index(e(f.current()).parent());f.cancelRow(),f.options.navigatable&&(f.current(f.items().eq(r).children().filter(Ht).first()),rt(f.table,!0))}}},y))),f.editable=f._editContainer.kendoEditable({fields:m,model:n,clearContainer:!1,target:f}).data("kendoEditable"),f._isMobile&&p.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){e(this).next().children("input").click()}),f._openPopUpEditor(),f.trigger(Vt,{container:p,model:n})},_openPopUpEditor:function(){this._isMobile?this.pane.navigate(this.editView,this._editAnimation):this._editContainer.data("kendoWindow").center().open()},_createInlineEditor:function(t,n){var i,r,o,a=this,s=[];a.lockedContent&&(t=t.add(a._relatedRow(t))),t.children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){if(r=e(this),i=L(a.columns)[a.cellIndex(r)],i.command||!i.field||n.editable&&!n.editable(i.field)){if(i.command&&(o=it(i.command,"edit"))){r.empty();var t,l,c;bt(o)&&(o.text&&bt(o.text)&&(t=o.text.update,l=o.text.cancel),o.attr&&(c=o.attr)),e(a._createButton({name:"update",text:t,attr:c})+a._createButton({name:"canceledit",text:l,attr:c})).appendTo(r)}}else s.push({field:i.field,format:i.format,editor:i.editor,values:i.values}),r.attr(pt.attr("container-for"),i.field),r.empty()}),a._editContainer=t,a.editable=new pt.ui.Editable(t.addClass("k-grid-edit-row"),{target:a,fields:s,model:n,clearContainer:!1}),t.length>1&&(nt(t[0],t[1]),a._applyLockedContainersWidth()),a.trigger(Vt,{container:t,model:n})},cancelRow:function(){var e,t=this,n=t._editContainer;n&&(e=t._modelForContainer(n),t._destroyEditable(),t.dataSource.cancelChanges(e),t._displayRow("popup"!==t._editMode()?n:t.tbody.find("["+pt.attr("uid")+"="+e.uid+"]")))},saveRow:function(){var e=this,t=e._editContainer,n=e._modelForContainer(t),i=e.editable;t&&i&&i.end()&&!e.trigger(Ut,{container:t,model:n})&&e.dataSource.sync()},_displayRow:function(t){var n,i,r,o=this,a=o._modelForContainer(t),s=t.hasClass("k-state-selected"),l=t.hasClass("k-alt");a&&(o.lockedContent&&(n=e((l?o.lockedAltRowTemplate:o.lockedRowTemplate)(a)),o._relatedRow(t.last()).replaceWith(n)),o.angular("cleanup",function(){return{elements:t.get()}}),i=e((l?o.altRowTemplate:o.rowTemplate)(a)),t.replaceWith(i),o.angular("compile",function(){return{elements:i.get(),data:[{dataItem:a}]}}),s&&o.options.selectable&&o.select(i.add(n)),n&&nt(i[0],n[0]),r=i.next(),r.hasClass("k-detail-row")&&r.is(":visible")&&i.find(".k-hierarchy-cell .k-icon").removeClass("k-plus").addClass("k-minus"))},_showMessage:function(t,n){var i,r,o,a=this;return a._isMobile?(i=pt.template('<ul><li class="km-actionsheet-title">#:title#</li><li><a href="\\#" class="k-button k-grid-delete">#:confirmDelete#</a></li></ul>'),r=e(i(t)).appendTo(a.view.element),o=a._actionSheet=new pt.mobile.ui.ActionSheet(r,{cancel:t.cancelDelete,cancelTemplate:'<li class="km-actionsheet-cancel"><a class="k-button" href="\\#">#:cancel#</a></li>',close:function(){this.destroy()},command:function(t){var i=e(t.currentTarget).parent();i.hasClass("km-actionsheet-cancel")||a._removeRow(n)},popup:a._actionSheetPopupOptions}),o.open(n),!1):window.confirm(t.title)},_confirmation:function(e){var t=this,n=t.options.editable,i=n===!0||typeof n===un?t.options.messages.editable.confirmation:n.confirmation;return i!==!1&&null!=i?(typeof i===dn&&(i=i(t._modelForContainer(e))),t._showMessage({confirmDelete:n.confirmDelete||t.options.messages.editable.confirmDelete,cancelDelete:n.cancelDelete||t.options.messages.editable.cancelDelete,title:i===!0?t.options.messages.editable.confirmation:i},e)):!0},cancelChanges:function(){this.dataSource.cancelChanges()},saveChanges:function(){var e=this;(e.editable&&e.editable.end()||!e.editable)&&!e.trigger(Kt)&&e.dataSource.sync()},addRow:function(){var e,t,n,i,r,o,a=this,s=a.dataSource,l=a._editMode(),c=a.options.editable.createAt||"",d=s.pageSize(),u=s.view()||[];(a.editable&&a.editable.end()||!a.editable)&&("incell"!=l&&a.cancelRow(),e=s.indexOf(u[0]),"bottom"==c.toLowerCase()&&(e+=u.length,d&&!s.options.serverPaging&&u.length>=d&&(e-=1)),0>e&&(e=s.page()>s.totalPages()?(s.page()-1)*d:0),t=s.insert(e,{}),n=t.uid,i=a.lockedContent?a.lockedTable:a.table,r=i.find("tr["+pt.attr("uid")+"="+n+"]"),o=r.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(a._firstEditableColumnIndex(r)),"inline"===l&&r.length?a.editRow(r):"popup"===l?a.editRow(t):o.length&&a.editCell(o),"bottom"==c.toLowerCase()&&a.lockedContent&&(a.lockedContent[0].scrollTop=a.content[0].scrollTop=a.content[0].offsetHeight))},_firstEditableColumnIndex:function(e){var t,n,i,r=this,o=L(r.columns),a=r._modelForContainer(e);for(n=0,i=o.length;i>n;n++)if(t=o[n],a&&(!a.editable||a.editable(t.field))&&!t.command&&t.field)return n;return-1},_toolbar:function(){var t,n=this,i=n.wrapper,r=n.options.toolbar,o=n.options.editable;r&&(t=n.wrapper.find(".k-grid-toolbar"),t.length||(Et(r)||(r=typeof r===un?r:n._toolbarTmpl(r).replace(mn,"\\#"),r=At(pt.template(r),n)),t=e('<div class="k-header k-grid-toolbar" />').html(r({})).prependTo(i),n.angular("compile",function(){return{elements:t.get()}})),o&&o.create!==!1&&t.on(sn+Ot,".k-grid-add",function(e){e.preventDefault(),n.addRow()}).on(sn+Ot,".k-grid-cancel-changes",function(e){e.preventDefault(),n.cancelChanges()}).on(sn+Ot,".k-grid-save-changes",function(e){e.preventDefault(),n.saveChanges()}),t.on(sn+Ot,".k-grid-excel",function(e){e.preventDefault(),n.saveAsExcel()}),t.on(sn+Ot,".k-grid-pdf",function(e){e.preventDefault(),n.saveAsPDF()}))},_toolbarTmpl:function(e){var t,n,i=this,r="";if(Tt(e))for(t=0,n=e.length;n>t;t++)r+=i._createButton(e[t]);return r},_createButton:function(e){var n,r=e.template||yn,o=typeof e===un?e:e.name||e.text,a=Sn[o]?Sn[o].className:"k-grid-"+(o||"").replace(/\s/g,""),s={className:a,text:o,imageClass:"",attr:"",iconClass:""},l=this.options.messages.commands;if(!(o||bt(e)&&e.template))throw Error("Custom commands should have name specified");return bt(e)?(e.className&&St(s.className,e.className.split(" "))<0?e.className+=" "+s.className:e.className===t&&(e.className=s.className),"edit"===o&&bt(e.text)&&(e=kt(!0,{},e),e.text=e.text.edit),e.attr&&(bt(e.attr)&&(e.attr=i(e.attr)),typeof e.attr===un&&(n=e.attr.match(/class="(.+?)"/),n&&St(n[1],e.className.split(" "))<0&&(e.className+=" "+n[1]))),s=kt(!0,s,Sn[o],{text:l[o]},e)):s=kt(!0,s,Sn[o],{text:l[o]}),pt.template(r)(s)},_hasFooters:function(){return!!this.footerTemplate||!!this.groupFooterTemplate||this.footer&&this.footer.length>0||this.wrapper.find(".k-grid-footer").length>0},_groupable:function(){var t=this;t._groupableClickHandler?t.table.add(t.lockedTable).off(sn+Ot,t._groupableClickHandler):t._groupableClickHandler=function(n){var i=e(this),r=i.closest("tr");i.hasClass("k-i-collapse")?t.collapseGroup(r):t.expandGroup(r),n.preventDefault(),n.stopPropagation()},t._isLocked()?t.lockedTable.on(sn+Ot,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler):t.table.on(sn+Ot,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler),t._attachGroupable()},_attachGroupable:function(){var t=this,n=t.wrapper,i=t.options.groupable,r=Nt+"["+pt.attr("field")+"]",o=t.content?".k-grid-header:first "+r:"table:first>.k-grid-header "+r;i&&i.enabled!==!1&&(n.has("div.k-grouping-header")[0]||e("<div>&nbsp;</div>").addClass("k-grouping-header").prependTo(n),t.groupable&&t.groupable.destroy(),t.groupable=new mt(n,kt({},i,{draggable:t._draggableInstance,groupContainer:">div.k-grouping-header",dataSource:t.dataSource,draggableElements:o,filter:o,allowDrag:t.options.reorderable})))},_continuousItems:function(t,n){var i,r,o,a,s,l,c,d;if(this.lockedContent){for(i=this,r=i.table.add(i.lockedTable),o=e(t,r[0]),a=e(t,r[1]),s=n?F(i.columns).length:1,l=n?i.columns.length-s:1,c=[],d=0;o.length>d;d+=s)Dt.apply(c,o.slice(d,d+s)),Dt.apply(c,a.splice(0,l));return c}},_selectable:function(){var n,i,r,o,a=this,s=[],l=a._isLocked(),c=a.options.selectable;c&&(a.selectable&&a.selectable.destroy(),c=pt.ui.Selectable.parseOptions(c),n=c.multiple,i=c.cell,a._hasDetails()&&(s[s.length]=".k-detail-row"),(a.options.groupable||a._hasFooters())&&(s[s.length]=".k-grouping-row,.k-group-footer"),s=s.join(","),""!==s&&(s=":not("+s+")"),r=a.table,l&&(r=r.add(a.lockedTable)),o=">"+(i?Rt:"tbody>tr"+s),a.selectable=new pt.ui.Selectable(r,{filter:o,aria:!0,multiple:n,change:function(){a.trigger($t)},useAllItems:l&&n&&i,relatedTarget:function(t){var n,r,o,s;if(!i&&l){for(r=e(),o=0,s=t.length;s>o;o++)n=a._relatedRow(t[o]),St(n[0],t)<0&&(r=r.add(n));return r}},continuousItems:function(){return a._continuousItems(o,i)}}),a.options.navigatable&&r.on("keydown"+Ot,function(o){var s=a.current(),c=o.target;if(o.keyCode===yt.SPACEBAR&&e.inArray(c,r)>-1&&!s.is(".k-edit-cell,.k-header")&&s.parent().is(":not(.k-grouping-row,.k-detail-row,.k-group-footer)")){if(o.preventDefault(),o.stopPropagation(),s=i?s:s.parent(),l&&!i&&(s=s.add(a._relatedRow(s))),n)if(o.ctrlKey){if(s.hasClass(tn))return s.removeClass(tn),a.trigger($t),t}else a.selectable.clear();else a.selectable.clear();a.selectable.value(s)}}))},_relatedRow:function(t){var n,i,r=this.lockedTable;return t=e(t),r?(n=t.closest(this.table.add(this.lockedTable)),i=n.find(">tbody>tr").index(t),n=n[0]===this.table[0]?r:this.table,n.find(">tbody>tr").eq(i)):t},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger($t)},select:function(n){var i=this,r=i.selectable;return n=e(n),n.length?(r.options.multiple||(r.clear(),n=n.first()),i._isLocked()&&(n=n.add(n.map(function(){return i._relatedRow(this)}))),r.value(n),t):r.value()},current:function(e){var n,i=this,r=i.options.scrollable,o=i._current,a=i.table.add(i.thead.parent());return e!==t&&e.length&&(o&&o[0]===e[0]||(o&&(o.removeClass(en).removeAttr("id"),a.removeAttr("aria-activedescendant")),e.attr("id",i._cellId),i._current=e.addClass(en),a.attr("aria-activedescendant",i._cellId),e.length&&r&&(n=e.closest("table").parent(),n.is(".k-grid-content")?i._scrollTo(e.parent()[0],i.content[0]):n.is(".k-grid-content-locked")&&(i._scrollTo(i._relatedRow(e.parent())[0],i.content[0]),i.lockedContent[0].scrollTop=i.content[0].scrollTop),n.is(".k-grid-content-locked,.k-grid-header-locked")||(r.virtual?i._scrollTo(e[0],i.content.find(">.k-virtual-scrollable-wrap")[0]):i._scrollTo(e[0],i.content[0]))))),i._current},_removeCurrent:function(){this._current&&(this._current.removeClass(en),this._current=null)},_scrollTo:function(e,t){var n=e.tagName.toLowerCase(),i="td"===n||"th"===n,r=e[i?"offsetLeft":"offsetTop"],o=e[i?"offsetWidth":"offsetHeight"],a=t[i?"scrollLeft":"scrollTop"],s=t[i?"clientWidth":"clientHeight"],l=r+o,c=0;c=a>r?r:l>a+s?s>=o?l-s:r:a,t[i?"scrollLeft":"scrollTop"]=c},_navigatable:function(){var t=this,n=At(t.current,t),i=t.table.add(t.lockedTable),r=t.thead.parent().add(e(">table",t.lockedHeader)),o=(t._isLocked(),i),a=pt.support.isRtl(t.element);t.options.navigatable&&(t.options.scrollable&&(o=i.add(r),r.attr(cn,-1)),o.off("mousedown"+Ot+" focus"+Ot+" focusout"+Ot+" keydown"+Ot),r.on("keydown"+Ot,function(e){e.altKey&&e.keyCode==yt.DOWN&&(n().find(".k-grid-filter, .k-header-column-menu").click(),e.stopImmediatePropagation())}).find("a.k-link").attr("tabIndex",-1),i.attr(cn,Pt.max(i.attr(cn)||0,0)).on("mousedown"+Ot+" keydown"+Ot,".k-detail-cell",function(e){e.target!==e.currentTarget&&e.stopImmediatePropagation()}),o.on(pt.support.touch?"touchstart"+Ot:"mousedown"+Ot,Bt+">"+Ht,At(ot,t)).on("focus"+Ot,function(){if(!pt.support.touch){var t=n();t&&t.is(":visible")?t.addClass(en):n(e(this).find(Lt)),i.attr(cn,-1),r.attr(cn,-1),e(this).attr(cn,0)}}).on("focusout"+Ot,function(){var e=n();e&&e.removeClass(en)}).on("keydown"+Ot,function(o){var s,l,c,d,u,h=o.keyCode,p=!1,f=!o.isDefaultPrevented()&&!e(o.target).is(":button,a,:input,a>.k-icon"),g=t.options.pageable,m=t.dataSource,v="incell"==t._editMode(),_=o.shiftKey,w=At(t._relatedRow,t),y=n();if(y&&y.is("th")&&(f=!0),f&&h==yt.UP)n(st(y,o.currentTarget,i,r,!0)),p=!0;else if(f&&h==yt.DOWN)n(st(y,o.currentTarget,i,r)),p=!0;else if(f&&h==(a?yt.RIGHT:yt.LEFT))n(lt(y,o.currentTarget,i,r,w)),p=!0;else if(f&&h==(a?yt.LEFT:yt.RIGHT))n(ct(y,o.currentTarget,i,r,w)),p=!0;else if(f&&g&&yt.PAGEDOWN==h)m.page(m.page()+1),p=!0;else if(f&&g&&yt.PAGEUP==h)m.page(m.page()-1),p=!0;else if(h==yt.ENTER||yt.F2==h){if(y=y?y:i.find(Lt),!y.length)return;e(o.target).is("table")||e.contains(y[0],o.target)||(y=e(o.target).closest("[role=gridcell]")),y.is("th")?(y.find(".k-link").click(),p=!0):y.parent().is(".k-master-row,.k-grouping-row")?(y.parent().find(".k-icon:first").click(),p=!0):(c=y.find(":kendoFocusable:first"),!y.hasClass("k-edit-cell")&&c[0]&&y.hasClass("k-state-focused")?(c.focus(),p=!0):t.options.editable&&!e(o.target).is(":button,.k-button,textarea")&&(d=e(o.target).closest("[role=gridcell]"),d[0]||(d=y),t._handleEditing(d,!1,v?o.currentTarget:i[0]),p=!0))}else yt.ESC==h?(s=_t(),y&&e.contains(y[0],s)&&!y.hasClass("k-edit-cell")&&!y.parent().hasClass("k-grid-edit-row")?(rt(o.currentTarget,!0),p=!0):!t._editContainer||y&&!t._editContainer.has(y[0])&&y[0]!==t._editContainer[0]||(v?t.closeCell(!0):(l=e(y).parent().index(),s&&s.blur(),t.cancelRow(),l>=0&&t.current(i.find(">tbody>tr").eq(l).children().filter(Ht).first())),kn.msie&&9>kn.version&&document.body.focus(),rt(v?o.currentTarget:i[0],!0),p=!0)):yt.TAB==h&&(y=e(y),t.options.editable&&v&&(u=e(_t()).closest(".k-edit-cell"),u[0]&&u[0]!==y[0]&&(y=u)),u=dt(y,o.currentTarget,i,w,_),!y.is("th")&&u.length&&t.options.editable&&v&&(t._handleEditing(y,u,u.closest(i)),p=!0));p&&(o.preventDefault(),o.stopPropagation())}))},_handleEditing:function(n,i,r){var o,a,s=this,l=e(_t()),c=s._editMode(),d=kn.msie,u=d&&9>kn.version,h=s._editContainer;if(r=e(r),a="incell"==c?n.hasClass("k-edit-cell"):n.parent().hasClass("k-grid-edit-row"),s.editable){if(e.contains(h[0],l[0])&&(kn.opera||u?l.change().triggerHandler("blur"):(l.blur(),d&&l.blur())),!s.editable)return rt(r),t;if(!s.editable.end())return s.current("incell"==c?h:h.children().filter(zt).first()),o=h.find(":kendoFocusable:first")[0],o&&o.focus(),t;"incell"==c?s.closeCell():(s.saveRow(),a=!0)}i&&s.current(i),u&&document.body.focus(),rt(r,!0),(!a&&!i||i)&&("incell"==c?s.editCell(s.current()):s.editRow(s.current().parent()))},_wrapper:function(){var e=this,t=e.table,n=e.options.height,i=e.element;i.is("div")||(i=i.wrap("<div/>").parent()),e.wrapper=i.addClass("k-grid k-widget"),n&&(e.wrapper.css(ln,n),t.css(ln,"auto")),e._initMobile()},_initMobile:function(){var t,n=this.options,i=this;this._isMobile=n.mobile===!0&&pt.support.mobileOS||"phone"===n.mobile||"tablet"===n.mobile,this._isMobile&&(t=this.wrapper.addClass("k-grid-mobile").wrap("<div data-"+pt.ns+'role="view" data-'+pt.ns+'init-widgets="false"></div>').parent(),this.pane=pt.mobile.ui.Pane.wrap(t),this.view=this.pane.view(),this._actionSheetPopupOptions=e(document.documentElement).hasClass("km-root")?{modal:!1}:{align:"bottom center",position:"bottom center",effect:"slideIn:up"},n.height&&this.pane.element.parent().css(ln,n.height),this._editAnimation="slide",this.view.bind("show",function(){i._isLocked()&&(i._updateTablesWidth(),i._applyLockedContainersWidth(),i._syncLockedContentHeight(),i._syncLockedHeaderHeight(),i._syncLockedFooterHeight())}))},_tbody:function(){var t,n=this,i=n.table;t=i.find(">tbody"),t.length||(t=e("<tbody/>").appendTo(i)),n.tbody=t.attr("role","rowgroup")},_scrollable:function(){var t,n,i,r,o=this,a=o.options,s=a.scrollable,l=s!==!0&&s.virtual&&!o.virtualScrollable,c=!pt.support.kineticScrollNeeded||l?pt.support.scrollbar():0;s&&(t=o.wrapper.children(".k-grid-header"),t[0]||(t=e('<div class="k-grid-header" />').insertBefore(o.table)),t.css(bn?"padding-left":"padding-right",s.virtual?c+1:c),n=e('<table role="grid" />'),xn&&n.attr("cellspacing",0),n.width(o.table[0].style.width),n.append(o.thead),t.empty().append(e('<div class="k-grid-header-wrap" />').append(n)),o.content=o.table.parent(),o.content.is(".k-virtual-scrollable-wrap, .km-scroll-container")&&(o.content=o.content.parent()),o.content.is(".k-grid-content, .k-virtual-scrollable-wrap")||(o.content=o.table.wrap('<div class="k-grid-content" />').parent()),l&&(o.virtualScrollable=new Tn(o.content,{dataSource:o.dataSource,itemHeight:function(){return o._averageRowHeight()}})),o.scrollables=t.children(".k-grid-header-wrap"),i=o.wrapper.find(".k-grid-footer"),i.length&&(o.scrollables=o.scrollables.add(i.children(".k-grid-footer-wrap"))),s.virtual?o.content.find(">.k-virtual-scrollable-wrap").unbind("scroll"+Ot).bind("scroll"+Ot,function(){o.scrollables.scrollLeft(this.scrollLeft),o.lockedContent&&(o.lockedContent[0].scrollTop=this.scrollTop)}):(o.content.unbind("scroll"+Ot).bind("scroll"+Ot,function(){o.scrollables.scrollLeft(this.scrollLeft),o.lockedContent&&(o.lockedContent[0].scrollTop=this.scrollTop)}),r=o.content.data("kendoTouchScroller"),r&&r.destroy(),r=pt.touchScroller(o.content),r&&r.movable&&(o.touchScroller=r,r.movable.bind("change",function(e){o.scrollables.scrollLeft(-e.sender.x),o.lockedContent&&o.lockedContent.scrollTop(-e.sender.y)}),o.one(Xt,function(e){e.sender.wrapper.addClass("k-grid-backface")}))))},_setContentWidth:function(){var t,n=this,i="k-grid-content-expander",r='<div class="'+i+'"></div>',o=n.resizable;n.options.scrollable&&n.wrapper.is(":visible")&&(t=n.table.parent().children("."+i),n._setContentWidthHandler=At(n._setContentWidth,n),n.dataSource&&n.dataSource.view().length?t[0]&&(t.remove(),o&&o.unbind("resize",n._setContentWidthHandler)):(t[0]||(t=e(r).appendTo(n.table.parent()),o&&o.bind("resize",n._setContentWidthHandler)),n.thead&&t.width(n.thead.width())),n._applyLockedContainersWidth())},_applyLockedContainersWidth:function(){if(this.options.scrollable&&this.lockedHeader){var e,t=this.thead.parent(),n=t.parent(),i=this.wrapper[0].clientWidth,r=this._groups(),o=pt.support.scrollbar(),a=this.lockedHeader.find(">table>colgroup>col:not(.k-group-col, .k-hierarchy-col)"),s=t.find(">colgroup>col:not(.k-group-col, .k-hierarchy-col)"),l=A(a),c=A(s);r>0&&(l+=this.lockedHeader.find(".k-group-cell:first").outerWidth()*r),l>=i&&(l=i-3*o),this.lockedHeader.add(this.lockedContent).width(l),n[0].style.width=n.parent().width()-l-2+"px",t.add(this.table).width(c),this.virtualScrollable&&(i-=o),this.content[0].style.width=i-l-2+"px",this.lockedFooter&&this.lockedFooter.length&&(this.lockedFooter.width(l),e=this.footer.find(".k-grid-footer-wrap"),e[0].style.width=n[0].clientWidth+"px",e.children().first().width(c))}},_setContentHeight:function(){var e,t=this,n=t.options,i=t.wrapper.innerHeight(),r=t.wrapper.children(".k-grid-header"),o=pt.support.scrollbar();n.scrollable&&t.wrapper.is(":visible")&&(i-=r.outerHeight(),t.pager&&(i-=t.pager.element.outerHeight()),n.groupable&&(i-=t.wrapper.children(".k-grouping-header").outerHeight()),n.toolbar&&(i-=t.wrapper.children(".k-grid-toolbar").outerHeight()),t.footerTemplate&&(i-=t.wrapper.children(".k-grid-footer").outerHeight()),e=function(e){var t,n;return e[0].style.height?!0:(t=e.height(),e.height("auto"),n=e.height(),t!=n?(e.height(""),!0):(e.height(""),!1))},e(t.wrapper)&&(i>2*o?(t.lockedContent&&(o=t.table[0].offsetWidth>t.table.parent()[0].clientWidth?o:0,t.lockedContent.height(i-o)),t.content.height(i)):t.content.height(2*o+1)))},_averageRowHeight:function(){var e,t=this,n=t._items(t.tbody).length,i=t._rowHeight;return 0===n?i:(t._rowHeight||(t._rowHeight=i=t.table.outerHeight()/n,t._sum=i,t._measures=1),e=t.table.outerHeight()/n,i!==e&&(t._measures++,t._sum+=e,t._rowHeight=t._sum/t._measures),i)
},_dataSource:function(){var e,n=this,i=n.options,r=i.dataSource;r=Tt(r)?{data:r}:r,bt(r)&&(kt(r,{table:n.table,fields:n.columns}),e=i.pageable,bt(e)&&e.pageSize!==t&&(r.pageSize=e.pageSize)),n.dataSource&&n._refreshHandler?n.dataSource.unbind($t,n._refreshHandler).unbind(Mt,n._progressHandler).unbind(Ft,n._errorHandler):(n._refreshHandler=At(n.refresh,n),n._progressHandler=At(n._requestStart,n),n._errorHandler=At(n._error,n)),n.dataSource=gt.create(r).bind($t,n._refreshHandler).bind(Mt,n._progressHandler).bind(Ft,n._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_modelChange:function(t){var n,i,r,o,a,s,l,c,d,u=this,h=u.tbody,p=t.model,f=u.tbody.find("tr["+pt.attr("uid")+"="+p.uid+"]"),g=f.hasClass("k-alt"),m=u._items(h).index(f),v=u.lockedContent;if(v&&(n=u._relatedRow(f)),f.add(n).children(".k-edit-cell").length&&!u.options.rowTemplate)f.add(n).children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){i=e(this),r=L(u.columns)[u.cellIndex(i)],r.field===t.field&&(i.hasClass("k-edit-cell")?i.addClass("k-dirty-cell"):(u._displayCell(i,r,p),e('<span class="k-dirty"/>').prependTo(i)))});else if(!f.hasClass("k-grid-edit-row")){for(s=e().add(f),v&&(o=(g?u.lockedAltRowTemplate:u.lockedRowTemplate)(p),s=s.add(n),n.replaceWith(o)),o=(g?u.altRowTemplate:u.rowTemplate)(p),f.replaceWith(o),o=u._items(h).eq(m),v&&(f=f.add(n),n=u._relatedRow(o)[0],nt(o[0],n),o=o.add(n)),a=u.options.selectable,a&&f.hasClass("k-state-selected")&&u.select(o),c=s.children(":not(.k-group-cell,.k-hierarchy-cell)"),l=o.children(":not(.k-group-cell,.k-hierarchy-cell)"),m=0,d=u.columns.length;d>m;m++)r=u.columns[m],i=l.eq(m),a&&c.eq(m).hasClass("k-state-selected")&&i.addClass("k-state-selected"),r.field===t.field&&e('<span class="k-dirty"/>').prependTo(i);u.trigger("itemChange",{item:o,data:p,ns:ft})}},_pageable:function(){var t,n=this,i=n.options.pageable;i&&(t=n.wrapper.children("div.k-grid-pager"),t.length||(t=e('<div class="k-pager-wrap k-grid-pager"/>').appendTo(n.wrapper)),n.pager&&n.pager.destroy(),n.pager="object"==typeof i&&i instanceof pt.ui.Pager?i:new pt.ui.Pager(t,kt({},i,{dataSource:n.dataSource})))},_footer:function(){var t,n,i,r,a=this,s=a.dataSource.aggregates(),l="",c=a.footerTemplate,d=a.options,u=a.footer||a.wrapper.find(".k-grid-footer");c?(s=It(s)?o(a.dataSource.aggregate()):s,l=e(a._wrapFooter(c(s))),u.length?(n=l,a.angular("cleanup",function(){return{elements:u.get()}}),u.replaceWith(n),u=a.footer=n):u=a.footer=d.scrollable?d.pageable?l.insertBefore(a.wrapper.children("div.k-grid-pager")):l.appendTo(a.wrapper):l.insertBefore(a.tbody),a.angular("compile",function(){return{elements:u.find("td").get(),data:xt(a.columns,function(e){return{column:e,aggregate:s[e.field]}})}})):u&&!a.footer&&(a.footer=u),u.length&&(d.scrollable&&(t=u.attr("tabindex",-1).children(".k-grid-footer-wrap"),a.scrollables=a.scrollables.filter(function(){return!e(this).is(".k-grid-footer-wrap")}).add(t)),a._footerWidth&&u.find("table").css("width",a._footerWidth),t&&(i=a.content.scrollLeft(),r=d.scrollable!==!0&&d.scrollable.virtual&&!a.virtualScrollable,r&&(i=a.wrapper.find(".k-virtual-scrollable-wrap").scrollLeft()),t.scrollLeft(i))),a.lockedContent&&(a._appendLockedColumnFooter(),a._applyLockedContainersWidth(),a._syncLockedFooterHeight())},_wrapFooter:function(t){var n=this,i="",r=pt.support.mobileOS?0:pt.support.scrollbar();return n.options.scrollable?(i=e('<div class="k-grid-footer"><div class="k-grid-footer-wrap"><table'+(xn?' cellspacing="0"':"")+"><tbody>"+t+"</tbody></table></div></div>"),n._appendCols(i.find("table")),i.css(bn?"padding-left":"padding-right",r),i):'<tfoot class="k-grid-footer">'+t+"</tfoot>"},_columnMenu:function(){var e,n,i,r,o,a,s,l,c,d=this,u=L(d.columns),h=d.options,p=h.columnMenu,f=Ct(d.columns,function(e){return e.columns!==t}).length>0,g=this._isMobile,m=function(e){d.trigger(Gt,{field:e.field,container:e.container})},v=function(e){rt(e.closest("table"),!0)},_=h.$angular;if(p)for("boolean"==typeof p&&(p={}),a=N(d.thead),s=0,l=a.length;l>s;s++)n=u[s],c=a.eq(s),n.command||!n.field&&!c.attr("data-"+pt.ns+"field")||(e=c.data("kendoColumnMenu"),e&&e.destroy(),r=n.sortable!==!1&&p.sortable!==!1&&h.sortable!==!1?kt({},h.sortable,{compare:(n.sortable||{}).compare}):!1,o=h.filterable&&n.filterable!==!1&&p.filterable!==!1?kt({pane:d.pane},n.filterable,h.filterable):!1,i={dataSource:d.dataSource,values:n.values,columns:p.columns,sortable:r,filterable:o,messages:p.messages,owner:d,closeCallback:v,init:m,pane:d.pane,filter:g?":not(.k-column-active)":"",lockedColumns:!f&&n.lockable!==!1&&F(u).length>0},_&&(i.$angular=_),c.kendoColumnMenu(i))},_headerCells:function(){return this.thead.find("th").filter(function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")})},_filterable:function(){var e,t,n,i,r,o,a,s=this,l=L(s.columns),c=function(e){s.trigger(qt,{field:e.field,container:e.container})},d=function(e){rt(e.closest("table"),!0)},u=s.options.filterable;if(u&&typeof u.mode==un&&-1==u.mode.indexOf("menu")&&(u=!1),u&&!s.options.columnMenu)for(t=N(s.thead),i=0,r=t.length;r>i;i++)n=t.eq(i),l[i].filterable===!1||l[i].command||!l[i].field&&!n.attr("data-"+pt.ns+"field")||(e=n.data("kendoFilterMenu"),e&&e.destroy(),o=l[i].filterable,a=kt({},u,o,{dataSource:s.dataSource,values:l[i].values,closeCallback:d,init:c,pane:s.pane}),o&&o.messages&&(a.messages=kt(!0,{},u.messages,o.messages)),n.kendoFilterMenu(a))},_filterRow:function(){var t,n,i,r,o,a,s,l,c,d,u,h,p=this;if(p._hasFilterRow())for(t=L(p.columns),n=p.options.filterable,i=p.thead.find(".k-filter-row"),this._updateHeader(this.dataSource.group().length),r=0;t.length>r;r++)if(a=t[r],s=p.options.filterable.operators,l=!1,c=e("<th/>"),d=a.field,a.hidden&&c.hide(),i.append(c),d&&a.filterable!==!1){if(u=a.filterable&&a.filterable.cell||{},o=p.options.dataSource,o instanceof gt&&(o=p.options.dataSource.options),h=kt(!0,{},n.messages),a.filterable&&kt(!0,h,a.filterable.messages),u.enabled===!1){c.html("&nbsp;");continue}u.dataSource&&(o=u.dataSource,l=!0),a.filterable&&a.filterable.operators&&(s=a.filterable.operators),e("<span/>").attr(pt.attr("field"),d).kendoFilterCell({dataSource:p.dataSource,suggestDataSource:o,customDataSource:l,field:d,messages:h,values:a.values,template:u.template,delay:u.delay,inputWidth:u.inputWidth,suggestionOperator:u.suggestionOperator,minLength:u.minLength,dataTextField:u.dataTextField,operator:u.operator,operators:s,showOperators:u.showOperators}).appendTo(c)}else c.html("&nbsp;")},_sortable:function(){var e,t,n,i,r,o,a=this,s=L(a.columns),l=a.options.sortable;if(l){for(i=N(a.thead),r=0,o=i.length;o>r;r++)e=s[r],e.sortable!==!1&&!e.command&&e.field&&(n=i.eq(r),t=n.data("kendoColumnSorter"),t&&t.destroy(),n.attr("data-"+pt.ns+"field",e.field).kendoColumnSorter(kt({},l,e.sortable,{dataSource:a.dataSource,aria:!0,filter:":not(.k-column-active)"})));i=null}},_columns:function(t){var n,i,r,o=this,a=o.table,s=a.find("col"),l=o.options.dataSource;if(t=t.length?t:xt(a.find("th"),function(t,n){t=e(t);var i=t.attr(pt.attr("sortable")),r=t.attr(pt.attr("filterable")),o=t.attr(pt.attr("type")),a=t.attr(pt.attr("groupable")),l=t.attr(pt.attr("field")),c=t.attr(pt.attr("menu"));return l||(l=t.text().replace(/\s|[^A-z0-9]/g,"")),{field:l,type:o,sortable:"false"!==i,filterable:"false"!==r,groupable:"false"!==a,menu:c,template:t.attr(pt.attr("template")),width:s.eq(n).css("width")}}),n=!(o.table.find("tbody tr").length>0&&(!l||!l.transport)),o.options.scrollable){if(r=t,i=F(t),t=z(t),i.length>0&&0===t.length)throw Error("There should be at least one non locked column");G(o.element.find("tr:has(th):first").find("th:not(.k-group-cell)"),r),t=i.concat(t)}o.columns=c(t,n)},_groups:function(){var e=this.dataSource.group();return e?e.length:0},_tmpl:function(e,t,r,o){var a,s,l,c,d=this,u=kt({},pt.Template,d.options.templateSettings),h=t.length,p={storage:{},count:0},f=d._hasDetails(),g=[],m=d._groups();if(!e){for(e="<tr",r&&g.push("k-alt"),f&&g.push("k-master-row"),g.length&&(e+=' class="'+g.join(" ")+'"'),h&&(e+=" "+pt.attr("uid")+'="#='+pt.expr("uid",u.paramName)+'#"'),e+=" role='row'>",m>0&&!o&&(e+=n(m)),f&&(e+='<td class="k-hierarchy-cell"><a class="k-icon k-plus" href="\\#" tabindex="-1"></a></td>'),a=0;h>a;a++)l=t[a],s=l.template,c=typeof s,e+="<td"+i(l.attributes)+" role='gridcell'>",e+=d._cellTmpl(l,p),e+="</td>";e+="</tr>"}return e=pt.template(e,u),p.count>0?At(e,p.storage):e},_headerCellText:function(e){var t=this,n=kt({},pt.Template,t.options.templateSettings),i=e.headerTemplate,r=typeof i,o=e.title||e.field||"";return r===dn?o=pt.template(i,n)({}):r===un&&(o=i),o},_cellTmpl:function(e,t){var n,i,r=this,o=kt({},pt.Template,r.options.templateSettings),a=e.template,s=o.paramName,l=e.field,c="",d=e.format,u=typeof a,h=e.values;if(e.command){if(Tt(e.command)){for(n=0,i=e.command.length;i>n;n++)c+=r._createButton(e.command[n]);return c.replace(mn,"\\#")}return r._createButton(e.command).replace(mn,"\\#")}return u===dn?(t.storage["tmpl"+t.count]=a,c+="#=this.tmpl"+t.count+"("+s+")#",t.count++):u===un?c+=a:h&&h.length&&bt(h[0])&&"value"in h[0]&&l?(c+="#var v ="+pt.stringify($(h)).replace(mn,"\\#")+"#",c+="#var f = v[",o.useWithBlock||(c+=s+"."),c+=l+"]#",c+="${f != null ? f : ''}"):(c+=e.encoded?"#:":"#=",d&&(c+='kendo.format("'+d.replace(gn,"\\$1")+'",'),l?(l=pt.expr(l,s),c+=l+"==null?'':"+l):c+="''",d&&(c+=")"),c+="#"),c},_templates:function(){var t=this,n=t.options,i=t.dataSource,r=i.group(),o=t.footer||t.wrapper.find(".k-grid-footer"),a=i.aggregate(),s=L(t.columns),l=L(F(t.columns)),c=n.scrollable?L(z(t.columns)):s;if(n.scrollable&&l.length){if(n.rowTemplate||n.altRowTemplate)throw Error("Having both row template and locked columns is not supported");t.rowTemplate=t._tmpl(n.rowTemplate,c,!1,!0),t.altRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,c,!0,!0),t.lockedRowTemplate=t._tmpl(n.rowTemplate,l),t.lockedAltRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,l,!0)}else t.rowTemplate=t._tmpl(n.rowTemplate,c),t.altRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,c,!0);t._hasDetails()&&(t.detailTemplate=t._detailTmpl(n.detailTemplate||"")),(t._group&&!It(a)||!It(a)&&!o.length||Ct(s,function(e){return e.footerTemplate}).length)&&(t.footerTemplate=t._footerTmpl(s,a,"footerTemplate","k-footer-template")),r&&Ct(s,function(e){return e.groupFooterTemplate}).length&&(a=e.map(r,function(e){return e.aggregates}),t.groupFooterTemplate=t._footerTmpl(c,a,"groupFooterTemplate","k-group-footer",l.length),n.scrollable&&l.length&&(t.lockedGroupFooterTemplate=t._footerTmpl(l,a,"groupFooterTemplate","k-group-footer")))},_footerTmpl:function(e,t,r,a,s){var l,c,d,u,h,p=this,f=kt({},pt.Template,p.options.templateSettings),g=f.paramName,m="",v={},_=0,w={},y=p._groups(),b=o(t);for(m+='<tr class="'+a+'">',y>0&&!s&&(m+=n(y)),p._hasDetails()&&(m+='<td class="k-hierarchy-cell">&nbsp;</td>'),l=0,c=e.length;c>l;l++)h=e[l],d=h[r],u=typeof d,m+="<td"+i(h.footerAttributes)+">",d?(u!==dn&&(w=b[h.field]?kt({},f,{paramName:g+"['"+h.field+"']"}):{},d=pt.template(d,w)),v["tmpl"+_]=d,m+="#=this.tmpl"+_+"("+g+")#",_++):m+="&nbsp;",m+="</td>";return m+="</tr>",m=pt.template(m,f),_>0?At(m,v):m},_detailTmpl:function(e){var t=this,i="",r=kt({},pt.Template,t.options.templateSettings),o=r.paramName,a={},s=0,l=t._groups(),c=g(L(t.columns)).length,d=typeof e;return i+='<tr class="k-detail-row">',l>0&&(i+=n(l)),i+='<td class="k-hierarchy-cell"></td><td class="k-detail-cell"'+(c?' colspan="'+c+'"':"")+">",d===dn?(a["tmpl"+s]=e,i+="#=this.tmpl"+s+"("+o+")#",s++):i+=e,i+="</td></tr>",i=pt.template(i,r),s>0?At(i,a):i},_hasDetails:function(){var e=this;return null!==e.options.detailTemplate||(e._events[jt]||[]).length},_hasFilterRow:function(){var t=this.options.filterable,n=t&&typeof t.mode==un&&-1!=t.mode.indexOf("row"),i=this.columns,r=e.grep(i,function(e){return e.filterable===!1});return i.length&&r.length==i.length&&(n=!1),n},_details:function(){var t=this;if(t.options.scrollable&&t._hasDetails()&&F(t.columns).length)throw Error("Having both detail template and locked columns is not supported");t.table.on(sn+Ot,".k-hierarchy-cell .k-plus, .k-hierarchy-cell .k-minus",function(n){var i,r,o=e(this),a=o.hasClass("k-plus"),s=o.closest("tr.k-master-row"),l=t.detailTemplate,c=t._hasDetails();return o.toggleClass("k-plus",!a).toggleClass("k-minus",a),i=s.next(),c&&!i.hasClass("k-detail-row")&&(r=t.dataItem(s),i=e(l(r)).addClass(s.hasClass("k-alt")?"k-alt":"").insertAfter(s),t.angular("compile",function(){return{elements:i.get(),data:[{dataItem:r}]}}),t.trigger(jt,{masterRow:s,detailRow:i,data:r,detailCell:i.find(".k-detail-cell")})),t.trigger(a?Zt:Jt,{masterRow:s,detailRow:i}),i.toggle(a),t._current&&t._current.attr("aria-expanded",a),n.preventDefault(),!1})},dataItem:function(t){if(t=e(t)[0],!t)return null;var n,i,r=this.tbody.children(),o=/k-grouping-row|k-detail-row|k-group-footer/,a=t.sectionRowIndex;for(i=a,n=0;a>n;n++)o.test(r[n].className)&&i--;return this._data[i]},expandRow:function(t){e(t).find("> td .k-plus, > td .k-i-expand").click()},collapseRow:function(t){e(t).find("> td .k-minus, > td .k-i-collapse").click()},_createHeaderCells:function(e,n){var r,o,a,s,l,c=this,d="",u=L(c.columns);for(r=0,s=e.length;s>r;r++)o=e[r].column||e[r],a=c._headerCellText(o),l=St(o,u),o.command?(d+="<th"+i(o.headerAttributes),n&&!e[r].colSpan&&(d+=" rowspan='"+n+"'"),l>-1&&(d+=pt.attr("index")+"='"+l+"'"),d+=">"+a+"</th>"):(d+="<th role='columnheader' "+pt.attr("field")+"='"+(o.field||"")+"' ",n&&!e[r].colSpan&&(d+=" rowspan='"+n+"'"),e[r].colSpan>1&&(d+='colspan="'+(e[r].colSpan-D(o.columns))+'" ',d+=pt.attr("colspan")+"='"+e[r].colSpan+"'"),o.title&&(d+=pt.attr("title")+'="'+o.title.replace(/'/g,"'")+'" '),o.groupable!==t&&(d+=pt.attr("groupable")+"='"+o.groupable+"' "),o.aggregates&&o.aggregates.length&&(d+=pt.attr("aggregates")+"='"+o.aggregates+"'"),l>-1&&(d+=pt.attr("index")+"='"+l+"'"),d+=i(o.headerAttributes),d+=">"+a+"</th>");return d},_appendLockedColumnContent:function(){var t,n,i,r,o,a=this.columns,s=this.table.find("colgroup"),l=s.find("col:not(.k-group-col,.k-hierarchy-col)"),c=e(),d=0,u=0;for(t=0,n=a.length;n>t;t++)if(a[t].locked)if(f(a[t])){for(r=1,a[t].columns&&(r=L(a[t].columns).length-D(a[t].columns)),r=r||1,o=0;r>o;o++)c=c.add(l.eq(t+u+o-d));u+=r-1}else d++;i=e('<div class="k-grid-content-locked"><table'+(xn?' cellspacing="0"':"")+"><colgroup/><tbody></tbody></table></div>"),s.detach(),i.find("colgroup").append(c),s.insertBefore(this.table.find("tbody")),this.lockedContent=i.insertBefore(this.content),this.lockedTable=i.children("table")},_appendLockedColumnFooter:function(){var t,n,i=this,r=i.footer,o=r.find(".k-footer-template>td"),a=r.find(".k-grid-footer-wrap>table>colgroup>col"),s=e('<div class="k-grid-footer-locked"><table><colgroup /><tbody><tr class="k-footer-template"></tr></tbody></table></div>'),l=i._groups(),c=e(),d=e();for(c=c.add(o.filter(".k-group-cell")),t=0,n=L(F(i.columns)).length;n>t;t++)c=c.add(o.eq(t+l));for(d=d.add(a.filter(".k-group-col")),t=0,n=L(B(i.columns)).length;n>t;t++)d=d.add(a.eq(t+l));c.appendTo(s.find("tr")),d.appendTo(s.find("colgroup")),i.lockedFooter=s.prependTo(r)},_appendLockedColumnHeader:function(t){var n,i,r,o,a,s,l,c,d,u,h,p=this,g=this.columns,v=[],_=0,w=e(),y=p._hasFilterRow(),b=0,k=e(),x=0,C=e(),T=p.thead.prev().find("col:not(.k-group-col,.k-hierarchy-col)"),S=p.thead.find("tr:first .k-header:not(.k-group-cell,.k-hierarchy-cell)"),A=p.thead.find(".k-filter-row").find("th:not(.k-group-cell,.k-hierarchy-cell)"),I=0;for(n=0,r=g.length;r>n;n++){if(g[n].locked){if(l=S.eq(n),x=L(g[n].columns||[]).length,f(g[n])){for(g[n].columns&&(c=x-D(g[n].columns)),c=c||1,d=0;c>d;d++)w=w.add(T.eq(n+I+d-_));I+=c-1}for(M([g[n]],V(l),v,0,0),x=x||1,u=0;x>u;u++)k=k.add(A.eq(b+u));b+=x}g[n].columns&&(_+=D(g[n].columns)),f(g[n])||_++}if(v.length){for(i='<div class="k-grid-header-locked" style="width:1px"><table'+(xn?' cellspacing="0"':"")+"><colgroup/><thead>",i+=Array(v.length+1).join("<tr></tr>"),i+=(y?'<tr class="k-filter-row" />':"")+"</thead></table></div>",s=e(i),T=s.find("colgroup"),T.append(p.thead.prev().find("col.k-group-col").add(w)),o=s.find("thead tr:not(.k-filter-row)"),n=0,r=v.length;r>n;n++)C=m(v[n]),o.eq(n).append(p.thead.find("tr:eq("+n+") .k-group-cell").add(C));h=P(this.thead),h>v.length&&E(s,h),a=s.find(".k-filter-row"),a.append(p.thead.find(".k-filter-row .k-group-cell").add(k)),this.lockedHeader=s.prependTo(t),this._syncLockedHeaderHeight()}},_removeLockedContainers:function(){var e=this.lockedHeader.add(this.lockedContent).add(this.lockedFooter);pt.destroy(e),e.off(Ot).remove(),this.lockedHeader=this.lockedContent=this.lockedFooter=null,this.selectable=null},_thead:function(){var t,n,i,r,o=this,a=o.columns,s=o._hasDetails()&&a.length,l=o._hasFilterRow(),c="",d=o.table.find(">thead"),u=o.element.find("thead:first").length>0;if(d.length||(d=e("<thead/>").insertBefore(o.tbody)),o.lockedHeader&&o.thead?(n=o.thead.find("tr:has(th):not(.k-filter-row)").html(""),o._removeLockedContainers()):n=o.element.find(u?"thead:first tr:has(th):not(.k-filter-row)":"tr:has(th):first"),n.length)n.children().attr(pt.attr("index"),function(){return e(this).index()});else if(n=d.children().first(),!n.length){for(i=[{rowSpan:1,cells:[],index:0}],o._prepareColumns(i,a),t=0;i.length>t;t++)c+="<tr>",s&&(c+='<th class="k-hierarchy-cell">&nbsp;</th>'),c+=o._createHeaderCells(i[t].cells,i[t].rowSpan),c+="</tr>";n=e(c)}l&&(r=e("<tr/>"),r.addClass("k-filter-row"),s&&r.prepend('<th class="k-hierarchy-cell">&nbsp;</th>'),d.append(r)),n.children().length?s&&!n.find(".k-hierarchy-cell")[0]&&n.prepend('<th class="k-hierarchy-cell">&nbsp;</th>'):(c="",s&&(c+='<th class="k-hierarchy-cell">&nbsp;</th>'),c+=o._createHeaderCells(a),n.html(c)),n.attr("role","row").find("th").addClass("k-header"),o.options.scrollable||d.addClass("k-grid-header"),n.find("script").remove().end().prependTo(d),o.thead&&o._destroyColumnAttachments(),this.angular("cleanup",function(){return{elements:d.find("th").get()}}),this.angular("compile",function(){return{elements:d.find("th").get(),data:xt(a,function(e){return{column:e}})}}),o.thead=d.attr("role","rowgroup"),o._sortable(),o._filterable(),o._filterRow(),o._scrollable(),o._updateCols(),o._columnMenu(),this.options.scrollable&&F(this.columns).length&&(o._appendLockedColumnHeader(o.thead.closest(".k-grid-header")),o._appendLockedColumnContent(),o.lockedContent.bind("DOMMouseScroll"+Ot+" mousewheel"+Ot,At(o._wheelScroll,o)),o._applyLockedContainersWidth()),o._updateFirstColumnClass(),o._resizable(),o._draggable(),o._reorderable(),o.groupable&&o._attachGroupable()},_updateFirstColumnClass:function(){var t,n,i=this,r=i.columns||[],o=i._hasDetails()&&r.length;o||i._groups()||(t=e(),n=i.thead.find(">tr:not(.k-filter-row):not(:first)"),r=z(r),n.length&&r[0]&&!r[0].columns&&(t=t.add(n)),i._isLocked()&&(n=i.lockedHeader.find("thead>tr:not(.k-filter-row):not(:first)"),r=F(i.columns),n.length&&r[0]&&!r[0].columns&&(t=t.add(n))),t.each(function(){var t=e(this).find("th");t.removeClass("k-first"),t.eq(0).addClass("k-first")}))},_prepareColumns:function(e,t,n,i){var r,o,a=i||e[e.length-1],s=e[a.index+1],l=0;for(r=0;t.length>r;r++)o={column:t[r],colSpan:0},a.cells.push(o),t[r].columns&&t[r].columns.length&&(s||(s={rowSpan:0,cells:[],index:e.length},e.push(s)),o.colSpan=t[r].columns.length,this._prepareColumns(e,t[r].columns,o,s),l+=o.colSpan-1,a.rowSpan=e.length-a.index);n&&(n.colSpan+=l)},_wheelScroll:function(t){var n,i,r;t.ctrlKey||(n=this.content,this.options.scrollable.virtual&&(n=this.virtualScrollable.verticalScrollbar),i=n.scrollTop(),r=pt.wheelDeltaY(t),r&&(t.preventDefault(),e(t.currentTarget).one("wheel"+Ot,!1),n.scrollTop(i+-r)))},_isLocked:function(){return null!=this.lockedHeader},_updateCols:function(e){e=e||this.thead.parent().add(this.table),this._appendCols(e,this._isLocked())},_updateLockedCols:function(e){this._isLocked()&&(e=e||this.lockedHeader.find("table").add(this.lockedTable),q(e,H(B(this.columns)),this._hasDetails(),this._groups()))},_appendCols:function(e,t){t?q(e,H(R(this.columns)),this._hasDetails(),0):q(e,H(g(this.columns)),this._hasDetails(),this._groups())},_autoColumns:function(e){if(e&&e.toJSON){var t,n=this;e=e.toJSON();for(t in e)n.columns.push({field:t});n._thead(),n._templates()}},_rowsHtml:function(e,t){var n,i,r=this,o="",a=t.rowTemplate,s=t.altRowTemplate;for(n=0,i=e.length;i>n;n++)o+=n%2?s(e[n]):a(e[n]),r._data.push(e[n]);return o},_groupRowHtml:function(e,t,n,i,r,o){var a,s,l=this,c="",d=e.field,u=Ct(L(l.columns),function(e){return e.field==d})[0]||{},h=u.groupHeaderTemplate,p=(u.title||d)+": "+Y(e.value,u.format,u.values),f=l._groupAggregatesDefaultObject||{},g=kt({},f,e.aggregates),m=kt({},{field:e.field,value:e.value,aggregates:g},e.aggregates[e.field]),v=r.groupFooterTemplate,_=e.items;if(h&&(p=typeof h===dn?h(m):pt.template(h)(m)),c+=i(t,n,p),e.hasSubgroups)for(a=0,s=_.length;s>a;a++)c+=l._groupRowHtml(_[a],o?t:t-1,n+1,i,r,o);else c+=l._rowsHtml(_,r);return v&&(c+=v(g)),c},collapseGroup:function(t){t=e(t);var n,i,r,o,a,s=this.options.groupable,l=s.showFooter,c=l?0:1,d=e();for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?d=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(d=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),n=t.find(".k-group-cell").length,t.find(".k-icon").addClass("k-i-expand").removeClass("k-i-collapse"),t.find("td:first").attr("aria-expanded",!1),t=t.nextAll("tr"),r=0,o=t.length;o>r&&(a=t.eq(r),i=a.find(".k-group-cell").length,a.hasClass("k-grouping-row")?c++:a.hasClass("k-group-footer")&&c--,!(n>=i||a.hasClass("k-group-footer")&&0>c));r++)a.hide(),d.eq(r).hide()},expandGroup:function(t){t=e(t);var n,i,r,o,a,s=this,l=e(),c=1;for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?l=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(l=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),n=t.find(".k-group-cell").length,t.find(".k-icon").addClass("k-i-collapse").removeClass("k-i-expand"),t.find("td:first").attr("aria-expanded",!0),t=t.nextAll("tr"),o=0,a=t.length;a>o&&(i=t.eq(o),r=i.find(".k-group-cell").length,!(n>=r));o++)r!=n+1||i.hasClass("k-detail-row")||(i.show(),l.eq(o).show(),i.hasClass("k-grouping-row")&&i.find(".k-icon").hasClass("k-i-collapse")&&s.expandGroup(i),i.hasClass("k-master-row")&&i.find(".k-icon").hasClass("k-minus")&&(i.next().show(),l.eq(o+1).show())),i.hasClass("k-grouping-row")&&c++,i.hasClass("k-group-footer")&&(1==c?(i.show(),l.eq(o).show()):c--)},_updateHeader:function(t){var n=this,i=n._isLocked()?n.lockedHeader.find("thead"):n.thead,r=i.find("tr.k-filter-row").find("th.k-group-cell").length,o=i.find("tr:first").find("th.k-group-cell").length,a=i.children("tr:not(:first)").filter(function(){return!e(this).children(":visible").length});t>o?(e(Array(t-o+1).join('<th class="k-group-cell k-header">&nbsp;</th>')).prependTo(i.children("tr:not(.k-filter-row)")),n.element.is(":visible")&&a.find("th.k-group-cell").hide()):o>t&&i.find("tr").each(function(){e(this).find("th.k-group-cell").filter(":eq("+t+"),:gt("+t+")").remove()}),t>r&&e(Array(t-r+1).join('<th class="k-group-cell k-header">&nbsp;</th>')).prependTo(i.find(".k-filter-row"))},_firstDataItem:function(e,t){return e&&t&&(e=e.hasSubgroups?this._firstDataItem(e.items[0],t):e.items[0]),e},_updateTablesWidth:function(){var t,n=this;n._isLocked()&&(t=e(">.k-grid-footer>.k-grid-footer-wrap>table",n.wrapper).add(n.thead.parent()).add(n.table),n._footerWidth=et(t.eq(0)),t.width(n._footerWidth),t=e(">.k-grid-footer>.k-grid-footer-locked>table",n.wrapper).add(n.lockedHeader.find(">table")).add(n.lockedTable),t.width(et(t.eq(0))))},hideColumn:function(n){var i,r,o,a,l,c,d,u,m,v,_=this,w=0,y=_.footer||_.wrapper.find(".k-grid-footer"),b=_.columns,k=_.lockedHeader?N(_.lockedHeader.find(">table>thead")).filter(p).length:0;if(n="number"==typeof n?b[n]:bt(n)?Ct(S(b),function(e){return e===n})[0]:Ct(S(b),function(e){return e.field===n})[0],n&&f(n)){if(n.columns&&n.columns.length){for(c=C(n,b),h(n,!1),Q(s(e(">table>thead",_.lockedHeader),_.thead,">tr:eq("+c.row+")>th"),c.cell,!1),o=0;n.columns.length>o;o++)this.hideColumn(n.columns[o]);return _.trigger(Yt,{column:n}),t}if(m=St(n,g(L(b))),h(n,!1),_._setParentsVisibility(n,!1),_._templates(),_._updateCols(),_._updateLockedCols(),v=_.thead,d=m,_.lockedHeader&&k>m?v=_.lockedHeader.find(">table>thead"):d-=k,i=N(v).filter(p).eq(d),i[0].style.display="none",Q(s(e(">table>thead",_.lockedHeader),_.thead,">tr.k-filter-row>th"),m,!1),y[0]&&(_._updateCols(y.find(">.k-grid-footer-wrap>table")),_._updateLockedCols(y.find(">.k-grid-footer-locked>table")),Q(y.find(".k-footer-template>td"),m,!1)),_.lockedTable&&k>m?K(_.lockedTable.find(">tbody>tr"),m):K(_.tbody.children(),m-k),_.lockedTable)_._updateTablesWidth(),_._applyLockedContainersWidth(),_._syncLockedContentHeight(),_._syncLockedHeaderHeight(),_._syncLockedFooterHeight();else{for(a=_.thead.prev().find("col"),o=0,u=a.length;u>o;o+=1){if(l=a[o].style.width,!l||-1!=l.indexOf("%")){w=0;break}w+=parseInt(l,10)}r=e(">.k-grid-header table:first,>.k-grid-footer table:first",_.wrapper).add(_.table),_._footerWidth=null,w&&(r.width(w),_._footerWidth=w),kn.msie&&8==kn.version&&(r.css("display","inline-table"),setTimeout(function(){r.css("display","table")},1))}_._updateFirstColumnClass(),_.trigger(Yt,{column:n})}},_setParentsVisibility:function(t,n){var i,r,o,a,l,c=this.columns,d=[],p=n?function(e){return g(e.columns).length&&e.hidden}:function(e){return!g(e.columns).length&&!e.hidden};if(u(t,c,d)&&d.length)for(i=d.length-1;i>=0;i--)r=d[i],o=k(r,c),a=s(e(">table>thead",this.lockedHeader),this.thead,">tr:eq("+o.row+")>th:not(.k-group-cell):not(.k-hierarchy-cell)").eq(o.cell),p(r)&&(h(r,n),a[0].style.display=n?"":"none"),a.filter("["+pt.attr("colspan")+"]").length&&(l=parseInt(a.attr(pt.attr("colspan")),10),a[0].colSpan=l-D(r.columns)||1)},showColumn:function(n){var i,r,o,a,l,c,d,u,p,g,m,v=this,_=v.columns,w=v.footer||v.wrapper.find(".k-grid-footer"),y=v.lockedHeader?N(v.lockedHeader.find(">table>thead")).length:0;if(n="number"==typeof n?_[n]:bt(n)?Ct(S(_),function(e){return e===n})[0]:Ct(S(_),function(e){return e.field===n})[0],n&&!f(n)){if(n.columns&&n.columns.length){for(d=C(n,_),h(n,!0),Q(s(e(">table>thead",v.lockedHeader),v.thead,">tr:eq("+d.row+")>th"),d.cell,!0),i=0;n.columns.length>i;i++)this.showColumn(n.columns[i]);return v.trigger(Qt,{column:n}),t}if(g=St(n,L(_)),h(n,!0),v._setParentsVisibility(n,!0),v._templates(),v._updateCols(),v._updateLockedCols(),m=v.thead,c=g,v.lockedHeader&&y>g?m=v.lockedHeader.find(">table>thead"):c-=y,o=N(m).eq(c),o[0].style.display="",Q(s(e(">table>thead",v.lockedHeader),v.thead,">tr.k-filter-row>th"),g,!0),w[0]&&(v._updateCols(w.find(">.k-grid-footer-wrap>table")),v._updateLockedCols(w.find(">.k-grid-footer-locked>table")),Q(w.find(".k-footer-template>td"),g,!0)),v.lockedTable&&y>g?Z(v.lockedTable.find(">tbody>tr"),g):Z(v.tbody.children(),g-y),v.lockedTable)v._updateTablesWidth(),v._applyLockedContainersWidth(),v._syncLockedContentHeight(),v._syncLockedHeaderHeight();else if(a=e(">.k-grid-header table:first,>.k-grid-footer table:first",v.wrapper).add(v.table),n.width){for(l=0,p=v.thead.prev().find("col"),i=0,r=p.length;r>i;i+=1){if(u=p[i].style.width,u.indexOf("%")>-1){l=0;break}l+=parseInt(u,10)}v._footerWidth=null,l&&(a.width(l),v._footerWidth=l)}else a.width("");v._updateFirstColumnClass(),v.trigger(Qt,{column:n})}},_progress:function(e){var t=this.element;this.lockedContent?t=this.wrapper:this.element.is("table")?t=this.element.parent():this.content&&this.content.length&&(t=this.content),pt.ui.progress(t,e)},_resize:function(){this.content&&(this._setContentHeight(),this._setContentWidth()),this.virtualScrollable&&this.virtualScrollable.repaintScrollbar()},_isActiveInTable:function(){var t=_t();return this.table[0]===t||e.contains(this.table[0],t)||this._isLocked()&&(this.lockedTable[0]===t||e.contains(this.lockedTable[0],t))},refresh:function(t){var n,i=this,r=i.dataSource.view(),o=i.options.navigatable,a=e(i.current()),s=!1,l=(i.dataSource.group()||[]).length,c=l+H(g(i.columns)).length;t&&"itemchange"===t.action&&i.editable||(t=t||{},i.trigger("dataBinding",{action:t.action||"rebind",index:t.index,items:t.items})||(i._angularItems("cleanup"),o&&(i._isActiveInTable()||i._editContainer&&i._editContainer.data("kendoWindow"))&&(s=a.is("th"),n=0,s&&(n=i.thead.find("th:not(.k-group-cell)").index(a))),i._destroyEditable(),i._progress(!1),i._hideResizeHandle(),i._data=[],i.columns.length||(i._autoColumns(i._firstDataItem(r[0],l)),c=l+i.columns.length),i._group=l>0||i._group,i._group&&(i._templates(),i._updateCols(),i._updateLockedCols(),i._updateHeader(l),i._group=l>0),i._renderContent(r,c,l),i._renderLockedContent(r,c,l),i._footer(),i._setContentHeight(),i._setContentWidth(),i.lockedTable&&(i.options.scrollable.virtual?i.content.find(">.k-virtual-scrollable-wrap").trigger("scroll"):i.content.trigger("scroll")),n>=0&&(i._removeCurrent(),i.current(s?i.thead.find("th:not(.k-group-cell)").eq(n):i.table.add(i.lockedTable).find(Lt).first()),i._current&&rt(i._current.closest("table")[0],!0)),i.touchScroller&&i.touchScroller.contentResized(),i.selectable&&i.selectable.resetTouchEvents(),i._angularItems("compile"),i.trigger(Xt)))},_angularItems:function(e){pt.ui.DataBoundWidget.fn._angularItems.call(this,e),this._angularGroupItems(e)},_angularGroupItems:function(t){var n=this;n._group&&n.angular(t,function(){return{elements:n.tbody.children(".k-grouping-row"),data:e.map(X(n.dataSource.view()),function(e){return{dataItem:e}})}})},_renderContent:function(e,t,n){var i,r,a=this,s="",l=null!=a.lockedContent,c={rowTemplate:a.rowTemplate,altRowTemplate:a.altRowTemplate,groupFooterTemplate:a.groupFooterTemplate};if(t=l?t-H(B(a.columns)).length:t,n>0)for(t=l?t-n:t,a.detailTemplate&&t++,a.groupFooterTemplate&&(a._groupAggregatesDefaultObject=o(a.dataSource.aggregate())),i=0,r=e.length;r>i;i++)s+=a._groupRowHtml(e[i],t,0,l?ht:ut,c,l);else s+=a._rowsHtml(e,c);a.tbody=U(a.tbody,a.table,s)},_renderLockedContent:function(e,t,n){var i,r,o,a="",s={rowTemplate:this.lockedRowTemplate,altRowTemplate:this.lockedAltRowTemplate,groupFooterTemplate:this.lockedGroupFooterTemplate};if(this.lockedContent){if(o=this.lockedTable,n>0)for(t-=g(L(z(this.columns))).length,i=0,r=e.length;r>i;i++)a+=this._groupRowHtml(e[i],t,0,ut,s);else a=this._rowsHtml(e,s);U(o.children("tbody"),o,a),this._syncLockedContentHeight()}},_adjustRowsHeight:function(e,t){var n,i,r,o,a=e[0].rows,s=a.length,l=t[0].rows,c=e.add(t),d=c.length,u=[];for(n=0;s>n&&l[n];n++)a[n].style.height&&(a[n].style.height=l[n].style.height=""),i=a[n].offsetHeight,r=l[n].offsetHeight,o=0,i>r?o=i:r>i&&(o=r),u.push(o);for(n=0;d>n;n++)c[n].style.display="none";for(n=0;s>n;n++)u[n]&&(a[n].style.height=l[n].style.height=u[n]+1+"px");for(n=0;d>n;n++)c[n].style.display=""}});pt.ExcelMixin&&pt.ExcelMixin.extend(Dn.prototype),pt.PDFMixin&&pt.PDFMixin.extend(Dn.prototype),ft.plugin(Dn),ft.plugin(Tn)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i="change",r="cancel",o="dataBound",a="dataBinding",s=n.ui.Widget,l=n.keys,c=">*",d="progress",u="error",h="k-state-focused",p="k-state-selected",f="k-edit-item",g="edit",m="remove",v="save",_="click",w=".kendoListView",y=e.proxy,b=n._activeElement,k=n.ui.progress,x=n.data.DataSource,C=n.ui.DataBoundWidget.extend({init:function(t,i){var r=this;i=e.isArray(i)?{dataSource:i}:i,s.fn.init.call(r,t,i),i=r.options,r.wrapper=t=r.element,t[0].id&&(r._itemId=t[0].id+"_lv_active"),r._element(),r._dataSource(),r._templates(),r._navigatable(),r._selectable(),r._pageable(),r._crudHandlers(),r.options.autoBind&&r.dataSource.fetch(),n.notify(r)},events:[i,r,a,o,g,m,v],options:{name:"ListView",autoBind:!0,selectable:!1,navigatable:!1,template:"",altTemplate:"",editTemplate:""},setOptions:function(e){s.fn.setOptions.call(this,e),this._templates()},_templates:function(){var e=this.options;this.template=n.template(e.template||""),this.altTemplate=n.template(e.altTemplate||e.template),this.editTemplate=n.template(e.editTemplate||"")
},_item:function(e){return this.element.children()[e]()},items:function(){return this.element.children()},dataItem:function(t){var i=n.attr("uid"),r=e(t).closest("["+i+"]").attr(i);return this.dataSource.getByUid(r)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&e.fetch()},_unbindDataSource:function(){var e=this;e.dataSource.unbind(i,e._refreshHandler).unbind(d,e._progressHandler).unbind(u,e._errorHandler)},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=y(e.refresh,e),e._progressHandler=y(e._progress,e),e._errorHandler=y(e._error,e)),e.dataSource=x.create(e.options.dataSource).bind(i,e._refreshHandler).bind(d,e._progressHandler).bind(u,e._errorHandler)},_progress:function(){k(this.element,!0)},_error:function(){k(this.element,!1)},_element:function(){this.element.addClass("k-widget k-listview").attr("role","listbox")},refresh:function(e){var i,r,s,l,c,d=this,u=d.dataSource.view(),h="",p=d.template,f=d.altTemplate,g=b();if(e=e||{},"itemchange"===e.action)return d._hasBindingTarget()||d.editable||(i=e.items[0],s=d.items().filter("["+n.attr("uid")+"="+i.uid+"]"),s.length>0&&(l=s.index(),d.angular("cleanup",function(){return{elements:[s]}}),s.replaceWith(p(i)),s=d.items().eq(l),s.attr(n.attr("uid"),i.uid),d.angular("compile",function(){return{elements:[s],data:[{dataItem:i}]}}),d.trigger("itemChange",{item:s,data:i}))),t;if(!d.trigger(a,{action:e.action||"rebind",items:e.items,index:e.index})){for(d._angularItems("cleanup"),d._destroyEditable(),l=0,c=u.length;c>l;l++)h+=l%2?f(u[l]):p(u[l]);for(d.element.html(h),r=d.items(),l=0,c=u.length;c>l;l++)r.eq(l).attr(n.attr("uid"),u[l].uid).attr("role","option").attr("aria-selected","false");d.element[0]===g&&d.options.navigatable&&d.current(r.eq(0)),d._angularItems("compile"),d.trigger(o)}},_pageable:function(){var t,i,r=this,o=r.options.pageable;e.isPlainObject(o)&&(i=o.pagerId,t=e.extend({},o,{dataSource:r.dataSource,pagerId:null}),r.pager=new n.ui.Pager(e("#"+i),t))},_selectable:function(){var e,r,o=this,a=o.options.selectable,s=o.options.navigatable;a&&(e=n.ui.Selectable.parseOptions(a).multiple,o.selectable=new n.ui.Selectable(o.element,{aria:!0,multiple:e,filter:c,change:function(){o.trigger(i)}}),s&&o.element.on("keydown"+w,function(n){if(n.keyCode===l.SPACEBAR){if(r=o.current(),n.target==n.currentTarget&&n.preventDefault(),e)if(n.ctrlKey){if(r&&r.hasClass(p))return r.removeClass(p),t}else o.selectable.clear();else o.selectable.clear();o.selectable.value(r)}}))},current:function(e){var n=this,i=n.element,r=n._current,o=n._itemId;return e===t?r:(r&&r[0]&&(r[0].id===o&&r.removeAttr("id"),r.removeClass(h),i.removeAttr("aria-activedescendant")),e&&e[0]&&(o=e[0].id||o,n._scrollTo(e[0]),i.attr("aria-activedescendant",o),e.addClass(h).attr("id",o)),n._current=e,t)},_scrollTo:function(t){var n,i,r=this,o=!1,a="scroll";"auto"==r.wrapper.css("overflow")||r.wrapper.css("overflow")==a?n=r.wrapper[0]:(n=window,o=!0),i=function(i,r){var s=o?e(t).offset()[i.toLowerCase()]:t["offset"+i],l=t["client"+r],c=e(n)[a+i](),d=e(n)[r.toLowerCase()]();s+l>c+d?e(n)[a+i](s+l-d):c>s&&e(n)[a+i](s)},i("Top","Height"),i("Left","Width")},_navigatable:function(){var t=this,i=t.options.navigatable,r=t.element,o=function(n){t.current(e(n.currentTarget)),e(n.target).is(":button,a,:input,a>.k-icon,textarea")||r.focus()};i&&(t._tabindex(),r.on("focus"+w,function(){var e=t._current;e&&e.is(":visible")||(e=t._item("first")),t.current(e)}).on("focusout"+w,function(){t._current&&t._current.removeClass(h)}).on("keydown"+w,function(i){var o,a,s=i.keyCode,c=t.current(),d=e(i.target),u=!d.is(":button,textarea,a,a>.t-icon,input"),h=d.is(":text"),p=n.preventDefault,g=r.find("."+f),m=b();if(!(!u&&!h&&l.ESC!=s||h&&l.ESC!=s&&l.ENTER!=s))if(l.UP===s||l.LEFT===s)c&&(c=c.prev()),t.current(c&&c[0]?c:t._item("last")),p(i);else if(l.DOWN===s||l.RIGHT===s)c&&(c=c.next()),t.current(c&&c[0]?c:t._item("first")),p(i);else if(l.PAGEUP===s)t.current(null),t.dataSource.page(t.dataSource.page()-1),p(i);else if(l.PAGEDOWN===s)t.current(null),t.dataSource.page(t.dataSource.page()+1),p(i);else if(l.HOME===s)t.current(t._item("first")),p(i);else if(l.END===s)t.current(t._item("last")),p(i);else if(l.ENTER===s)0!==g.length&&(u||h)?(o=t.items().index(g),m&&m.blur(),t.save(),a=function(){t.element.trigger("focus"),t.current(t.items().eq(o))},t.one("dataBound",a)):""!==t.options.editTemplate&&t.edit(c);else if(l.ESC===s){if(g=r.find("."+f),0===g.length)return;o=t.items().index(g),t.cancel(),t.element.trigger("focus"),t.current(t.items().eq(o))}}),r.on("mousedown"+w+" touchstart"+w,c,y(o,t)))},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger(i)},select:function(n){var i=this,r=i.selectable;return n=e(n),n.length?(r.options.multiple||(r.clear(),n=n.first()),r.value(n),t):r.value()},_destroyEditable:function(){var e=this;e.editable&&(e.editable.destroy(),delete e.editable)},_modelFromElement:function(e){var t=e.attr(n.attr("uid"));return this.dataSource.getByUid(t)},_closeEditable:function(e){var t,i,r,o=this,a=o.editable,s=o.template,l=!0;return a&&(e&&(l=a.end()),l&&(a.element.index()%2&&(s=o.altTemplate),t=o._modelFromElement(a.element),o._destroyEditable(),r=a.element.index(),a.element.replaceWith(s(t)),i=o.items().eq(r),i.attr(n.attr("uid"),t.uid),o._hasBindingTarget()&&n.bind(i,t))),l},edit:function(e){var t,i,r=this,o=r._modelFromElement(e),a=o.uid;r.cancel(),e=r.items().filter("["+n.attr("uid")+"="+a+"]"),i=e.index(),e.replaceWith(r.editTemplate(o)),t=r.items().eq(i).addClass(f).attr(n.attr("uid"),o.uid),r.editable=t.kendoEditable({model:o,clearContainer:!1,errorTemplate:!1,target:r}).data("kendoEditable"),r.trigger(g,{model:o,item:t})},save:function(){var e,t=this,n=t.editable;n&&(n=n.element,e=t._modelFromElement(n),!t.trigger(v,{model:e,item:n})&&t._closeEditable(!0)&&t.dataSource.sync())},remove:function(e){var t=this,n=t.dataSource,i=t._modelFromElement(e);t.trigger(m,{model:i,item:e})||(e.hide(),n.remove(i),n.sync())},add:function(){var e=this,t=e.dataSource,n=t.indexOf((t.view()||[])[0]);0>n&&(n=0),e.cancel(),t.insert(n,{}),e.edit(e.element.children().first())},cancel:function(){var e,t,n=this,i=n.dataSource;n.editable&&(e=n.editable.element,t=n._modelFromElement(e),n.trigger(r,{model:t,container:e})||(i.cancelChanges(t),n._closeEditable(!1)))},_crudHandlers:function(){var t=this,i=_+w;t.element.on(i,".k-edit-button",function(i){var r=e(this).closest("["+n.attr("uid")+"]");t.edit(r),i.preventDefault()}),t.element.on(i,".k-delete-button",function(i){var r=e(this).closest("["+n.attr("uid")+"]");t.remove(r),i.preventDefault()}),t.element.on(i,".k-update-button",function(e){t.save(),e.preventDefault()}),t.element.on(i,".k-cancel-button",function(e){t.cancel(),e.preventDefault()})},destroy:function(){var e=this;s.fn.destroy.call(e),e._unbindDataSource(),e._destroyEditable(),e.element.off(w),e.pager&&e.pager.destroy(),n.destroy(e.element)}});n.ui.plugin(C)}(window.kendo.jQuery),function(e,t){function n(t){return e.map(i(t),function(e){return e.name}).join(", ")}function i(e){var t=e[0];return t.files?r(t.files):[{name:s(t.value),extension:a(t.value),size:null}]}function r(t){return e.map(t,function(e){return o(e)})}function o(e){var t=e.name||e.fileName;return{name:w.htmlEncode(t),extension:a(t),size:e.size||e.fileSize,rawFile:e}}function a(e){var t=e.match(x);return t?t[0]:""}function s(e){var t=e.lastIndexOf("\\");return-1!=t?e.substr(t+1):e}function l(t,n){var i=w.guid();return e.map(t,function(e){return e.uid=n?w.guid():i,e})}function c(t){return!t.multiple&&e(".k-file",t.wrapper).length>1}function d(n,i,r){var o,a;return i._supportsRemove()?(o=n.data("fileNames"),a=e.map(o,function(e){return e.name}),i._submitRemove(a,r,function(e,t,r){i._removeFileEntry(n),i.trigger(D,{operation:"remove",files:o,response:e,XMLHttpRequest:r})},function(e){c(i)&&i._removeFileEntry(n),i.trigger(A,{operation:"remove",files:o,XMLHttpRequest:e}),k("Server response: "+e.responseText)}),t):(c(i)&&i._removeFileEntry(n),t)}function u(t,n,i){var r=!1,o="";try{o=e.parseJSON(h(t)),r=!0}catch(a){i()}r&&n(o)}function h(e){return(t===e||""===e)&&(e="{}"),e}function p(e){e.stopPropagation(),e.preventDefault()}function f(e,t,n,i){var r,o;e.on("dragenter"+t,function(){n(),o=new Date,r||(r=setInterval(function(){var e=new Date-o;e>100&&(i(),clearInterval(r),r=null)},100))}).on("dragover"+t,function(){o=new Date})}function g(e){return e.is(".k-file-progress, .k-file-success, .k-file-error")}function m(t){return e(t.target).closest(".k-file")}var v,_,w=window.kendo,y=w.ui.Widget,b=w.antiForgeryTokens,k=w.logToConsole,x=/\.([^\.]+)$/,C=".kendoUpload",T="select",S="upload",D="success",A="error",E="complete",I="cancel",P="progress",M="remove",F=y.extend({init:function(t,n){var i,r,o,a=this;y.fn.init.call(a,t,n),a.name=t.name,a.multiple=a.options.multiple,a.localization=a.options.localization,i=a.element,a.wrapper=i.closest(".k-upload"),0===a.wrapper.length&&(a.wrapper=a._wrapInput(i)),a._activeInput(i),a.toggle(a.options.enabled),r=a._ns=C+"-"+w.guid(),i.closest("form").on("submit"+r,e.proxy(a._onParentFormSubmit,a)).on("reset"+r,e.proxy(a._onParentFormReset,a)),a.options.async.saveUrl?(a._module=a._supportsFormData()?new _(a):new v(a),a._async=!0,o=a.options.files,o.length>0&&a._renderInitialFiles(o)):a._module=new z(a),a._supportsDrop()&&a._setupDropZone(),a.wrapper.on("click",".k-upload-action",e.proxy(a._onFileAction,a)).on("click",".k-upload-selected",e.proxy(a._onUploadSelected,a)),a.element.val()&&a._onInputChange({target:a.element})},events:[T,S,D,A,E,I,P,M],options:{name:"Upload",enabled:!0,multiple:!0,showFileList:!0,template:"",files:[],async:{removeVerb:"POST",autoUpload:!0,withCredentials:!0},localization:{select:"Select files...",cancel:"Cancel",retry:"Retry",remove:"Remove",uploadSelectedFiles:"Upload files",dropFilesHere:"drop files here to upload",statusUploading:"uploading",statusUploaded:"uploaded",statusWarning:"warning",statusFailed:"failed",headerStatusUploading:"Uploading...",headerStatusUploaded:"Done"}},setOptions:function(e){var t=this,n=t.element;y.fn.setOptions.call(t,e),t.multiple=t.options.multiple,n.attr("multiple",t._supportsMultiple()?t.multiple:!1),t.toggle(t.options.enabled)},enable:function(e){e=t===e?!0:e,this.toggle(e)},disable:function(){this.toggle(!1)},toggle:function(e){e=t===e?e:!e,this.wrapper.toggleClass("k-state-disabled",e),this.element.prop("disabled",e)},destroy:function(){var t=this;e(document).add(e(".k-dropzone",t.wrapper)).add(t.wrapper.closest("form")).off(t._ns),e(t.element).off(C),y.fn.destroy.call(t)},_addInput:function(t){if(t[0].nodeType){var n=this,i=t.clone().val("");i.insertAfter(n.element).data("kendoUpload",n),e(n.element).hide().attr("tabindex","-1").removeAttr("id").off(C),n._activeInput(i),n.element.focus()}},_activeInput:function(t){var n=this,i=n.wrapper;n.element=t,t.attr("multiple",n._supportsMultiple()?n.multiple:!1).attr("autocomplete","off").on("click"+C,function(e){i.hasClass("k-state-disabled")&&e.preventDefault()}).on("focus"+C,function(){e(this).parent().addClass("k-state-focused")}).on("blur"+C,function(){e(this).parent().removeClass("k-state-focused")}).on("change"+C,e.proxy(n._onInputChange,n)).on("keydown"+C,e.proxy(n._onInputKeyDown,n))},_onInputKeyDown:function(e){var t=this,n=t.wrapper.find(".k-upload-action:first");e.keyCode===w.keys.TAB&&n.length>0&&(e.preventDefault(),n.focus())},_onInputChange:function(t){var n=this,i=e(t.target),r=l(n._inputFiles(i),n._isAsyncNonBatch()),o=n.trigger(T,{files:r});o?(n._addInput(i),i.remove()):n._module.onSelect({target:i},r)},_onDrop:function(t){var n,i=t.originalEvent.dataTransfer,o=this,a=i.files,s=l(r(a),o._isAsyncNonBatch());p(t),a.length>0&&(!o.multiple&&s.length>1&&s.splice(1,s.length-1),n=o.trigger(T,{files:s}),n||o._module.onSelect({target:e(".k-dropzone",o.wrapper)},s))},_isAsyncNonBatch:function(){return this._async&&!this.options.async.batch||!1},_renderInitialFiles:function(t){var n,i,r=this,o=0;for(t=l(t,!0),o=0;t.length>o;o++)n=t[o],i=r._enqueueFile(n.name,{fileNames:[n]}),i.addClass("k-file-success").data("files",[t[o]]),e(".k-progress",i).width("100%"),e(".k-upload-status",i).prepend("<span class='k-upload-pct'>100%</span>"),r._supportsRemove()&&r._fileAction(i,M)},_prepareTemplateData:function(e,t){var n=t.fileNames,i={},r=0,o=0;for(o=0;n.length>o;o++)r+=n[o].size;return i.name=e,i.size=r,i.files=t.fileNames,i},_prepareDefaultFileEntryTemplate:function(t,n){var i="",r=e("<li class='k-file'><span class='k-progress'></span><span class='k-icon'></span><span class='k-filename' title='"+t+"'>"+t+"</span><strong class='k-upload-status'></strong></li>");return 1==n.fileNames.length&&n.fileNames[0].extension&&(i=n.fileNames[0].extension.substring(1),e(".k-icon",r).addClass("k-i-"+i)),r},_enqueueFile:function(t,n){var i,r,o,a=this,s=n.fileNames[0].uid,l=e(".k-upload-files",a.wrapper),c=a.options,d=c.template;return 0===l.length&&(l=e("<ul class='k-upload-files k-reset'></ul>").appendTo(a.wrapper),a.options.showFileList||l.hide(),a.wrapper.removeClass("k-upload-empty")),i=e(".k-file",l),d?(o=a._prepareTemplateData(t,n),d=w.template(d),r=e("<li class='k-file'>"+d(o)+"</li>"),r.find(".k-upload-action").addClass("k-button k-button-bare"),a.angular("compile",function(){return{elements:r,data:[o]}})):r=a._prepareDefaultFileEntryTemplate(t,n),r.attr(w.attr("uid"),s).appendTo(l).data(n),a._async||e(".k-progress",r).width("100%"),!a.multiple&&i.length>0&&(a.trigger(M,{files:i.data("fileNames")})||a._module.onRemove({target:e(i,a.wrapper)})),r},_removeFileEntry:function(t){var n,i,r=this,o=t.closest(".k-upload-files");t.remove(),n=e(".k-file",o),i=e(".k-file-success, .k-file-error",o),i.length===n.length&&this._hideUploadButton(),0===n.length&&(o.remove(),r.wrapper.addClass("k-upload-empty"),r._hideHeaderUploadstatus())},_fileAction:function(e,t){var n={remove:"k-delete",cancel:"k-cancel",retry:"k-retry"},i={remove:"k-i-close",cancel:"k-i-close",retry:"k-i-refresh"};n.hasOwnProperty(t)&&(this._clearFileAction(e),this.options.template?e.find(".k-upload-action").addClass("k-button k-button-bare").append("<span class='k-icon "+i[t]+" "+n[t]+"' title='"+this.localization[t]+"'></span>").show():(e.find(".k-upload-status .k-upload-action").remove(),e.find(".k-upload-status").append(this._renderAction(n[t],this.localization[t],i[t]))))},_fileState:function(t,n){var i=this.localization,r={uploading:{text:i.statusUploading},uploaded:{text:i.statusUploaded},failed:{text:i.statusFailed}},o=r[n];o&&e(".k-icon:not(.k-delete, .k-cancel, .k-retry)",t).text(o.text)},_renderAction:function(t,n,i){return e(""!==t?"<button type='button' class='k-button k-button-bare k-upload-action'><span class='k-icon "+i+" "+t+"' title='"+n+"'></span></button>":"<button type='button' class='k-button'>"+n+"</button>")},_clearFileAction:function(t){e(".k-upload-action",t).empty().hide()},_onFileAction:function(t){var n,i,r,o,a=this;return a.wrapper.hasClass("k-state-disabled")||(n=e(t.target).closest(".k-upload-action"),i=n.find(".k-icon"),r=n.closest(".k-file"),o={files:r.data("fileNames")},i.hasClass("k-delete")?a.trigger(M,o)||a._module.onRemove({target:e(r,a.wrapper)},o.data):i.hasClass("k-cancel")?(a.trigger(I,o),a._module.onCancel({target:e(r,a.wrapper)}),this._checkAllComplete(),a._updateHeaderUploadStatus()):i.hasClass("k-retry")&&(e(".k-warning",r).remove(),a._module.onRetry({target:e(r,a.wrapper)}))),!1},_onUploadSelected:function(){var e=this,t=e.wrapper;return t.hasClass("k-state-disabled")||this._module.onSaveSelected(),!1},_onFileProgress:function(t,n){var i;this.options.template?e(".k-progress",t.target).width(n+"%"):(i=e(".k-upload-pct",t.target),0===i.length&&e(".k-upload-status",t.target).prepend("<span class='k-upload-pct'></span>"),e(".k-upload-pct",t.target).text(n+"%"),e(".k-progress",t.target).width(n+"%")),this.trigger(P,{files:m(t).data("fileNames"),percentComplete:n})},_onUploadSuccess:function(e,t,n){var i=m(e);this._fileState(i,"uploaded"),i.removeClass("k-file-progress").addClass("k-file-success"),this._updateHeaderUploadStatus(),this.trigger(D,{files:i.data("fileNames"),response:t,operation:"upload",XMLHttpRequest:n}),this._supportsRemove()?this._fileAction(i,M):this._clearFileAction(i),this._checkAllComplete()},_onUploadError:function(t,n){var i=m(t),r=e(".k-upload-pct",i);this._fileState(i,"failed"),i.removeClass("k-file-progress").addClass("k-file-error"),e(".k-progress",i).width("100%"),r.length>0?r.empty().removeClass("k-upload-pct").addClass("k-icon k-warning"):e(".k-upload-status",i).prepend("<span class='k-icon k-warning'></span>"),this._updateHeaderUploadStatus(),this._fileAction(i,"retry"),this.trigger(A,{operation:"upload",files:i.data("fileNames"),XMLHttpRequest:n}),k("Server response: "+n.responseText),this._checkAllComplete()},_showUploadButton:function(){var t=e(".k-upload-selected",this.wrapper);0===t.length&&(t=this._renderAction("",this.localization.uploadSelectedFiles).addClass("k-upload-selected")),this.wrapper.append(t)},_hideUploadButton:function(){e(".k-upload-selected",this.wrapper).remove()},_showHeaderUploadStatus:function(){var t=this.localization,n=e(".k-dropzone",this.wrapper),i=e(".k-upload-status-total",this.wrapper);0!==i.length&&i.remove(),i='<strong class="k-upload-status k-upload-status-total">'+t.headerStatusUploading+'<span class="k-icon k-loading">'+t.statusUploading+"</span></strong>",n.length>0?n.append(i):e(".k-upload-button",this.wrapper).after(i)},_updateHeaderUploadStatus:function(){var t,n,i,r=this,o=r.localization,a=e(".k-file",r.wrapper).not(".k-file-success, .k-file-error");0===a.length&&(t=e(".k-file.k-file-error",r.wrapper),n=e(".k-upload-status-total",r.wrapper),i=e(".k-icon",n).removeClass("k-loading").addClass(0!==t.length?"k-warning":"k-i-tick").text(0!==t.length?o.statusWarning:o.statusUploaded),n.text(r.localization.headerStatusUploaded).append(i))},_hideHeaderUploadstatus:function(){e(".k-upload-status-total",this.wrapper).remove()},_onParentFormSubmit:function(){var n,i=this,r=i.element;t!==this._module.onAbort&&this._module.onAbort(),r.value||(n=e(r),n.attr("disabled","disabled"),window.setTimeout(function(){n.removeAttr("disabled")},0))},_onParentFormReset:function(){e(".k-upload-files",this.wrapper).remove()},_supportsFormData:function(){return"undefined"!=typeof FormData},_supportsMultiple:function(){var e=this._userAgent().indexOf("Windows")>-1;return!(w.support.browser.opera||w.support.browser.safari&&e)},_supportsDrop:function(){var e=this._userAgent().toLowerCase(),t=/chrome/.test(e),n=!t&&/safari/.test(e),i=n&&/windows/.test(e);return!i&&this._supportsFormData()&&this.options.async.saveUrl},_userAgent:function(){return navigator.userAgent},_setupDropZone:function(){var t,n,i=this;e(".k-upload-button",this.wrapper).wrap("<div class='k-dropzone'></div>"),t=i._ns,n=e(".k-dropzone",i.wrapper).append(e("<em>"+i.localization.dropFilesHere+"</em>")).on("dragenter"+t,p).on("dragover"+t,function(e){e.preventDefault()}).on("drop"+t,e.proxy(this._onDrop,this)),f(n,t,function(){n.addClass("k-dropzone-hovered")},function(){n.removeClass("k-dropzone-hovered")}),f(e(document),t,function(){n.addClass("k-dropzone-active"),n.closest(".k-upload").removeClass("k-upload-empty")},function(){n.removeClass("k-dropzone-active"),0===e("li.k-file",n.closest(".k-upload")).length&&n.closest(".k-upload").addClass("k-upload-empty")})},_supportsRemove:function(){return!!this.options.async.removeUrl},_submitRemove:function(t,n,i,r){var o=this,a=o.options.async.removeField||"fileNames",s=e.extend(n,b());s[a]=t,jQuery.ajax({type:this.options.async.removeVerb,dataType:"json",dataFilter:h,url:this.options.async.removeUrl,traditional:!0,data:s,success:i,error:r})},_wrapInput:function(e){var t=this,n=t.options;return e.wrap("<div class='k-widget k-upload k-header'><div class='k-button k-upload-button'></div></div>"),n.async.saveUrl||e.closest(".k-upload").addClass("k-upload-sync"),e.closest(".k-upload").addClass("k-upload-empty"),e.closest(".k-button").append("<span>"+this.localization.select+"</span>"),e.closest(".k-upload")},_checkAllComplete:function(){0===e(".k-file.k-file-progress",this.wrapper).length&&this.trigger(E)},_inputFiles:function(e){return i(e)}}),z=function(e){this.name="syncUploadModule",this.element=e.wrapper,this.upload=e,this.element.closest("form").attr("enctype","multipart/form-data").attr("encoding","multipart/form-data")};z.prototype={onSelect:function(t,i){var r,o=this.upload,a=e(t.target);o._addInput(a),r=o._enqueueFile(n(a),{relatedInput:a,fileNames:i}),o._fileAction(r,M)},onRemove:function(e){var t=m(e);t.data("relatedInput").remove(),this.upload._removeFileEntry(t)}},v=function(e){this.name="iframeUploadModule",this.element=e.wrapper,this.upload=e,this.iframes=[]},F._frameId=0,v.prototype={onSelect:function(t,n){var i=this.upload,r=e(t.target),o=this.prepareUpload(r,n);i.options.async.autoUpload?this.performUpload(o):(i._supportsRemove()&&this.upload._fileAction(o,M),i._showUploadButton())},prepareUpload:function(t,i){var r,o,a,s=this.upload,l=e(s.element),c=s.options.async.saveField||t.attr("name");return s._addInput(t),t.attr("name",c),r=this.createFrame(s.name+"_"+F._frameId++),this.registerFrame(r),o=this.createForm(s.options.async.saveUrl,r.attr("name")).append(l),a=s._enqueueFile(n(t),{frame:r,relatedInput:l,fileNames:i}),r.data({form:o,file:a}),a},performUpload:function(t){var n,i,r,o={files:t.data("fileNames")},a=t.data("frame"),s=this.upload;if(s.trigger(S,o))s._removeFileEntry(a.data("file")),this.cleanupFrame(a),this.unregisterFrame(a);else{s._hideUploadButton(),s._showHeaderUploadStatus(),a.appendTo(document.body),n=a.data("form").attr("action",s.options.async.saveUrl).appendTo(document.body),o.data=e.extend({},o.data,b());for(i in o.data)r=n.find("input[name='"+i+"']"),0===r.length&&(r=e("<input>",{type:"hidden",name:i}).prependTo(n)),r.val(o.data[i]);s._fileAction(t,I),s._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),a.one("load",e.proxy(this.onIframeLoad,this)),n[0].submit()}},onSaveSelected:function(){var t=this;e(".k-file",this.element).each(function(){var n=e(this),i=g(n);i||t.performUpload(n)})},onIframeLoad:function(t){var n,i=e(t.target);try{n=i.contents().text()}catch(r){n="Error trying to get server response: "+r}this.processResponse(i,n)},processResponse:function(t,n){var i=t.data("file"),r=this,o={responseText:n};u(n,function(n){e.extend(o,{statusText:"OK",status:"200"}),r.upload._onFileProgress({target:e(i,r.upload.wrapper)},100),r.upload._onUploadSuccess({target:e(i,r.upload.wrapper)},n,o),r.cleanupFrame(t),r.unregisterFrame(t)},function(){e.extend(o,{statusText:"error",status:"500"}),r.upload._onUploadError({target:e(i,r.upload.wrapper)},o)})},onCancel:function(t){var n=e(t.target).data("frame");this.stopFrameSubmit(n),this.cleanupFrame(n),this.unregisterFrame(n),this.upload._removeFileEntry(n.data("file"))},onRetry:function(e){var t=m(e);this.performUpload(t)},onRemove:function(e,t){var n=m(e),i=n.data("frame");i?(this.unregisterFrame(i),this.upload._removeFileEntry(n),this.cleanupFrame(i)):d(n,this.upload,t)},onAbort:function(){var t=this.element,n=this;e.each(this.iframes,function(){e("input",this.data("form")).appendTo(t),n.stopFrameSubmit(this[0]),this.data("form").remove(),this.remove()}),this.iframes=[]},createFrame:function(t){return e("<iframe name='"+t+"' id='"+t+"' style='display:none;' />")},createForm:function(t,n){return e("<form enctype='multipart/form-data' method='POST' action='"+t+"' target='"+n+"'/>")},stopFrameSubmit:function(e){t!==e.stop?e.stop():e.document&&e.document.execCommand("Stop")},registerFrame:function(e){this.iframes.push(e)},unregisterFrame:function(t){this.iframes=e.grep(this.iframes,function(e){return e.attr("name")!=t.attr("name")})},cleanupFrame:function(e){var t=e.data("form");e.data("file").data("frame",null),setTimeout(function(){t.remove(),e.remove()},1)}},_=function(e){this.name="formDataUploadModule",this.element=e.wrapper,this.upload=e},_.prototype={onSelect:function(t,n){var i=this.upload,r=this,o=e(t.target),a=this.prepareUpload(o,n);e.each(a,function(){i.options.async.autoUpload?r.performUpload(this):(i._supportsRemove()&&i._fileAction(this,M),i._showUploadButton())})},prepareUpload:function(t,n){var i=this.enqueueFiles(n);return t.is("input")&&(e.each(i,function(){e(this).data("relatedInput",t)}),t.data("relatedFileEntries",i),this.upload._addInput(t)),i},enqueueFiles:function(t){var n,i,r,o,a=this.upload,s=t.length,l=[];if(a.options.async.batch===!0)n=e.map(t,function(e){return e.name}).join(", "),o=a._enqueueFile(n,{fileNames:t}),o.data("files",t),l.push(o);else for(i=0;s>i;i++)r=t[i],n=r.name,o=a._enqueueFile(n,{fileNames:[r]}),o.data("files",[r]),l.push(o);return l},performUpload:function(t){var n,i=this.upload,r=this.createFormData(),o=this.createXHR(),a={files:t.data("fileNames"),XMLHttpRequest:o};if(i.trigger(S,a))this.removeFileEntry(t);else{i._fileAction(t,I),i._hideUploadButton(),i._showHeaderUploadStatus(),a.data=e.extend({},a.data,b());for(n in a.data)r.append(n,a.data[n]);this.populateFormData(r,t.data("files")),i._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),this.postFormData(i.options.async.saveUrl,r,t,o)}},onSaveSelected:function(){var t=this;e(".k-file",this.element).each(function(){var n=e(this),i=g(n);i||t.performUpload(n)})},onCancel:function(e){var t=m(e);this.stopUploadRequest(t),this.removeFileEntry(t)},onRetry:function(e){var t=m(e);this.performUpload(t)},onRemove:function(e,t){var n=m(e);n.hasClass("k-file-success")?d(n,this.upload,t):this.removeFileEntry(n)},createXHR:function(){return new XMLHttpRequest},postFormData:function(e,t,n,i){var r=this;n.data("request",i),i.addEventListener("load",function(e){r.onRequestSuccess.call(r,e,n)},!1),i.addEventListener(A,function(e){r.onRequestError.call(r,e,n)},!1),i.upload.addEventListener("progress",function(e){r.onRequestProgress.call(r,e,n)},!1),i.open("POST",e,!0),i.withCredentials=this.upload.options.async.withCredentials,i.send(t)},createFormData:function(){return new FormData},populateFormData:function(e,t){var n,i=this.upload,r=t.length;for(n=0;r>n;n++)e.append(i.options.async.saveField||i.name,t[n].rawFile);return e},onRequestSuccess:function(t,n){function i(){o.upload._onUploadError({target:e(n,o.upload.wrapper)},r)}var r=t.target,o=this;r.status>=200&&299>=r.status?u(r.responseText,function(t){o.upload._onFileProgress({target:e(n,o.upload.wrapper)},100),o.upload._onUploadSuccess({target:e(n,o.upload.wrapper)},t,r),o.cleanupFileEntry(n)},i):i()},onRequestError:function(t,n){var i=t.target;this.upload._onUploadError({target:e(n,this.upload.wrapper)},i)},cleanupFileEntry:function(t){var n=t.data("relatedInput"),i=!0;n&&(e.each(n.data("relatedFileEntries")||[],function(){this.parent().length>0&&this[0]!=t[0]&&(i=i&&this.hasClass("k-file-success"))}),i&&n.remove())},removeFileEntry:function(e){this.cleanupFileEntry(e),this.upload._removeFileEntry(e)},onRequestProgress:function(t,n){var i=Math.round(100*t.loaded/t.total);this.upload._onFileProgress({target:e(n,this.upload.wrapper)},i)},stopUploadRequest:function(e){e.data("request").abort()}},w.ui.plugin(F)}(window.kendo.jQuery),function(e,t){function n(e,t,n){var i,r;e.on("dragenter"+x,function(){t(),r=new Date,i||(i=setInterval(function(){var e=new Date-r;e>100&&(n(),clearInterval(i),i=null)},100))}).on("dragover"+x,function(){r=new Date})}function i(e,n){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+n}function r(e){if(!e)return"";var t=" bytes";return e>=1073741824?(t=" GB",e/=1073741824):e>=1048576?(t=" MB",e/=1048576):e>=1024&&(t=" KB",e/=1024),Math.round(100*e)/100+t}function o(e,t){var n=e[t];return h(n)?n.from||n.field||t:n}var a,s,l,c,d=window.kendo,u=d.ui.Widget,h=e.isPlainObject,p=e.proxy,f=e.extend,g=d.support.placeholder,m=d.support.browser,v=d.isFunction,_=/(^\/|\/$)/g,w="change",y="apply",b="error",k="click",x=".kendoFileBrowser",C=".kendoBreadcrumbs",T=".kendoSearchBox",S="name",D="size",A="type",E={field:A,dir:"asc"},I=d.template('<li class="k-tile-empty"><strong>${text}</strong></li>'),P='<div class="k-widget k-filebrowser-toolbar k-header k-floatwrap"><div class="k-toolbar-wrap"># if (showUpload) { # <div class="k-widget k-upload"><div class="k-button k-button-icontext k-upload-button"><span class="k-icon k-add"></span>#=messages.uploadFile#<input type="file" name="file" /></div></div># } ## if (showCreate) { #<button type="button" class="k-button k-button-icon"><span class="k-icon k-addfolder" /></button># } ## if (showDelete) { #<button type="button" class="k-button k-button-icon k-state-disabled"><span class="k-icon k-delete" /></button>&nbsp;# } #</div><div class="k-tiles-arrange"><label>#=messages.orderBy#: <select /></label></a></div></div>';f(!0,d.data,{schemas:{filebrowser:{data:function(e){return e.items||e||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}}),f(!0,d.data,{transports:{filebrowser:d.data.RemoteTransport.extend({init:function(t){d.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,n){n.data=e.extend({},n.data,{path:this.options.path()}),v(this.options[t])?this.options[t].call(this,n):d.data.RemoteTransport.fn[t].call(this,n)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}}),a=m.msie&&8>m.version?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()},s=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),n.element.addClass("k-filebrowser"),n.element.on(k+x,".k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-delete)",p(n._deleteClick,n)).on(k+x,".k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-addfolder)",p(n._addClick,n)).on("keydown"+x,"li.k-state-selected input",p(n._directoryKeyDown,n)).on("blur"+x,"li.k-state-selected input",p(n._directoryBlur,n)),n._dataSource(),n.refresh(),n.path(n.options.path)},options:{name:"FileBrowser",messages:{uploadFile:"Upload",orderBy:"Arrange by",orderByName:"Name",orderBySize:"Size",directoryNotFound:"A directory with this name was not found.",emptyFolder:"Empty Folder",deleteFile:'Are you sure you want to delete "{0}"?',invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',dropFilesHere:"drop file here to upload",search:"Search"},transport:{},path:"/",fileTypes:"*.*"},events:[b,w,y],destroy:function(){var e=this;u.fn.destroy.call(e),e.dataSource.unbind(b,e._errorHandler),e.element.add(e.list).add(e.toolbar).off(x),d.destroy(e.element)},value:function(){var e,n=this,r=n._selectedItem(),o=n.options.transport.fileUrl;return r&&"f"===r.get(A)?(e=i(n.path(),r.get(S)).replace(_,""),o&&(e=v(o)?o(e):d.format(o,encodeURIComponent(e))),e):t},_selectedItem:function(){var e=this.listView,n=e.select();return n.length?this.dataSource.getByUid(n.attr(d.attr("uid"))):t},_toolbar:function(){var t=this,n=d.template(P),i=t.options.messages,r=[{text:i.orderByName,value:"name"},{text:i.orderBySize,value:"size"}];t.toolbar=e(n({messages:i,showUpload:t.options.transport.uploadUrl,showCreate:t.options.transport.create,showDelete:t.options.transport.destroy})).appendTo(t.element).find(".k-upload input").kendoUpload({multiple:!1,localization:{dropFilesHere:i.dropFilesHere},async:{saveUrl:t.options.transport.uploadUrl,autoUpload:!0},upload:p(t._fileUpload,t),error:function(e){t._error({xhr:e.XMLHttpRequest,status:"error"})}}).end(),t.upload=t.toolbar.find(".k-upload input").data("kendoUpload"),t.arrangeBy=t.toolbar.find(".k-tiles-arrange select").kendoDropDownList({dataSource:r,dataTextField:"text",dataValueField:"value",change:function(){t.orderBy(this.value())}}).data("kendoDropDownList"),t._attachDropzoneEvents()
},_attachDropzoneEvents:function(){var t=this;t.options.transport.uploadUrl&&(n(e(document.documentElement),e.proxy(t._dropEnter,t),e.proxy(t._dropLeave,t)),t._scrollHandler=p(t._positionDropzone,t))},_dropEnter:function(){this._positionDropzone(),e(document).on("scroll"+x,this._scrollHandler)},_dropLeave:function(){this._removeDropzone(),e(document).off("scroll"+x,this._scrollHandler)},_positionDropzone:function(){var e=this,t=e.element,n=t.offset();e.toolbar.find(".k-dropzone").addClass("k-filebrowser-dropzone").offset(n).css({width:t[0].clientWidth,height:t[0].clientHeight,lineHeight:t[0].clientHeight+"px"})},_removeDropzone:function(){this.toolbar.find(".k-dropzone").removeClass("k-filebrowser-dropzone").css({width:"",height:"",lineHeight:"",top:"",left:""})},_deleteClick:function(){var e=this,t=e.listView.select(),n=d.format(e.options.messages.deleteFile,t.find("strong").text());t.length&&e._showMessage(n,"confirm")&&e.listView.remove(t)},_addClick:function(){this.createDirectory()},_getFieldName:function(e){return o(this.dataSource.reader.model.fields,e)},_fileUpload:function(e){var t,n=this,i=n.options,r=i.fileTypes,o=RegExp(("("+r.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),a=e.files[0].name,s=S,l=D;o.test(a)?(e.data={path:n.path()},t=n._createFile(a),t?n.upload.one("success",function(e){t.set(s,e.response[n._getFieldName(s)]),t.set(l,e.response[n._getFieldName(l)]),n._tiles=n.listView.items().filter("["+d.attr("type")+"=f]")}):e.preventDefault()):(e.preventDefault(),n._showMessage(d.format(i.messages.invalidFileType,a,r)))},_findFile:function(e){var t,n,i,r=this.dataSource.data(),o=A,a=S;for(e=e.toLowerCase(),t=0,i=r.length;i>t;t++)if("f"===r[t].get(o)&&r[t].get(a).toLowerCase()===e){n=r[t];break}return n},_createFile:function(e){var t,n,i=this,r=0,o={},a=A,s=i.dataSource.view(),l=i._findFile(e);if(l&&!i._showMessage(d.format(i.options.messages.overwriteFile,e),"confirm"))return null;if(l)return l;for(t=0,n=s.length;n>t;t++)if("f"===s[t].get(a)){r=t;break}return o[a]="f",o[S]=e,o[D]=0,i.dataSource.insert(++r,o)},createDirectory:function(){var e,t,n=this,i=0,r=A,o=S,a=n.dataSource.data(),s=n._nameDirectory(),l=new n.dataSource.reader.model;for(e=0,t=a.length;t>e;e++)"d"===a[e].get(r)&&(i=e);l.set(r,"d"),l.set(o,s),n.listView.one("dataBound",function(){var e=n.listView.items().filter("["+d.attr("uid")+"="+l.uid+"]"),t=e.find("input");e.length&&this.edit(e),this.element.scrollTop(e.attr("offsetTop")-this.element[0].offsetHeight),setTimeout(function(){t.select()})}).one("save",function(e){var t=e.model.get(o);t?e.model.set(o,n._nameExists(t,l.uid)?n._nameDirectory():t):e.model.set(o,s)}),n.dataSource.insert(++i,l)},_directoryKeyDown:function(e){13==e.keyCode&&e.currentTarget.blur()},_directoryBlur:function(){this.listView.save()},_nameExists:function(e,t){var n,i,r=this.dataSource.data(),o=A,a=S;for(n=0,i=r.length;i>n;n++)if("d"===r[n].get(o)&&r[n].get(a).toLowerCase()===e.toLowerCase()&&r[n].uid!==t)return!0;return!1},_nameDirectory:function(){var t,n,i,r="New folder",o=this.dataSource.data(),a=[],s=A,l=S;for(n=0,i=o.length;i>n;n++)"d"===o[n].get(s)&&o[n].get(l).toLowerCase().indexOf(r.toLowerCase())>-1&&a.push(o[n].get(l));if(e.inArray(r,a)>-1){n=2;do t=r+" ("+n+")",n++;while(e.inArray(t,a)>-1);r=t}return r},orderBy:function(e){this.dataSource.sort([{field:A,dir:"asc"},{field:e,dir:"asc"}])},search:function(e){this.dataSource.filter({field:S,operator:"contains",value:e})},_content:function(){var t=this;t.list=e('<ul class="k-reset k-floats k-tiles" />').appendTo(t.element).on("dblclick"+x,"li",p(t._dblClick,t)),t.listView=new d.ui.ListView(t.list,{dataSource:t.dataSource,template:t._itemTmpl(),editTemplate:t._editTmpl(),selectable:!0,autoBind:!1,dataBinding:function(e){t.toolbar.find(".k-delete").parent().addClass("k-state-disabled"),("remove"===e.action||"sync"===e.action)&&e.preventDefault()},dataBound:function(){t.dataSource.view().length?t._tiles=this.items().filter("["+d.attr("type")+"=f]"):this.wrapper.append(I({text:t.options.messages.emptyFolder}))},change:p(t._listViewChange,t)})},_dblClick:function(t){var n,r=this,o=e(t.currentTarget);o.hasClass("k-edit-item")&&r._directoryBlur(),o.filter("["+d.attr("type")+"=d]").length?(n=r.dataSource.getByUid(o.attr(d.attr("uid"))),n&&(r.path(i(r.path(),n.get(S))),r.breadcrumbs.value(r.path()))):o.filter("["+d.attr("type")+"=f]").length&&r.trigger(y)},_listViewChange:function(){var e=this._selectedItem();e&&(this.toolbar.find(".k-delete").parent().removeClass("k-state-disabled"),"f"===e.get(A)&&this.trigger(w))},_dataSource:function(){var e,t=this,n=t.options,i=n.transport,r=f({},E),o={field:S,dir:"asc"},a={type:i.type||"filebrowser",sort:[r,o]};h(i)&&(i.path=p(t.path,t),a.transport=i),h(n.schema)?a.schema=n.schema:i.type&&h(d.data.schemas[i.type])&&(e=d.data.schemas[i.type]),t.dataSource&&t._errorHandler?t.dataSource.unbind(b,t._errorHandler):t._errorHandler=p(t._error,t),t.dataSource=d.data.DataSource.create(a).bind(b,t._errorHandler)},_navigation:function(){var t=this,n=e('<div class="k-floatwrap"><input/><input/></div>').appendTo(this.element);t.breadcrumbs=n.find("input:first").kendoBreadcrumbs({value:t.options.path,change:function(){t.path(this.value())}}).data("kendoBreadcrumbs"),t.searchBox=n.parent().find("input:last").kendoSearchBox({label:t.options.messages.search,change:function(){t.search(this.value())}}).data("kendoSearchBox")},_error:function(e){var t,n=this;n.trigger(b,e)||(t=e.xhr.status,"error"==e.status?"404"==t?n._showMessage(n.options.messages.directoryNotFound):"0"!=t&&n._showMessage("Error! The requested URL returned "+t+" - "+e.xhr.statusText):"timeout"==t&&n._showMessage("Error! Server timeout."))},_showMessage:function(e,t){return window[t||"alert"](e)},refresh:function(){var e=this;e._navigation(),e._toolbar(),e._content()},_editTmpl:function(){var e='<li class="k-tile k-state-selected" '+d.attr("uid")+'="#=uid#" ';return e+=d.attr("type")+'="${'+A+'}">',e+="#if("+A+' == "d") { #',e+='<div class="k-thumb"><span class="k-icon k-folder"></span></div>',e+="#}else{#",e+='<div class="k-thumb"><span class="k-icon k-loading"></span></div>',e+="#}#",e+="#if("+A+' == "d") { #',e+='<input class="k-input" '+d.attr("bind")+'="value:'+S+'"/>',e+="#}#",e+="</li>",p(d.template(e),{sizeFormatter:r})},_itemTmpl:function(){var e='<li class="k-tile" '+d.attr("uid")+'="#=uid#" ';return e+=d.attr("type")+'="${'+A+'}">',e+="#if("+A+' == "d") { #',e+='<div class="k-thumb"><span class="k-icon k-folder"></span></div>',e+="#}else{#",e+='<div class="k-thumb"><span class="k-icon k-file"></span></div>',e+="#}#",e+="<strong>${"+S+"}</strong>",e+="#if("+A+' == "f") { # <span class="k-filesize">${this.sizeFormatter('+D+")}</span> #}#",e+="</li>",p(d.template(e),{sizeFormatter:r})},path:function(e){var n=this,i=n._path||"";return e!==t?(n._path=e.replace(_,"")+"/",n.dataSource.read({path:n._path}),t):(i&&(i=i.replace(_,"")),"/"===i||""===i?"":i+"/")}}),l=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),g&&n.element.attr("placeholder",n.options.label),n._wrapper(),n.element.on("keydown"+T,p(n._keydown,n)).on("change"+T,p(n._updateValue,n)),n.wrapper.on(k+T,"a",p(n._click,n)),g||n.element.on("focus"+T,p(n._focus,n)).on("blur"+T,p(n._blur,n))},options:{name:"SearchBox",label:"Search",value:""},events:[w],destroy:function(){var e=this;e.wrapper.add(e.element).add(e.label).off(T),u.fn.destroy.call(e)},_keydown:function(e){13===e.keyCode&&this._updateValue()},_click:function(e){e.preventDefault(),this._updateValue()},_updateValue:function(){var e=this,t=e.element.val();t!==e.value()&&(e.value(t),e.trigger(w))},_blur:function(){this._updateValue(),this._toggleLabel()},_toggleLabel:function(){g||this.label.toggle(!this.element.val())},_focus:function(){this.label.hide()},_wrapper:function(){var t=this.element,n=t.parents(".k-search-wrap");t[0].style.width="",t.addClass("k-input"),n.length||(n=t.wrap(e('<div class="k-widget k-search-wrap k-textbox"/>')).parent(),g||e('<label style="display:block">'+this.options.label+"</label>").insertBefore(t),e('<a href="#" class="k-icon k-i-search k-search"/>').appendTo(n)),this.wrapper=n,this.label=n.find(">label")},value:function(e){var n=this;return e!==t?(n.options.value=e,n.element.val(e),n._toggleLabel(),t):n.options.value}}),c=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),n._wrapper(),n.wrapper.on("focus"+C,"input",p(n._focus,n)).on("blur"+C,"input",p(n._blur,n)).on("keydown"+C,"input",p(n._keydown,n)).on(k+C,"a.k-i-arrow-n:first",p(n._rootClick,n)).on(k+C,"a:not(.k-i-arrow-n)",p(n._click,n)),n.value(n.options.value)},options:{name:"Breadcrumbs",gap:50},events:[w],destroy:function(){var e=this;u.fn.destroy.call(e),e.wrapper.add(e.wrapper.find("input")).add(e.wrapper.find("a")).off(C)},_update:function(e){e="/"===(e||"").charAt(0)?e:"/"+(e||""),e!==this.value()&&(this.value(e),this.trigger(w))},_click:function(t){t.preventDefault(),this._update(this._path(e(t.target).prevAll("a:not(.k-i-arrow-n)").addBack()))},_rootClick:function(e){e.preventDefault(),this._update("")},_focus:function(){var e=this,t=e.element;e.overlay.hide(),e.element.val(e.value()),setTimeout(function(){t.select()})},_blur:function(){if(!this.overlay.is(":visible")){var e=this,t=e.element,n=t.val().replace(/\/{2,}/g,"/");e.overlay.show(),t.val(""),e._update(n)}},_keydown:function(e){var t=this;13===e.keyCode&&(t._blur(),setTimeout(function(){t.overlay.find("a:first").focus()}))},_wrapper:function(){var t,n=this.element,i=n.parents(".k-breadcrumbs");n[0].style.width="",n.addClass("k-input"),i.length||(i=n.wrap(e('<div class="k-widget k-breadcrumbs k-textbox"/>')).parent()),t=i.find(".k-breadcrumbs-wrap"),t.length||(t=e('<div class="k-breadcrumbs-wrap"/>').appendTo(i)),this.wrapper=i,this.overlay=t},refresh:function(){var n,i,r,o,a="",s=this.value();for(s!==t&&s.match(/^\//)||(s="/"+(s||"")),n=s.split("/"),r=0,o=n.length;o>r;r++)i=n[r],i&&(a||(a+='<a href="#" class="k-icon k-i-arrow-n">root</a>'),a+='<a class="k-link" href="#">'+n[r]+"</a>",a+='<span class="k-icon k-i-arrow-e">&gt;</span>');this.overlay.empty().append(e(a)),this._adjustSectionWidth()},_adjustSectionWidth:function(){var t,n=this,i=n.wrapper,r=i.width()-n.options.gap,o=n.overlay.find("a");o.each(function(n){t=e(this),t.parent().width()>r&&(n==o.length-1?t.width(r):t.prev().addBack().hide())})},value:function(e){return e!==t?(this._value=e.replace(/\/{2,}/g,"/"),this.refresh(),t):this._value},_path:function(t){return"/"+e.map(t,function(t){return e(t).text()}).join("/")}}),d.ui.plugin(s),d.ui.plugin(c),d.ui.plugin(l)}(window.kendo.jQuery),function(e,t){function n(e,n){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+n}function i(e){if(!e)return"";var t=" bytes";return e>=1073741824?(t=" GB",e/=1073741824):e>=1048576?(t=" MB",e/=1048576):e>=1024&&(t=" KB",e/=1024),Math.round(100*e)/100+t}var r,o,a=window.kendo,s=a.ui.FileBrowser,l=e.isPlainObject,c=e.proxy,d=e.extend,u=a.support.browser,h=a.isFunction,p=/(^\/|\/$)/g,f="error",g=".kendoImageBrowser",m="name",v="size",_="type",w={field:_,dir:"asc"},y=a.template('<li class="k-tile-empty"><strong>${text}</strong></li>');d(!0,a.data,{schemas:{imagebrowser:{data:function(e){return e.items||e||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}}),d(!0,a.data,{transports:{imagebrowser:a.data.RemoteTransport.extend({init:function(t){a.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,n){n.data=e.extend({},n.data,{path:this.options.path()}),h(this.options[t])?this.options[t].call(this,n):a.data.RemoteTransport.fn[t].call(this,n)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}}),r=u.msie&&8>u.version?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()},o=s.extend({init:function(e,t){var n=this;t=t||{},s.fn.init.call(n,e,t),n.element.addClass("k-imagebrowser")},options:{name:"ImageBrowser",fileTypes:"*.png,*.gif,*.jpg,*.jpeg"},value:function(){var e,i=this,r=i._selectedItem(),o=i.options.transport.imageUrl;return r&&"f"===r.get(_)?(e=n(i.path(),r.get(m)).replace(p,""),o&&(e=h(o)?o(e):a.format(o,encodeURIComponent(e))),e):t},_fileUpload:function(e){var t,n=this,i=n.options,r=i.fileTypes,o=RegExp(("("+r.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),s=e.files[0].name,l=m,c=v;o.test(s)?(e.data={path:n.path()},t=n._createFile(s),t?(t._uploading=!0,n.upload.one("success",function(e){delete t._uploading,t.set(l,e.response[n._getFieldName(l)]),t.set(c,e.response[n._getFieldName(c)]),n._tiles=n.listView.items().filter("["+a.attr("type")+"=f]"),n._scroll()})):e.preventDefault()):(e.preventDefault(),n._showMessage(a.format(i.messages.invalidFileType,s,r)))},_content:function(){var t=this;t.list=e('<ul class="k-reset k-floats k-tiles" />').appendTo(t.element).on("scroll"+g,c(t._scroll,t)).on("dblclick"+g,"li",c(t._dblClick,t)),t.listView=new a.ui.ListView(t.list,{dataSource:t.dataSource,template:t._itemTmpl(),editTemplate:t._editTmpl(),selectable:!0,autoBind:!1,dataBinding:function(e){t.toolbar.find(".k-delete").parent().addClass("k-state-disabled"),("remove"===e.action||"sync"===e.action)&&e.preventDefault()},dataBound:function(){t.dataSource.view().length?(t._tiles=this.items().filter("["+a.attr("type")+"=f]"),t._scroll()):this.wrapper.append(y({text:t.options.messages.emptyFolder}))},change:c(t._listViewChange,t)})},_dataSource:function(){var e,t=this,n=t.options,i=n.transport,r=d({},w),o={field:m,dir:"asc"},s={type:i.type||"imagebrowser",sort:[r,o]};l(i)&&(i.path=c(t.path,t),s.transport=i),l(n.schema)?s.schema=n.schema:i.type&&l(a.data.schemas[i.type])&&(e=a.data.schemas[i.type]),t.dataSource&&t._errorHandler?t.dataSource.unbind(f,t._errorHandler):t._errorHandler=c(t._error,t),t.dataSource=a.data.DataSource.create(s).bind(f,t._errorHandler)},_loadImage:function(t){var n=this,i=e(t),r=n.dataSource.getByUid(i.attr(a.attr("uid"))),o=r.get(m),s=n.options.transport.thumbnailUrl,l=e("<img />",{alt:o}),c="?";r._uploading||(l.hide().on("load"+g,function(){e(this).prev().remove().end().addClass("k-image").fadeIn()}),i.find(".k-loading").after(l),h(s)?s=s(n.path(),encodeURIComponent(o)):(s.indexOf("?")>=0&&(c="&"),s=s+c+"path="+n.path()+encodeURIComponent(o)),l.attr("src",s),t.loaded=!0)},_scroll:function(){var e=this;e.options.transport&&e.options.transport.thumbnailUrl&&(clearTimeout(e._timeout),e._timeout=setTimeout(function(){var n=e.list.outerHeight(),i=e.list.scrollTop(),o=i+n;e._tiles.each(function(){var n=r(this),a=n+this.offsetHeight;return(n>=i&&o>n||a>=i&&o>a)&&e._loadImage(this),n>o?!1:t}),e._tiles=e._tiles.filter(function(){return!this.loaded})},250))},_itemTmpl:function(){var e=this,t='<li class="k-tile" '+a.attr("uid")+'="#=uid#" ';return t+=a.attr("type")+'="${'+_+'}">',t+="#if("+_+' == "d") { #',t+='<div class="k-thumb"><span class="k-icon k-folder"></span></div>',t+="#}else{#",t+=e.options.transport&&e.options.transport.thumbnailUrl?'<div class="k-thumb"><span class="k-icon k-loading"></span></div>':'<div class="k-thumb"><span class="k-icon k-file"></span></div>',t+="#}#",t+="<strong>${"+m+"}</strong>",t+="#if("+_+' == "f") { # <span class="k-filesize">${this.sizeFormatter('+v+")}</span> #}#",t+="</li>",c(a.template(t),{sizeFormatter:i})}}),a.ui.plugin(o)}(window.kendo.jQuery),function(e,t){var n,i,r,o,a=window.kendo,s=a.Class,l=a.ui.Widget,c=a.support.mobileOS,d=a.support.browser,u=e.extend,h=e.proxy,p=a.deepExtend,f=".kendoEditor",g=a.keys,m=s.extend({init:function(e){this.options=e},getHtml:function(){var e=this.options;return a.template(e.template,{useWithBlock:!1})(e)}}),v={editorWrapperTemplate:'<table cellspacing="4" cellpadding="0" class="k-widget k-editor k-header" role="presentation"><tbody><tr role="presentation"><td class="k-editor-toolbar-wrap" role="presentation"><ul class="k-editor-toolbar" role="toolbar" /></td></tr><tr><td class="k-editable-area" /></tr></tbody></table>',buttonTemplate:'<a href="" role="button" class="k-tool"#= data.popup ? " data-popup" : "" # unselectable="on" title="#= data.title #"><span unselectable="on" class="k-tool-icon #= data.cssClass #">#= data.title #</span></a>',colorPickerTemplate:'<div class="k-colorpicker #= data.cssClass #" />',comboBoxTemplate:'<select title="#= data.title #" class="#= data.cssClass #" />',dropDownListTemplate:'<span class="k-editor-dropdown"><select title="#= data.title #" class="#= data.cssClass #" /></span>',separatorTemplate:'<span class="k-separator" />',formatByName:function(t,n){for(var i=0;n.length>i;i++)if(e.inArray(t,n[i].tags)>=0)return n[i]},registerTool:function(e,t){var n=t.options;n&&n.template&&(n.template.options.cssClass="k-"+e),t.name||(t.options.name=e,t.name=e.toLowerCase()),b.defaultTools[e]=t},registerFormat:function(e,t){b.fn.options.formats[e]=t}},_={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertFile:"Insert file",insertHtml:"Insert HTML",viewHtml:"View HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",formatting:"Format",foreColor:"Color",backColor:"Background color",style:"Styles",emptyFolder:"Empty Folder",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found.",imageWebAddress:"Web address",imageAltText:"Alternate text",imageWidth:"Width (px)",imageHeight:"Height (px)",fileWebAddress:"Web address",fileTitle:"Title",linkWebAddress:"Web address",linkText:"Text",linkToolTip:"ToolTip",linkOpenInNewWindow:"Open link in new window",dialogUpdate:"Update",dialogInsert:"Insert",dialogCancel:"Cancel",createTable:"Create table",createTableHint:"Create a {0} x {1} table",addColumnLeft:"Add column on the left",addColumnRight:"Add column on the right",addRowAbove:"Add row above",addRowBelow:"Add row below",deleteRow:"Delete row",deleteColumn:"Delete column"},w=!c||c.ios&&c.flatVersion>=500||!c.ios&&t!==document.documentElement.contentEditable,y={basic:["bold","italic","underline"],alignment:["justifyLeft","justifyCenter","justifyRight"],lists:["insertUnorderedList","insertOrderedList"],indenting:["indent","outdent"],links:["createLink","unlink"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"]},b=l.extend({init:function(t,n){var i,r,o,s,c=this,d=a.ui.editor;w&&(l.fn.init.call(c,t,n),c.options=p({},c.options,n),t=c.element,s=d.Dom.name(t[0]),t.closest("form").on("submit"+f,function(){c.update()}),o=u({},c.options),o.editor=c,"textarea"==s?(c._wrapTextarea(),r=c.wrapper.find(".k-editor-toolbar"),t[0].id&&r.attr("aria-controls",t[0].id)):(c.element.attr("contenteditable",!0).addClass("k-widget k-editor k-editor-inline"),o.popup=!0,r=e('<ul class="k-editor-toolbar" role="toolbar" />').insertBefore(t)),c.toolbar=new d.Toolbar(r[0],o),c.toolbar.bindTo(c),"textarea"==s&&setTimeout(function(){var e=c.wrapper[0].style.height,t=parseInt(e,10),n=c.wrapper.height();e.indexOf("px")>0&&!isNaN(t)&&n>t&&c.wrapper.height(t-(n-t))}),c._initializeContentElement(c),c.keyboard=new d.Keyboard([new d.TypingHandler(c),new d.BackspaceHandler(c),new d.SystemHandler(c)]),c.clipboard=new d.Clipboard(this),c.undoRedoStack=new d.UndoRedoStack,i=n&&n.value?n.value:c.textarea?t.val().replace(/[\r\n\v\f\t ]+/gi," "):t[0].innerHTML,c.value(i),e(document).on("mousedown",h(c._endTyping,c)).on("mouseup",h(c._mouseup,c)),a.notify(c))},_endTyping:function(){var e=this.keyboard;try{e.isTypingInProgress()&&(e.endTyping(!0),this.saveSelection())}catch(t){}},_selectionChange:function(){d.msie||a.ui.editor.Dom.ensureTrailingBreaks(this.body),this._selectionStarted=!1,this.saveSelection(),this.trigger("select",{})},_wrapTextarea:function(){var t=this,n=t.element,i=n[0].style.width,r=n[0].style.height,o=v.editorWrapperTemplate,a=e(o).insertBefore(n).width(i).height(r),s=a.find(".k-editable-area");n.attr("autocomplete","off").appendTo(s).addClass("k-content k-raw-content").css("display","none"),t.textarea=n,t.wrapper=a},_createContentElement:function(t){var n,i,r,o=this,s=o.textarea,l=o.options.domain,c=l||document.domain,d="",u='javascript:""';return(l||c!=location.hostname)&&(d='<script>document.domain="'+c+'"</script>',u="javascript:document.write('"+d+"')"),s.hide(),n=e("<iframe />",{frameBorder:"0"})[0],e(n).css("display","").addClass("k-content").insertBefore(s),n.src=u,i=n.contentWindow||n,r=i.document||n.contentDocument,e(n).one("load",function(){o.toolbar.decorateFrom(r.body)}),r.open(),r.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0;margin:0;height:100%;min-height:100%;}body{font-size:12px;font-family:Verdana,Geneva,sans-serif;padding-top:1px;margin-top:-1px;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;"+(a.support.isRtl(s)?"direction:rtl;":"")+"}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}p{margin:0 0 1em;padding:0 .2em}.k-marker{display:none;}.k-paste-container,.Apple-style-span{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}ul,ol{padding-left:2.5em}span{-ms-high-contrast-adjust:none;}a{color:#00a}code{font-size:1.23em}telerik\\3Ascript{display: none;}.k-table{table-layout:fixed;width:100%;border-spacing:0;margin: 0 0 1em;}.k-table td{min-width:1px;padding:.2em .3em;}.k-table,.k-table td{outline:0;border: 1px dotted #ccc;}.k-table p{margin:0;padding:0;}</style>"+d+"<script>(function(d,c){d[c]('header'),d[c]('article'),d[c]('nav'),d[c]('section'),d[c]('footer');})(document, 'createElement');</script>"+e.map(t,function(e){return"<link rel='stylesheet' href='"+e+"'>"}).join("")+"</head><body autocorrect='off' contenteditable='true'></body></html>"),r.close(),i},_blur:function(){var e=this.textarea,t=e?e.val():this._oldValue,n=this.options.encoded?this.encodedValue():this.value();this.update(),e&&e.trigger("blur"),n!=t&&this.trigger("change")},_initializeContentElement:function(){var n,i,r=this;r.textarea?(r.window=r._createContentElement(r.options.stylesheets),n=r.document=r.window.contentDocument||r.window.document,r.body=n.body,i=r.window,e(n).on("mouseup"+f,h(r._mouseup,r))):(r.window=window,n=r.document=document,r.body=r.element[0],i=r.body,r.toolbar.decorateFrom(r.body)),e(i).on("blur"+f,h(this._blur,this));try{n.execCommand("enableInlineTableEditing",null,!1)}catch(o){}a.support.touch&&e(n).on("selectionchange"+f,h(this._selectionChange,this)).on("keydown"+f,function(){a._activeElement()!=n.body&&r.window.focus()}),e(r.body).on("keydown"+f,function(e){var n,i,o,a,s,l;return e.keyCode===g.F10?(setTimeout(h(r.toolbar.focus,r.toolbar),100),e.preventDefault(),t):((e.keyCode==g.LEFT||e.keyCode==g.RIGHT)&&(n=r.getRange(),i=e.keyCode==g.LEFT,o=n[i?"startContainer":"endContainer"],a=n[i?"startOffset":"endOffset"],s=i?-1:1,i&&(a-=1),a+s>0&&3==o.nodeType&&"﻿"==o.nodeValue[a]&&(n.setStart(o,a+s),n.collapse(!0),r.selectRange(n))),(l=r.keyboard.toolFromShortcut(r.toolbar.tools,e))?(e.preventDefault(),/^(undo|redo)$/.test(l)||r.keyboard.endTyping(!0),r.trigger("keydown",e),r.exec(l),!1):(r.keyboard.clearTimeout(),r.keyboard.keydown(e),t))}).on("keyup"+f,function(t){var n=[8,9,33,34,35,36,37,38,39,40,40,45,46];(e.inArray(t.keyCode,n)>-1||65==t.keyCode&&t.ctrlKey&&!t.altKey&&!t.shiftKey)&&r._selectionChange(),r.keyboard.keyup(t)}).on("mousedown"+f,function(t){if(r._selectionStarted=!0,!d.gecko){var n=e(t.target);(2==t.which||1==t.which&&t.ctrlKey)&&n.is("a[href]")&&window.open(n.attr("href"),"_new")}}).on("click"+f,function(e){var t,n=a.ui.editor.Dom;"img"===n.name(e.target)&&(t=r.createRange(),t.selectNode(e.target),r.selectRange(t))}).on("cut"+f+" paste"+f,function(e){r.clipboard["on"+e.type](e)}).on("focusin"+f,function(){e(this).addClass("k-state-active"),r.toolbar.show()}).on("focusout"+f,function(){setTimeout(function(){var t=a._activeElement(),n=r.body,i=r.toolbar;t==n||e.contains(n,t)||e(t).is(".k-editortoolbar-dragHandle")||i.focused()||(e(n).removeClass("k-state-active"),i.hide())},10)})},_mouseup:function(){var e=this;e._selectionStarted&&setTimeout(function(){e._selectionChange()},1)},refresh:function(){var e=this;e.textarea&&(e.textarea.val(e.value()),e.wrapper.find("iframe").remove(),e._initializeContentElement(e),e.value(e.textarea.val()))},events:["select","change","execute","error","paste","keydown","keyup"],options:{name:"Editor",messages:_,formats:{},encoded:!0,domain:null,serialization:{entities:!0,scripts:!1},stylesheets:[],dialogOptions:{modal:!0,resizable:!1,draggable:!0,animation:!1},fontName:[{text:"Arial",value:"Arial,Helvetica,sans-serif"},{text:"Courier New",value:"'Courier New',Courier,monospace"},{text:"Georgia",value:"Georgia,serif"},{text:"Impact",value:"Impact,Charcoal,sans-serif"},{text:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{text:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{text:"Times New Roman",value:"'Times New Roman',Times,serif"},{text:"Trebuchet MS",value:"'Trebuchet MS',Helvetica,sans-serif"},{text:"Verdana",value:"Verdana,Geneva,sans-serif"}],fontSize:[{text:"1 (8pt)",value:"xx-small"},{text:"2 (10pt)",value:"x-small"},{text:"3 (12pt)",value:"small"},{text:"4 (14pt)",value:"medium"},{text:"5 (18pt)",value:"large"},{text:"6 (24pt)",value:"x-large"},{text:"7 (36pt)",value:"xx-large"}],formatBlock:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],tools:[].concat.call(["formatting"],y.basic,y.alignment,y.lists,y.indenting,y.links,["insertImage"],y.tables)},destroy:function(){var t=this;l.fn.destroy.call(t),e(t.window).add(t.document).add(t.body).add(t.wrapper).add(t.element.closest("form")).off(f),e(document).off("mousedown",h(t._endTyping,t)).off("mouseup",h(t._mouseup,t)),t._focusOutside(),t.toolbar.destroy(),a.destroy(t.wrapper)},_focusOutside:function(){if(a.support.browser.msie&&this.textarea){var t=e("<input style='position:absolute;left:-10px;top:-10px;width:1px;height:1px;font-size:0;border:0;' />").appendTo(document.body).focus();t.blur().remove()}},state:function(e){var t,n,i=b.defaultTools[e],r=i&&(i.options.finder||i.finder),o=a.ui.editor.RangeUtils;return r?(t=this.getRange(),n=o.textNodes(t),!n.length&&t.collapsed&&(n=[t.startContainer]),r.getFormat?r.getFormat(n):r.isFormatted(n)):!1},value:function(e){var n=this.body,i=a.ui.editor,r=i.Serializer.domToXhtml(n,this.options.serialization);return e===t?r:(e!=r&&(i.Serializer.htmlToDom(e,n),d.msie||a.ui.editor.Dom.ensureTrailingBreaks(this.body),this.selectionRestorePoint=null,this.update(),this.toolbar.refreshTools()),t)},saveSelection:function(t){t=t||this.getRange();var n=t.commonAncestorContainer,i=this.body;(n==i||e.contains(i,n))&&(this.selectionRestorePoint=new a.ui.editor.RestorePoint(t))},_focusBody:function(){var e,t=this.body,n=this.wrapper&&this.wrapper.find("iframe")[0],i=this.document.documentElement,r=a._activeElement();r!=t&&r!=n&&(e=i.scrollTop,t.focus(),i.scrollTop=e)},restoreSelection:function(){this._focusBody(),this.selectionRestorePoint&&this.selectRange(this.selectionRestorePoint.toRange())},focus:function(){this.restoreSelection()},update:function(e){e=e||this.options.encoded?this.encodedValue():this.value(),this.textarea?this.textarea.val(e):this._oldValue=e},encodedValue:function(){return a.ui.editor.Dom.encode(this.value())},createRange:function(e){return a.ui.editor.RangeUtils.createRange(e||this.document)},getSelection:function(){return a.ui.editor.SelectionUtils.selectionFromDocument(this.document)},selectRange:function(e){this._focusBody();var t=this.getSelection();t.removeAllRanges(),t.addRange(e),this.saveSelection(e)},getRange:function(){var e=this.getSelection(),t=e&&e.rangeCount>0?e.getRangeAt(0):this.createRange(),n=this.document;return t.startContainer!=n||t.endContainer!=n||t.startOffset||t.endOffset||(t.setStart(this.body,0),t.collapse(!0)),t},selectedHtml:function(){return a.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(e,t){this.clipboard.paste(e,t)},exec:function(e,n){var i,r,o,a=this,s=null;if(!e)throw Error("kendoEditor.exec(): `name` parameter cannot be empty");if(e=e.toLowerCase(),a.keyboard.isTypingInProgress()||a.restoreSelection(),r=a.toolbar.toolById(e),!r)for(o in b.defaultTools)if(o.toLowerCase()==e){r=b.defaultTools[o];break}if(r){if(i=a.getRange(),r.command&&(s=r.command(u({range:i},n))),a.trigger("execute",{name:e,command:s}),/^(undo|redo)$/i.test(e))a.undoRedoStack[e]();else if(s&&(s.managesUndoRedo||a.undoRedoStack.push(s),s.editor=a,s.exec(),s.async))return s.change=h(a._selectionChange,a),t;a._selectionChange()}}});b.defaultTools={undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}},a.ui.plugin(b),n=s.extend({init:function(e){this.options=e},initialize:function(e,t){e.attr({unselectable:"on",title:t.title})},command:function(e){return new this.options.command(e)},update:e.noop}),n.exec=function(e,t,n){e.exec(t,{value:n})},i=n.extend({init:function(e){n.fn.init.call(this,e)},command:function(e){var t=this;return new a.ui.editor.FormatCommand(u(e,{formatter:t.options.formatter}))},update:function(e,t){var n=this.options.finder.isFormatted(t);e.toggleClass("k-state-selected",n),e.attr("aria-pressed",n)}}),v.registerTool("separator",new n({template:new m({template:v.separatorTemplate})})),r=d.msie&&9>d.version?"﻿":"",o='<br class="k-br" />',d.msie&&(10>d.version?o="﻿":11>d.version&&(o=" ")),u(a.ui,{editor:{ToolTemplate:m,EditorUtils:v,Tool:n,FormatTool:i,_bomFill:r,emptyElementContent:o}})}(window.jQuery),function(e){function t(e){var t,n,i={};for(t=0,n=e.length;n>t;t++)i[e[t]]=!0;return i}var n,i,r,o,a,s,l,c,d,u,h=window.kendo,p=e.map,f=e.extend,g=h.support.browser,m="style",v="float",_="cssFloat",w="styleFloat",y="class",b="k-marker",k=t("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),x="div,p,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,map,menu,noframes,noscript,object,pre,script,table,tbody,td,tfoot,th,thead,tr,header,article,nav,footer,section,aside,main,figure,figcaption".split(","),C=x.concat(["ul","ol","li"]),T=t(C),S="span,em,a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,strike,strong,sub,sup,textarea,tt,u,var,data,time,mark,ruby".split(","),D=t(S),A=t("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),E=function(e){1==e.nodeType&&e.normalize()};g.msie&&g.version>=8&&(E=function(e){if(1==e.nodeType&&e.firstChild)for(var t=e.firstChild,n=t;;){if(n=n.nextSibling,!n)break;3==n.nodeType&&3==t.nodeType&&(n.nodeValue=t.nodeValue+n.nodeValue,u.remove(t)),t=n}}),n=/^\s+$/,i=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,r=/\ufeff/g,o=/^(\s+|\ufeff)$/,s="color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height".split(","),l=/[<>\&]/g,c=/[\u00A0-\u2666<>\&]/g,d={34:"quot",38:"amp",39:"apos",60:"lt",62:"gt",160:"nbsp",161:"iexcl",162:"cent",163:"pound",164:"curren",165:"yen",166:"brvbar",167:"sect",168:"uml",169:"copy",170:"ordf",171:"laquo",172:"not",173:"shy",174:"reg",175:"macr",176:"deg",177:"plusmn",178:"sup2",179:"sup3",180:"acute",181:"micro",182:"para",183:"middot",184:"cedil",185:"sup1",186:"ordm",187:"raquo",188:"frac14",189:"frac12",190:"frac34",191:"iquest",192:"Agrave",193:"Aacute",194:"Acirc",195:"Atilde",196:"Auml",197:"Aring",198:"AElig",199:"Ccedil",200:"Egrave",201:"Eacute",202:"Ecirc",203:"Euml",204:"Igrave",205:"Iacute",206:"Icirc",207:"Iuml",208:"ETH",209:"Ntilde",210:"Ograve",211:"Oacute",212:"Ocirc",213:"Otilde",214:"Ouml",215:"times",216:"Oslash",217:"Ugrave",218:"Uacute",219:"Ucirc",220:"Uuml",221:"Yacute",222:"THORN",223:"szlig",224:"agrave",225:"aacute",226:"acirc",227:"atilde",228:"auml",229:"aring",230:"aelig",231:"ccedil",232:"egrave",233:"eacute",234:"ecirc",235:"euml",236:"igrave",237:"iacute",238:"icirc",239:"iuml",240:"eth",241:"ntilde",242:"ograve",243:"oacute",244:"ocirc",245:"otilde",246:"ouml",247:"divide",248:"oslash",249:"ugrave",250:"uacute",251:"ucirc",252:"uuml",253:"yacute",254:"thorn",255:"yuml",402:"fnof",913:"Alpha",914:"Beta",915:"Gamma",916:"Delta",917:"Epsilon",918:"Zeta",919:"Eta",920:"Theta",921:"Iota",922:"Kappa",923:"Lambda",924:"Mu",925:"Nu",926:"Xi",927:"Omicron",928:"Pi",929:"Rho",931:"Sigma",932:"Tau",933:"Upsilon",934:"Phi",935:"Chi",936:"Psi",937:"Omega",945:"alpha",946:"beta",947:"gamma",948:"delta",949:"epsilon",950:"zeta",951:"eta",952:"theta",953:"iota",954:"kappa",955:"lambda",956:"mu",957:"nu",958:"xi",959:"omicron",960:"pi",961:"rho",962:"sigmaf",963:"sigma",964:"tau",965:"upsilon",966:"phi",967:"chi",968:"psi",969:"omega",977:"thetasym",978:"upsih",982:"piv",8226:"bull",8230:"hellip",8242:"prime",8243:"Prime",8254:"oline",8260:"frasl",8472:"weierp",8465:"image",8476:"real",8482:"trade",8501:"alefsym",8592:"larr",8593:"uarr",8594:"rarr",8595:"darr",8596:"harr",8629:"crarr",8656:"lArr",8657:"uArr",8658:"rArr",8659:"dArr",8660:"hArr",8704:"forall",8706:"part",8707:"exist",8709:"empty",8711:"nabla",8712:"isin",8713:"notin",8715:"ni",8719:"prod",8721:"sum",8722:"minus",8727:"lowast",8730:"radic",8733:"prop",8734:"infin",8736:"ang",8743:"and",8744:"or",8745:"cap",8746:"cup",8747:"int",8756:"there4",8764:"sim",8773:"cong",8776:"asymp",8800:"ne",8801:"equiv",8804:"le",8805:"ge",8834:"sub",8835:"sup",8836:"nsub",8838:"sube",8839:"supe",8853:"oplus",8855:"otimes",8869:"perp",8901:"sdot",8968:"lceil",8969:"rceil",8970:"lfloor",8971:"rfloor",9001:"lang",9002:"rang",9674:"loz",9824:"spades",9827:"clubs",9829:"hearts",9830:"diams",338:"OElig",339:"oelig",352:"Scaron",353:"scaron",376:"Yuml",710:"circ",732:"tilde",8194:"ensp",8195:"emsp",8201:"thinsp",8204:"zwnj",8205:"zwj",8206:"lrm",8207:"rlm",8211:"ndash",8212:"mdash",8216:"lsquo",8217:"rsquo",8218:"sbquo",8220:"ldquo",8221:"rdquo",8222:"bdquo",8224:"dagger",8225:"Dagger",8240:"permil",8249:"lsaquo",8250:"rsaquo",8364:"euro"},u={block:T,inline:D,findNodeIndex:function(e,t){var n=0;
if(!e)return-1;for(;;){if(e=e.previousSibling,!e)break;t&&3==e.nodeType||n++}return n},isDataNode:function(e){return e&&null!==e.nodeValue&&null!==e.data},isAncestorOf:function(t,n){try{return!u.isDataNode(t)&&(e.contains(t,u.isDataNode(n)?n.parentNode:n)||n.parentNode==t)}catch(i){return!1}},isAncestorOrSelf:function(e,t){return u.isAncestorOf(e,t)||e==t},findClosestAncestor:function(e,t){if(u.isAncestorOf(e,t))for(;t&&t.parentNode!=e;)t=t.parentNode;return t},getNodeLength:function(e){return u.isDataNode(e)?e.length:e.childNodes.length},splitDataNode:function(e,t){for(var n=e.cloneNode(!1),i="",r=e;r.nextSibling&&3==r.nextSibling.nodeType&&r.nextSibling.nodeValue;)i+=r.nextSibling.nodeValue,r=r.nextSibling;e.deleteData(t,e.length),n.deleteData(0,t),n.nodeValue+=i,u.insertAfter(n,e)},attrEquals:function(e,t){var n,i;for(n in t)if(i=e[n],n==v&&(i=e[h.support.cssFloat?_:w]),"object"==typeof i){if(!u.attrEquals(i,t[n]))return!1}else if(i!=t[n])return!1;return!0},blockParentOrBody:function(e){return u.parentOfType(e,C)||e.ownerDocument.body},blockParents:function(t){var n,i,r,o=[];for(n=0,i=t.length;i>n;n++)r=u.parentOfType(t[n],u.blockElements),r&&e.inArray(r,o)<0&&o.push(r);return o},windowFromDocument:function(e){return e.defaultView||e.parentWindow},normalize:E,blockElements:C,nonListBlockElements:x,inlineElements:S,empty:k,fillAttrs:A,toHex:function(e){var t=i.exec(e);return t?"#"+p(t.slice(1),function(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}).join(""):e},encode:function(e,t){var n=!t||t.entities?c:l;return e.replace(n,function(e){var t=e.charCodeAt(0),n=d[t];return n?"&"+n+";":e})},stripBom:function(e){return(e||"").replace(r,"")},insignificant:function(e){var t=e.attributes;return"k-marker"==e.className||u.is(e,"br")&&("k-br"==e.className||t._moz_dirty||t._moz_editor_bogus_node)},emptyNode:function(t){var n=e.grep(t.childNodes,function(e){return u.is(e,"br")?!1:u.insignificant(e)?!1:3==e.nodeType&&o.test(e.nodeValue)?!1:u.is(e,"p")&&u.emptyNode(e)?!1:!0});return!n.length},name:function(e){return e.nodeName.toLowerCase()},significantChildNodes:function(t){return e.grep(t.childNodes,function(e){return 3!=e.nodeType||!u.isWhitespace(e)})},lastTextNode:function(e){var t,n=null;if(3==e.nodeType)return e;for(t=e.lastChild;t;t=t.previousSibling)if(n=u.lastTextNode(t))return n;return n},is:function(e,t){return u.name(e)==t},isMarker:function(e){return e.className==b},isWhitespace:function(e){return n.test(e.nodeValue)},isBlock:function(e){return T[u.name(e)]},isEmpty:function(e){return k[u.name(e)]},isInline:function(e){return D[u.name(e)]},scrollContainer:function(e){var t=u.windowFromDocument(e),n=(t.contentWindow||t).document||t.ownerDocument||t;return n=h.support.browser.webkit||"BackCompat"==n.compatMode?n.body:n.documentElement},scrollTo:function(t){var n,i,r=e(u.isDataNode(t)?t.parentNode:t),o=u.windowFromDocument(t.ownerDocument),a=o.innerHeight,s=u.scrollContainer(t.ownerDocument);"br"==u.name(r[0])&&(r=r.parent()),n=r.offset().top,i=r[0].offsetHeight,i+n>s.scrollTop+a&&(s.scrollTop=i+n-a)},persistScrollTop:function(e){a=u.scrollContainer(e).scrollTop},restoreScrollTop:function(e){u.scrollContainer(e).scrollTop=a},insertAt:function(e,t,n){e.insertBefore(t,e.childNodes[n]||null)},insertBefore:function(e,t){return t.parentNode?t.parentNode.insertBefore(e,t):t},insertAfter:function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},remove:function(e){e.parentNode.removeChild(e)},removeTextSiblings:function(e){for(var t=e.parentNode;e.nextSibling&&3==e.nextSibling.nodeType;)t.removeChild(e.nextSibling);for(;e.previousSibling&&3==e.previousSibling.nodeType;)t.removeChild(e.previousSibling)},trim:function(e){var t,n;for(t=e.childNodes.length-1;t>=0;t--)n=e.childNodes[t],u.isDataNode(n)?(u.stripBom(n.nodeValue).length||u.remove(n),u.isWhitespace(n)&&u.insertBefore(n,e)):n.className!=b&&(u.trim(n),n.childNodes.length||u.isEmpty(n)||u.remove(n));return e},closest:function(e,t){for(;e&&u.name(e)!=t;)e=e.parentNode;return e},sibling:function(e,t){do e=e[t];while(e&&1!=e.nodeType);return e},next:function(e){return u.sibling(e,"nextSibling")},prev:function(e){return u.sibling(e,"previousSibling")},parentOfType:function(e,t){do e=e.parentNode;while(e&&!u.ofType(e,t));return e},ofType:function(t,n){return e.inArray(u.name(t),n)>=0},changeTag:function(e,t,n){var i,r,o,a,s,l=u.create(e.ownerDocument,t),c=e.attributes;if(!n)for(i=0,r=c.length;r>i;i++)s=c[i],s.specified&&(o=s.nodeName,a=s.nodeValue,o==y?l.className=a:o==m?l.style.cssText=e.style.cssText:l.setAttribute(o,a));for(;e.firstChild;)l.appendChild(e.firstChild);return u.insertBefore(l,e),u.remove(e),l},editableParent:function(e){for(;e&&(3==e.nodeType||"true"!==e.contentEditable);)e=e.parentNode;return e},wrap:function(e,t){return u.insertBefore(t,e),t.appendChild(e),t},unwrap:function(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)},create:function(e,t,n){return u.attr(e.createElement(t),n)},attr:function(e,t){t=f({},t),t&&m in t&&(u.style(e,t.style),delete t.style);for(var n in t)null===t[n]?(e.removeAttribute(n),delete t[n]):"className"==n&&(e[n]=t[n]);return f(e,t)},style:function(t,n){e(t).css(n||{})},unstyle:function(e,t){for(var n in t)n==v&&(n=h.support.cssFloat?_:w),e.style[n]="";""===e.style.cssText&&e.removeAttribute(m)},inlineStyle:function(t,n,i){var r,o=e(u.create(t.ownerDocument,n,i));return t.appendChild(o[0]),r=p(s,function(e){return g.msie&&"line-height"==e&&"1px"==o.css(e)?"line-height:1.5":e+":"+o.css(e)}).join(";"),o.remove(),r},getEffectiveBackground:function(e){var t=e.css("background-color");return t.indexOf("rgba(0, 0, 0, 0")<0&&"transparent"!==t?t:"html"===e[0].tagName.toLowerCase()?"Window":u.getEffectiveBackground(e.parent())},removeClass:function(t,n){var i,r,o=" "+t.className+" ",a=n.split(" ");for(i=0,r=a.length;r>i;i++)o=o.replace(" "+a[i]+" "," ");o=e.trim(o),o.length?t.className=o:t.removeAttribute(y)},commonAncestor:function(){var e,t,n,i,r,o=arguments.length,a=[],s=1/0,l=null;if(!o)return null;if(1==o)return arguments[0];for(e=0;o>e;e++){for(t=[],n=arguments[e];n;)t.push(n),n=n.parentNode;a.push(t.reverse()),s=Math.min(s,t.length)}if(1==o)return a[0][0];for(e=0;s>e;e++){for(i=a[0][e],r=1;o>r;r++)if(i!=a[r][e])return l;l=i}return l},closestSplittableParent:function(t){var n,i,r;return n=1==t.length?u.parentOfType(t[0],["ul","ol"]):u.commonAncestor.apply(null,t),n||(n=u.parentOfType(t[0],["p","td"])||t[0].ownerDocument.body),u.isInline(n)&&(n=u.blockParentOrBody(n)),i=p(t,u.editableParent),r=u.commonAncestor(i)[0],e.contains(n,r)&&(n=r),n},closestEditable:function(t,n){var i=u.parentOfType(t,n),r=u.editableParent(t);return i&&r&&e.contains(i,r)?i=r:!i&&r&&(i=r),i},closestEditableOfType:function(e,t){var n=u.closestEditable(e,t);return n&&u.ofType(n,t)?n:void 0},filter:function(e,t,n){for(var i,r=0,o=t.length,a=[];o>r;r++)i=u.name(t[r]),(!n&&i==e||n&&i!=e)&&a.push(t[r]);return a},ensureTrailingBreaks:function(t){var n=e(t).find("p,td,th"),i=n.length,r=0;if(i)for(;i>r;r++)u.ensureTrailingBreak(n[r]);else u.ensureTrailingBreak(t)},ensureTrailingBreak:function(e){var t,n=e.lastChild,i=n&&u.name(n);(!i||"br"!=i&&"img"!=i||"br"==i&&"k-br"!=n.className)&&(t=e.ownerDocument.createElement("br"),t.className="k-br",e.appendChild(t))}},h.ui.editor.Dom=u}(window.kendo.jQuery),function(e,t){var n,i,r=window.kendo,o=r.ui.editor,a=o.Dom,s=e.extend,l="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),c=/"/g,d=/<br[^>]*>/i,u=/^\d+(\.\d*)?(px)?$/i,h=/<p><\/p>/i,p=/([\w|\-]+)\s*:\s*([^;]+);?/i,f=/^sizzle-\d+/i,g=/^k-script-/i,m=/\s*onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i,v=document.createElement("div");v.innerHTML=" <hr>",n=3===v.firstChild.nodeType,v=null,i={toEditableHtml:function(e){var t='<br class="k-br">';return e=e||"",e.replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<script([^>]*)>(.*)?<\/script>/gi,"<k:script$1>$2</k:script>").replace(/<img([^>]*)>/gi,function(e){return e.replace(m,"")}).replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/gi,"$1").replace(/^<(table|blockquote)/i,t+"<$1").replace(/<\/(table|blockquote)>$/i,"</$1>"+t)},_fillEmptyElements:function(t){e(t).find("p").each(function(){var t,n=e(this);if(/^\s*$/g.test(n.text())&&!n.find("img,input").length){for(t=this;t.firstChild&&3!=t.firstChild.nodeType;)t=t.firstChild;1!=t.nodeType||a.empty[a.name(t)]||(t.innerHTML=r.ui.editor.emptyElementContent)}})},_removeSystemElements:function(t){e(".k-paste-container",t).remove()},_resetOrderedLists:function(e){var t,n,i,r=e.getElementsByTagName("ol");for(t=0;r.length>t;t++)n=r[t],i=n.getAttribute("start"),n.setAttribute("start",1),i?n.setAttribute("start",i):n.removeAttribute(i)},_preventScriptExecution:function(t){e(t).find("*").each(function(){var e,t,n,i,r=this.attributes;for(t=0,n=r.length;n>t;t++)e=r[t],i=e.nodeName,e.specified&&/^on/i.test(i)&&(this.setAttribute("k-script-"+i,e.value),this.removeAttribute(i))})},htmlToDom:function(t,n){var o,s,l=r.support.browser,c=l.msie,d=c&&9>l.version;return t=i.toEditableHtml(t),d&&(t="<br/>"+t,o="originalsrc",s="originalhref",t=t.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,s+'="$1"'),t=t.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,o+'="$1"')),n.innerHTML=t,d?(a.remove(n.firstChild),e(n).find("k\\:script,script,link,img,a").each(function(){var e=this;e[s]&&(e.setAttribute("href",e[s]),e.removeAttribute(s)),e[o]&&(e.setAttribute("src",e[o]),e.removeAttribute(o))})):c&&(a.normalize(n),i._resetOrderedLists(n)),i._preventScriptExecution(n),i._fillEmptyElements(n),i._removeSystemElements(n),e("table",n).addClass("k-table"),n},domToXhtml:function(i,o){function s(t){var n,i,r,o,s=e.trim,l=s(t).split(";"),d=l.length;for(n=0,d=l.length;d>n;n++)l[n].length&&(i=p.exec(l[n]),i&&(r=s(i[1].toLowerCase()),o=s(i[2]),"font-size-adjust"!=r&&"font-stretch"!=r&&(r.indexOf("color")>=0?o=a.toHex(o):r.indexOf("font")>=0?o=o.replace(c,"'"):/\burl\(/g.test(o)&&(o=o.replace(c,"")),b.push(r),b.push(":"),b.push(o),b.push(";"))))}function m(n){var i,l,c,d,h,p,m,v,_,w=[],y=n.attributes;for(a.is(n,"img")&&(m=n.style.width,v=n.style.height,_=e(n),m&&u.test(m)&&(_.attr("width",parseInt(m,10)),a.unstyle(n,{width:t})),v&&u.test(v)&&(_.attr("height",parseInt(v,10)),a.unstyle(n,{height:t}))),l=0,c=y.length;c>l;l++)i=y[l],d=i.nodeName,h=i.value,p=i.specified,"value"==d&&"value"in n&&n.value?p=!0:"type"==d&&"text"==h?p=!0:"class"!=d||h?f.test(d)?p=!1:"complete"==d?p=!1:"altHtml"==d?p=!1:"start"==d&&(a.is(n,"ul")||a.is(n,"ol"))?p=!1:d.indexOf("_moz")>=0?p=!1:g.test(d)&&(p=!!o.scripts):p=!1,p&&w.push(i);if(w.length)for(w.sort(function(e,t){return e.nodeName>t.nodeName?1:t.nodeName>e.nodeName?-1:0}),l=0,c=w.length;c>l;l++)i=w[l],d=i.nodeName,h=i.value,("class"!=d||"k-table"!=h)&&(d=d.replace(g,""),b.push(" "),b.push(d),b.push('="'),"style"==d?s(h||n.style.cssText):b.push("src"==d||"href"==d?r.htmlEncode(n.getAttribute(d,2)):a.fillAttrs[d]?d:h),b.push('"'))}function v(e,t,n){for(var i=e.firstChild;i;i=i.nextSibling)w(i,t,n)}function _(e){return e.nodeValue.replace(/\ufeff/g,"")}function w(e,i,r){var s,l,c,d,u,h=e.nodeType;if(1==h){if(s=a.name(e),!s||a.insignificant(e))return;if(a.isInline(e)&&1==e.childNodes.length&&3==e.firstChild.nodeType&&!_(e.firstChild))return;if(!o.scripts&&("script"==s||"k:script"==s))return;if(l=k[s])return l.start(e),v(e,!1,l.skipEncoding),l.end(e),t;b.push("<"),b.push(s),m(e),a.empty[s]?b.push(" />"):(b.push(">"),v(e,i||a.is(e,"pre")),b.push("</"),b.push(s),b.push(">"))}else 3==h?(d=_(e),!i&&n&&(c=e.parentNode,u=e.previousSibling,u||(u=(a.isInline(c)?c:e).previousSibling),(!u||""===u.innerHTML||a.isBlock(u))&&(d=d.replace(/^[\r\n\v\f\t ]+/,"")),d=d.replace(/ +/," ")),b.push(r?d:a.encode(d,o))):4==h?(b.push("<![CDATA["),b.push(e.data),b.push("]]>")):8==h&&(e.data.indexOf("[CDATA[")<0?(b.push("<!--"),b.push(e.data),b.push("-->")):(b.push("<!"),b.push(e.data),b.push(">")))}function y(e){var t=e.childNodes.length,n=t&&3==e.firstChild.nodeType;return n&&(1==t||2==t&&a.insignificant(e.lastChild))}var b=[],k={"k:script":{start:function(e){b.push("<script"),m(e),b.push(">")},end:function(){b.push("</script>")},skipEncoding:!0},b:{start:function(){b.push("<strong>")},end:function(){b.push("</strong>")}},i:{start:function(){b.push("<em>")},end:function(){b.push("</em>")}},u:{start:function(){b.push('<span style="text-decoration:underline;">')},end:function(){b.push("</span>")}},iframe:{start:function(e){b.push("<iframe"),m(e),b.push(">")},end:function(){b.push("</iframe>")}},font:{start:function(e){var t,n,i;b.push('<span style="'),t=e.getAttribute("color"),n=l[e.getAttribute("size")],i=e.getAttribute("face"),t&&(b.push("color:"),b.push(a.toHex(t)),b.push(";")),i&&(b.push("font-face:"),b.push(i),b.push(";")),n&&(b.push("font-size:"),b.push(n),b.push(";")),b.push('">')},end:function(){b.push("</span>")}}};return k.script=k["k:script"],o=o||{},y(i)?a.encode(_(i.firstChild).replace(/[\r\n\v\f\t ]+/," "),o):(v(i),b=b.join(""),""===b.replace(d,"").replace(h,"")?"":b)}},s(o,{Serializer:i})}(window.kendo.jQuery),function(e){function t(e,t,n,i){var r,o,a,s;if(e==t)return i-n;for(r=t;r&&r.parentNode!=e;)r=r.parentNode;if(r)return p(r)-n;for(r=e;r&&r.parentNode!=t;)r=r.parentNode;if(r)return i-p(r)-1;for(o=h.commonAncestor(e,t),a=e;a&&a.parentNode!=o;)a=a.parentNode;for(a||(a=o),s=t;s&&s.parentNode!=o;)s=s.parentNode;return s||(s=o),a==s?0:p(s)-p(a)}function n(e,n){function i(e){try{return t(e.startContainer,e.endContainer,e.startOffset,e.endOffset)<0}catch(n){return!0}}i(e)&&(n?(e.commonAncestorContainer=e.endContainer=e.startContainer,e.endOffset=e.startOffset):(e.commonAncestorContainer=e.startContainer=e.endContainer,e.startOffset=e.endOffset),e.collapsed=!0)}function i(e){e.collapsed=e.startContainer==e.endContainer&&e.startOffset==e.endOffset;for(var t=e.startContainer;t&&t!=e.endContainer&&!h.isAncestorOf(t,e.endContainer);)t=t.parentNode;e.commonAncestorContainer=t}function r(e){var t=e.duplicate(),n=e.duplicate();return t.collapse(!0),n.collapse(!1),h.commonAncestor(e.parentElement(),t.parentElement(),n.parentElement())}function o(e,t,n){var i,r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],a=0,s=f(r),l=s?r:r.childNodes[o]||null,c=s?r.parentNode:r,d=t.ownerDocument,u=d.body.createTextRange();(3==r.nodeType||4==r.nodeType)&&(a=o),c||(c=d.body),"img"==c.nodeName.toLowerCase()?(u.moveToElementText(c),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u)):(i=c.insertBefore(h.create(d,"a"),l),u.moveToElementText(i),h.remove(i),u[n?"moveStart":"moveEnd"]("character",a),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u))}function a(e,t,n,i){var r,o,a,s,l,c,d,u=h.create(t.ownerDocument,"a"),g=e.duplicate(),m=i?"StartToStart":"StartToEnd",v=!1;u.innerHTML="﻿",g.collapse(i),o=g.parentElement(),h.isAncestorOrSelf(n,o)||(o=n);do v?o.insertBefore(u,u.previousSibling):(o.appendChild(u),v=!0),g.moveToElementText(u);while((r=g.compareEndPoints(m,e))>0&&u.previousSibling);a=u.nextSibling,-1==r&&f(a)?(g.setEndPoint(i?"EndToStart":"EndToEnd",e),h.remove(u),c=[a,g.text.length]):(s=!i&&u.previousSibling,l=i&&u.nextSibling,f(l)?c=[l,0]:f(s)?c=[s,s.length]:(d=p(u),c=o.nextSibling&&d==o.childNodes.length-1?[o.nextSibling,0]:[o,d]),h.remove(u)),t[i?"setStart":"setEnd"].apply(t,c)}var s=window.kendo,l=s.Class,c=e.extend,d=s.ui.editor,u=s.support.browser,h=d.Dom,p=h.findNodeIndex,f=h.isDataNode,g=h.findClosestAncestor,m=h.getNodeLength,v=h.normalize,_={selectionFromWindow:function(e){return"getSelection"in e?e.getSelection():new b(e.document)},selectionFromRange:function(e){var t=S.documentFromRange(e);return _.selectionFromDocument(t)},selectionFromDocument:function(e){return _.selectionFromWindow(h.windowFromDocument(e))}},w=l.extend({init:function(t){e.extend(this,{ownerDocument:t,startContainer:t,endContainer:t,commonAncestorContainer:t,startOffset:0,endOffset:0,collapsed:!0})},setStart:function(e,t){this.startContainer=e,this.startOffset=t,i(this),n(this,!0)},setEnd:function(e,t){this.endContainer=e,this.endOffset=t,i(this),n(this,!1)},setStartBefore:function(e){this.setStart(e.parentNode,p(e))},setStartAfter:function(e){this.setStart(e.parentNode,p(e)+1)},setEndBefore:function(e){this.setEnd(e.parentNode,p(e))},setEndAfter:function(e){this.setEnd(e.parentNode,p(e)+1)},selectNode:function(e){this.setStartBefore(e),this.setEndAfter(e)},selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e[1===e.nodeType?"childNodes":"nodeValue"].length)},collapse:function(e){var t=this;e?t.setEnd(t.startContainer,t.startOffset):t.setStart(t.endContainer,t.endOffset)},deleteContents:function(){var e=this,t=e.cloneRange();e.startContainer!=e.commonAncestorContainer&&e.setStartAfter(g(e.commonAncestorContainer,e.startContainer)),e.collapse(!0),function n(e){for(;e.next();)e.hasPartialSubtree()?n(e.getSubtreeIterator()):e.remove()}(new y(t))},cloneContents:function(){var e=S.documentFromRange(this);return function t(n){for(var i,r=e.createDocumentFragment();i=n.next();)i=i.cloneNode(!n.hasPartialSubtree()),n.hasPartialSubtree()&&i.appendChild(t(n.getSubtreeIterator())),r.appendChild(i);return r}(new y(this))},extractContents:function(){var e,t=this,n=t.cloneRange();return t.startContainer!=t.commonAncestorContainer&&t.setStartAfter(g(t.commonAncestorContainer,t.startContainer)),t.collapse(!0),e=S.documentFromRange(t),function i(n){for(var r,o=e.createDocumentFragment();r=n.next();)n.hasPartialSubtree()?(r=r.cloneNode(!1),r.appendChild(i(n.getSubtreeIterator()))):n.remove(t.originalRange),o.appendChild(r);return o}(new y(n))},insertNode:function(e){var t=this;f(t.startContainer)?(t.startOffset!=t.startContainer.nodeValue.length&&h.splitDataNode(t.startContainer,t.startOffset),h.insertAfter(e,t.startContainer)):h.insertAt(t.startContainer,e,t.startOffset),t.setStart(t.startContainer,t.startOffset)},cloneRange:function(){return e.extend(new w(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var e=this.startContainer.nodeName,t=this.endContainer.nodeName;return("#text"==e?this.startContainer.nodeValue:e)+"("+this.startOffset+") : "+("#text"==t?this.endContainer.nodeValue:t)+"("+this.endOffset+")"}}),y=l.extend({init:function(t){if(e.extend(this,{range:t,_current:null,_next:null,_end:null}),!t.collapsed){var n=t.commonAncestorContainer;this._next=t.startContainer!=n||f(t.startContainer)?g(n,t.startContainer):t.startContainer.childNodes[t.startOffset],this._end=t.endContainer!=n||f(t.endContainer)?g(n,t.endContainer).nextSibling:t.endContainer.childNodes[t.endOffset]}},hasNext:function(){return!!this._next},next:function(){var e=this,t=e._current=e._next;return e._next=e._current&&e._current.nextSibling!=e._end?e._current.nextSibling:null,f(e._current)&&(e.range.endContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(e.range.endOffset,t.length-e.range.endOffset)),e.range.startContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(0,e.range.startOffset))),t},traverse:function(e){function t(){return i._current=i._next,i._next=i._current&&i._current.nextSibling!=i._end?i._current.nextSibling:null,i._current}for(var n,i=this;n=t();)i.hasPartialSubtree()?i.getSubtreeIterator().traverse(e):e(n);return n},remove:function(e){var t,n,i,r,o,a=this,s=a.range.startContainer==a._current,l=a.range.endContainer==a._current;f(a._current)&&(s||l)?(t=s?a.range.startOffset:0,n=l?a.range.endOffset:a._current.length,i=n-t,e&&(s||l)&&(a._current==e.startContainer&&e.startOffset>=t&&(e.startOffset-=i),a._current==e.endContainer&&e.endOffset>=n&&(e.endOffset-=i)),a._current.deleteData(t,i)):(r=a._current.parentNode,!e||a.range.startContainer!=r&&a.range.endContainer!=r||(o=p(a._current),r==e.startContainer&&e.startOffset>=o&&(e.startOffset-=1),r==e.endContainer&&e.endOffset>o&&(e.endOffset-=1)),h.remove(a._current))},hasPartialSubtree:function(){return!f(this._current)&&(h.isAncestorOrSelf(this._current,this.range.startContainer)||h.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var e=this,t=e.range.cloneRange();return t.selectNodeContents(e._current),h.isAncestorOrSelf(e._current,e.range.startContainer)&&t.setStart(e.range.startContainer,e.range.startOffset),h.isAncestorOrSelf(e._current,e.range.endContainer)&&t.setEnd(e.range.endContainer,e.range.endOffset),new y(t)}}),b=l.extend({init:function(e){this.ownerDocument=e,this.rangeCount=1},addRange:function(e){var t=this.ownerDocument.body.createTextRange();o(t,e,!1),o(t,e,!0),t.select()},removeAllRanges:function(){var e=this.ownerDocument.selection;"None"!=e.type&&e.empty()},getRangeAt:function(){var e,t,n,i,o,s,l,c,d=new w(this.ownerDocument),u=this.ownerDocument.selection;try{if(e=u.createRange(),t=e.item?e.item(0):e.parentElement(),t.ownerDocument!=this.ownerDocument)return d}catch(h){return d}if("Control"==u.type)d.selectNode(e.item(0));else if(n=r(e),a(e,d,n,!0),a(e,d,n,!1),9==d.startContainer.nodeType&&d.setStart(d.endContainer,d.startOffset),9==d.endContainer.nodeType&&d.setEnd(d.startContainer,d.endOffset),0===e.compareEndPoints("StartToEnd",e)&&d.collapse(!1),i=d.startContainer,o=d.endContainer,s=this.ownerDocument.body,!(d.collapsed||0!==d.startOffset||d.endOffset!=m(d.endContainer)||i==o&&f(i)&&i.parentNode==s)){for(l=!1,c=!1;0===p(i)&&i==i.parentNode.firstChild&&i!=s;)i=i.parentNode,l=!0;for(;p(o)==m(o.parentNode)-1&&o==o.parentNode.lastChild&&o!=s;)o=o.parentNode,c=!0;i==s&&o==s&&l&&c&&(d.setStart(i,0),d.setEnd(o,m(s)))}return d}}),k=l.extend({init:function(e){this.enumerate=function(){function t(e){if(h.is(e,"img")||3==e.nodeType&&(!h.isWhitespace(e)||"﻿"==e.nodeValue))n.push(e);else for(e=e.firstChild;e;)t(e),e=e.nextSibling}var n=[];return new y(e).traverse(t),n}}}),x=l.extend({init:function(e,t){var n=this;n.range=e,n.rootNode=S.documentFromRange(e),n.body=t||n.getEditable(e),"body"!=h.name(n.body)&&(n.rootNode=n.body),n.html=n.body.innerHTML,n.startContainer=n.nodeToPath(e.startContainer),n.endContainer=n.nodeToPath(e.endContainer),n.startOffset=n.offset(e.startContainer,e.startOffset),n.endOffset=n.offset(e.endContainer,e.endOffset)},index:function(e){for(var t,n=0,i=e.nodeType;e=e.previousSibling;)t=e.nodeType,(3!=t||i!=t)&&n++,i=t;return n},getEditable:function(e){for(var t=e.commonAncestorContainer;t&&(3==t.nodeType||t.attributes&&!t.attributes.contentEditable);)t=t.parentNode;return t},restoreHtml:function(){this.body.innerHTML=this.html},offset:function(e,t){if(3==e.nodeType)for(;(e=e.previousSibling)&&3==e.nodeType;)t+=e.nodeValue.length;return t},nodeToPath:function(e){for(var t=[];e!=this.rootNode;)t.push(this.index(e)),e=e.parentNode;return t},toRangePoint:function(e,t,n,i){for(var r=this.rootNode,o=n.length,a=i;o--;)r=r.childNodes[n[o]];for(;r&&3==r.nodeType&&a>r.nodeValue.length;)a-=r.nodeValue.length,r=r.nextSibling;r&&a>=0&&e[t?"setStart":"setEnd"](r,a)},toRange:function(){var e=this,t=e.range.cloneRange();return e.toRangePoint(t,!0,e.startContainer,e.startOffset),e.toRangePoint(t,!1,e.endContainer,e.endOffset),t}}),C=l.extend({init:function(){this.caret=null},addCaret:function(e){var t=this;return t.caret=h.create(S.documentFromRange(e),"span",{className:"k-marker"}),e.insertNode(t.caret),e.selectNode(t.caret),t.caret},removeCaret:function(e){var t,n,i,r,o=this,a=o.caret.previousSibling,s=0;a&&(s=f(a)?a.nodeValue.length:p(a)),t=o.caret.parentNode,n=a?p(a):0,h.remove(o.caret),v(t),i=t.childNodes[n],f(i)?e.setStart(i,s):i?(r=h.lastTextNode(i),r?e.setStart(r,r.nodeValue.length):e[a?"setStartAfter":"setStartBefore"](i)):(u.msie||t.innerHTML||(t.innerHTML='<br _moz_dirty="" />'),e.selectNodeContents(t)),e.collapse(!0)},add:function(e,t){var n,i,r=this,o=e.collapsed&&!S.isExpandable(e),a=S.documentFromRange(e);return t&&e.collapsed&&(r.addCaret(e),e=S.expand(e)),n=e.cloneRange(),n.collapse(!1),r.end=h.create(a,"span",{className:"k-marker"}),n.insertNode(r.end),n=e.cloneRange(),n.collapse(!0),r.start=r.end.cloneNode(!0),n.insertNode(r.start),r._removeDeadMarkers(r.start,r.end),o&&(i=a.createTextNode("﻿"),h.insertAfter(i.cloneNode(),r.start),h.insertBefore(i,r.end)),v(e.commonAncestorContainer),e.setStartBefore(r.start),e.setEndAfter(r.end),e},_removeDeadMarkers:function(e,t){e.previousSibling&&"﻿"==e.previousSibling.nodeValue&&h.remove(e.previousSibling),t.nextSibling&&"﻿"==t.nextSibling.nodeValue&&h.remove(t.nextSibling)},remove:function(e){var t,n,i,r,o,a,s,l,c,d,u,g,m,_=this,w=_.start,y=_.end;for(v(e.commonAncestorContainer);!w.nextSibling&&w.parentNode;)w=w.parentNode;for(;!y.previousSibling&&y.parentNode;)y=y.parentNode;if(t=w.previousSibling&&3==w.previousSibling.nodeType&&w.nextSibling&&3==w.nextSibling.nodeType,n=y.previousSibling&&3==y.previousSibling.nodeType&&y.nextSibling&&3==y.nextSibling.nodeType,i=t&&n,w=w.nextSibling,y=y.previousSibling,r=!1,o=!1,w==_.end&&(o=!!_.start.previousSibling,w=y=_.start.previousSibling||_.end.nextSibling,r=!0),h.remove(_.start),h.remove(_.end),!w||!y)return e.selectNodeContents(e.commonAncestorContainer),void e.collapse(!0);if(a=r?f(w)?w.nodeValue.length:w.childNodes.length:0,s=f(y)?y.nodeValue.length:y.childNodes.length,3==w.nodeType)for(;w.previousSibling&&3==w.previousSibling.nodeType;)w=w.previousSibling,a+=w.nodeValue.length;if(3==y.nodeType)for(;y.previousSibling&&3==y.previousSibling.nodeType;)y=y.previousSibling,s+=y.nodeValue.length;for(l=p(w),c=w.parentNode,d=p(y),u=y.parentNode,g=w;g.previousSibling;g=g.previousSibling)3==g.nodeType&&3==g.previousSibling.nodeType&&l--;for(m=y;m.previousSibling;m=m.previousSibling)3==m.nodeType&&3==m.previousSibling.nodeType&&d--;v(c),3==w.nodeType&&(w=c.childNodes[l]),v(u),3==y.nodeType&&(y=u.childNodes[d]),r?(3==w.nodeType?e.setStart(w,a):e[o?"setStartAfter":"setStartBefore"](w),e.collapse(!0)):(3==w.nodeType?e.setStart(w,a):e.setStartBefore(w),3==y.nodeType?e.setEnd(y,s):e.setEndAfter(y)),_.caret&&_.removeCaret(e)}}),T=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,S={nodes:function(e){var t=S.textNodes(e);return t.length||(e.selectNodeContents(e.commonAncestorContainer),t=S.textNodes(e),t.length||(t=h.significantChildNodes(e.commonAncestorContainer))),t},textNodes:function(e){return new k(e).enumerate()},documentFromRange:function(e){var t=e.startContainer;return 9==t.nodeType?t:t.ownerDocument},createRange:function(e){return u.msie&&9>u.version?new w(e):e.createRange()},selectRange:function(e){var t,n=S.image(e);n&&(e.setStartAfter(n),e.setEndAfter(n)),t=_.selectionFromRange(e),t.removeAllRanges(),t.addRange(e)},stringify:function(e){return s.format("{0}:{1} - {2}:{3}",h.name(e.startContainer),e.startOffset,h.name(e.endContainer),e.endOffset)},split:function(e,t,n){function i(i){var r,o=e.cloneRange();o.collapse(i),o[i?"setStartBefore":"setEndAfter"](t),r=o.extractContents(),n&&(r=h.trim(r)),h[i?"insertBefore":"insertAfter"](r,t)}i(!0),i(!1)},mapAll:function(t,n){var i=[];return new y(t).traverse(function(t){var r=n(t);r&&e.inArray(r,i)<0&&i.push(r)}),i},getAll:function(e,t){var n=t;return"string"==typeof t&&(t=function(e){return h.is(e,n)}),S.mapAll(e,function(e){return t(e)?e:void 0})},getMarkers:function(e){return S.getAll(e,function(e){return"k-marker"==e.className})},image:function(e){var t=S.getAll(e,"img");return 1==t.length?t[0]:void 0},wrapSelectedElements:function(e){function t(e,t){var n,i=h.getNodeLength(t);if(e==i)return!0;for(n=e;i>n;n++)if(!h.insignificant(t.childNodes[n]))return!1;return!0}for(var n=h.editableParent(e.startContainer),i=h.editableParent(e.endContainer);0===e.startOffset&&e.startContainer!=n;)e.setStart(e.startContainer.parentNode,h.findNodeIndex(e.startContainer));for(;t(e.endOffset,e.endContainer)&&e.endContainer!=i;)e.setEnd(e.endContainer.parentNode,h.findNodeIndex(e.endContainer)+1);return e},expand:function(e){var t,n,i,r,o=e.cloneRange(),a=o.startContainer.childNodes[0===o.startOffset?0:o.startOffset-1],s=o.endContainer.childNodes[o.endOffset];return f(a)&&f(s)?(t=a.nodeValue,n=s.nodeValue,t&&n?(i=t.split("").reverse().join("").search(T),r=n.search(T),i&&r?(r=-1==r?n.length:r,i=-1==i?0:t.length-i,o.setStart(a,i),o.setEnd(s,r),o):o):o):o},isExpandable:function(e){var t,n,i,r,o,a,s=e.startContainer,l=S.documentFromRange(e);return s==l||s==l.body?!1:(t=e.cloneRange(),(n=s.nodeValue)?(i=n.substring(0,t.startOffset),r=n.substring(t.startOffset),o=0,a=0,i&&(o=i.split("").reverse().join("").search(T)),r&&(a=r.search(T)),o&&a):!1)}};c(d,{SelectionUtils:_,W3CRange:w,RangeIterator:y,W3CSelection:b,RangeEnumerator:k,RestorePoint:x,Marker:C,RangeUtils:S})}(window.kendo.jQuery),function(e){function t(e,t){var n=e.selectionRestorePoint=new d(e.getRange()),i=new f(t,n);return i.editor=e,e.undoRedoStack.push(i),n}var n=window.kendo,i=n.Class,r=n.ui.editor,o=r.EditorUtils,a=o.registerTool,s=r.Dom,l=r.Tool,c=r.ToolTemplate,d=r.RestorePoint,u=r.Marker,h=e.extend,p=i.extend({init:function(e){this.options=e,this.restorePoint=new d(e.range),this.marker=new u,this.formatter=e.formatter},getRange:function(){return this.restorePoint.toRange()},lockRange:function(e){return this.marker.add(this.getRange(),e)},releaseRange:function(e){this.marker.remove(e),this.editor.selectRange(e)},undo:function(){var e=this.restorePoint;e.restoreHtml(),this.editor.selectRange(e.toRange())},redo:function(){this.exec()},createDialog:function(t,i){var r=this.editor;return e(t).appendTo(document.body).kendoWindow(h({},r.options.dialogOptions,i)).closest(".k-window").toggleClass("k-rtl",n.support.isRtl(r.wrapper)).end()},exec:function(){var e=this.lockRange(!0);this.formatter.editor=this.editor,this.formatter.toggle(e),this.releaseRange(e)}}),f=i.extend({init:function(e,t){this.body=e.body,this.startRestorePoint=e,this.endRestorePoint=t},redo:function(){this.body.innerHTML=this.endRestorePoint.html,this.editor.selectRange(this.endRestorePoint.toRange())},undo:function(){this.body.innerHTML=this.startRestorePoint.html,this.editor.selectRange(this.startRestorePoint.toRange())}}),g=p.extend({init:function(e){p.fn.init.call(this,e),this.managesUndoRedo=!0},exec:function(){var e,t=this.editor,n=this.options,i=n.range,r=t.body,o=new d(i,r),a=n.html||n.value||"";t.selectRange(i),t.clipboard.paste(a,n),n.postProcess&&n.postProcess(t,t.getRange()),e=new f(o,new d(t.getRange(),r)),e.editor=t,t.undoRedoStack.push(e),t.focus()}}),m=l.extend({initialize:function(e,t){var n=t.editor,i=this.options,o=i.items?i.items:n.options.insertHtml;new r.SelectBox(e,{dataSource:o,dataTextField:"text",dataValueField:"value",change:function(){l.exec(n,"insertHtml",this.value())},title:n.options.messages.insertHtml,highlightFirst:!1})},command:function(e){return new g(e)},update:function(e){var t=e.data("kendoSelectBox")||e.find("select").data("kendoSelectBox");t.close(),t.value(t.options.title)}}),v=i.extend({init:function(){this.stack=[],this.currentCommandIndex=-1},push:function(e){this.stack=this.stack.slice(0,this.currentCommandIndex+1),this.currentCommandIndex=this.stack.push(e)-1},undo:function(){this.canUndo()&&this.stack[this.currentCommandIndex--].undo()},redo:function(){this.canRedo()&&this.stack[++this.currentCommandIndex].redo()},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}}),_=i.extend({init:function(e){this.editor=e},keydown:function(n){var i,r=this,o=r.editor,a=o.keyboard,s=a.isTypingKey(n),l=h(e.Event(),n);return r.editor.trigger("keydown",l),l.isDefaultPrevented()?(n.preventDefault(),!0):l.isDefaultPrevented()||!s||a.isTypingInProgress()?!1:(i=o.getRange(),r.startRestorePoint=new d(i),a.startTyping(function(){r.endRestorePoint=t(o,r.startRestorePoint)}),!0)},keyup:function(e){var t=this.editor.keyboard;return this.editor.trigger("keyup",e),t.isTypingInProgress()?(t.endTyping(),!0):!1}}),w=i.extend({init:function(e){this.editor=e},keydown:function(e){var i,r,o,a,l;if(e.keyCode===n.keys.BACKSPACE){if(i=this.editor,r=i.getRange(),o=n.support.browser.msie?"":'<br _moz_dirty="" />',r.collapsed)return;
e.preventDefault(),a=new d(r),l=r.commonAncestorContainer,/t(able|body|r)/i.test(s.name(l))&&r.selectNode(s.closest(l,"table")),r.deleteContents(),l=r.commonAncestorContainer,"p"===s.name(l)&&""===l.innerHTML&&(l.innerHTML=o,r.setStart(l,0),r.collapse(!0),i.selectRange(r)),t(i,a)}},keyup:function(){}}),y=i.extend({init:function(e){this.editor=e,this.systemCommandIsInProgress=!1},createUndoCommand:function(){this.startRestorePoint=this.endRestorePoint=t(this.editor,this.startRestorePoint)},changed:function(){return this.startRestorePoint?this.startRestorePoint.html!=this.editor.body.innerHTML:!1},keydown:function(e){var t=this,n=t.editor,i=n.keyboard;return i.isModifierKey(e)?(i.isTypingInProgress()&&i.endTyping(!0),t.startRestorePoint=new d(n.getRange()),!0):i.isSystem(e)?(t.systemCommandIsInProgress=!0,t.changed()&&(t.systemCommandIsInProgress=!1,t.createUndoCommand()),!0):!1},keyup:function(){var e=this;return e.systemCommandIsInProgress&&e.changed()?(e.systemCommandIsInProgress=!1,e.createUndoCommand(),!0):!1}}),b=i.extend({init:function(e){this.handlers=e,this.typingInProgress=!1},isCharacter:function(e){return e>=48&&90>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||229==e},toolFromShortcut:function(t,n){var i,r,o=String.fromCharCode(n.keyCode);for(i in t)if(r=e.extend({ctrl:!1,alt:!1,shift:!1},t[i].options),(r.key==o||r.key==n.keyCode)&&r.ctrl==n.ctrlKey&&r.alt==n.altKey&&r.shift==n.shiftKey)return i},isTypingKey:function(e){var t=e.keyCode;return this.isCharacter(t)&&!e.ctrlKey&&!e.altKey||32==t||13==t||8==t||46==t&&!e.shiftKey&&!e.ctrlKey&&!e.altKey},isModifierKey:function(e){var t=e.keyCode;return 17==t&&!e.shiftKey&&!e.altKey||16==t&&!e.ctrlKey&&!e.altKey||18==t&&!e.ctrlKey&&!e.shiftKey},isSystem:function(e){return 46==e.keyCode&&e.ctrlKey&&!e.altKey&&!e.shiftKey},startTyping:function(e){this.onEndTyping=e,this.typingInProgress=!0},stopTyping:function(){this.typingInProgress&&this.onEndTyping&&this.onEndTyping(),this.typingInProgress=!1},endTyping:function(t){var n=this;n.clearTimeout(),t?n.stopTyping():n.timeout=window.setTimeout(e.proxy(n.stopTyping,n),1e3)},isTypingInProgress:function(){return this.typingInProgress},clearTimeout:function(){window.clearTimeout(this.timeout)},notify:function(e,t){var n,i=this.handlers;for(n=0;i.length>n&&!i[n][t](e);n++);},keydown:function(e){this.notify(e,"keydown")},keyup:function(e){this.notify(e,"keyup")}}),k=i.extend({init:function(e){this.editor=e,this.cleaners=[new C,new T,new S]},htmlToFragment:function(e){var t=this.editor,n=t.document,i=s.create(n,"div"),r=n.createDocumentFragment();for(i.innerHTML=e;i.firstChild;)r.appendChild(i.firstChild);return r},isBlock:function(e){return/<(div|p|ul|ol|table|h[1-6])/i.test(e)},_startModification:function(){var e,t,n=this.editor;if(!this._inProgress)return this._inProgress=!0,e=n.getRange(),t=new d(e),s.persistScrollTop(n.document),{range:e,restorePoint:t}},_endModification:function(e){t(this.editor,e.restorePoint),this.editor._selectionChange(),this._inProgress=!1},_contentModification:function(e,t){var n=this,i=n.editor,r=n._startModification();r&&(e.call(n,i,r.range),setTimeout(function(){t.call(n,i,r.range),n._endModification(r)}))},oncut:function(){this._contentModification(e.noop,e.noop)},_fileToDataURL:function(t,n){var i=t.getAsFile(),r=new FileReader;r.onload=n||e.noop,r.readAsDataURL(i)},_triggerPaste:function(e,t){var n={html:e||""};n.html=n.html.replace(/\ufeff/g,""),this.editor.trigger("paste",n),this.paste(n.html,t||{})},_handleImagePaste:function(e){var t,n,i,r;if("FileReader"in window&&(t=this,n=e.clipboardData||e.originalEvent.clipboardData,i=n&&(n.items||n.files),i&&i.length&&/^image\//i.test(i[0].type)&&(r=t._startModification())))return this._fileToDataURL(i[0],function(e){t._triggerPaste('<img src="'+e.target.result+'" />'),t._endModification(r)}),!0},onpaste:function(t){this._handleImagePaste(t)||this._contentModification(function(i,r){var o,a,l,c=s.create(i.document,"div",{className:"k-paste-container",innerHTML:"﻿"}),d=n.support.browser;i.body.appendChild(c),d.msie&&11>d.version?(t.preventDefault(),o=i.createRange(),o.selectNodeContents(c),i.selectRange(o),a=i.document.body.createTextRange(),a.moveToElementText(c),e(i.body).unbind("paste"),a.execCommand("Paste"),e(i.body).bind("paste",e.proxy(this.onpaste,this))):(l=i.createRange(),l.selectNodeContents(c),i.selectRange(l)),r.deleteContents()},function(t,n){var i,r="";t.selectRange(n),i=e(t.body).children(".k-paste-container"),i.each(function(){var e=this.lastChild;e&&s.is(e,"br")&&s.remove(e),r+=this.innerHTML}),i.remove(),this._triggerPaste(r,{clean:!0})})},splittableParent:function(e,t){var n,i;if(e)return s.closestEditableOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,i=t.ownerDocument.body,s.isInline(n))for(;n.parentNode!=i&&!s.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(t,n){var i,o,a,l,c,d,p,f,g,m,v,_=this.editor;for(n=h({clean:!1,split:!0},n),i=0,o=this.cleaners.length;o>i;i++)this.cleaners[i].applicable(t)&&(t=this.cleaners[i].clean(t));if(n.clean&&(t=t.replace(/(<br>(\s|&nbsp;)*)+(<\/?(div|p|li|col|t))/gi,"$3"),t=t.replace(/<(a|span)[^>]*><\/\1>/gi,"")),t=t.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li></ul>"),a=this.isBlock(t),_.focus(),l=_.getRange(),l.deleteContents(),l.startContainer==_.document&&l.selectNodeContents(_.body),c=new u,d=c.addCaret(l),p=this.splittableParent(a,d),f=!1,g=p!=_.body&&!s.is(p,"td"),n.split&&g&&(a||s.isInline(p))&&(l.selectNode(d),r.RangeUtils.split(l,p,!0),f=!0),m=this.htmlToFragment(t),m.firstChild&&"k-paste-container"===m.firstChild.className){for(v=[],i=0,o=m.childNodes.length;o>i;i++)v.push(m.childNodes[i].innerHTML);m=this.htmlToFragment(v.join("<br />"))}if(e(m.childNodes).filter("table").addClass("k-table").end().find("table").addClass("k-table"),l.insertNode(m),p=this.splittableParent(a,d),f){for(;d.parentNode!=p;)s.unwrap(d.parentNode);s.unwrap(d.parentNode)}s.normalize(l.commonAncestorContainer),d.style.display="inline",s.restoreScrollTop(_.document),s.scrollTo(d),c.removeCaret(l),_.selectRange(l)}}),x=i.extend({clean:function(e){var t,n,i=this,r=i.replacements;for(t=0,n=r.length;n>t;t+=2)e=e.replace(r[t],r[t+1]);return e}}),C=x.extend({init:function(){this.replacements=[/<(\/?)script([^>]*)>/i,"<$1telerik:script$2>"]},applicable:function(e){return/<script[^>]*>/i.test(e)}}),T=x.extend({init:function(){this.replacements=[/<\?xml[^>]*>/gi,"",/<!--(.|\n)*?-->/g,"",/&quot;/g,"'",/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6]|hr|p|div|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|address|pre|form|blockquote|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g,"$1",/<br><br>/g,"<BR><BR>",/<br>(?!\n)/g," ",/<table([^>]*)>(\s|&nbsp;)+<t/gi,"<table$1><t",/<tr[^>]*>(\s|&nbsp;)*<\/tr>/gi,"",/<tbody[^>]*>(\s|&nbsp;)*<\/tbody>/gi,"",/<table[^>]*>(\s|&nbsp;)*<\/table>/gi,"",/<BR><BR>/g,"<br>",/^\s*(&nbsp;)+/gi,"",/(&nbsp;|<br[^>]*>)+\s*$/gi,"",/mso-[^;"]*;?/gi,"",/<(\/?)b(\s[^>]*)?>/gi,"<$1strong$2>",/<(\/?)i(\s[^>]*)?>/gi,"<$1em$2>",/<o:p>&nbsp;<\/o:p>/gi,"&nbsp;",/<\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:|x:)[^>]*>)?/gi,"",/<\/o>/g,"",/style=(["|'])\s*\1/g,"",/(<br[^>]*>)?\n/g,function(e,t){return t?e:" "}]},applicable:function(e){return/class="?Mso|style="[^"]*mso-/i.test(e)||/urn:schemas-microsoft-com:office/.test(e)},stripEmptyAnchors:function(e){return e.replace(/<a([^>]*)>\s*<\/a>/gi,function(e,t){return!t||t.indexOf("href")<0?"":e})},listType:function(e){var t;return/^(<span [^>]*texhtml[^>]*>)?<span [^>]*(Symbol|Wingdings)[^>]*>/i.test(e)&&(t=!0),e=e.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g," "),!t&&/^[\u2022\u00b7\u00a7\u00d8o]\u00a0+/.test(e)||t&&/^.\u00a0+/.test(e)?"ul":/^\s*\w+[\.\)]\u00a0{2,}/.test(e)?"ol":void 0},_convertToLi:function(e){var t;return 1==e.childNodes.length?t=e.firstChild.innerHTML.replace(/^\w+[\.\)](&nbsp;)+ /,""):(s.remove(e.firstChild),3==e.firstChild.nodeType&&/^[ivx]+\.$/i.test(e.firstChild.nodeValue)&&s.remove(e.firstChild),/^(&nbsp;|\s)+$/i.test(e.firstChild.innerHTML)&&s.remove(e.firstChild),t=e.innerHTML),s.remove(e),s.create(document,"li",{innerHTML:t})},lists:function(t){var n,i,r,o,a,l,c,d,u,h=e(s.blockElements.join(","),t),p=-1,f={ul:{},ol:{}},g=t;for(r=0;h.length>r;r++)if(o=h[r],a=this.listType(o.innerHTML),i=s.name(o),"td"!=i)if(a&&"p"==i){if(l=parseFloat(o.style.marginLeft||0),c=f[a][l],(l>p||!c)&&(c=s.create(document,a),g==t?s.insertBefore(c,o):g.appendChild(c),f[a][l]=c),n!=a)for(d in f)for(u in f[d])e.contains(c,f[d][u])&&delete f[d][u];g=this._convertToLi(o),c.appendChild(g),p=l,n=a}else o.innerHTML?(f={ul:{},ol:{}},g=t,p=-1):s.remove(o)},removeAttributes:function(e){for(var t=e.attributes,n=t.length;n--;)"colspan"!=s.name(t[n])&&e.removeAttributeNode(t[n])},createColGroup:function(t){var i=t.cells,r=e(t).closest("table"),o=r.children("colgroup");2>i.length||(o.length&&(i=o.children(),o[0].parentNode.removeChild(o[0])),o=e(e.map(i,function(e){var t=e.width;return t&&0!==parseInt(t,10)?n.format('<col style="width:{0}px;"/>',t):"<col />"}).join("")),o.is("colgroup")||(o=e("<colgroup/>").append(o)),o.prependTo(r))},convertHeaders:function(t){var n,i=t.cells,r=e.map(i,function(t){var n=e(t).children("p").children("strong")[0];return n&&"strong"==s.name(n)?n:void 0});if(r.length==i.length){for(n=0;r.length>n;n++)s.unwrap(r[n]);for(e(t).closest("table").find("colgroup").after("<thead></thead>").end().find("thead").append(t),n=0;i.length>n;n++)s.changeTag(i[n],"th")}},removeParagraphs:function(t){var n,i,r,o,a;for(n=0;t.length>n;n++)for(this.removeAttributes(t[n]),o=e(t[n]),a=o.children("p"),i=0,r=a.length;r>i;i++)r-1>i&&s.insertAfter(s.create(document,"br"),a[i]),s.unwrap(a[i])},removeDefaultColors:function(e){for(var t=0;e.length>t;t++)/^\s*color:\s*[^;]*;?$/i.test(e[t].style.cssText)&&s.unwrap(e[t])},tables:function(t){var n,i,r,o,a,s=e(t).find("table"),l=this;for(o=0;s.length>o;o++){for(n=s[o].rows,r=i=n[0],a=1;n.length>a;a++)n[a].cells.length>r.cells.length&&(r=n[a]);l.createColGroup(r),l.convertHeaders(i),l.removeAttributes(s[o]),l.removeParagraphs(s.eq(o).find("td,th")),l.removeDefaultColors(s.eq(o).find("span"))}},headers:function(t){var n,i=e(t).find("p.MsoTitle");for(n=0;i.length>n;n++)s.changeTag(i[n],"h1")},clean:function(e){var t,n=this;return e=x.fn.clean.call(n,e),e=n.stripEmptyAnchors(e),t=s.create(document,"div",{innerHTML:e}),n.headers(t),n.lists(t),n.tables(t),e=t.innerHTML.replace(/(<[^>]*)\s+class="?[^"\s>]*"?/gi,"$1")}}),S=x.extend({init:function(){this.replacements=[/\s+class="Apple-style-span[^"]*"/gi,"",/<(div|p|h[1-6])\s+style="[^"]*"/gi,"<$1",/^<div>(.*)<\/div>$/,"$1"]},applicable:function(e){return/class="?Apple-style-span|style="[^"]*-webkit-nbsp-mode/i.test(e)}});h(r,{Command:p,GenericCommand:f,InsertHtmlCommand:g,InsertHtmlTool:m,UndoRedoStack:v,TypingHandler:_,SystemHandler:y,BackspaceHandler:w,Keyboard:b,Clipboard:k,Cleaner:x,MSWordFormatCleaner:T,WebkitFormatCleaner:S}),a("insertHtml",new m({template:new c({template:o.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=t.ui.editor,r=t.ui.Editor.fn.options.formats,o=i.EditorUtils,a=i.Tool,s=i.ToolTemplate,l=i.FormatTool,c=i.Dom,d=i.RangeUtils,u=e.extend,h=i.EditorUtils.registerTool,p=i.EditorUtils.registerFormat,f="k-marker",g=n.extend({init:function(e){this.format=e},numberOfSiblings:function(e){var t,n=0,i=0,r=0,o=e.parentNode;for(t=o.firstChild;t;t=t.nextSibling)t!=e&&(t.className==f?r++:3==t.nodeType?n++:i++);return r>1&&o.firstChild.className==f&&o.lastChild.className==f?0:i+n},findSuitable:function(e,t){var n,i;if(!t&&this.numberOfSiblings(e)>0)return null;for(n=e.parentNode,i=this.format[0].tags;!c.ofType(n,i);){if(this.numberOfSiblings(n)>0)return null;n=n.parentNode}return n},findFormat:function(e){var t,n,i,r,o,a=this.format,s=c.attrEquals;for(t=0,n=a.length;n>t;t++){if(i=e,r=a[t].tags,o=a[t].attr,i&&c.ofType(i,r)&&s(i,o))return i;for(;i;)if(i=c.parentOfType(i,r),i&&s(i,o))return i}return null},isFormatted:function(e){var t,n;for(t=0,n=e.length;n>t;t++)if(this.findFormat(e[t]))return!0;return!1}}),m=n.extend({init:function(e,t){this.finder=new g(e),this.attributes=u({},e[0].attr,t),this.tag=e[0].tags[0]},wrap:function(e){return c.wrap(e,c.create(e.ownerDocument,this.tag,this.attributes))},activate:function(e,t){this.finder.isFormatted(t)?(this.split(e),this.remove(t)):this.apply(t)},toggle:function(e){var t=d.textNodes(e);t.length>0&&this.activate(e,t)},apply:function(e){var t,n,i,r,o=[];for(t=0,n=e.length;n>t;t++){if(i=e[t],r=this.finder.findSuitable(i))c.attr(r,this.attributes);else{for(;!c.isBlock(i.parentNode)&&1==i.parentNode.childNodes.length;)i=i.parentNode;r=this.wrap(i)}o.push(r)}this.consolidate(o)},remove:function(e){var t,n,i;for(t=0,n=e.length;n>t;t++)i=this.finder.findFormat(e[t]),i&&(this.attributes&&this.attributes.style?(c.unstyle(i,this.attributes.style),i.style.cssText||i.attributes["class"]||c.unwrap(i)):c.unwrap(i))},split:function(e){var t,n,i=d.textNodes(e),r=i.length;if(r>0)for(t=0;r>t;t++)n=this.finder.findFormat(i[t]),n&&d.split(e,n,!0)},consolidate:function(e){for(var t,n;e.length>1;)if(t=e.pop(),n=e[e.length-1],t.previousSibling&&t.previousSibling.className==f&&n.appendChild(t.previousSibling),t.tagName==n.tagName&&t.previousSibling==n&&t.style.cssText==n.style.cssText){for(;t.firstChild;)n.appendChild(t.firstChild);c.remove(t)}}}),v=g.extend({init:function(e,t){this.format=e,this.greedyProperty=t,g.fn.init.call(this,e)},getInlineCssValue:function(t){var n,i,r,o,a,s,l,d,u,h,p,f,g=t.attributes,m=e.trim;if(g)for(n=0,i=g.length;i>n;n++)if(r=g[n],o=r.nodeName,a=r.nodeValue,r.specified&&"style"==o)for(s=m(a||t.style.cssText).split(";"),d=0,u=s.length;u>d;d++)if(l=s[d],l.length){if(h=l.split(":"),p=m(h[0].toLowerCase()),f=m(h[1]),p!=this.greedyProperty)continue;return p.indexOf("color")>=0?c.toHex(f):f}},getFormatInner:function(t){var n,i,r,o=e(c.isDataNode(t)?t.parentNode:t),a=o.parentsUntil("[contentEditable]").addBack().toArray().reverse();for(n=0,i=a.length;i>n;n++)if(r="className"==this.greedyProperty?a[n].className:this.getInlineCssValue(a[n]))return r;return"inherit"},getFormat:function(e){var t,n,i=this.getFormatInner(e[0]);for(t=1,n=e.length;n>t;t++)if(i!=this.getFormatInner(e[t]))return"";return i},isFormatted:function(e){return""!==this.getFormat(e)}}),_=m.extend({init:function(e,n,i){m.fn.init.call(this,e,n),this.values=n,this.finder=new v(e,i),i&&(this.greedyProperty=t.toCamelCase(i))},activate:function(e,t){var n=this.greedyProperty,i="apply";this.split(e),n&&"inherit"==this.values.style[n]&&(i="remove"),this[i](t)}}),w=l.extend({init:function(e){l.fn.init.call(this,u(e,{finder:new g(e.format),formatter:function(){return new m(e.format)}}))}}),y=a.extend({update:function(e,t){var n=e.data(this.type);n.close(),n.value(this.finder.getFormat(t))}}),b=y.extend({init:function(e){a.fn.init.call(this,e),this.type=t.support.browser.msie||t.support.touch?"kendoDropDownList":"kendoComboBox",this.format=[{tags:["span"]}],this.finder=new v(this.format,e.cssAttr)},command:function(e){var t=this.options,n=this.format,r={};return new i.FormatCommand(u(e,{formatter:function(){return r[t.domAttr]=e.value,new _(n,{style:r},t.cssAttr)}}))},initialize:function(e,t){var n,i=t.editor,r=this.options,o=r.name,s=[];r.defaultValue&&(s=[{text:i.options.messages[r.defaultValue[0].text],value:r.defaultValue[0].value}]),n=s.concat(r.items?r.items:i.options[o]||[]),e[this.type]({dataTextField:"text",dataValueField:"value",dataSource:n,change:function(){a.exec(i,o,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+o).find("*").addBack().attr("unselectable","on"),e.data(this.type).value("inherit")}}),k=a.extend({init:function(e){a.fn.init.call(this,e),this.format=[{tags:["span"]}],this.finder=new v(this.format,e.cssAttr)},options:{palette:"websafe"},update:function(){this._widget.close()},command:function(e){var t=this.options,n=this.format,r={};return new i.FormatCommand(u(e,{formatter:function(){return r[t.domAttr]=e.value,new _(n,{style:r},t.cssAttr)}}))},initialize:function(n,i){var r=i.editor,o=this.name,s=u({},k.fn.options,this.options),l=s.palette;n=this._widget=new t.ui.ColorPicker(n,{value:e.isArray(l)?l[0]:"#000",toolIcon:"k-"+s.name,palette:l,change:function(){var e=n.value();e&&a.exec(r,o,e),r.focus()},activate:function(e){e.preventDefault(),n.trigger("change")}}),n.wrapper.attr({title:i.title,unselectable:"on"}).find("*").attr("unselectable","on")}});u(i,{InlineFormatFinder:g,InlineFormatter:m,DelayedExecutionTool:y,GreedyInlineFormatFinder:v,GreedyInlineFormatter:_,InlineFormatTool:w,FontTool:b,ColorTool:k}),p("bold",[{tags:["strong","b"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]),h("bold",new w({key:"B",ctrl:!0,format:r.bold,template:new s({template:o.buttonTemplate,title:"Bold"})})),p("italic",[{tags:["em","i"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]),h("italic",new w({key:"I",ctrl:!0,format:r.italic,template:new s({template:o.buttonTemplate,title:"Italic"})})),p("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}},{tags:["u"]}]),h("underline",new w({key:"U",ctrl:!0,format:r.underline,template:new s({template:o.buttonTemplate,title:"Underline"})})),p("strikethrough",[{tags:["del","strike"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]),h("strikethrough",new w({format:r.strikethrough,template:new s({template:o.buttonTemplate,title:"Strikethrough"})})),p("superscript",[{tags:["sup"]}]),h("superscript",new w({format:r.superscript,template:new s({template:o.buttonTemplate,title:"Superscript"})})),p("subscript",[{tags:["sub"]}]),h("subscript",new w({format:r.subscript,template:new s({template:o.buttonTemplate,title:"Subscript"})})),h("foreColor",new k({cssAttr:"color",domAttr:"color",name:"foreColor",template:new s({template:o.colorPickerTemplate,title:"Color"})})),h("backColor",new k({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new s({template:o.colorPickerTemplate,title:"Background Color"})})),h("fontName",new b({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new s({template:o.comboBoxTemplate,title:"Font Name"})})),h("fontSize",new b({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new s({template:o.comboBoxTemplate,title:"Font Size"})}))}(window.kendo.jQuery),function(e){var t,n=window.kendo,i=n.Class,r=e.extend,o=n.ui.editor,a=n.ui.Editor.fn.options.formats,s=o.Dom,l=o.Command,c=o.ToolTemplate,d=o.FormatTool,u=o.EditorUtils,h=u.registerTool,p=u.registerFormat,f=o.RangeUtils,g=i.extend({init:function(e){this.format=e},contains:function(e,t){var n,i,r;for(n=0,i=t.length;i>n;n++)if(r=t[n],!r||!s.isAncestorOrSelf(e,r))return!1;return!0},findSuitable:function(t){var n,i,r,o,a=this.format,l=[];for(n=0,i=t.length;i>n;n++){for(o=a.length-1;o>=0&&!(r=s.ofType(t[n],a[o].tags)?t[n]:s.parentOfType(t[n],a[o].tags));o--);if(!r||"true"===r.contentEditable)return[];e.inArray(r,l)<0&&l.push(r)}for(n=0,i=l.length;i>n;n++)if(this.contains(l[n],l))return[l[n]];return l},findFormat:function(e){var t,n,i,r,o,a=this.format,l=s.editableParent(e);for(t=0,n=a.length;n>t;t++)for(i=e,r=a[t].tags,o=a[t].attr;i&&s.isAncestorOf(l,i);){if(s.ofType(i,r)&&s.attrEquals(i,o))return i;i=i.parentNode}return null},getFormat:function(e){var t,n,i=this,r=function(e){return i.findFormat(s.isDataNode(e)?e.parentNode:e)},o=r(e[0]);if(!o)return"";for(t=1,n=e.length;n>t;t++)if(o!=r(e[t]))return"";return o.nodeName.toLowerCase()},isFormatted:function(e){for(var t=0,n=e.length;n>t;t++)if(!this.findFormat(e[t]))return!1;return!0}}),m=i.extend({init:function(e,t){this.format=e,this.values=t,this.finder=new g(e)},wrap:function(e,t,n){var i,r,o,a,l,c=1==n.length?s.blockParentOrBody(n[0]):s.commonAncestor.apply(null,n);for(s.isInline(c)&&(c=s.blockParentOrBody(c)),i=s.significantChildNodes(c),r=s.findNodeIndex(i[0]),o=s.create(c.ownerDocument,e,t),a=0;i.length>a;a++)l=i[a],s.isBlock(l)?(s.attr(l,t),o.childNodes.length&&(s.insertBefore(o,l),o=o.cloneNode(!1)),r=s.findNodeIndex(l)+1):o.appendChild(l);o.firstChild&&s.insertAt(c,o,r)},apply:function(t){function n(e){return r({},e&&e.attr,d)}var i,o,a,l,c,d=this.values,h=s.filter("img",t),p=u.formatByName("img",this.format),f=n(p);if(e.each(h,function(){s.attr(this,f)}),h.length!=t.length)if(o=s.filter("img",t,!0),a=this.finder.findSuitable(o),a.length)for(l=0,c=a.length;c>l;l++)i=u.formatByName(s.name(a[l]),this.format),s.attr(a[l],n(i));else i=this.format[0],this.wrap(i.tags[0],n(i),o)},remove:function(e){var t,n,i,r,o;for(t=0,n=e.length;n>t;t++)i=this.finder.findFormat(e[t]),i&&(o=s.name(i),"div"!=o||i.getAttribute("class")?(r=u.formatByName(o,this.format),r.attr.style&&s.unstyle(i,r.attr.style),r.attr.className&&s.removeClass(i,r.attr.className)):s.unwrap(i))},toggle:function(e){var t=this,n=f.nodes(e);t.finder.isFormatted(n)?t.remove(n):t.apply(n)}}),v=i.extend({init:function(e,t){var n=this;n.format=e,n.values=t,n.finder=new g(e)},apply:function(e){var t,n,i,r,a,l,c,d=this.format,u=s.blockParents(e),h=d[0].tags[0];if(u.length)for(t=0,n=u.length;n>t;t++)c=s.name(u[t]),"li"==c?(i=u[t].parentNode,r=new o.ListFormatter(i.nodeName.toLowerCase(),h),a=this.editor.createRange(),a.selectNode(u[t]),r.toggle(a)):h&&("td"==c||u[t].attributes.contentEditable)?new m(d,this.values).apply(u[t].childNodes):(l=s.changeTag(u[t],h),s.attr(l,d[0].attr));else new m(d,this.values).apply(e)},toggle:function(e){var t=f.textNodes(e);t.length||(e.selectNodeContents(e.commonAncestorContainer),t=f.textNodes(e),t.length||(t=s.significantChildNodes(e.commonAncestorContainer))),this.apply(t)}}),_=l.extend({init:function(e){e.formatter=e.formatter(),l.fn.init.call(this,e)}}),w=d.extend({init:function(e){d.fn.init.call(this,r(e,{finder:new g(e.format),formatter:function(){return new m(e.format)}}))}});r(o,{BlockFormatFinder:g,BlockFormatter:m,GreedyBlockFormatter:v,FormatCommand:_,BlockFormatTool:w}),t=["ul","ol","li"],p("justifyLeft",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left",display:"",marginLeft:"",marginRight:""}}},{tags:t,attr:{style:{textAlign:"left",listStylePosition:""}}}]),h("justifyLeft",new w({format:a.justifyLeft,template:new c({template:u.buttonTemplate,title:"Justify Left"})})),p("justifyCenter",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:t,attr:{style:{textAlign:"center",listStylePosition:"inside"}}}]),h("justifyCenter",new w({format:a.justifyCenter,template:new c({template:u.buttonTemplate,title:"Justify Center"})})),p("justifyRight",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right",display:"",marginLeft:"",marginRight:""}}},{tags:t,attr:{style:{textAlign:"right",listStylePosition:"inside"}}}]),h("justifyRight",new w({format:a.justifyRight,template:new c({template:u.buttonTemplate,title:"Justify Right"})})),p("justifyFull",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"justify"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:t,attr:{style:{textAlign:"justify",listStylePosition:""}}}]),h("justifyFull",new w({format:a.justifyFull,template:new c({template:u.buttonTemplate,title:"Justify Full"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,r=i.Dom,o=i.Command,a=i.Tool,s=i.BlockFormatter,l=r.normalize,c=i.RangeUtils,d=i.EditorUtils.registerTool,u=o.extend({init:function(e){this.options=e,o.fn.init.call(this,e)},_insertMarker:function(e,t){var n,i=r.create(e,"a");return i.className="k-marker",t.insertNode(i),i.parentNode||(n=t.commonAncestorContainer,n.innerHTML="",n.appendChild(i)),l(i.parentNode),i},_moveFocus:function(e,t){if(r.isEmpty(t))e.setStartBefore(t);else{e.selectNodeContents(t);var n=c.textNodes(e)[0];if(!n){for(;t.childNodes.length&&!r.is(t.firstChild,"br");)t=t.firstChild;n=t}r.isEmpty(n)?e.setStartBefore(n):e.selectNodeContents(n)}},shouldTrim:function(e){var t="p,h1,h2,h3,h4,h5,h6".split(","),n=r.parentOfType(e.startContainer,t),i=r.parentOfType(e.endContainer,t);return n&&!i||!n&&i},_blankAfter:function(e){for(;e&&(r.isMarker(e)||""===r.stripBom(e.nodeValue));)e=e.nextSibling;return!e},exec:function(){var e,t,n,o,a,d,u,h,p=this.getRange(),f=c.documentFromRange(p),g=i.emptyElementContent,m=this.shouldTrim(p);p.deleteContents(),a=this._insertMarker(f,p),d=r.closestEditableOfType(a,["li"]),u=r.closestEditableOfType(a,"h1,h2,h3,h4,h5,h6".split(",")),d?r.emptyNode(d)&&(o=r.create(f,"p"),d.nextSibling&&(h=p.cloneRange(),h.selectNode(d),c.split(h,d.parentNode)),r.insertAfter(o,d.parentNode),r.remove(1==d.parentNode.childNodes.length?d.parentNode:d),o.innerHTML=g,n=o):u&&this._blankAfter(a)&&(o=r.create(f,"p"),r.insertAfter(o,u),o.innerHTML=g,r.remove(a),n=o),n||(d||u||new s([{tags:["p"]}]).apply([a]),p.selectNode(a),e=r.parentOfType(a,[d?"li":u?r.name(u):"p"]),c.split(p,e,m),t=e.previousSibling,r.is(t,"li")&&t.firstChild&&!r.is(t.firstChild,"br")&&(t=t.firstChild),n=e.nextSibling,this.clean(t),this.clean(n,{links:!0}),r.is(n,"li")&&n.firstChild&&!r.is(n.firstChild,"br")&&(n=n.firstChild),r.remove(e),l(t)),l(n),this._moveFocus(p,n),p.collapse(!0),r.scrollTo(n),c.selectRange(p)},clean:function(e,t){var n=e;if(e.firstChild&&r.is(e.firstChild,"br")&&r.remove(e.firstChild),r.isDataNode(e)&&!e.nodeValue&&(e=e.parentNode),e){for(;e.firstChild&&1==e.firstChild.nodeType;)e=e.firstChild;if(!r.isEmpty(e)&&/^\s*$/.test(e.innerHTML)&&(e.innerHTML=i.emptyElementContent),t&&t.links)for(;e!=n;){if(r.is(e,"a")&&r.emptyNode(e)){r.unwrap(e);break}e=e.parentNode}}}}),h=o.extend({init:function(e){this.options=e,o.fn.init.call(this,e)},exec:function(){var e,n=this.getRange(),i=r.create(c.documentFromRange(n),"br"),o=t.support.browser,a=o.msie&&11>o.version;n.deleteContents(),n.insertNode(i),l(i.parentNode),a||i.nextSibling&&!r.isWhitespace(i.nextSibling)||(e=i.cloneNode(!0),e.className="k-br",r.insertAfter(e,i)),n.setStartAfter(i),n.collapse(!0),r.scrollTo(i.nextSibling||i),c.selectRange(n)}});n(i,{ParagraphCommand:u,NewLineCommand:h}),d("insertLineBreak",new a({key:13,shift:!0,command:h})),d("insertParagraph",new a({key:13,command:u}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,r=t.ui.editor,o=r.Dom,a=r.RangeUtils,s=r.EditorUtils,l=r.Command,c=r.ToolTemplate,d=r.FormatTool,u=r.BlockFormatFinder,h=a.textNodes,p=r.EditorUtils.registerTool,f=u.extend({init:function(e){this.tag=e;var t=this.tags=["ul"==e?"ol":"ul",e];u.fn.init.call(this,[{tags:t}])},isFormatted:function(e){var t,n,i=[];for(n=0;e.length>n;n++)(t=this.findFormat(e[n]))&&o.name(t)==this.tag&&i.push(t);if(1>i.length)return!1;if(i.length!=e.length)return!1;for(n=0;i.length>n&&i[n].parentNode==t.parentNode;n++)if(i[n]!=t)return!1;return!0},findSuitable:function(e){var t=o.parentOfType(e[0],this.tags);return t&&o.name(t)==this.tag?t:null}}),g=n.extend({init:function(e,t){var n=this;n.finder=new f(e),n.tag=e,n.unwrapTag=t},isList:function(e){var t=o.name(e);return"ul"==t||"ol"==t||"dl"==t},wrap:function(e,t){var n,i,r=o.create(e.ownerDocument,"li");for(n=0;t.length>n;n++)if(i=t[n],o.is(i,"li"))e.appendChild(i);else if(this.isList(i))for(;i.firstChild;)e.appendChild(i.firstChild);else if(o.is(i,"td")){for(;i.firstChild;)r.appendChild(i.firstChild);e.appendChild(r),i.appendChild(e),e=e.cloneNode(!1),r=r.cloneNode(!1)}else r.appendChild(i),o.isBlock(i)&&(e.appendChild(r),o.unwrap(i),r=r.cloneNode(!1));r.firstChild&&e.appendChild(r)},containsAny:function(e,t){for(var n=0;t.length>n;n++)if(o.isAncestorOrSelf(e,t[n]))return!0;return!1},suitable:function(e,t){if("k-marker"==e.className){var n=e.nextSibling;if(n&&o.isBlock(n))return!1;if(n=e.previousSibling,n&&o.isBlock(n))return!1}return this.containsAny(e,t)||o.isInline(e)||3==e.nodeType},split:function(t){var n,i,r,s,l,c,d=h(t);if(d.length)for(n=o.parentOfType(d[0],["li"]),i=o.parentOfType(d[d.length-1],["li"]),t.setStartBefore(n),t.setEndAfter(i),r=0,s=d.length;s>r;r++)l=this.finder.findFormat(d[r]),l&&(c=e(l).parents("ul,ol"),c[0]?a.split(t,c.last()[0],!0):a.split(t,l,!0))},merge:function(e,t){for(var n,i=t.previousSibling;i&&("k-marker"==i.className||3==i.nodeType&&o.isWhitespace(i));)i=i.previousSibling;if(i&&o.name(i)==e){for(;t.firstChild;)i.appendChild(t.firstChild);o.remove(t),t=i}for(n=t.nextSibling;n&&("k-marker"==n.className||3==n.nodeType&&o.isWhitespace(n));)n=n.nextSibling;if(n&&o.name(n)==e){for(;t.lastChild;)n.insertBefore(t.lastChild,n.firstChild);o.remove(t)}},breakable:function(e){return e!=e.ownerDocument.body&&!/table|tbody|tr|td/.test(o.name(e))&&!e.attributes.contentEditable},applyOnSection:function(t,n){function i(){u.push(this)}var r,a,s,l,c=this.tag,d=o.closestSplittableParent(n),u=[],h=this.finder.findSuitable(n);for(h||(h=new f("ul"==c?"ol":"ul").findSuitable(n)),/table|tbody/.test(o.name(d))?r=e.map(n,function(e){return o.parentOfType(e,["td"])}):(r=o.significantChildNodes(d),e.grep(r,o.isBlock).length&&(r=e.grep(r,e.proxy(function(e){return this.containsAny(e,n)},this))),r.length||(r=n)),a=0;r.length>a;a++)s=r[a],l=(!h||!o.isAncestorOrSelf(h,s))&&this.suitable(s,n),l&&(h&&this.isList(s)?(e.each(s.childNodes,i),o.remove(s)):u.push(s));u.length==r.length&&this.breakable(d)&&(u=[d]),h||(h=o.create(d.ownerDocument,c),o.insertBefore(h,u[0])),this.wrap(h,u),o.is(h,c)||o.changeTag(h,c),this.merge(c,h)},apply:function(e){var t,n,i,r=0,a=[];do i=o.closestEditable(e[r],["td","body"]),t&&i==t?n.push(e[r]):(t&&a.push({section:t,nodes:n}),n=[e[r]],t=i),r++;while(e.length>r);for(a.push({section:t,nodes:n}),r=0;a.length>r;r++)this.applyOnSection(a[r].section,a[r].nodes)},unwrap:function(t){var n,i,r,a,s=t.ownerDocument.createDocumentFragment(),l=this.unwrapTag;for(i=t.firstChild;i;i=i.nextSibling){for(r=o.create(t.ownerDocument,l||"p");i.firstChild;)a=i.firstChild,o.isBlock(a)?(r.firstChild&&(s.appendChild(r),r=o.create(t.ownerDocument,l||"p")),s.appendChild(a)):r.appendChild(a);r.firstChild&&s.appendChild(r)}n=e(t).parents("ul,ol"),n[0]?(o.insertAfter(s,n.last()[0]),n.last().remove()):o.insertAfter(s,t),o.remove(t)},remove:function(e){var t,n,i;for(n=0,i=e.length;i>n;n++)t=this.finder.findFormat(e[n]),t&&this.unwrap(t)},toggle:function(e){var t,n=this,i=h(e),r=e.commonAncestorContainer;i.length||(e.selectNodeContents(r),i=h(e),i.length||(t=r.ownerDocument.createTextNode(""),e.startContainer.appendChild(t),i=[t],e.selectNode(t.parentNode))),n.finder.isFormatted(i)?(n.split(e),n.remove(i)):n.apply(i)}}),m=l.extend({init:function(e){e.formatter=new g(e.tag),l.fn.init.call(this,e)}}),v=d.extend({init:function(e){this.options=e,d.fn.init.call(this,i(e,{finder:new f(e.tag)}))},command:function(e){return new m(i(e,{tag:this.options.tag}))}});i(r,{ListFormatFinder:f,ListFormatter:g,ListCommand:m,ListTool:v}),p("insertUnorderedList",new v({tag:"ul",template:new c({template:s.buttonTemplate,title:"Insert unordered list"})})),p("insertOrderedList",new v({tag:"ol",template:new c({template:s.buttonTemplate,title:"Insert ordered list"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,r=e.proxy,o=t.ui.editor,a=o.Dom,s=o.RangeUtils,l=o.EditorUtils,c=o.Command,d=o.Tool,u=o.ToolTemplate,h=o.InlineFormatter,p=o.InlineFormatFinder,f=s.textNodes,g=o.EditorUtils.registerTool,m=n.extend({findSuitable:function(e){return a.parentOfType(e,["a"])}}),v=n.extend({init:function(){this.finder=new m},apply:function(e,t){var n,i,r,o,l,c=f(e);t.innerHTML?(n=s.getMarkers(e),i=s.documentFromRange(e),e.deleteContents(),o=a.create(i,"a",t),e.insertNode(o),l=o.parentNode,"a"==a.name(l)&&a.insertAfter(o,l),a.emptyNode(l)&&a.remove(l),n.length>1&&(a.insertAfter(n[n.length-1],o),a.insertAfter(n[1],o),a[c.length>0?"insertBefore":"insertAfter"](n[0],o))):(r=new h([{tags:["a"]}],t),r.finder=this.finder,r.apply(c))
}}),_=c.extend({init:function(e){e.formatter={toggle:function(e){new h([{tags:["a"]}]).remove(f(e))}},this.options=e,c.fn.init.call(this,e)}}),w=c.extend({init:function(e){var t=this;t.options=e,c.fn.init.call(t,e),t.formatter=new v,e.url?this.exec=function(){this.formatter.apply(e.range,{href:e.url,innerHTML:e.text||e.url,target:e.target})}:(t.attributes=null,t.async=!0)},_dialogTemplate:function(){return t.template("<div class=\"k-editor-dialog k-popup-edit-form k-edit-form-container\"><div class='k-edit-label'><label for='k-editor-link-url'>#: messages.linkWebAddress #</label></div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-url'></div><div class='k-edit-label k-editor-link-text-row'><label for='k-editor-link-text'>#: messages.linkText #</label></div><div class='k-edit-field k-editor-link-text-row'><input type='text' class='k-input k-textbox' id='k-editor-link-text'></div><div class='k-edit-label'><label for='k-editor-link-title'>#: messages.linkToolTip #</label></div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-title'></div><div class='k-edit-label'></div><div class='k-edit-field'><input type='checkbox' class='k-checkbox' id='k-editor-link-target'><label for='k-editor-link-target' class='k-checkbox-label'>#: messages.linkOpenInNewWindow #</label></div><div class='k-edit-buttons k-state-default'><button class=\"k-dialog-insert k-button k-primary\">#: messages.dialogInsert #</button><button class=\"k-dialog-close k-button\">#: messages.dialogCancel #</button></div></div>")({messages:this.editor.options.messages})},exec:function(){var t,n,i,o,s=this.getRange().collapsed,l=this.editor.options.messages;this._initialText="",this._range=this.lockRange(!0),t=f(this._range),n=t.length?this.formatter.finder.findSuitable(t[0]):null,i=t.length&&"img"==a.name(t[0]),o=this.createDialog(this._dialogTemplate(),{title:l.createLink,close:r(this._close,this),visible:!1}),o.find(".k-dialog-insert").click(r(this._apply,this)).end().find(".k-dialog-close").click(r(this._close,this)).end().find(".k-edit-field input").keydown(r(this._keydown,this)).end().find("#k-editor-link-url").val(this.linkUrl(n)).end().find("#k-editor-link-text").val(this.linkText(t)).end().find("#k-editor-link-title").val(n?n.title:"").end().find("#k-editor-link-target").attr("checked",n?"_blank"==n.target:!1).end().find(".k-editor-link-text-row").toggle(!i),t.length>0&&!s&&(this._initialText=e("#k-editor-link-text",o).val()),this._dialog=o.data("kendoWindow").center().open(),e("#k-editor-link-url",o).focus().select()},_keydown:function(e){var n=t.keys;e.keyCode==n.ENTER?this._apply(e):e.keyCode==n.ESC&&this._close(e)},_apply:function(t){var n,i,r,o=this._dialog.element,s=e("#k-editor-link-url",o).val(),l=e("#k-editor-link-text",o);s&&"http://"!=s&&(s.indexOf("@")>0&&!/^(\w+:)|(\/\/)/i.test(s)&&(s="mailto:"+s),this.attributes={href:s},n=e("#k-editor-link-title",o).val(),n&&(this.attributes.title=n),l.is(":visible")&&(i=l.val(),i||this._initialText?i&&i!==this._initialText&&(this.attributes.innerHTML=a.stripBom(i)):this.attributes.innerHTML=s),r=e("#k-editor-link-target",o).is(":checked"),this.attributes.target=r?"_blank":null,this.formatter.apply(this._range,this.attributes)),this._close(t),this.change&&this.change()},_close:function(e){e.preventDefault(),this._dialog.destroy(),a.windowFromDocument(s.documentFromRange(this._range)).focus(),this.releaseRange(this._range)},linkUrl:function(e){return e?e.getAttribute("href",2):"http://"},linkText:function(e){var t="";return 1==e.length?t=e[0].nodeValue:e.length&&(t=e[0].nodeValue+e[1].nodeValue),a.stripBom(t||"")},redo:function(){var e=this.lockRange(!0);this.formatter.apply(e,this.attributes),this.releaseRange(e)}}),y=d.extend({init:function(t){this.options=t,this.finder=new p([{tags:["a"]}]),d.fn.init.call(this,e.extend(t,{command:_}))},initialize:function(e,t){d.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){e.toggleClass("k-state-disabled",!this.finder.isFormatted(t)).removeClass("k-state-hover")}});i(t.ui.editor,{LinkFormatFinder:m,LinkFormatter:v,UnlinkCommand:_,LinkCommand:w,UnlinkTool:y}),g("createLink",new d({key:"K",ctrl:!0,command:w,template:new u({template:l.buttonTemplate,title:"Create Link"})})),g("unlink",new y({key:"K",ctrl:!0,shift:!0,template:new u({template:l.buttonTemplate,title:"Remove Link"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=e.extend,r=n.ui.editor,o=r.EditorUtils,a=r.Dom,s=o.registerTool,l=r.ToolTemplate,c=r.RangeUtils,d=r.Command,u=r.LinkFormatter,h=c.textNodes,p=n.keys,f="#k-editor-file-url",g="#k-editor-file-title",m=d.extend({init:function(e){var t=this;d.fn.init.call(t,e),t.formatter=new u,t.async=!0,t.attributes={}},insertFile:function(e,t){var n=this.attributes,i=c.documentFromRange(t);if(n.href&&"http://"!=n.href){if(!e)return e=a.create(i,"a",{href:n.href}),e.innerHTML=n.innerHTML,t.deleteContents(),t.insertNode(e),e.nextSibling||a.insertAfter(i.createTextNode("﻿"),e),t.setStartAfter(e),t.setEndAfter(e),c.selectRange(t),!0;a.attr(e,n)}return!1},_dialogTemplate:function(e){return n.template('<div class="k-editor-dialog k-popup-edit-form k-edit-form-container"># if (showBrowser) { #<div class="k-filebrowser"></div># } #<div class=\'k-edit-label\'><label for="k-editor-file-url">#: messages.fileWebAddress #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-file-url"></div><div class=\'k-edit-label\'><label for="k-editor-file-title">#: messages.fileTitle #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-file-title"></div><div class="k-edit-buttons k-state-default"><button class="k-dialog-insert k-button k-primary">#: messages.dialogInsert #</button><button class="k-dialog-close k-button">#: messages.dialogCancel #</button></div></div>')({messages:this.editor.options.messages,showBrowser:e})},redo:function(){var e=this,t=e.lockRange();this.formatter.apply(t,this.attributes),e.releaseRange(t)},exec:function(){function e(e){var t=s.element,n=t.find(f).val().replace(/ /g,"%20"),i=t.find(g).val();l.attributes={href:n,innerHTML:""!==i?i:n},m=l.insertFile(v,d),r(e),l.change&&l.change()}function r(e){e.preventDefault(),s.destroy(),a.windowFromDocument(c.documentFromRange(d)).focus(),m||l.releaseRange(d)}function o(t){t.keyCode==p.ENTER?e(t):t.keyCode==p.ESC&&r(t)}var s,l=this,d=l.lockRange(),u=h(d),m=!1,v=u.length?this.formatter.finder.findSuitable(u[0]):null,_=l.editor.options,w=_.messages,y=_.fileBrowser,b=!!(n.ui.FileBrowser&&y&&y.transport&&y.transport.read!==t),k={title:w.insertFile,visible:!1,resizable:b};k.close=r,b&&(k.width=750),s=this.createDialog(l._dialogTemplate(b),k).toggleClass("k-filebrowser-dialog",b).find(".k-dialog-insert").click(e).end().find(".k-dialog-close").click(r).end().find(".k-edit-field input").keydown(o).end().find(f).val(v?v.getAttribute("href",2):"http://").end().find(g).val(v?v.title:"").end().data("kendoWindow"),b&&new n.ui.FileBrowser(s.element.find(".k-filebrowser"),i({},y,{change:function(){s.element.find(f).val(this.value())},apply:e})),s.center().open(),s.element.find(f).focus().select()}});n.ui.editor.FileCommand=m,s("insertFile",new r.Tool({command:m,template:new l({template:o.buttonTemplate,title:"Insert File"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=e.extend,r=n.ui.editor,o=r.EditorUtils,a=r.Dom,s=o.registerTool,l=r.ToolTemplate,c=r.RangeUtils,d=r.Command,u=n.keys,h="#k-editor-image-url",p="#k-editor-image-title",f="#k-editor-image-width",g="#k-editor-image-height",m=d.extend({init:function(e){var t=this;d.fn.init.call(t,e),t.async=!0,t.attributes={}},insertImage:function(e,t){var n,i=this.attributes,r=c.documentFromRange(t);if(i.src&&"http://"!=i.src){if(n=function(){setTimeout(function(){i.width||e.removeAttribute("width"),i.height||e.removeAttribute("height"),e.removeAttribute("complete")})},!e)return e=a.create(r,"img",i),e.onload=e.onerror=function(){n()},t.deleteContents(),t.insertNode(e),e.nextSibling||a.insertAfter(r.createTextNode("﻿"),e),n(),t.setStartAfter(e),t.setEndAfter(e),c.selectRange(t),!0;a.attr(e,i),n()}return!1},_dialogTemplate:function(e){return n.template('<div class="k-editor-dialog k-popup-edit-form k-edit-form-container"># if (showBrowser) { #<div class="k-filebrowser k-imagebrowser"></div># } #<div class=\'k-edit-label\'><label for="k-editor-image-url">#: messages.imageWebAddress #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-url"></div><div class=\'k-edit-label\'><label for="k-editor-image-title">#: messages.imageAltText #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-title"></div><div class=\'k-edit-label\'><label for="k-editor-image-width">#: messages.imageWidth #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-width"></div><div class=\'k-edit-label\'><label for="k-editor-image-height">#: messages.imageHeight #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-height"></div><div class="k-edit-buttons k-state-default"><button class="k-dialog-insert k-button k-primary">#: messages.dialogInsert #</button><button class="k-dialog-close k-button">#: messages.dialogCancel #</button></div></div>')({messages:this.editor.options.messages,showBrowser:e})},redo:function(){var e=this,t=e.lockRange();e.insertImage(c.image(t),t)||e.releaseRange(t)},exec:function(){function e(e){var t=s.element,n=parseInt(t.find(f).val(),10),i=parseInt(t.find(g).val(),10);l.attributes={src:t.find(h).val().replace(/ /g,"%20"),alt:t.find(p).val()},l.attributes.width=null,l.attributes.height=null,!isNaN(n)&&n>0&&(l.attributes.width=n),!isNaN(i)&&i>0&&(l.attributes.height=i),m=l.insertImage(v,d),r(e),l.change&&l.change()}function r(e){e.preventDefault(),s.destroy(),a.windowFromDocument(c.documentFromRange(d)).focus(),m||l.releaseRange(d)}function o(t){t.keyCode==u.ENTER?e(t):t.keyCode==u.ESC&&r(t)}var s,l=this,d=l.lockRange(),m=!1,v=c.image(d),_=v&&v.getAttribute("width")||"",w=v&&v.getAttribute("height")||"",y=l.editor.options,b=y.messages,k=y.imageBrowser,x=!!(n.ui.ImageBrowser&&k&&k.transport&&k.transport.read!==t),C={title:b.insertImage,visible:!1,resizable:x};C.close=r,x&&(C.width=750),s=this.createDialog(l._dialogTemplate(x),C).toggleClass("k-filebrowser-dialog",x).find(".k-dialog-insert").click(e).end().find(".k-dialog-close").click(r).end().find(".k-edit-field input").keydown(o).end().find(h).val(v?v.getAttribute("src",2):"http://").end().find(p).val(v?v.alt:"").end().find(f).val(_).end().find(g).val(w).end().data("kendoWindow"),x&&new n.ui.ImageBrowser(s.element.find(".k-imagebrowser"),i({},k,{change:function(){s.element.find(h).val(this.value())},apply:e})),s.center().open(),s.element.find(h).focus().select()}});n.ui.editor.ImageCommand=m,s("insertImage",new r.Tool({command:m,template:new l({template:o.buttonTemplate,title:"Insert Image"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui.DropDownList,r=n.ui.editor.Dom,o=i.extend({init:function(t,r){var o=this;i.fn.init.call(o,t,r),n.support.mobileOS.ios&&(this._initSelectOverlay(),this.bind("dataBound",e.proxy(this._initSelectOverlay,this))),o.value(o.options.title),o.bind("open",function(){if(o.options.autoSize){var e,t=o.list;t.css({whiteSpace:"nowrap",width:"auto"}),e=t.width(),e?e+=20:e=o._listWidth,t.css("width",e+n.support.scrollbar()),o._listWidth=e}})},options:{name:"SelectBox"},_initSelectOverlay:function(){var t,i,r,o,a=this,s=a.value(),l=this.dataSource.view(),c="",d=n.htmlEncode;for(i=0;l.length>i;i++)t=l[i],c+="<option value='"+d(t.value)+"'",t.value==s&&(c+=" selected"),c+=">"+d(t.text)+"</option>";r=e("<select class='k-select-overlay'>"+c+"</select>"),o=e(this.element).closest(".k-widget"),o.next(".k-select-overlay").remove(),r.insertAfter(o),r.on("change",function(){a.value(this.value),a.trigger("change")})},value:function(e){var n=this,r=i.fn.value.call(n,e);return e===t?r:(e!==i.fn.value.call(n)&&(n.text(n.options.title),n._current&&n._current.removeClass("k-state-selected"),n.current(null),n._oldIndex=n.selectedIndex=-1),t)},decorate:function(t){var n,i,o,a,s=this,l=s.dataSource,c=l.data();for(t&&s.list.css("background-color",r.getEffectiveBackground(e(t))),n=0;c.length>n;n++)i=c[n].tag||"span",o=c[n].className,a=r.inlineStyle(t,i,{className:o}),a=a.replace(/"/g,"'"),c[n].style=a+";display:inline-block";l.trigger("change")}});n.ui.plugin(o),n.ui.editor.SelectBox=o}(window.kendo.jQuery),function(e,t){function n(n,i){var r="rtl"==e(n).css("direction"),o=r?"Right":"Left",a="td"!=s.name(n)?"margin"+o:"padding"+o;return i===t?n.style[a]||0:(i>0?n.style[a]=i+"px":(n.style[a]="",n.style.cssText||n.removeAttribute("style")),t)}var i=window.kendo,r=i.Class,o=e.extend,a=i.ui.editor,s=a.Dom,l=a.EditorUtils,c=l.registerTool,d=a.Command,u=a.Tool,h=a.ToolTemplate,p=a.RangeUtils,f=s.blockElements,g=a.BlockFormatFinder,m=a.BlockFormatter,v=r.extend({init:function(){this.finder=new g([{tags:s.blockElements}])},apply:function(t){var i,r,o,a,l,c,d,u,h,p,f=this.finder.findSuitable(t),g=[];if(f.length){for(i=0,r=f.length;r>i;i++)s.is(f[i],"li")?e(f[i]).index()?e.inArray(f[i].parentNode,g)<0&&g.push(f[i]):g.push(f[i].parentNode):g.push(f[i]);for(;g.length;)if(o=g.shift(),s.is(o,"li"))if(a=o.parentNode,l=e(o).prev("li"),c=l.find("ul,ol").last(),d=e(o).children("ul,ol")[0],d&&l[0])c[0]?(c.append(o),c.append(e(d).children()),s.remove(d)):(l.append(d),d.insertBefore(o,d.firstChild));else for(d=l.children("ul,ol")[0],d||(d=s.create(o.ownerDocument,s.name(a)),l.append(d));o&&o.parentNode==a;)d.appendChild(o),o=g.shift();else for(u=parseInt(n(o),10)+30,n(o,u),h=0;g.length>h;h++)e.contains(o,g[h])&&g.splice(h,1)}else p=new m([{tags:["p"]}],{style:{marginLeft:30}}),p.apply(t)},remove:function(t){var i,r,o,a,s,l,c,d,u=this.finder.findSuitable(t);for(r=0,o=u.length;o>r;r++){if(c=e(u[r]),c.is("li")){if(a=c.parent(),s=a.parent(),s.is("li,ul,ol")&&!n(a[0])){if(i&&e.contains(i,s[0]))continue;l=c.nextAll("li"),l.length&&e(a[0].cloneNode(!1)).appendTo(c).append(l),s.is("li")?c.insertAfter(s):c.appendTo(s),a.children("li").length||a.remove();continue}if(i==a[0])continue;i=a[0]}else i=u[r];d=parseInt(n(i),10)-30,n(i,d)}}}),_=d.extend({init:function(e){e.formatter={toggle:function(e){(new v).apply(p.nodes(e))}},d.fn.init.call(this,e)}}),w=d.extend({init:function(e){e.formatter={toggle:function(e){(new v).remove(p.nodes(e))}},d.fn.init.call(this,e)}}),y=u.extend({init:function(e){u.fn.init.call(this,e),this.finder=new g([{tags:f}])},initialize:function(e,t){u.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(i,r){var o,a,l,c,d=this.finder.findSuitable(r);for(l=0,c=d.length;c>l;l++)if(o=n(d[l]),o||(a=e(d[l]).parents("ul,ol").length,o=s.is(d[l],"li")&&(a>1||n(d[l].parentNode))||s.ofType(d[l],["ul","ol"])&&a>0),o)return i.removeClass("k-state-disabled"),t;i.addClass("k-state-disabled").removeClass("k-state-hover")}});o(a,{IndentFormatter:v,IndentCommand:_,OutdentCommand:w,OutdentTool:y}),c("indent",new u({command:_,template:new h({template:l.buttonTemplate,title:"Indent"})})),c("outdent",new y({command:w,template:new h({template:l.buttonTemplate,title:"Outdent"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,r=i.EditorUtils,o=i.Command,a=i.Tool,s=i.ToolTemplate,l=o.extend({init:function(e){var t=this;t.options=e,o.fn.init.call(t,e),t.attributes=null,t.async=!0},exec:function(){function n(e){o.value(s.find(d).val()),i(e),r.change&&r.change(),o.trigger("change")}function i(e){e.preventDefault(),s.data("kendoWindow").destroy(),o.focus()}var r=this,o=r.editor,a=o.options.messages,s=e(t.template(l.template)(a)).appendTo(document.body),c=l.indent(o.value()),d=".k-editor-textarea";this.createDialog(s,{title:a.viewHtml,close:i,visible:!1}).find(d).val(c).end().find(".k-dialog-update").click(n).end().find(".k-dialog-close").click(i).end().data("kendoWindow").center().open(),s.find(d).focus()}});n(l,{template:"<div class='k-editor-dialog k-popup-edit-form k-edit-form-container k-viewhtml-dialog'><textarea class='k-editor-textarea k-input'></textarea><div class='k-edit-buttons k-state-default'><button class='k-dialog-update k-button k-primary'>#: dialogUpdate #</button><button class='k-dialog-close k-button'>#: dialogCancel #</button></div></div>",indent:function(e){return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")}}),t.ui.editor.ViewHtmlCommand=l,i.EditorUtils.registerTool("viewHtml",new a({command:l,template:new s({template:r.buttonTemplate,title:"View HTML"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.ui.editor,i=n.Tool,r=n.ToolTemplate,o=n.DelayedExecutionTool,a=n.Command,s=n.Dom,l=n.EditorUtils,c=n.RangeUtils,d=l.registerTool,u=o.extend({init:function(e){var n=this;i.fn.init.call(n,t.deepExtend({},n.options,e)),n.type="kendoSelectBox",n.finder={getFormat:function(){return""}}},options:{items:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],width:110},toFormattingItem:function(e){var t,n=e.value;return n?e.tag||e.className?e:(t=n.indexOf("."),0===t?e.className=n.substring(1):-1==t?e.tag=n:(e.tag=n.substring(0,t),e.className=n.substring(t+1)),e):e},command:function(t){var i=t.value;return i=this.toFormattingItem(i),new n.FormatCommand({range:t.range,formatter:function(){var t,r=(i.tag||i.context||"span").split(","),o=[{tags:r,attr:{className:i.className||""}}];return t=e.inArray(r[0],s.inlineElements)>=0?new n.GreedyInlineFormatter(o):new n.GreedyBlockFormatter(o)}})},initialize:function(e,n){var r=n.editor,o=this.options,a=o.name,s=this;e.width(o.width),e.kendoSelectBox({dataTextField:"text",dataValueField:"value",dataSource:o.items||r.options[a],title:r.options.messages[a],autoSize:!0,change:function(){i.exec(r,a,this.dataItem().toJSON())},dataBound:function(){var e,t=this.dataSource.data();for(e=0;t.length>e;e++)t[e]=s.toFormattingItem(t[e])},highlightFirst:!1,template:t.template('<span unselectable="on" style="display:block;#=(data.style||"")#">#:data.text#</span>')}),e.addClass("k-decorated").closest(".k-widget").removeClass("k-"+a).find("*").addBack().attr("unselectable","on")},getFormattingValue:function(t,n){var i,r,o,a,s,l,c;for(i=0;t.length>i;i++)if(r=t[i],o=r.tag||r.context||"",a=r.className?"."+r.className:"",s=o+a,l=e(n[0]).closest(s)[0]){if(1==n.length)return r.value;for(c=1;n.length>c&&e(n[c]).closest(s)[0];c++)if(c==n.length-1)return r.value}return""},update:function(t,n){var i,r,a,l,c,d=e(t).data(this.type);if(d){for(i=d.dataSource,r=i.data(),c=s.commonAncestor.apply(null,n),a=0;r.length>a;a++)l=r[a].context,r[a].visible=!l||!!e(c).closest(l).length;i.filter([{field:"visible",operator:"eq",value:!0}]),o.fn.update.call(this,t,n),d.value(this.getFormattingValue(i.view(),n)),d.wrapper.toggleClass("k-state-disabled",!i.view().length)}}}),h=a.extend({exec:function(){var e,t=this.lockRange(!0),i=this.options.remove||"strong,em,span".split(",");c.wrapSelectedElements(t),e=new n.RangeIterator(t),e.traverse(function r(e){if(e&&!s.isMarker(e)){if(1==e.nodeType&&!s.insignificant(e)){for(var t=e.childNodes.length-1;t>=0;t--)r(e.childNodes[t]);e.removeAttribute("style"),e.removeAttribute("class")}i.indexOf(s.name(e))>-1&&s.unwrap(e)}}),this.releaseRange(t)}});e.extend(n,{FormattingTool:u,CleanFormatCommand:h}),d("formatting",new u({template:new r({template:l.dropDownListTemplate,title:"Format"})})),d("cleanFormatting",new i({command:h,template:new r({template:l.buttonTemplate,title:"Clean formatting"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.ui,i=n.editor,r=n.Widget,o=e.extend,a=e.proxy,s=t.keys,l=".kendoEditor",c="a.k-tool:not(.k-state-disabled),.k-widget.k-colorpicker,.k-selectbox,.k-dropdown,.k-combobox .k-input",d=r.extend({init:function(e,t){var n=this;t=o({},t,{name:"EditorToolbar"}),r.fn.init.call(n,e,t),t.popup&&n._initPopup()},events:["execute"],groups:{basic:["bold","italic","underline","strikethrough"],scripts:["subscript","superscript"],alignment:["justifyLeft","justifyCenter","justifyRight","justifyFull"],links:["insertImage","insertFile","createLink","unlink"],lists:["insertUnorderedList","insertOrderedList","indent","outdent"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"],advanced:["viewHtml","cleanFormatting"]},_initPopup:function(){this.window=e(this.element).wrap("<div class='editorToolbarWindow k-header' />").parent().prepend("<button class='k-button k-button-bare k-editortoolbar-dragHandle'><span class='k-icon k-i-move' /></button>").kendoWindow({title:!1,resizable:!1,draggable:{dragHandle:".k-editortoolbar-dragHandle"},animation:{open:{effects:"fade:in"},close:{effects:"fade:out"}},minHeight:42,visible:!1,autoFocus:!1,actions:[],dragend:function(){this._moved=!0}}).on("mousedown",function(t){e(t.target).is(".k-icon")||t.preventDefault()}).data("kendoWindow")},items:function(){return this.element.children().find("> *, select")},focused:function(){return this.element.find(".k-state-focused").length>0},toolById:function(e){var t,n=this.tools;for(t in n)if(t.toLowerCase()==e)return n[t]},toolGroupFor:function(t){var n,i=this.groups;if(this.isCustomTool(t))return"custom";for(n in i)if(e.inArray(t,i[n])>=0)return n},bindTo:function(t){var n=this,i=n.window;n._editor&&n._editor.unbind("select",a(n.refreshTools,n)),n._editor=t,n.tools=n.expandTools(t.options.tools),n.render(),n.element.find(".k-combobox .k-input").keydown(function(t){var n=e(this).closest(".k-combobox").data("kendoComboBox"),i=t.keyCode;i==s.RIGHT||i==s.LEFT?n.close():i==s.DOWN&&(n.dropDown.isOpened()||(t.stopImmediatePropagation(),n.open()))}),n._attachEvents(),n.items().each(function(){var i,r=n._toolName(this),o=n.tools[r],a=o&&o.options,s=t.options.messages,l=a&&a.tooltip||s[r],c=e(this);o&&o.initialize&&(("fontSize"==r||"fontName"==r)&&(i=s[r+"Inherit"],c.find("input").val(i).end().find("span.k-input").text(i).end()),o.initialize(c,{title:n._appendShortcutSequence(l,o),editor:n._editor}),c.closest(".k-widget",n.element).addClass("k-editor-widget"),c.closest(".k-colorpicker",n.element).next(".k-colorpicker").addClass("k-editor-widget"))}),t.bind("select",a(n.refreshTools,n)),n.update(),i&&i.wrapper.css({top:"",left:"",width:""})},show:function(){var e,t,n,i=this,r=i.window,o=i.options.editor;r&&(e=r.wrapper,t=o.element,e.is(":visible")&&i.window.options.visible||(e[0].style.width||e.width(t.outerWidth()-parseInt(e.css("border-left-width"),10)-parseInt(e.css("border-right-width"),10)),r._moved||(n=t.offset(),e.css({top:Math.max(0,parseInt(n.top,10)-e.outerHeight()-parseInt(i.window.element.css("padding-bottom"),10)),left:Math.max(0,parseInt(n.left,10))})),r.open()))},hide:function(){this.window&&this.window.close()},focus:function(){var e="tabIndex",t=this.element,n=this._editor.element.attr(e);t.attr(e,n||0).focus().find(c).first().focus(),n||0===n||t.removeAttr(e)},_appendShortcutSequence:function(e,t){if(!t.key)return e;var n=e+" (";return t.ctrl&&(n+="Ctrl + "),t.shift&&(n+="Shift + "),t.alt&&(n+="Alt + "),n+=t.key+")"},_nativeTools:["insertLineBreak","insertParagraph","redo","undo"],tools:{},isCustomTool:function(e){return!(e in t.ui.Editor.defaultTools)},expandTools:function(n){var r,a,s,l,c=this._nativeTools,d=t.deepExtend({},t.ui.Editor.defaultTools),u={};for(a=0;n.length>a;a++)r=n[a],l=r.name,e.isPlainObject(r)?l&&d[l]?(u[l]=o({},d[l]),o(u[l].options,r)):(s=o({cssClass:"k-i-custom",type:"button",title:""},r),s.name||(s.name="custom"),s.cssClass="k-"+("custom"==s.name?"i-custom":s.name),s.template||"button"!=s.type||(s.template=i.EditorUtils.buttonTemplate,s.title=s.title||s.tooltip),u[l]={options:s}):d[r]&&(u[r]=d[r]);for(a=0;c.length>a;a++)u[c[a]]||(u[c[a]]=d[c[a]]);return u},render:function(){function n(n){var i;return n.getHtml?i=n.getHtml():(e.isFunction(n)||(n=t.template(n)),i=n(o)),e.trim(i)}function i(){h.children().length&&h.appendTo(v)}function r(){h=e("<li class='k-tool-group' role='presentation' />")}var o,s,l,c,d,u,h,p,f=this,g=f.tools,m=f._editor.element,v=f.element.empty(),_=f._editor.options.tools,w=t.support.browser;for(v.empty(),r(),p=0;_.length>p;p++)c=_[p].name||_[p],o=g[c]&&g[c].options,!o&&e.isPlainObject(c)&&(o=c),s=o&&o.template,"break"==c&&(i(),e("<li class='k-row-break' />").appendTo(f.element),r()),s&&(u=f.toolGroupFor(c),d!=u&&(i(),r(),d=u),s=n(s),l=e(s).appendTo(h),"custom"==u&&(i(),r()),o.exec&&l.hasClass("k-tool")&&l.click(a(o.exec,m[0])));i(),e(f.element).children(":has(> .k-tool)").addClass("k-button-group"),f.options.popup&&w.msie&&9>w.version&&f.window.wrapper.find("*").attr("unselectable","on"),f.updateGroups(),f.angular("compile",function(){return{elements:f.element}})},updateGroups:function(){e(this.element).children().each(function(){e(this).children().filter(function(){return"none"!==this.style.display}).removeClass("k-group-end").first().addClass("k-group-start").end().last().addClass("k-group-end").end()})},decorateFrom:function(t){this.items().filter(".k-decorated").each(function(){var n=e(this).data("kendoSelectBox");n&&n.decorate(t)})},destroy:function(){r.fn.destroy.call(this);var e,t=this.tools;for(e in t)t[e].destroy&&t[e].destroy();this.window&&this.window.destroy()},_attachEvents:function(){var t=this,n="[role=button].k-tool",i=n+":not(.k-state-disabled)",r=n+".k-state-disabled";t.element.off(l).on("mouseenter"+l,i,function(){e(this).addClass("k-state-hover")}).on("mouseleave"+l,i,function(){e(this).removeClass("k-state-hover")}).on("mousedown"+l,n,function(e){e.preventDefault()}).on("keydown"+l,c,function(n){function i(e,n){var i=t.element.find(c),r=i.index(o)+e;return n&&(r=Math.max(0,Math.min(i.length-1,r))),i[r]}var r,o=this,a=n.keyCode;a==s.RIGHT||a==s.LEFT?e(o).hasClass(".k-dropdown")||(r=i(a==s.RIGHT?1:-1,!0)):a==s.ESC?r=t._editor:a!=s.TAB||n.ctrlKey||n.altKey||(n.shiftKey?r=i(-1):(r=i(1),r||(r=t._editor))),r&&(n.preventDefault(),r.focus())}).on("click"+l,i,function(n){var i=e(this);n.preventDefault(),n.stopPropagation(),i.removeClass("k-state-hover"),i.is("[data-popup]")||t._editor.exec(t._toolName(this))}).on("click"+l,r,function(e){e.preventDefault()})},_toolName:function(t){var n,i;if(t)return n=t.className,/k-tool\b/i.test(n)&&(n=t.firstChild.className),i=e.grep(n.split(" "),function(e){return!/^k-(widget|tool|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(e)}),i[0]?i[0].substring(i[0].lastIndexOf("-")+1):"custom"},refreshTools:function(){var n=this,i=n._editor,r=i.getRange(),o=t.ui.editor.RangeUtils.textNodes(r);o.length||(o=[r.startContainer]),n.items().each(function(){var t=n.tools[n._toolName(this)];t&&t.update&&t.update(e(this),o)}),this.update()},update:function(){this.element.children().children().each(function(){var t=e(this);t.css("display",t.hasClass("k-state-disabled")?"none":"")}),this.updateGroups()}});e.extend(i,{Toolbar:d})}(window.jQuery),function(e){var t=window.kendo,n=e.extend,i=e.proxy,r=t.ui.editor,o=r.Dom,a=r.EditorUtils,s=r.RangeUtils,l=r.Command,c=".kendoEditor",d="k-state-active",u="k-state-selected",h=r.Tool,p=r.ToolTemplate,f=r.InsertHtmlCommand,g=r.BlockFormatFinder,m=r.EditorUtils.registerTool,v="<td>"+r.emptyElementContent+"</td>",_=new g([{tags:["table"]}]),w=f.extend({_tableHtml:function(e,t){return e=e||1,t=t||1,"<table class='k-table' data-last>"+Array(e+1).join("<tr>"+Array(t+1).join(v)+"</tr>")+"</table>"},postProcess:function(t,n){var i=e("table[data-last]",t.document).removeAttr("data-last");n.selectNodeContents(i.find("td")[0]),t.selectRange(n)},exec:function(){var e=this.options;e.html=this._tableHtml(e.rows,e.columns),e.postProcess=this.postProcess,f.fn.exec.call(this)}}),y=h.extend({initialize:function(t,n){h.fn.initialize.call(this,t,n);var r=e(this.options.popupTemplate).appendTo("body").kendoPopup({anchor:t,copyAnchorStyles:!1,open:i(this._open,this),activate:i(this._activate,this),close:i(this._close,this)}).data("kendoPopup");t.click(i(this._toggle,this)).keydown(i(this._keydown,this)),this._editor=n.editor,this._popup=r},popup:function(){return this._popup},_activate:e.noop,_open:function(){this._popup.options.anchor.addClass(d)},_close:function(){this._popup.options.anchor.removeClass(d)},_keydown:function(e){var n=t.keys,i=e.keyCode;i==n.DOWN&&e.altKey?this._popup.open():i==n.ESC&&this._popup.close()},_toggle:function(t){var n=e(t.target).closest(".k-tool");n.hasClass("k-state-disabled")||this.popup().toggle()},update:function(e){this.popup().close(),e.removeClass("k-state-hover")},destroy:function(){this._popup.destroy()}}),b=y.extend({init:function(t){this.cols=8,this.rows=6,y.fn.init.call(this,e.extend(t,{command:w,popupTemplate:"<div class='k-ct-popup'>"+Array(this.cols*this.rows+1).join("<span class='k-ct-cell k-state-disabled' />")+"<div class='k-status'></div></div>"}))},_activate:function(){function n(t){var n=e(window);return{row:Math.floor((t.clientY+n.scrollTop()-u.top)/r)+1,col:Math.floor((t.clientX+n.scrollLeft()-u.left)/i)+1}}var i,r,o=this,a=o._popup.element,s=a.find(".k-ct-cell"),l=s.eq(0),d=s.eq(s.length-1),u=t.getOffset(l),h=t.getOffset(d),p=o.cols,f=o.rows;a.find("*").addBack().attr("unselectable","on"),h.left+=d[0].offsetWidth,h.top+=d[0].offsetHeight,i=(h.left-u.left)/p,r=(h.top-u.top)/f,a.on("mousemove"+c,function(e){o._setTableSize(n(e))}).on("mouseleave"+c,function(){o._setTableSize()}).on("mouseup"+c,function(e){o._exec(n(e))})},_valid:function(e){return e&&e.row>0&&e.col>0&&this.rows>=e.row&&this.cols>=e.col},_exec:function(e){this._valid(e)&&(this._editor.exec("createTable",{rows:e.row,columns:e.col}),this._popup.close())},_setTableSize:function(n){var i=this._popup.element,r=i.find(".k-status"),o=i.find(".k-ct-cell"),a=this.cols,s=this._editor.options.messages;this._valid(n)?(r.text(t.format(s.createTableHint,n.row,n.col)),o.each(function(t){e(this).toggleClass(u,n.col>t%a&&n.row>t/a)})):(r.text(s.dialogCancel),o.removeClass(u))},_keydown:function(e){var n,i,r,o,a,s,l,c;y.fn._keydown.call(this,e),n=t.keys,i=e.keyCode,r=this._popup.element.find(".k-ct-cell"),o=Math.max(r.filter(".k-state-selected").last().index(),0),a=Math.floor(o/this.cols),s=o%this.cols,l=!1,i!=n.DOWN||e.altKey?i==n.UP?(l=!0,a--):i==n.RIGHT?(l=!0,s++):i==n.LEFT&&(l=!0,s--):(l=!0,a++),c={row:Math.max(1,Math.min(this.rows,a+1)),col:Math.max(1,Math.min(this.cols,s+1))},i==n.ENTER?this._exec(c):this._setTableSize(c),l&&(e.preventDefault(),e.stopImmediatePropagation())},_open:function(){var e=this._editor.options.messages;y.fn._open.call(this),this.popup().element.find(".k-status").text(e.dialogCancel).end().find(".k-ct-cell").removeClass(u)},_close:function(){y.fn._close.call(this),this.popup().element.off(c)},update:function(e,t){var n;y.fn.update.call(this,e),n=_.isFormatted(t),e.toggleClass("k-state-disabled",n)}}),k=l.extend({exec:function(){for(var e,t,n,i,a=this.lockRange(!0),s=a.endContainer;"td"!=o.name(s);)s=s.parentNode;for(t=s.parentNode,e=t.children.length,n=t.cloneNode(!0),i=0;t.cells.length>i;i++)n.cells[i].innerHTML=r.emptyElementContent;"before"==this.options.position?o.insertBefore(n,t):o.insertAfter(n,t),this.releaseRange(a)}}),x=l.extend({exec:function(){var e,t,n,i,a=this.lockRange(!0),s=o.closest(a.endContainer,"td"),l=o.closest(s,"table"),c=l.rows,d=this.options.position;for(e=o.findNodeIndex(s),t=0;c.length>t;t++)n=c[t].cells[e],i=n.cloneNode(),i.innerHTML=r.emptyElementContent,"before"==d?o.insertBefore(i,n):o.insertAfter(i,n);this.releaseRange(a)}}),C=l.extend({exec:function(){var t,n,i,r=this.lockRange(),a=s.mapAll(r,function(t){return e(t).closest("tr")[0]}),l=o.closest(a[0],"table");
if(a.length>=l.rows.length)t=o.next(l),(!t||o.insignificant(t))&&(t=o.prev(l)),o.remove(l);else for(n=0;a.length>n;n++)i=a[n],o.removeTextSiblings(i),t=o.next(i)||o.prev(i),t=t.cells[0],o.remove(i);t&&(r.setStart(t,0),r.collapse(!0),this.editor.selectRange(r))}}),T=l.extend({exec:function(){var e,t,n=this.lockRange(),i=o.closest(n.endContainer,"td"),r=o.closest(i,"table"),a=r.rows,s=o.findNodeIndex(i,!0),l=a[0].cells.length;if(1==l)e=o.next(r),(!e||o.insignificant(e))&&(e=o.prev(r)),o.remove(r);else for(o.removeTextSiblings(i),e=o.next(i)||o.prev(i),t=0;a.length>t;t++)o.remove(a[t].cells[s]);e&&(n.setStart(e,0),n.collapse(!0),this.editor.selectRange(n))}}),S=h.extend({command:function(e){return e=n(e,this.options),"delete"==e.action?"row"==e.type?new C(e):new T(e):"row"==e.type?new k(e):new x(e)},initialize:function(e,t){h.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){var n=!_.isFormatted(t);e.toggleClass("k-state-disabled",n)}});n(t.ui.editor,{PopupTool:y,TableCommand:w,InsertTableTool:b,TableModificationTool:S,InsertRowCommand:k,InsertColumnCommand:x,DeleteRowCommand:C,DeleteColumnCommand:T}),m("createTable",new b({template:new p({template:a.buttonTemplate,popup:!0,title:"Create table"})})),m("addColumnLeft",new S({type:"column",position:"before",template:new p({template:a.buttonTemplate,title:"Add column on the left"})})),m("addColumnRight",new S({type:"column",template:new p({template:a.buttonTemplate,title:"Add column on the right"})})),m("addRowAbove",new S({type:"row",position:"before",template:new p({template:a.buttonTemplate,title:"Add row above"})})),m("addRowBelow",new S({type:"row",template:new p({template:a.buttonTemplate,title:"Add row below"})})),m("deleteRow",new S({type:"row",action:"delete",template:new p({template:a.buttonTemplate,title:"Delete row"})})),m("deleteColumn",new S({type:"column",action:"delete",template:new p({template:a.buttonTemplate,title:"Delete column"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.caret,r=n.keys,o=n.ui,a=o.Widget,s=".kendoMaskedTextBox",l=e.proxy,c=(n.support.propertyChangeEvent?"propertychange":"input")+s,d="k-state-disabled",u="disabled",h="readonly",p="change",f=a.extend({init:function(t,r){var o,l,c=this;a.fn.init.call(c,t,r),c._rules=e.extend({},c.rules,c.options.rules),t=c.element,o=t[0],c.wrapper=t,c._tokenize(),c._reset(),c.element.addClass("k-textbox").attr("autocomplete","off").on("focus"+s,function(){var e=o.value;e?c._togglePrompt(!0):o.value=c._old=c._emptyMask,c._oldValue=e,c._timeoutId=setTimeout(function(){i(t,0,e?c._maskLength:0)})}).on("focusout"+s,function(){var e=t.val();clearTimeout(c._timeoutId),o.value=c._old="",e!==c._emptyMask&&(o.value=c._old=e),c._change(),c._togglePrompt()}),l=t.is("[disabled]"),l?c.enable(!1):c.readonly(t.is("[readonly]")),c.value(c.options.value||t.val()),n.notify(c)},options:{name:"MaskedTextBox",promptChar:"_",clearPromptChar:!1,culture:"",rules:{},value:"",mask:""},events:[p],rules:{0:/\d/,9:/\d|\s/,"#":/\d|\s|\+|\-/,L:/[a-zA-Z]/,"?":/[a-zA-Z]|\s/,"&":/\S/,C:/./,A:/[a-zA-Z0-9]/,a:/[a-zA-Z0-9]|\s/},setOptions:function(t){var n=this;a.fn.setOptions.call(n,t),n._rules=e.extend({},n.rules,n.options.rules),n._tokenize(),this._unbindInput(),this._bindInput(),n.value(n.element.val())},destroy:function(){var e=this;e.element.off(s),e._form&&e._form.off("reset",e._resetHandler),a.fn.destroy.call(e)},value:function(e){var i=this.element,r=this._emptyMask;return e===t?this.element.val():(null===e&&(e=""),r?(e=this._unmask(e+""),i.val(e?r:""),this._mask(0,this._maskLength,e),e=i.val(),this._oldValue=e,n._activeElement()!==i&&(e===r?i.val(""):this._togglePrompt()),t):(i.val(e),t))},_togglePrompt:function(e){var t=this.element[0],n=t.value;this.options.clearPromptChar&&(n=e?this._oldValue:n.replace(RegExp(this.options.promptChar,"g")," "),t.value=this._old=n)},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},_bindInput:function(){var e=this;e._maskLength&&e.element.on("keydown"+s,l(e._keydown,e)).on("keypress"+s,l(e._keypress,e)).on("paste"+s,l(e._paste,e)).on(c,l(e._propertyChange,e))},_unbindInput:function(){this.element.off("keydown"+s).off("keypress"+s).off("paste"+s).off(c)},_editable:function(e){var t=this,n=t.element,i=e.disable,r=e.readonly;t._unbindInput(),r||i?n.attr(u,i).attr(h,r).toggleClass(d,i):(n.removeAttr(u).removeAttr(h).removeClass(d),t._bindInput())},_change:function(){var e=this,t=e.value();t!==e._oldValue&&(e._oldValue=t,e.trigger(p),e.element.trigger(p))},_propertyChange:function(){var e,t,r=this,o=r.element[0],a=o.value;n._activeElement()===o&&(a===r._old||r._pasting||(t=i(o)[0],e=r._unmask(a.substring(t),t),o.value=r._old=a.substring(0,t)+r._emptyMask.substring(t),r._mask(t,t,e),i(o,t)))},_paste:function(e){var t=this,n=e.target,r=i(n),o=r[0],a=r[1],s=t._unmask(n.value.substring(a),a);t._pasting=!0,setTimeout(function(){var e=n.value,r=e.substring(o,i(n)[0]);n.value=t._old=e.substring(0,o)+t._emptyMask.substring(o),t._mask(o,o,r),o=i(n)[0],t._mask(o,o,s),i(n,o),t._pasting=!1})},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(n[0].value)})},t._form=r.on("reset",t._resetHandler))},_keydown:function(e){var n,o=e.keyCode,a=this.element[0],s=i(a),l=s[0],c=s[1],d=o===r.BACKSPACE;d||o===r.DELETE?(l===c&&(d?l-=1:c+=1,n=this._find(l,d)),n!==t&&n!==l?(d&&(n+=1),i(a,n)):l>-1&&this._mask(l,c,"",d),e.preventDefault()):o===r.ENTER&&this._change()},_keypress:function(e){var t,n;0===e.which||e.ctrlKey||e.keyCode===r.ENTER||(t=String.fromCharCode(e.which),n=i(this.element),this._mask(n[0],n[1],t),(e.keyCode===r.BACKSPACE||t)&&e.preventDefault())},_find:function(e,t){var n=this.element.val()||this._emptyMask,i=1;for(t===!0&&(i=-1);e>-1||this._maskLength>=e;){if(n.charAt(e)!==this.tokens[e])return e;e+=i}return-1},_mask:function(e,r,o,a){var s,l,c,d,u=this.element[0],h=u.value||this._emptyMask,p=this.options.promptChar,f=0;for(e=this._find(e,a),e>r&&(r=e),l=this._unmask(h.substring(r),r),o=this._unmask(o,e),s=o.length,o&&(l=l.replace(RegExp("^_{0,"+s+"}"),"")),o+=l,h=h.split(""),c=o.charAt(f);this._maskLength>e;)h[e]=c||p,c=o.charAt(++f),d===t&&f>s&&(d=e),e=this._find(e+1);u.value=this._old=h.join(""),n._activeElement()===u&&(d===t&&(d=this._maskLength),i(u,d))},_unmask:function(t,n){var i,r,o,a,s,l,c,d;if(!t)return"";for(t=(t+"").split(""),o=0,a=n||0,s=this.options.promptChar,l=t.length,c=this.tokens.length,d="";c>a&&(i=t[o],r=this.tokens[a],i===r||i===s?(d+=i===s?s:"",o+=1,a+=1):"string"!=typeof r?((r.test&&r.test(i)||e.isFunction(r)&&r(i))&&(d+=i,a+=1),o+=1):a+=1,!(o>=l)););return d},_tokenize:function(){for(var e,t,i,r,o=[],a=0,s=this.options.mask||"",l=s.split(""),c=l.length,d=0,u="",h=this.options.promptChar,p=n.getCulture(this.options.culture).numberFormat,f=this._rules;c>d;d++)if(e=l[d],t=f[e])o[a]=t,u+=h,a+=1;else for("."===e||","===e?e=p[e]:"$"===e?e=p.currency.symbol:"\\"===e&&(d+=1,e=l[d]),e=e.split(""),i=0,r=e.length;r>i;i++)o[a]=e[i],u+=e[i],a+=1;this.tokens=o,this._emptyMask=u,this._maskLength=u.length}});o.plugin(f)}(window.kendo.jQuery),function(e,t){function n(e){var n="string"==typeof e?[{name:e}]:e,i="[object Array]"===_t.call(n)?n:n!==t?[n]:[];return yt(i,function(e){return"string"==typeof e?{name:e}:{name:e.name,type:e.type}})}function i(e){var n="string"==typeof e?[{name:[e],expand:!1}]:e,i="[object Array]"===_t.call(n)?n:n!==t?[n]:[];return yt(i,function(e){return"string"==typeof e?{name:[e],expand:!1}:{name:"[object Array]"===_t.call(e.name)?e.name.slice():[e.name],expand:e.expand}})}function r(e,t,n,i){var o,a,s,l;if(n||(n=t),i||(i=0),l=n.members[i],l&&!l.measure){if(s=l.children,a=s.length,n===t?e[pt.stringify([l.name])]=!!a:a&&(e[pt.stringify(lt(n,i))]=!0),a)for(o=0;a>o;o++)r(e,t,s[o],i);r(e,t,n,i+1)}}function o(t){var n,i,o={};t.length&&r(o,t[0]),n=[];for(i in o)n.push({name:e.parseJSON(i),expand:o[i]});return n}function a(e,t){var n,i,r,o,a=t.tuples||[],s=a[0];if(s&&s.members.length>e.length)for(n=s.members,i=0;n.length>i;i++)if(!n[i].measure){for(r=!1,o=0;e.length>o;o++)if(0===L(e[o]).indexOf(n[i].hierarchy)){r=!0;break}r||e.push({name:[n[i].name],expand:!1})}}function s(e){var t,n=[],i=e.members;for(t=0;i.length>t;t++)i[t].measure||n.push({name:[i[t].name],expand:i[t].children.length>0});return n}function l(e,t,n){var r,o;return e=e||{},a(t,e),n.length>1&&t.push({name:"Measures",measure:!0,children:i(n)}),r={members:t},e.tuples&&(o=x(e.tuples,r),o.tuple&&(t=s(o.tuple))),t}function c(e,t,n,i,r,o,a){var s,l,c,d,u,h,p,f=0,g=t;for(l in n[i].aggregates)s=n[i].aggregates[l],d=r[l],u=o[l],s=d?d(s):s.accumulator,e[g]={ordinal:g,value:s,fmtValue:u?pt.format(u,s):s},++f,g+=a;h=n[i].items;for(c in h){p=h[c].index*f,p=g+p*a;for(l in h[c].aggregates)s=h[c].aggregates[l],d=r[l],u=o[l],s=d?d(s):s.accumulator,e[p]={ordinal:p,value:s,fmtValue:u?pt.format(u,s):s},p+=a}}function d(e,t,n,i,r,o){var a,s,l,c,d,u,h,p=0;for(s in n[i].aggregates)a=n[i].aggregates[s],c=r[s],d=o[s],a=c?c(a):a.accumulator,e[e.length]={ordinal:t++,value:a,fmtValue:d?pt.format(d,a):a},++p;u=n[i].items;for(l in u){h=u[l].index*p;for(s in u[l].aggregates)a=u[l].aggregates[s],c=r[s],d=o[s],a=c?c(a):a.accumulator,e[e.length]={ordinal:t+h++,value:a,fmtValue:d?pt.format(d,a):a}}}function u(e){var t=pt.getter(e.field,!0);return function(n,i){return e.aggregate(t(n.dataItem),i,n)}}function h(e){return"number"==typeof e&&!isNaN(e)}function p(e){return e&&e.getTime}function f(e,n,i){return e.tuples.length<_(n.tuples,i)?n:t}function g(e,t,n,i,r){var o,a,s,l=e.length,c=_(t,i),d=i.length||1;for(a=0;n>a;a++)for(o=0;l>o;o++)s=v(e[o],t)*d,s+=o%d,r[a*l+o].ordinal=a*c+s}function m(e,t,n,i,r){var o,a,s,l=e.length,c=(_(t,i),i.length||1);for(a=0;l>a;a++)for(s=v(e[a],t),s*=c,s+=a%c,o=0;n>o;o++)r[a*n+o].ordinal=s*n+o}function v(e,t){return x(t,e).index}function _(e,t){var n,i,r;if(!e.length)return 0;for(n=e.slice(),i=n.shift(),r=1;i;)i.members?[].push.apply(n,i.members):i.children&&(i.measure||(r+=i.children.length),[].push.apply(n,i.children)),i=n.shift();return t.length&&(r*=t.length),r}function w(e){return e||(e={tuples:[]}),e.tuples||(e.tuples=[]),e}function y(e,t,n){var i,r,o;if(!e)return 0;for(i=Math.max(n.length,1),r=e.members.slice(0,t),o=r.shift();o;)o.children?[].push.apply(r,o.children):(i++,[].push.apply(r,o.members)),o=r.shift();return i}function b(e,t,n){var i,r,o,a,s,l;if(!t[0])return{parsedRoot:null,tuples:e,memberIndex:0,index:0};if(i=x(e,t[0]),!i.tuple)return{parsedRoot:null,tuples:t,memberIndex:0,index:0};if(r=i.tuple.members,o=t[0].members,a=-1,r.length!==o.length)return{parsedRoot:null,tuples:t,memberIndex:0,index:0};for(s=0,l=r.length;l>s;s++)!r[s].measure&&o[s].children[0]&&(-1==a&&o[s].children.length&&(a=s),r[s].children=o[s].children);return n=Math.max(n.length,1),{parsedRoot:i.tuple,index:i.index*n,memberIndex:a,tuples:e}}function k(e,t){var n,i,r=!0;for(e=e.members,t=t.members,n=0,i=e.length;i>n;n++)e[n].measure||t[n].measure||(r=r&&L(e[n])===L(t[n]));return r}function x(e,t){var n,i,r,o,a,s,l,c=0;for(n=0,i=e.length;i>n;n++){if(r=e[n],k(r,t))return{tuple:r,index:c};for(c++,a=0,s=r.members.length;s>a;a++)if(l=r.members[a],!l.measure&&(o=x(l.children,t),c+=o.index,o.tuple))return{tuple:o.tuple,index:c}}return{index:c}}function C(e,t){var n,i,r,o="";for(i=0,r=e.length;r>i;i++)n=e[i],o+=n.name,t[o]||(t[o]=n)}function T(e,t){var n,i,r,o,a=e.members,s="",l="";for(n=0,i=a.length;i>n;n++){if(r=a[n],o){if(t[s+r.name]){s+=r.name,o=t[s];continue}return t[s+r.parentName]?t[s+r.parentName]:(r.parentName&&(l+=r.parentName),t[l])}if(s+=r.name,o=t[r.parentName],!o&&(o=t[s],!o))return null;o&&(l+=o.name)}return o}function S(e,t){var n,i,r,o;if(0===t.length)return-1;for(n=t[0],i=e.members,r=0,o=i.length;o>r;r++)if(i[r].name==n.name)return r}function D(n,i){if(!(0>i)){var r={name:"Measures",measure:!0,children:[e.extend({members:[],dataIndex:n.dataIndex},n.members[i])]};n.members.splice(i,1,r),n.dataIndex=t}}function A(e,t){var n,i,r,o,a,s;if(1>e.length)return[];for(n=[],i={},r=S(e[0],t),o=0;e.length>o;o++)a=e[o],a.dataIndex=o,D(a,r),s=T(a,i),s?s.children.push(0>r||!s.measure?a:a.members[r].children[0]):n.push(a),C(a.members,i);return n}function E(e,t){var n,i,r,o,a,s,l,c,d;if(!e||!e.length)return t;for(n=[],i=P(e),r=i.length,o=Math.max(t.length/r,1),a=0;r>a;a++)for(l=o*a,c=o*i[a],s=0;o>s;s++)d=parseInt(c+s,10),n[parseInt(l+s,10)]=t[d]||{value:"",fmtValue:"",ordinal:d};return n}function I(e,t){var n,i,r,o,a,s,l,c;if(!e||!e.length)return t;for(n=[],i=P(e),r=i.length,o=Math.max(t.length/r,1),s=0;o>s;s++)for(l=r*s,a=0;r>a;a++)c=i[a]+l,n[l+a]=t[c]||{value:"",fmtValue:"",ordinal:c};return n}function P(e){var n,i,r,o,a,s,l;for(e=e.slice(),n=[],i=e.shift();i;){for(i.dataIndex!==t&&n.push(i.dataIndex),a=0,r=0,o=i.members.length;o>r;r++)l=i.members[r],s=l.children,l.measure?[].splice.apply(e,[0,0].concat(s)):[].splice.apply(e,[a,0].concat(s)),a+=s.length;i=e.shift()}return n}function M(e){var t=e.split(".");return t.length>2?t[0]+"."+t[1]:e}function F(e,t){var n=e.length-1,i=e[n],r=z(t,i);return r&&r.dir?i="ORDER("+i+".Children,"+r.field+".CurrentMember.MEMBER_CAPTION,"+r.dir+")":i+=".Children",e[n]=i,e}function z(e,t){for(var n=0,i=e.length;i>n;n++)if(0===t.indexOf(e[n].field))return e[n];return null}function R(e){var t,n="CROSSJOIN({";return e.length>2?(t=e.pop(),n+=R(e)):(n+=e.shift(),t=e.pop()),n+="},{",n+=t,n+="})"}function B(e,t){var n=e.slice(0);return t.length>1&&n.push("{"+H(t).join(",")+"}"),R(n)}function H(e){for(var n,i=0,r=e.length,o=[];r>i;i++)n=e[i],o.push(n.name!==t?n.name:n);return o}function L(e){return e=e.name||e,"[object Array]"===_t.call(e)&&(e=e[e.length-1]),e}function N(e){for(var t=e.length,n=[],i=0;t>i;i++)n.push(e[i].name[0]);return n}function O(e,t){var n,i,r,o=0,a=e.length,s=t.length;for(t=t.slice(0);a>o;o++)for(n=e[o],r=0;s>r;r++)if(i=M(t[r]),-1!==n.indexOf(i)){t[r]=n;break}return t}function V(e){for(var t,n,i,r,o,a,s=[],l=[],c=[],d=0,u=e.length;u>d;d++)if(t=e[d],r=t.name,a=!1,"[object Array]"!==_t.call(r)&&(t.name=r=[r]),r.length>1)l.push(t);else{for(o=M(r[0]),n=0,i=c.length;i>n;n++)if(0===c[n].name[0].indexOf(o)){a=!0;break}a||c.push(t),t.expand&&s.push(t)}return s=s.concat(l),{root:c,expanded:s}}function U(e,t,n){var i,r,o,a,s,l,c,d,u="";if(e=e||[],i=V(e),r=i.root,o=N(r),a=[],i=i.expanded,s=i.length,l=0,d=[],o.length>1||t.length>1){for(a.push(B(o,t));s>l;l++)c=F(i[l].name,n),d=O(c,o),a.push(B(d,t));u+=a.join(",")}else{for(;s>l;l++)c=F(i[l].name,n),d.push(c[0]);u+=o.concat(d).join(",")}return u}function W(e){var t="",n=e.value,i=e.field,r=e.operator;return"in"==r?(t+="{",t+=n,t+="}"):(t+="Filter(",t+=i+".Children",t+=pt.format(Y[r],i,n),t+=")"),t}function j(e,t){var n,i,r="",o=e.filters,a=o.length;for(i=a-1;i>=0;i--)n="SELECT (",n+=W(o[i]),n+=") ON 0",i==a-1?(n+=" FROM ["+t+"]",r=n):r=n+" FROM ( "+r+" )";return r}function q(e,t,n){var i,r,o="";if(t){o+="<"+e+">";for(r in t)i=t[r],n&&(r=r.replace(/([A-Z]+(?=$|[A-Z][a-z])|[A-Z]?[a-z]+)/g,"$1_").toUpperCase().replace(/_$/,"")),o+="<"+r+">"+i+"</"+r+">";o+="</"+e+">"}else o+="<"+e+"/>";return o}function G(e){if(null==e)return[];var t=_t.call(e);return"[object Array]"!==t?[e]:e}function $(e){var t,n,i,r,o={tuples:[]},a=G(pt.getter("Tuples.Tuple",!0)(e)),s=pt.getter("Caption['#text']"),l=pt.getter("UName['#text']"),c=pt.getter("LName['#text']"),d=pt.getter("LNum['#text']"),u=pt.getter("CHILDREN_CARDINALITY['#text']",!0),h=pt.getter("['@Hierarchy']"),p=pt.getter("PARENT_UNIQUE_NAME['#text']",!0);for(t=0;a.length>t;t++){for(n=[],i=G(a[t].Member),r=0;i.length>r;r++)n.push({children:[],caption:s(i[r]),name:l(i[r]),levelName:c(i[r]),levelNum:d(i[r]),hasChildren:parseInt(u(i[r]),10)>0,parentName:p(i[r]),hierarchy:h(i[r])});o.tuples.push({members:n})}return o}var Y,Q,K,X,Z,J,et,tt,nt,it,rt,ot,at,st,lt,ct,dt,ut,ht,pt=window.kendo,ft=pt.ui,gt=pt.Class,mt=ft.Widget,vt=pt.data.DataSource,_t={}.toString,wt=function(e){return e},yt=e.map,bt=e.extend,kt=pt.isFunction,xt="change",Ct="error",Tt="progress",St="stateReset",Dt="auto",At="<div/>",Et=".kendoPivotGrid",It="__row_total__",Pt="dataBinding",Mt="dataBound",Ft="expandMember",zt="collapseMember",Rt="k-i-arrow-s",Bt="k-i-arrow-e",Ht="#: data.member.caption || data.member.name #",Lt='<span class="k-icon k-i-kpi-#=data.dataItem.value > 0 ? "open" : data.dataItem.value < 0 ? "denied" : "hold"#">#:data.dataItem.value#</span>',Nt='<span class="k-icon k-i-kpi-#=data.dataItem.value > 0 ? "increase" : data.dataItem.value < 0 ? "decrease" : "equal"#">#:data.dataItem.value#</span>',Ot='#= data.dataItem ? kendo.htmlEncode(data.dataItem.fmtValue || data.dataItem.value) || "&nbsp;" : "&nbsp;" #',Vt='<table class="k-pivot-layout"><tr><td><div class="k-pivot-rowheaders"></div></td><td><div class="k-pivot-table k-state-default"></div></td></tr></table>',Ut={sum:function(e,t){var n=t.accumulator;return h(n)?h(e)&&(n+=e):n=e,n},count:function(e,t){return(t.accumulator||0)+1},average:{aggregate:function(e,n){var i=n.accumulator;return n.count===t&&(n.count=0),h(i)?h(e)&&(i+=e):i=e,h(e)&&n.count++,i},result:function(e){var t=e.accumulator;return h(t)&&(t/=e.count),t}},max:function(e,t){var n=t.accumulator;return h(n)||p(n)||(n=e),e>n&&(h(e)||p(e))&&(n=e),n},min:function(e,t){var n=t.accumulator;return h(n)||p(n)||(n=e),n>e&&(h(e)||p(e))&&(n=e),n}},Wt=gt.extend({init:function(e){this.options=bt({},this.options,e),this.dimensions=this._normalizeDescriptors("field",this.options.dimensions),this.measures=this._normalizeDescriptors("name",this.options.measures)},_normalizeDescriptors:function(e,t){var n,i,r,o;if(t=t||{},n={},"[object Array]"===_t.call(t)){for(r=0,o=t.length;o>r;r++)i=t[r],"string"==typeof i?n[i]={}:i[e]&&(n[i[e]]=i);t=n}return t},_asTuples:function(e,n,i){var r,o,a,s,l,c,d,u,h,p;if(i=i||[],r=this.dimensions||[],o=[],h=i.length||1,n.length||i.length)for(c=0;h>c;c++){for(a={members:[]},s=0,l=n.length;l>s;s++)u=L(n[s].name),a.members[a.members.length]={children:[],caption:(r[u]||{}).caption||"All",name:u,levelName:u,levelNum:"0",hasChildren:!0,parentName:t,hierarchy:u};h>1&&(a.members[a.members.length]={children:[],caption:i[c].caption,name:i[c].descriptor.name,levelName:"MEASURES",levelNum:"0",hasChildren:!1,parentName:t,hierarchy:"MEASURES"}),o[o.length]=a}for(p in e)for(c=0;h>c;c++){for(d={members:[]},s=0,l=n.length;l>s;s++)u=L(n[s].name),d.members[d.members.length]=0===e[p].parentName.indexOf(u)?{children:[],caption:e[p].value,name:e[p].name,levelName:e[p].name,levelNum:1,hasChildren:!1,parentName:u,hierarchy:u}:{children:[],caption:(r[u]||{}).caption||"All",name:u,levelName:u,levelNum:"0",hasChildren:!0,parentName:t,hierarchy:u};h>1&&(d.members[d.members.length]={children:[],caption:i[c].caption,name:i[c].descriptor.name,levelName:"MEASURES",levelNum:"0",hasChildren:!0,parentName:t,hierarchy:"MEASURES"}),o[o.length]=d}return o},_toDataArray:function(e,t,n,i,r){var o,a,s,l,c,d,u={},h={},p=0,f=n&&n.length;if(f)for(o=this.measures||{};f>p;p++)s=n[p].name,a=o[s],a.result&&(h[s]=a.result),a.format&&(u[s]=a.format);l=[],c=0,r(l,c,e,It,h,u,t);for(d in e)d!==It&&(c+=i,r(l,c,e,d,h,u,t));return l},_matchDescriptors:function(e,t,n,i){for(var r,o,a,s,l;i>0;)if(r=t[--i],o=L(r).split("&"),o.length>1&&(a=o[0],s=o[1],l=n[a],l(e)!=s))return!1;return!0},_isExpanded:function(e){for(var t=0,n=e.length;n>t;t++)if(e[t].expand)return!0;return!1},_calculateAggregate:function(e,t,n){var i,r,o,a={};for(o=0;e.length>o;o++)r=e[o].descriptor.name,i=n.aggregates[r]||{},i.accumulator=e[o].aggregator(t,i),a[r]=i;return a},_processColumns:function(e,n,i,r,o,a,s,l){var c,d,u,h,p,f,g=o.dataItem;for(f=0;n.length>f;f++)if(d=n[f],d.expand){if(!this._matchDescriptors(g,n,i,f))continue;u=L(d),c=i[u](g),c=c!==t?""+c:c,u=u+"&"+c,h=r[u]||{index:s.columnIndex,name:u,parentName:u,value:c},p=a.items[u]||{aggregates:{}},a.items[u]={index:h.index,aggregates:this._calculateAggregate(e,o,p)},l&&(r[u]||s.columnIndex++,r[u]=h)}},_measureAggregators:function(e){var t,n,i,r,o,a,s=e.measures||[],l=this.measures||{},c=[];if(s.length){for(i=0,r=s.length;r>i;i++)if(t=s[i],n=l[t.name],o=null,n){if(a=n.aggregate,"string"==typeof a){if(o=Ut[a.toLowerCase()],!o)throw Error("There is no such aggregate function");n.aggregate=o.aggregate||o,n.result=o.result}c.push({descriptor:t,caption:n.caption,result:n.result,aggregator:u(n)})}}else c.push({descriptor:{name:"default"},caption:"default",aggregator:function(){return 1}});return c},_buildGetters:function(e){var t,n,i,r,o,a={};for(r=0,o=e.length;o>r;r++)t=e[r],i=L(t),n=i.split("&"),n.length>1?a[n[0]]=pt.getter(n[0],!0):a[i]=pt.getter(i,!0);return a},process:function(e,n){var r,o,a,s,l,u,h,p,f,g,m,v,_,w,y,b,k,x,C,T,S,D,A,E,I,P;if(e=e||[],n=n||{},r=n.measures||[],o="rows"===n.measuresAxis,a=(o?n.rows:n.columns)||[],s=(o?n.columns:n.rows)||[],!a.length&&s.length&&(!r.length||r.length&&o)&&(a=s,s=[],o=!1),a.length||s.length||(o=!1),!a.length&&r.length&&(a=i(n.measures)),l={},u={},h={},f={columnIndex:0},g=this._measureAggregators(n),m=this._buildGetters(a),v=this._buildGetters(s),_=!1,a.length||s.length)for(b=this._isExpanded(s),_=!0,k=0,x=e.length;x>k;k++)for(w=e[k],y={dataItem:w,index:k},C=l[It]||{items:{},aggregates:{}},this._processColumns(g,a,m,u,y,C,f,!b),C.aggregates=this._calculateAggregate(g,y,C),l[It]=C,T=0,S=s.length;S>T;T++)if(D=s[T],D.expand){if(!this._matchDescriptors(w,s,v,T))continue;A=L(D),p=v[A](w),p=p!==t?""+p:p,h[p]={name:A+"&"+p,parentName:A,value:p},E=l[p]||{items:{},aggregates:{}},this._processColumns(g,a,m,u,y,E,f,!0),E.aggregates=this._calculateAggregate(g,y,E),l[p]=E}return _&&e.length?(!(g.length>1)||n.columns&&n.columns.length||(a=[]),u=this._asTuples(u,a,g),h=this._asTuples(h,s,[]),I=u.length,o&&(I=1,P=u,u=h,h=P),l=this._toDataArray(l,u.length,n.measures,I,o?c:d),l=this._normalizeData(l,u.length,h.length)):l=u=h=[],{axes:{columns:{tuples:u},rows:{tuples:h}},data:l}},_normalizeData:function(e,t,n){var i,r,o=(t||1)*(n||1),a=Array(o),s=e.length;if(s===o)return e;for(r=0;o>r;r++)a[r]={value:"",fmtValue:"",ordinal:r};for(r=0;s>r;r++)i=e[r],i&&(a[i.ordinal]=i);return a}}),jt=gt.extend({init:function(e,t){this.transport=t,this.options=t.options||{},this.transport.discover||kt(e.discover)&&(this.discover=e.discover)},read:function(e){return this.transport.read(e)},update:function(e){return this.transport.update(e)},create:function(e){return this.transport.create(e)},destroy:function(e){return this.transport.destroy(e)},discover:function(e){return this.transport.discover?this.transport.discover(e):(e.success({}),t)},catalog:function(n){var i,r=this.options||{};return n===t?(r.connection||{}).catalog:(i=r.connection||{},i.catalog=n,this.options.connection=i,e.extend(this.transport.options,{connection:i}),t)},cube:function(e){var n,i=this.options||{};return e===t?(i.connection||{}).cube:(n=i.connection||{},n.cube=e,this.options.connection=n,bt(!0,this.transport.options,{connection:n}),t)}}),qt=vt.extend({init:function(t){var r,o=((t||{}).schema||{}).cube,a="columns",s={axes:wt,cubes:wt,catalogs:wt,measures:wt,dimensions:wt,hierarchies:wt,levels:wt,members:wt};o&&(s=e.extend(s,this._cubeSchema(o)),this.cubeBuilder=new Wt(o)),vt.fn.init.call(this,bt(!0,{},{schema:s},t)),this.transport=new jt(this.options.transport||{},this.transport),this._columns=i(this.options.columns),this._rows=i(this.options.rows),r=this.options.measures||[],"[object Object]"===_t.call(r)&&(a=r.axis||"columns",r=r.values||[]),this._measures=n(r),this._measuresAxis=a,this._axes={}},_cubeSchema:function(e){return{dimensions:function(){var t,n=[],i=e.dimensions;for(t in i)n.push({name:t,caption:i[t].caption||t,uniqueName:t,defaultHierarchy:t,type:1});return e.measures&&n.push({name:"Measures",caption:"Measures",uniqueName:"Measures",type:2}),n},hierarchies:function(){return[]},measures:function(){var t,n=[],i=e.measures;for(t in i)n.push({name:t,caption:t,uniqueName:t,aggregator:t});return n}}},options:{serverSorting:!0,serverPaging:!0,serverFiltering:!0,serverGrouping:!0,serverAggregates:!0},catalog:function(e){return e===t?this.transport.catalog():(this.transport.catalog(e),this._mergeState({}),this._axes={},this.data([]),t)},cube:function(e){return e===t?this.transport.cube():(this.transport.cube(e),this._axes={},this._mergeState({}),this.data([]),t)},axes:function(){return this._axes},columns:function(e){return e===t?this._columns:(this._clearAxesData=!0,this._columns=i(e),this.query({columns:e,rows:this.rowsAxisDescriptors(),measures:this.measures()}),t)},rows:function(e){return e===t?this._rows:(this._clearAxesData=!0,this._rows=i(e),this.query({columns:this.columnsAxisDescriptors(),rows:e,measures:this.measures()}),t)},measures:function(e){return e===t?this._measures:(this._clearAxesData=!0,this.query({columns:this.columnsAxisDescriptors(),rows:this.rowsAxisDescriptors(),measures:n(e)}),t)},measuresAxis:function(){return this._measuresAxis||"columns"},_expandPath:function(e,t){var n,r,o,a="columns"===t?"columns":"rows",s="columns"===t?"rows":"columns",c=i(e),d=L(c[c.length-1]);for(this._lastExpanded=a,c=l(this.axes()[a],c,this.measures()),n=0;c.length>n;n++)if(r=L(c[n]),r===d){if(c[n].expand)return;c[n].expand=!0}else c[n].expand=!1;o={},o[a]=c,o[s]=this._descriptorsForAxis(s),this._query(o)},_descriptorsForAxis:function(e){var t=this.axes(),n=this[e]()||[];return t&&t[e]&&t[e].tuples&&t[e].tuples[0]&&(n=o(t[e].tuples||[])),n},columnsAxisDescriptors:function(){return this._descriptorsForAxis("columns")},rowsAxisDescriptors:function(){return this._descriptorsForAxis("rows")},_process:function(e,t){this._view=e,t=t||{},t.items=t.items||this._view,this.trigger(xt,t)},_query:function(e){var t=this;return e||(this._clearAxesData=!0),t.query(bt({},{page:t.page(),pageSize:t.pageSize(),sort:t.sort(),filter:t.filter(),group:t.group(),aggregate:t.aggregate(),columns:this.columnsAxisDescriptors(),rows:this.rowsAxisDescriptors(),measures:this.measures()},e))},query:function(t){var n=this._mergeState(t);return this._data.length&&this.cubeBuilder?(this._params(n),this._updateLocalData(this._pristineData),e.Deferred().resolve().promise()):this.read(n)},_mergeState:function(e){return e=vt.fn._mergeState.call(this,e),e!==t&&(this._measures=n(e.measures),e.columns?e.columns=i(e.columns):e.columns||(this._columns=[]),e.rows?e.rows=i(e.rows):e.rows||(this._rows=[])),e},filter:function(e){return e===t?this._filter:(this._clearAxesData=!0,this._query({filter:e,page:1}),t)},expandColumn:function(e){this._expandPath(e,"columns")},expandRow:function(e){this._expandPath(e,"rows")},success:function(e){var t;this.cubeBuilder&&(t=(this.reader.data(e)||[]).slice(0)),vt.fn.success.call(this,e),t&&(this._pristineData=t)},_processResult:function(e,t){var n,i,r,o,a,s,l,c,d,u,h;return this.cubeBuilder&&(n=this.cubeBuilder.process(e,this._requestData),e=n.data,t=n.axes),c=this.columns(),d=this.rows(),u=t.columns&&t.columns.tuples,c.length||!d.length||!u||!this._rowMeasures().length&&this.measures().length||(t={columns:{},rows:t.columns}),c.length||d.length||"rows"!==this.measuresAxis()||!u||(t={columns:{},rows:t.columns}),this._axes={columns:w(this._axes.columns),rows:w(this._axes.rows)},t={columns:w(t.columns),rows:w(t.rows)},i=this._normalizeTuples(t.columns.tuples,this._axes.columns.tuples,c,this._columnMeasures()),r=this._normalizeTuples(t.rows.tuples,this._axes.rows.tuples,d,this._rowMeasures()),this.cubeBuilder||(e=this._normalizeData({columnsLength:t.columns.tuples.length,rowsLength:t.rows.tuples.length,columnIndexes:i,rowIndexes:r,data:e})),"rows"==this._lastExpanded?(o=t.columns.tuples,s=this._columnMeasures(),a=f(t.columns,this._axes.columns,s),a&&(l="columns",t.columns=a,g(o,a.tuples,t.rows.tuples.length,s,e),e=this._normalizeData({columnsLength:_(t.columns.tuples,s),rowsLength:t.rows.tuples.length,data:e}))):"columns"==this._lastExpanded&&(o=t.rows.tuples,s=this._rowMeasures(),a=f(t.rows,this._axes.rows,s),a&&(l="rows",t.rows=a,m(o,a.tuples,t.columns.tuples.length,s,e),e=this._normalizeData({columnsLength:_(t.rows.tuples,s),rowsLength:t.columns.tuples.length,data:e}))),this._lastExpanded=null,h=this._mergeAxes(t,e,l),this._axes=h.axes,h.data},_readData:function(e){var t=this.reader.axes(e),n=this.reader.data(e);return this._processResult(n,t)},_createTuple:function(e,t,n){var i,r,o,a,s,l=e.members,c=l.length,d={members:[]},u=0;for(t&&(c-=1);c>u;u++)r=l[u],a=+r.levelNum,i=r.name,o=r.parentName,s=r.caption||i,n&&(s="All",0===a?o=r.name:a-=1,i=o),d.members.push({name:i,children:[],caption:s,levelName:o,levelNum:""+a,hasChildren:n,hierarchy:o,parentName:n?"":o});return t&&d.members.push({name:t.name,children:[]}),d},_hasRoot:function(e,t,n){var i,r,o,a,s,l,c;if(t.length)return x(t,e).tuple;for(i=e.members,a=!0,l=0,c=i.length;c>l;l++)if(r=i[l],s=+r.levelNum||0,o=n[l],!(0===s||o&&r.name===L(o))){a=!1;break}return a},_mergeAxes:function(e,t,n){var i,r,o,a,s,l=this._columnMeasures(),c=this._rowMeasures(),d=this.axes(),u=e.rows.tuples.length,h=_(d.columns.tuples,l),p=e.columns.tuples.length;return"columns"==n?(p=h,r=e.columns.tuples):(r=A(e.columns.tuples,l),t=I(r,t)),o=b(d.columns.tuples,r,l),"rows"==n?(u=_(e.rows.tuples,c),r=e.rows.tuples):(r=A(e.rows.tuples,c),t=E(r,t)),a=b(d.rows.tuples,r,c),d.columns.tuples=o.tuples,d.rows.tuples=a.tuples,h!==_(d.columns.tuples,l)?(i=o.index+y(o.parsedRoot,o.memberIndex,l),s=h+p,t=this._mergeColumnData(t,i,u,p,s)):(i=a.index+y(a.parsedRoot,a.memberIndex,c),t=this._mergeRowData(t,i,u,p)),{axes:d,data:t}},_mergeColumnData:function(e,t,n,i,r){var o,a,s,l=this.data().toJSON(),c=0,d=Math.max(this._columnMeasures().length,1);for(n=Math.max(n,1),l.length>0&&(c=d,r-=d),o=0;n>o;o++)a=t+o*r,s=e.splice(0,i),s.splice(0,c),[].splice.apply(l,[a,0].concat(s));return l},_mergeRowData:function(e,t,n,i){var r,o,a,s=this.data().toJSON(),l=Math.max(this._rowMeasures().length,1);for(i=Math.max(i,1),s.length>0&&(n-=l,e.splice(0,i*l)),r=0;n>r;r++)a=e.splice(0,i),o=t*i+r*i,[].splice.apply(s,[o,0].concat(a));return s},_columnMeasures:function(){var e=this.measures(),t=[];return"columns"===this.measuresAxis()&&(0===this.columns().length?t=e:e.length>1&&(t=e)),t},_rowMeasures:function(){var e=this.measures(),t=[];return"rows"===this.measuresAxis()&&(0===this.rows().length?t=e:e.length>1&&(t=e)),t},_updateLocalData:function(e,t){this.cubeBuilder&&(t&&(this._requestData=t),e=this._processResult(e)),this._data=this._observe(e),this._ranges=[],this._addRange(this._data),this._total=this._data.length,this._pristineTotal=this._total,this._process(this._data)},data:function(e){var n=this;return e===t?n._data:(this._pristineData=e.slice(0),this._updateLocalData(e,{columns:this.columns(),rows:this.rows(),measures:this.measures()}),t)},_normalizeTuples:function(e,t,n,i){var r,o,a,s=i.length||1,l=0,c=[],d={},u=0;if(e.length){if(!this._hasRoot(e[0],t,n)){for(;s>l;l++)c.push(this._createTuple(e[0],i[l],!0)),d[l]=l;e.splice.apply(e,[0,e.length].concat(c).concat(e)),l=s}if(i.length)for(a=r=e[l],o=r.members.length-1;r;){if(u>=s&&(u=0),r.members[o].name!==i[u].name&&(e.splice(l,0,this._createTuple(r,i[u])),d[l]=l),l+=1,u+=1,r=e[l],s>u&&(!r||ct(a,o-1)!==ct(r,o-1))){for(;s>u;u++)e.splice(l,0,this._createTuple(a,i[u])),d[l]=l,l+=1;r=e[l]}a=r}return d}},_normalizeData:function(e){var n,i,r=e.data,o=e.columnIndexes||{},a=e.rowIndexes||{},s=e.columnsLength||1,l=s*(e.rowsLength||1),c=0,d=0,u=0,h=Array(l);if(r.length===l)return r;for(;l>c;c++){if(a[parseInt(c/s,10)]!==t)for(i=0;s>i;i++)h[c]={value:"",fmtValue:"",ordinal:c},c+=1;if(o[c%s]!==t&&(h[c]={value:"",fmtValue:"",ordinal:c},c+=1),n=r[d]){if(n.ordinal-u>1)for(u+=1;n.ordinal>u;u++)h[c]={value:"",fmtValue:"",ordinal:c},c+=1;u=n.ordinal,n.ordinal=c,h[c]=n,d+=1}else h[c]={value:"",fmtValue:"",ordinal:c}}return h},discover:function(t,n){var i=this,r=i.transport;return e.Deferred(function(e){r.discover(bt({success:function(t){t=i.reader.parse(t),i._handleCustomErrors(t)||(n&&(t=n(t)),e.resolve(t))},error:function(t,n,r){e.reject(t),i.error(t,n,r)}},t))}).promise().done(function(){i.trigger("schemaChange")
})},schemaMeasures:function(){var e=this;return e.discover({data:{command:"schemaMeasures",restrictions:{catalogName:e.transport.catalog(),cubeName:e.transport.cube()}}},function(t){return e.reader.measures(t)})},schemaKPIs:function(){var e=this;return e.discover({data:{command:"schemaKPIs",restrictions:{catalogName:e.transport.catalog(),cubeName:e.transport.cube()}}},function(t){return e.reader.kpis(t)})},schemaDimensions:function(){var e=this;return e.discover({data:{command:"schemaDimensions",restrictions:{catalogName:e.transport.catalog(),cubeName:e.transport.cube()}}},function(t){return e.reader.dimensions(t)})},schemaHierarchies:function(e){var t=this;return t.discover({data:{command:"schemaHierarchies",restrictions:{catalogName:t.transport.catalog(),cubeName:t.transport.cube(),dimensionUniqueName:e}}},function(e){return t.reader.hierarchies(e)})},schemaLevels:function(e){var t=this;return t.discover({data:{command:"schemaLevels",restrictions:{catalogName:t.transport.catalog(),cubeName:t.transport.cube(),hierarchyUniqueName:e}}},function(e){return t.reader.levels(e)})},schemaCubes:function(){var e=this;return e.discover({data:{command:"schemaCubes",restrictions:{catalogName:e.transport.catalog()}}},function(t){return e.reader.cubes(t)})},schemaCatalogs:function(){var e=this;return e.discover({data:{command:"schemaCatalogs"}},function(t){return e.reader.catalogs(t)})},schemaMembers:function(e){var t=this;return t.discover({data:{command:"schemaMembers",restrictions:bt({catalogName:t.transport.catalog(),cubeName:t.transport.cube()},e)}},function(e){return t.reader.members(e)})},_params:function(e){this._clearAxesData&&(this._axes={},this._data=this._observe([]),this._clearAxesData=!1,this.trigger(St));var t=vt.fn._params.call(this,e);return t=bt({measures:this.measures(),measuresAxis:this.measuresAxis(),columns:this.columns(),rows:this.rows()},t),this.cubeBuilder&&(this._requestData=t),t}});qt.create=function(e){e=e&&e.push?{data:e}:e;var t=e||{},n=t.data;if(t.data=n,!(t instanceof qt)&&t instanceof pt.data.DataSource)throw Error("Incorrect DataSource type. Only PivotDataSource instances are supported");return t instanceof qt?t:new qt(t)},Y={contains:', InStr({0}.CurrentMember.MEMBER_CAPTION,"{1}") > 0',doesnotcontain:', InStr({0}.CurrentMember.MEMBER_CAPTION,"{1}") = 0',startswith:', Left({0}.CurrentMember.MEMBER_CAPTION,Len("{1}"))="{1}"',endswith:', Right({0}.CurrentMember.MEMBER_CAPTION,Len("{1}"))="{1}"',eq:', {0}.CurrentMember.MEMBER_CAPTION = "{1}"',neq:', NOT {0}.CurrentMember.MEMBER_CAPTION = "{1}"'},Q={schemaCubes:"MDSCHEMA_CUBES",schemaCatalogs:"DBSCHEMA_CATALOGS",schemaMeasures:"MDSCHEMA_MEASURES",schemaDimensions:"MDSCHEMA_DIMENSIONS",schemaHierarchies:"MDSCHEMA_HIERARCHIES",schemaLevels:"MDSCHEMA_LEVELS",schemaMembers:"MDSCHEMA_MEMBERS",schemaKPIs:"MDSCHEMA_KPIS"},K={read:function(e){var t,n,i,r,o,a='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Execute xmlns="urn:schemas-microsoft-com:xml-analysis"><Command><Statement>';return a+="SELECT NON EMPTY {",t=e.columns||[],n=e.rows||[],i=e.measures||[],r="rows"===e.measuresAxis,o=e.sort||[],!t.length&&n.length&&(!i.length||i.length&&r)&&(t=n,n=[],r=!1),t.length||n.length||(r=!1),t.length?a+=U(t,r?[]:i,o):i.length&&!r&&(a+=H(i).join(",")),a+="} DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON COLUMNS",(n.length||r&&i.length>1)&&(a+=", NON EMPTY {",a+=n.length?U(n,r?i:[],o):H(i).join(","),a+="} DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON ROWS"),e.filter?(a+=" FROM ",a+="(",a+=j(e.filter,e.connection.cube),a+=")"):a+=" FROM ["+e.connection.cube+"]",1==i.length&&t.length&&(a+=" WHERE ("+H(i).join(",")+")"),a+="</Statement></Command><Properties><PropertyList><Catalog>"+e.connection.catalog+"</Catalog><Format>Multidimensional</Format></PropertyList></Properties></Execute></Body></Envelope>",a.replace(/\&/g,"&amp;")},discover:function(t){t=t||{};var n='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis">';return n+="<RequestType>"+(Q[t.command]||t.command)+"</RequestType>",n+="<Restrictions>"+q("RestrictionList",t.restrictions,!0)+"</Restrictions>",t.connection&&t.connection.catalog&&(t.properties=e.extend({},{Catalog:t.connection.catalog},t.properties)),n+="<Properties>"+q("PropertyList",t.properties)+"</Properties>",n+="</Discover></Body></Envelope>"}},X=pt.data.RemoteTransport.extend({init:function(e){var t=e;e=this.options=bt(!0,{},this.options,e),pt.data.RemoteTransport.call(this,e),kt(t.discover)?this.discover=t.discover:"string"==typeof t.discover?this.options.discover={url:t.discover}:t.discover||(this.options.discover=this.options.read)},setup:function(t,n){return t.data=t.data||{},e.extend(!0,t.data,{connection:this.options.connection}),pt.data.RemoteTransport.fn.setup.call(this,t,n)},options:{read:{dataType:"text",contentType:"text/xml",type:"POST"},discover:{dataType:"text",contentType:"text/xml",type:"POST"},parameterMap:function(e,t){return K[t](e,t)}},discover:function(t){return e.ajax(this.setup(t,"discover"))}}),Z={cubes:{name:pt.getter("CUBE_NAME['#text']",!0),caption:pt.getter("CUBE_CAPTION['#text']",!0),description:pt.getter("DESCRIPTION['#text']",!0),type:pt.getter("CUBE_TYPE['#text']",!0)},catalogs:{name:pt.getter("CATALOG_NAME['#text']",!0),description:pt.getter("DESCRIPTION['#text']",!0)},measures:{name:pt.getter("MEASURE_NAME['#text']",!0),caption:pt.getter("MEASURE_CAPTION['#text']",!0),uniqueName:pt.getter("MEASURE_UNIQUE_NAME['#text']",!0),description:pt.getter("DESCRIPTION['#text']",!0),aggregator:pt.getter("MEASURE_AGGREGATOR['#text']",!0),groupName:pt.getter("MEASUREGROUP_NAME['#text']",!0),displayFolder:pt.getter("MEASURE_DISPLAY_FOLDER['#text']",!0),defaultFormat:pt.getter("DEFAULT_FORMAT_STRING['#text']",!0)},kpis:{name:pt.getter("KPI_NAME['#text']",!0),caption:pt.getter("KPI_CAPTION['#text']",!0),value:pt.getter("KPI_VALUE['#text']",!0),goal:pt.getter("KPI_GOAL['#text']",!0),status:pt.getter("KPI_STATUS['#text']",!0),trend:pt.getter("KPI_TREND['#text']",!0),statusGraphic:pt.getter("KPI_STATUS_GRAPHIC['#text']",!0),trendGraphic:pt.getter("KPI_TREND_GRAPHIC['#text']",!0),description:pt.getter("KPI_DESCRIPTION['#text']",!0),groupName:pt.getter("MEASUREGROUP_NAME['#text']",!0)},dimensions:{name:pt.getter("DIMENSION_NAME['#text']",!0),caption:pt.getter("DIMENSION_CAPTION['#text']",!0),description:pt.getter("DESCRIPTION['#text']",!0),uniqueName:pt.getter("DIMENSION_UNIQUE_NAME['#text']",!0),defaultHierarchy:pt.getter("DEFAULT_HIERARCHY['#text']",!0),type:pt.getter("DIMENSION_TYPE['#text']",!0)},hierarchies:{name:pt.getter("HIERARCHY_NAME['#text']",!0),caption:pt.getter("HIERARCHY_CAPTION['#text']",!0),description:pt.getter("DESCRIPTION['#text']",!0),uniqueName:pt.getter("HIERARCHY_UNIQUE_NAME['#text']",!0),dimensionUniqueName:pt.getter("DIMENSION_UNIQUE_NAME['#text']",!0),displayFolder:pt.getter("HIERARCHY_DISPLAY_FOLDER['#text']",!0),origin:pt.getter("HIERARCHY_ORIGIN['#text']",!0),defaultMember:pt.getter("DEFAULT_MEMBER['#text']",!0)},levels:{name:pt.getter("LEVEL_NAME['#text']",!0),caption:pt.getter("LEVEL_CAPTION['#text']",!0),description:pt.getter("DESCRIPTION['#text']",!0),uniqueName:pt.getter("LEVEL_UNIQUE_NAME['#text']",!0),dimensionUniqueName:pt.getter("DIMENSION_UNIQUE_NAME['#text']",!0),displayFolder:pt.getter("LEVEL_DISPLAY_FOLDER['#text']",!0),orderingProperty:pt.getter("LEVEL_ORDERING_PROPERTY['#text']",!0),origin:pt.getter("LEVEL_ORIGIN['#text']",!0),hierarchyUniqueName:pt.getter("HIERARCHY_UNIQUE_NAME['#text']",!0)},members:{name:pt.getter("MEMBER_NAME['#text']",!0),caption:pt.getter("MEMBER_CAPTION['#text']",!0),uniqueName:pt.getter("MEMBER_UNIQUE_NAME['#text']",!0),dimensionUniqueName:pt.getter("DIMENSION_UNIQUE_NAME['#text']",!0),hierarchyUniqueName:pt.getter("HIERARCHY_UNIQUE_NAME['#text']",!0),levelUniqueName:pt.getter("LEVEL_UNIQUE_NAME['#text']",!0),childrenCardinality:pt.getter("CHILDREN_CARDINALITY['#text']",!0)}},J=["axes","catalogs","cubes","dimensions","hierarchies","levels","measures"],et=pt.data.XmlDataReader.extend({init:function(e){pt.data.XmlDataReader.call(this,e),this._extend(e)},_extend:function(e){for(var t,n,i=0,r=J.length;r>i;i++)t=J[i],n=e[t],n&&n!==wt&&(this[t]=n)},parse:function(e){var t=pt.data.XmlDataReader.fn.parse(e.replace(/<(\/?)(\w|-)+:/g,"<$1"));return pt.getter("['Envelope']['Body']",!0)(t)},errors:function(e){var t=pt.getter("['Fault']",!0)(e);return t?[{faultstring:pt.getter("faultstring['#text']",!0)(t),faultcode:pt.getter("faultcode['#text']",!0)(t)}]:null},axes:function(e){var t,n,i;return e=pt.getter('ExecuteResponse["return"].root',!0)(e),t=G(pt.getter("Axes.Axis",!0)(e)),n=$(t[0]),i={},t.length>2&&(i=$(t[1])),{columns:n,rows:i}},data:function(e){var t,n,i,r,o,a;for(e=pt.getter('ExecuteResponse["return"].root',!0)(e),t=G(pt.getter("CellData.Cell",!0)(e)),n=[],i=pt.getter("['@CellOrdinal']"),r=pt.getter("Value['#text']"),o=pt.getter("FmtValue['#text']"),a=0;t.length>a;a++)n.push({value:r(t[a]),fmtValue:o(t[a]),ordinal:parseInt(i(t[a]),10)});return n},_mapSchema:function(e,t){var n,i,r,o,a;for(e=pt.getter('DiscoverResponse["return"].root',!0)(e),n=G(pt.getter("row",!0)(e)),i=[],r=0;n.length>r;r++){o={};for(a in t)o[a]=t[a](n[r]);i.push(o)}return i},measures:function(e){return this._mapSchema(e,Z.measures)},kpis:function(e){return this._mapSchema(e,Z.kpis)},hierarchies:function(e){return this._mapSchema(e,Z.hierarchies)},levels:function(e){return this._mapSchema(e,Z.levels)},dimensions:function(e){return this._mapSchema(e,Z.dimensions)},cubes:function(e){return this._mapSchema(e,Z.cubes)},catalogs:function(e){return this._mapSchema(e,Z.catalogs)},members:function(e){return this._mapSchema(e,Z.members)}}),bt(!0,pt.data,{PivotDataSource:qt,XmlaTransport:X,XmlaDataReader:et,PivotCubeBuilder:Wt,transports:{xmla:X},readers:{xmla:et}}),tt=function(e,t){if(!e)return null;for(var n=0,i=e.length;i>n;n++)if(e[n].field===t)return e[n];return null},nt=function(e,t){var n,i,r=[];for(n=0,i=e.length;i>n;n++)e[n].field!==t&&r.push(e[n]);return r},pt.ui.PivotSettingTarget=mt.extend({init:function(t,n){var i=this;mt.fn.init.call(i,t,n),i.element.addClass("k-pivot-setting"),i.dataSource=pt.data.PivotDataSource.create(n.dataSource),i._refreshHandler=e.proxy(i.refresh,i),i.dataSource.first(xt,i._refreshHandler),n.template||(i.options.template="<div data-"+pt.ns+'name="${data.name || data}">${data.name || data}'+(i.options.enabled?'<a class="k-button k-button-icon k-button-bare"><span class="k-icon k-setting-delete"></span></a>':"")+"</div>"),i.template=pt.template(i.options.template),i.emptyTemplate=pt.template(i.options.emptyTemplate),i._sortable(),i.element.on("click"+Et,".k-button,.k-item",function(t){var n=e(t.target),r=n.closest("["+pt.attr("name")+"]").attr(pt.attr("name"));r&&(n.hasClass("k-setting-delete")?i.remove(r):i.options.sortable&&n[0]===t.currentTarget&&i.sort({field:r,dir:n.find(".k-i-sort-asc")[0]?"desc":"asc"}))}),(n.filterable||n.sortable)&&(i.fieldMenu=new ft.PivotFieldMenu(i.element,{messages:i.options.messages.fieldMenu,filter:".k-setting-fieldmenu",filterable:n.filterable,sortable:n.sortable,dataSource:i.dataSource})),i.refresh()},options:{name:"PivotSettingTarget",template:null,filterable:!1,sortable:!1,emptyTemplate:"<div class='k-empty'>${data}</div>",setting:"columns",enabled:!0,messages:{empty:"Drop Fields Here"}},setDataSource:function(e){this.dataSource.unbind(xt,this._refreshHandler),this.dataSource=this.options.dataSource=e,this.fieldMenu&&this.fieldMenu.setDataSource(e),e.first(xt,this._refreshHandler),this.refresh()},_sortable:function(){var e=this;e.options.enabled&&(this.sortable=this.element.kendoSortable({connectWith:this.options.connectWith,filter:">:not(.k-empty)",hint:e.options.hint,cursor:"move",start:function(e){e.item.focus().blur()},change:function(t){var n=t.item.attr(pt.attr("name"));"receive"==t.action?e.add(n):"remove"==t.action?e.remove(n):"sort"==t.action&&e.move(n,t.newIndex)}}).data("kendoSortable"))},_indexOf:function(e,t){var n,i,r=-1;for(n=0,i=t.length;i>n;n++)if(L(t[n])===e){r=n;break}return r},_isKPI:function(e){return"kpi"===e.type||e.measure},validate:function(e){var t,n,i=2==e.type||"aggregator"in e||this._isKPI(e);return i?"measures"===this.options.setting:"measures"===this.options.setting?i:(t=this.dataSource[this.options.setting](),n=e.defaultHierarchy||e.uniqueName,this._indexOf(n,t)>-1?!1:(t=this.dataSource["columns"===this.options.setting?"rows":"columns"](),this._indexOf(n,t)>-1?!1:!0))},add:function(t){var n,i,r=this.dataSource[this.options.setting]();for(t=e.isArray(t)?t.slice(0):[t],n=0,i=t.length;i>n;n++)-1!==this._indexOf(t[n],r)&&(t.splice(n,1),n-=1,i-=1);t.length&&(r=r.concat(t),this.dataSource[this.options.setting](r))},move:function(e,t){var n=this.dataSource[this.options.setting](),i=this._indexOf(e,n);i>-1&&(e=n.splice(i,1)[0],n.splice(t,0,e),this.dataSource[this.options.setting](n))},remove:function(e){var t=this.dataSource[this.options.setting](),n=this._indexOf(e,t);n>-1&&(t.splice(n,1),this.dataSource[this.options.setting](t))},sort:function(e){var t=this.options.sortable,n=t===!0||t.allowUnsort,i=n&&"asc"===e.dir,r=this.dataSource.sort()||[],o=nt(r,e.field);i&&r.length!==o.length&&(e=null),e&&o.push(e),this.dataSource.sort(o)},refresh:function(){var e,n="",i=this.dataSource[this.options.setting](),r=i.length,o=0;if(r)for(;r>o;o++)e=i[o],e=e.name===t?{name:e}:e,n+=this.template(bt({sortIcon:this._sortIcon(e.name)},e));else n=this.emptyTemplate(this.options.messages.empty);this.element.html(n)},destroy:function(){mt.fn.destroy.call(this),this.dataSource.unbind(xt,this._refreshHandler),this.element.off(Et),this.sortable&&this.sortable.destroy(),this.fieldMenu&&this.fieldMenu.destroy(),this.element=null,this._refreshHandler=null},_sortIcon:function(e){var t=this.dataSource.sort(),n=tt(t,L(e)),i="";return n&&(i="k-i-sort-"+n.dir),i}}),it=mt.extend({init:function(n,i){var r,o,a=this;mt.fn.init.call(a,n,i),a._dataSource(),a._bindConfigurator(),a._wrapper(),a._createLayout(),a._columnBuilder=r=new dt,a._rowBuilder=o=new ut,a._contentBuilder=new ht,a._templates(),a.columnsHeader.add(a.rowsHeader).on("click","span.k-icon",function(){var n,i,s,l,c=e(this),d=r,u="expandColumn",h=c.attr(pt.attr("path")),p={axis:"columns",path:e.parseJSON(h)};c.parent().is("td")&&(d=o,u="expandRow",p.axis="rows"),i=c.hasClass(Rt),s=d.metadata[h],l=s.expanded===t,n=i?zt:Ft,a.trigger(n,p)||(d.metadata[h].expanded=!i,c.toggleClass(Rt,!i).toggleClass(Bt,i),!i&&l?a.dataSource[u](p.path):a.refresh())}),a._scrollable(),a.options.autoBind&&a.dataSource.fetch(),pt.notify(a)},events:[Pt,Mt,Ft,zt],options:{name:"PivotGrid",autoBind:!0,reorderable:!0,filterable:!1,sortable:!1,height:null,columnWidth:100,configurator:"",columnHeaderTemplate:null,rowHeaderTemplate:null,dataCellTemplate:null,kpiStatusTemplate:null,kpiTrendTemplate:null,messages:{measureFields:"Drop Data Fields Here",columnFields:"Drop Column Fields Here",rowFields:"Drop Rows Fields Here"}},_templates:function(){var e=this.options.columnHeaderTemplate,t=this.options.rowHeaderTemplate,n=this.options.dataCellTemplate,i=this.options.kpiStatusTemplate,r=this.options.kpiTrendTemplate;this._columnBuilder.template=pt.template(e||Ht,{useWithBlock:!!e}),this._contentBuilder.dataTemplate=pt.template(n||Ot,{useWithBlock:!!n}),this._contentBuilder.kpiStatusTemplate=pt.template(i||Lt,{useWithBlock:!!i}),this._contentBuilder.kpiTrendTemplate=pt.template(r||Nt,{useWithBlock:!!r}),this._rowBuilder.template=pt.template(t||Ht,{useWithBlock:!!t})},_bindConfigurator:function(){var t=this.options.configurator;t&&e(t).kendoPivotConfigurator("setDataSource",this.dataSource)},cellInfoByElement:function(t){return t=e(t),this.cellInfo(t.index(),t.parent("tr").index())},cellInfo:function(e,t){var n,i=this._contentBuilder,r=i.columnIndexes[e||0],o=i.rowIndexes[t||0];return r&&o?(n=o.index*i.rowLength+r.index,{columnTuple:r.tuple,rowTuple:o.tuple,measure:r.measure||o.measure,dataItem:this.dataSource.view()[n]}):null},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.measuresTarget&&this.measuresTarget.setDataSource(e),this.rowsTarget&&this.rowsTarget.setDataSource(e),this.columnsTarget&&this.columnsTarget.setDataSource(e),this._bindConfigurator(),this.options.autoBind&&e.fetch()},setOptions:function(e){mt.fn.setOptions.call(this,e),this._templates()},_dataSource:function(){var t=this,n=t.options.dataSource;n=e.isArray(n)?{data:n}:n,t.dataSource&&this._refreshHandler?t.dataSource.unbind(xt,t._refreshHandler).unbind(St,t._stateResetHandler).unbind(Tt,t._progressHandler).unbind(Ct,t._errorHandler):(t._refreshHandler=e.proxy(t.refresh,t),t._progressHandler=e.proxy(t._requestStart,t),t._stateResetHandler=e.proxy(t._stateReset,t),t._errorHandler=e.proxy(t._error,t)),t.dataSource=pt.data.PivotDataSource.create(n).bind(xt,t._refreshHandler).bind(Tt,t._progressHandler).bind(St,t._stateResetHandler).bind(Ct,t._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_stateReset:function(){this._columnBuilder.reset(),this._rowBuilder.reset()},_wrapper:function(){var e=this.options.height;this.wrapper=this.element.addClass("k-widget k-pivot"),e&&this.wrapper.css("height",e)},_measureFields:function(){this.measureFields=e(At).addClass("k-pivot-toolbar k-header k-settings-measures"),this.measuresTarget=this._createSettingTarget(this.measureFields,{setting:"measures",messages:{empty:this.options.messages.measureFields}})},_createSettingTarget:function(t,n){var i='<span tabindex="0" class="k-button" data-'+pt.ns+'name="${data.name}">${data.name}',r=n.sortable,o="";return r&&(o+="#if (data.sortIcon) {#",o+='<span class="k-icon ${data.sortIcon} k-setting-sort"></span>',o+="#}#"),(n.filterable||r)&&(o+='<span class="k-icon k-i-arrowhead-s k-setting-fieldmenu"></span>'),this.options.reorderable&&(o+='<span class="k-icon k-si-close k-setting-delete"></span>'),o&&(i+='<span class="k-field-actions">'+o+"</span>"),i+="</span>",new pt.ui.PivotSettingTarget(t,e.extend({template:i,emptyTemplate:'<span class="k-empty">${data}</span>',enabled:this.options.reorderable,dataSource:this.dataSource},n))},_initSettingTargets:function(){this.columnsTarget=this._createSettingTarget(this.columnFields,{connectWith:this.rowFields,setting:"columns",filterable:this.options.filterable,sortable:this.options.sortable,messages:{empty:this.options.messages.columnFields,fieldMenu:this.options.messages.fieldMenu}}),this.rowsTarget=this._createSettingTarget(this.rowFields,{connectWith:this.columnFields,setting:"rows",filterable:this.options.filterable,sortable:this.options.sortable,messages:{empty:this.options.messages.rowFields,fieldMenu:this.options.messages.fieldMenu}})},_createLayout:function(){var t=this,n=e(Vt),i=n.find(".k-pivot-rowheaders"),r=n.find(".k-pivot-table"),o=e(At).addClass("k-grid k-widget");t._measureFields(),t.columnFields=e(At).addClass("k-pivot-toolbar k-header k-settings-columns"),t.rowFields=e(At).addClass("k-pivot-toolbar k-header k-settings-rows"),t.columnsHeader=e('<div class="k-grid-header-wrap" />').wrap('<div class="k-grid-header" />'),t.columnsHeader.parent().css("padding-right",pt.support.scrollbar()),t.rowsHeader=e('<div class="k-grid k-widget k-alt"/>'),t.content=e('<div class="k-grid-content" />'),i.append(t.measureFields),i.append(t.rowFields),i.append(t.rowsHeader),o.append(t.columnsHeader.parent()),o.append(t.content),r.append(t.columnFields),r.append(o),t.wrapper.append(n),t.columnsHeaderTree=new pt.dom.Tree(t.columnsHeader[0]),t.rowsHeaderTree=new pt.dom.Tree(t.rowsHeader[0]),t.contentTree=new pt.dom.Tree(t.content[0]),t._initSettingTargets()},_progress:function(e){pt.ui.progress(this.wrapper,e)},_resize:function(){var e=this.columnsHeader.children("table");this.content[0].firstChild&&(this._setSectionsWidth(),this._setSectionsHeight(),this._setContentWidth(),this._setContentHeight(),e.css("table-layout",Dt),clearTimeout(this._layoutTimeout),this._layoutTimeout=setTimeout(function(){e.css("table-layout","fixed")}))},_setSectionsWidth:function(){var e=this.rowsHeader,t=e.parent(".k-pivot-rowheaders").width(Dt),n=Math.max(this.measureFields.outerWidth(),this.rowFields.outerWidth());n=Math.max(e.children("table").width(),n),t.width(n)},_setSectionsHeight:function(){var e=this.measureFields.height(Dt).height(),t=this.columnFields.height(Dt).height(),n=this.rowFields.height(Dt).innerHeight(),i=this.columnsHeader.height(Dt).innerHeight(),r=n-this.rowFields.height(),o=t>e?t:e,a=i>n?i:n;this.measureFields.height(o),this.columnFields.height(o),this.rowFields.height(a-r),this.columnsHeader.height(a)},_setContentWidth:function(){var e=this.content.find("table"),t=this.content.width(),n=e.children("colgroup").children().length,i=100,r=n*this.options.columnWidth;r>t&&(i=Math.ceil(r/t*100)),e.add(this.columnsHeader.children("table")).css("min-width",i+"%")},_setContentHeight:function(){var e=this,n=e.content,i=e.rowsHeader,r=e.wrapper.innerHeight(),o=pt.support.scrollbar(),a=n[0].offsetHeight===n[0].clientHeight;if(e.wrapper.is(":visible")){if(!r)return a&&(o=0),i.height(n.height()-o),t;r-=e.columnFields.outerHeight(),r-=e.columnsHeader.outerHeight(),2*o>=r&&(r=2*o+1,a||(r+=o)),n.height(r),a&&(o=0),i.height(r-o)}},_axisMeasures:function(e){var t=[],n=this.dataSource,i=n.measures(),r=i.length>1||i[0]&&i[0].type;return n.measuresAxis()===e&&(0===n[e]().length||r)&&(t=i),t},refresh:function(){var e,t=this,n=t.dataSource,i=n.axes(),r=(i.columns||{}).tuples||[],o=(i.rows||{}).tuples||[],a=t._columnBuilder,s=t._rowBuilder,l={},c={};t.trigger(Pt,{action:"rebind"})||(a.measures=this._axisMeasures("columns"),t.columnsHeaderTree.render(a.build(r)),t.rowsHeaderTree.render(s.build(o)),l={indexes:a._indexes,measures:a.measures,metadata:a.metadata},c={indexes:s._indexes,measures:this._axisMeasures("rows"),metadata:s.metadata},t.contentTree.render(t._contentBuilder.build(n.view(),l,c)),t._resize(),t.touchScroller?t.touchScroller.contentResized():(e=pt.touchScroller(t.content),e&&e.movable&&(t.touchScroller=e,e.movable.bind("change",function(e){t.columnsHeader.scrollLeft(-e.sender.x),t.rowsHeader.scrollTop(-e.sender.y)}))),t._progress(!1),t.trigger(Mt))},_scrollable:function(){var t=this,n=t.columnsHeader,i=t.rowsHeader;t.content.scroll(function(){n.scrollLeft(this.scrollLeft),i.scrollTop(this.scrollTop)}),i.bind("DOMMouseScroll"+Et+" mousewheel"+Et,e.proxy(t._wheelScroll,t))},_wheelScroll:function(t){var n,i;t.ctrlKey||(n=pt.wheelDeltaY(t),i=this.content.scrollTop(),n&&(t.preventDefault(),e(t.currentTarget).one("wheel"+Et,!1),this.rowsHeader.scrollTop(i+-n),this.content.scrollTop(i+-n)))}}),rt=pt.dom.element,ot=pt.dom.html,at=pt.dom.text,st=function(e,t){return{maxChildren:0,children:0,maxMembers:0,members:0,measures:1,levelNum:e,parentMember:0!==t}},lt=function(e,t){for(var n=[],i=0;t>=i;i++)n.push(e.members[i].name);return n},ct=function(e,t){for(var n="",i=0;t>=i;i++)n+=e.members[i].name;return n},dt=gt.extend({init:function(){this.measures=1,this.metadata={}},build:function(e){var t=this._tbody(e),n=this._colGroup();return[rt("table",null,[n,t])]},reset:function(){this.metadata={}},_colGroup:function(){for(var e=this._rowLength(),t=[],n=0;e>n;n++)t.push(rt("col",null));return rt("colgroup",null,t)},_tbody:function(e){var t=e[0];return this.map={},this.rows=[],this.rootTuple=t,this._indexes=[],t?(this._buildRows(t,0),this._normalize()):this.rows.push(rt("tr",null,[rt("th",null,[ot("&nbsp;")])])),rt("tbody",null,this.rows)},_normalize:function(){for(var e,t,n,i,r,o=this.rows,a=o.length,s=0;a>s;s++)if(e=o[s],1!==e.rowSpan)for(i=e.children,n=0,t=i.length;t>n;n++)r=i[n],r.tupleAll&&(r.attr.rowSpan=e.rowSpan)},_rowIndex:function(e){for(var t=this.rows,n=t.length,i=0;n>i&&t[i]!==e;i++);return i},_rowLength:function(){var e=this.rows[0]?this.rows[0].children:[],t=e.length,n=0,i=0;if(t)for(;t>i;i++)n+=e[i].attr.colSpan||1;return n||(n=this.measures),n},_row:function(e,t,n){var i,r,o=this.rootTuple.members[t].name,a=e.members[t].levelNum,s=o+a,l=this.map,c=l[s];return c?(c.notFirst=!1,c.parentMember&&c.parentMember===n||(c.parentMember=n,c.colSpan=0)):(c=rt("tr",null,[]),c.parentMember=n,c.colSpan=0,c.rowSpan=1,l[s]=c,i=l[o+(+a-1)],i&&(r=i.children,c.notFirst=r[1]&&-1===r[1].attr.className.indexOf("k-alt")?!0:i.notFirst),this.rows.splice(this._rowIndex(i)+1,0,c)),c},_measures:function(e,t,n){var i,r,o,a=this.map,s=a.measureRow;for(s||(s=rt("tr",null,[]),a.measureRow=s,this.rows.push(s)),r=0,o=e.length;o>r;r++)i=e[r],s.children.push(rt("th",{className:"k-header"+(n||"")},[this._content(i,t)]));return o},_content:function(e,t){return ot(this.template({member:e,tuple:t}))},_cell:function(e,t){return rt("th",{className:"k-header"+e},t)},_buildRows:function(e,n,i){var r,o,a,s,l,c,d,u,h,p,f=e.members,g=f[n],m=f[n+1],v=[],_=0;if(g.measure)return this._measures(g.children,e),t;if(u=pt.stringify(lt(e,n)),r=this._row(e,n,i),a=g.children,s=a.length,p=this.metadata[u],p||(this.metadata[u]=p=st(+g.levelNum,n)),this._indexes.push({path:u,tuple:e}),g.hasChildren&&(p.expanded===!1&&(s=0,p.children=0),d={className:"k-icon "+(s?Rt:Bt)},d[pt.attr("path")]=u,v.push(rt("span",d))),v.push(this._content(g,e)),l=this._cell(r.notFirst?" k-first":"",v),r.children.push(l),r.colSpan+=1,s){for(c=this._cell(" k-alt",[this._content(g,e)]),r.children.push(c);s>_;_++)o=this._buildRows(a[_],n,g);h=o.colSpan,l.attr.colSpan=h,p.children=h,p.members=1,r.colSpan+=h,r.rowSpan=o.rowSpan+1,m&&(h=m.measure?this._measures(m.children,e," k-alt"):this._buildRows(e,n+1).colSpan,c.attr.colSpan=h,h-=1,p.members+=h,r.colSpan+=h)}else m&&(h=m.measure?this._measures(m.children,e):this._buildRows(e,n+1).colSpan,p.members=h,h>1&&(l.attr.colSpan=h,r.colSpan+=h-1));return p.children>p.maxChildren&&(p.maxChildren=p.children),p.members>p.maxMembers&&(p.maxMembers=p.members),(c||l).tupleAll=!0,r}}),ut=gt.extend({init:function(){this.metadata={}},build:function(e){var t=this._tbody(e),n=this._colGroup();return[rt("table",null,[n,t])]},reset:function(){this.metadata={}},_colGroup:function(){for(var e=this.rows[0].children.length,t=[],n=0;e>n;n++)t.push(rt("col",null));return rt("colgroup",null,t)},_tbody:function(e){var t=e[0];return this.rootTuple=t,this.rows=[],this.map={},this._indexes=[],t?(this._buildRows(t,0),this._normalize()):this.rows.push(rt("tr",null,[rt("td",null,[ot("&nbsp;")])])),rt("tbody",null,this.rows)},_normalize:function(){for(var e,t,n,i,r=this.rows,o=r.length,a=0,s=this.rootTuple.members,l=s[0].name,c=s.length,d=0,u=this.map;o>a;a++)for(e=r[a],d=0;c>d;d++)n=this[s[d].name],t=e.colSpan["dim"+d],t&&n>t.levelNum&&(t.attr.colSpan=n-t.levelNum+1);e=u[l],i=u[l+"all"],e&&(e.children[0].attr.className="k-first"),i&&(i.children[0].attr.className+=" k-first")},_row:function(e){var t=rt("tr",null,e);return t.rowSpan=1,t.colSpan={},this.rows.push(t),t},_content:function(e,t){return ot(this.template({member:e,tuple:t}))},_buildRows:function(e,t){var n,i,r,o,a,s,l,c,d,u=this.map,h=e.members,p=h[t],f=h[t+1],g=p.children,m=g.length,v=+p.levelNum+1,_=this.rootTuple.members[t].name,w=lt(e,t-1).join(""),y=w+(p.parentName||""),b=u[y+"all"]||u[y],k=[];if(!b||b.hasChild?b=this._row():b.hasChild=!0,p.measure){for(c={className:b.allCell?"k-grid-footer":""},b.children.push(rt("td",c,[this._content(g[0],e)])),b.rowSpan=m,d=1;m>d;d++)this._row([rt("td",c,[this._content(g[d],e)])]);return b}if(u[w+p.name]=b,n=pt.stringify(lt(e,t)),o=this.metadata[n],o||(this.metadata[n]=o=st(v-1,t)),this._indexes.push({path:n,tuple:e}),p.hasChildren&&(o.expanded===!1&&(m=0,o.children=0),a={className:"k-icon "+(m?Rt:Bt)},a[pt.attr("path")]=n,k.push(rt("span",a))),k.push(this._content(p,e)),l=rt("td",{className:b.allCell&&!m?"k-grid-footer":""},k),l.levelNum=v,b.children.push(l),b.colSpan["dim"+t]=l,(!this[_]||v>this[_])&&(this[_]=v),m){for(b.allCell=!1,b.hasChild=!1,d=0;m>d;d++)i=this._buildRows(g[d],t),b!==i&&(b.rowSpan+=i.rowSpan);b.rowSpan>1&&(l.attr.rowSpan=b.rowSpan),o.children=b.rowSpan,s=rt("td",{className:"k-grid-footer"},[this._content(p,e)]),s.levelNum=v,r=this._row([s]),r.colSpan["dim"+t]=s,r.allCell=!0,u[w+p.name+"all"]=r,f&&(i=this._buildRows(e,t+1),s.attr.rowSpan=i.rowSpan),b.rowSpan+=r.rowSpan,o.members=r.rowSpan}else f&&(b.hasChild=!1,this._buildRows(e,t+1),(s||l).attr.rowSpan=b.rowSpan,o.members=b.rowSpan);return o.children>o.maxChildren&&(o.maxChildren=o.children),o.members>o.maxMembers&&(o.maxMembers=o.members),b}}),ht=gt.extend({init:function(){this.columnAxis={},this.rowAxis={}},build:function(e,n,i){var r,o,a=n.indexes[0],s=n.metadata[a?a.path:t];return this.columnAxis=n,this.rowAxis=i,this.data=e,this.rowLength=s?s.maxChildren+s.maxMembers:n.measures.length||1,this.rowLength||(this.rowLength=1),r=this._tbody(),o=this._colGroup(),[rt("table",null,[o,r])]},_colGroup:function(){var e=this.columnAxis.measures.length||1,t=[],n=0;for(this.rows[0]&&(e=this.rows[0].children.length);e>n;n++)t.push(rt("col",null));return rt("colgroup",null,t)},_tbody:function(){return this.rows=[],this.data[0]?(this.columnIndexes=this._indexes(this.columnAxis),this.rowIndexes=this._indexes(this.rowAxis),this._buildRows()):this.rows.push(rt("tr",null,[rt("td",null,[ot("&nbsp;")])])),rt("tbody",null,this.rows)},_indexes:function(e){var n,i,r,o,a,s=[],l=e.indexes,c=e.metadata,d=e.measures,u=d.length||1,h=0,p=0,f=0,g=l.length;if(!g){for(r=0;u>r;r++)s[r]={index:r,measure:d[r],tuple:null};return s}for(;g>f;f++){if(n=l[f],i=c[n.path],o=i.children+i.members,a=0,o&&(o-=u),i.expanded===!1&&i.children!==i.maxChildren&&(a=i.maxChildren),i.parentMember&&0===i.levelNum&&(o=-1),o>-1){for(r=0;u>r;r++)s[o+p+r]={children:o,index:h,measure:d[r],tuple:n.tuple},h+=1;for(;s[p]!==t;)p+=1}h+=a}return s},_buildRows:function(){for(var e=this.rowIndexes,t=e.length,n=0;t>n;n++)this.rows.push(this._buildRow(e[n]))},_buildRow:function(e){for(var t,n,i,r,o,a,s=e.index*this.rowLength,l=this.columnIndexes,c=l.length,d=[],u=0;c>u;u++)t=l[u],r={},t.children&&(r.className="k-alt"),i="",o=this.data[s+t.index],a=t.measure||e.measure,n={columnTuple:t.tuple,rowTuple:e.tuple,measure:a,dataItem:o},""!==o.value&&a&&a.type&&("status"===a.type?i=this.kpiStatusTemplate(n):"trend"===a.type&&(i=this.kpiTrendTemplate(n))),i||(i=this.dataTemplate(n)),d.push(rt("td",r,[ot(i)]));return r={},e.children&&(r.className="k-grid-footer"),rt("tr",r,d)}}),ft.plugin(it)}(window.kendo.jQuery),function(e,t){function n(e){return function(t){var n=t.children(".k-animation-container");return n.length||(n=t),n.children(e)}}function i(e){return f.template(e,{useWithBlock:!1})}function r(e){return e.find("> div .k-checkbox [type=checkbox]")}function o(e){return function(t,n){n=n.closest(q);var i,r=n.parent();return r.parent().is("li")&&(i=r.parent()),this._dataSourceMove(t,r,i,function(t,i){return this._insert(t.data(),i,n.index()+e)})}}function a(t,n){for(var i;t&&"ul"!=t.nodeName.toLowerCase();)i=t,t=t.nextSibling,3==i.nodeType&&(i.nodeValue=e.trim(i.nodeValue)),p.test(i.className)?n.insertBefore(i,n.firstChild):n.appendChild(i)}function s(t){var n=t.children("div"),i=t.children("ul"),r=n.children(".k-icon"),o=t.children(":checkbox"),s=n.children(".k-in");t.hasClass("k-treeview")||(n.length||(n=e("<div />").prependTo(t)),!r.length&&i.length?r=e("<span class='k-icon' />").prependTo(n):i.length&&i.children().length||(r.remove(),i.remove()),o.length&&e("<span class='k-checkbox' />").appendTo(n).append(o),s.length||(s=t.children("a").eq(0).addClass("k-in"),s.length||(s=e("<span class='k-in' />")),s.appendTo(n),n.length&&a(n[0].nextSibling,s[0])))}function l(e){var t=this;t.treeview=e,t.hovered=e.element,t._draggable=new g.Draggable(e.element,{filter:"div:not(.k-state-disabled) .k-in",hint:function(t){return e.templates.dragClue({item:e.dataItem(t),treeview:e.options})},cursorOffset:{left:10,top:f.support.mobileOS?-40/f.support.zoomLevel():10},dragstart:k(t.dragstart,t),dragcancel:k(t.dragcancel,t),drag:k(t.drag,t),dragend:k(t.dragend,t),$angular:e.options.$angular})}var c,d,u,h,p,f=window.kendo,g=f.ui,m=f.data,v=e.extend,_=f.template,w=e.isArray,y=g.Widget,b=m.HierarchicalDataSource,k=e.proxy,x=f.keys,C=".kendoTreeView",T="select",S="check",D="navigate",A="expand",E="change",I="error",P="checked",M="indeterminate",F="collapse",z="dragstart",R="drag",B="drop",H="dragend",L="dataBound",N="click",O="visibility",V="undefined",U="k-state-hover",W="k-treeview",j=":visible",q=".k-item",G="string",$="aria-selected",Y="aria-disabled",Q={text:"dataTextField",url:"dataUrlField",spriteCssClass:"dataSpriteCssClassField",imageUrl:"dataImageUrlField"},K=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&typeof e.nodeName===G
};d=n(".k-group"),u=n(".k-group,.k-content"),h=function(e){return e.children("div").children(".k-icon")},p=/k-sprite/,c=f.ui.DataBoundWidget.extend({init:function(e,t){var n,i,r=this,o=!1,a=t&&!!t.dataSource;w(t)&&(n=!0,t={dataSource:t}),t&&typeof t.loadOnDemand==V&&w(t.dataSource)&&(t.loadOnDemand=!1),y.prototype.init.call(r,e,t),e=r.element,t=r.options,i=e.is("ul")&&e||e.hasClass(W)&&e.children("ul"),o=!a&&i.length,o&&(t.dataSource.list=i),r._animation(),r._accessors(),r._templates(),e.hasClass(W)?(r.wrapper=e,r.root=e.children("ul").eq(0)):(r._wrapper(),i&&(r.root=e,r._group(r.wrapper))),r._tabindex(),r.root.attr("role","tree"),r._dataSource(o),r._attachEvents(),r._dragging(),o?r._syncHtmlAndDataSource():t.autoBind&&(r._progress(!0),r.dataSource.fetch()),t.checkboxes&&t.checkboxes.checkChildren&&r.updateIndeterminate(),r.element[0].id&&(r._ariaId=f.format("{0}_tv_active",r.element[0].id)),f.notify(r)},_attachEvents:function(){var t=this,n=".k-in:not(.k-state-selected,.k-state-disabled)",i="mouseenter";t.wrapper.on(i+C,".k-in.k-state-selected",function(e){e.preventDefault()}).on(i+C,n,function(){e(this).addClass(U)}).on("mouseleave"+C,n,function(){e(this).removeClass(U)}).on(N+C,n,k(t._click,t)).on("dblclick"+C,".k-in:not(.k-state-disabled)",k(t._toggleButtonClick,t)).on(N+C,".k-plus,.k-minus",k(t._toggleButtonClick,t)).on("keydown"+C,k(t._keydown,t)).on("focus"+C,k(t._focus,t)).on("blur"+C,k(t._blur,t)).on("mousedown"+C,".k-in,.k-checkbox :checkbox,.k-plus,.k-minus",k(t._mousedown,t)).on("change"+C,".k-checkbox :checkbox",k(t._checkboxChange,t)).on("click"+C,".k-checkbox :checkbox",k(t._checkboxClick,t)).on("click"+C,".k-request-retry",k(t._retryRequest,t)).on("click"+C,function(n){e(n.target).is(":kendoFocusable")||t.focus()})},_checkboxClick:function(t){var n=e(t.target);n.data(M)&&(n.data(M,!1).prop(M,!1).prop(P,!0),this._checkboxChange(t))},_syncHtmlAndDataSource:function(e,t){var n,i,o,a,s,l,c,d;for(e=e||this.root,t=t||this.dataSource,n=t.view(),i=f.attr("uid"),o=f.attr("expanded"),a=this.options.checkboxes,s=e.children("li"),l=0;s.length>l;l++)d=n[l],c=s.eq(l),c.attr("role","treeitem").attr(i,d.uid),d.expanded="true"===c.attr(o),a&&(d.checked=r(c).prop(P)),this._syncHtmlAndDataSource(c.children("ul"),d.children)},_animation:function(){var e=this.options,t=e.animation;t===!1?t={expand:{effects:{}},collapse:{hide:!0,effects:{}}}:t.collapse&&"effects"in t.collapse||(t.collapse=v({reverse:!0},t.expand)),v(t.collapse,{hide:!0}),e.animation=t},_dragging:function(){var e=this.options.dragAndDrop,t=this.dragging;e&&!t?this.dragging=new l(this):!e&&t&&(t.destroy(),this.dragging=null)},_templates:function(){var e=this,t=e.options,n=k(e._fieldAccessor,e);t.template&&typeof t.template==G?t.template=_(t.template):t.template||(t.template=i("# var text = "+n("text")+"(data.item); ## if (typeof data.item.encoded != 'undefined' && data.item.encoded === false) {##= text ## } else { ##: text ## } #")),e._checkboxes(),e.templates={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return e.firstLevel&&0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),n},cssClass:function(e,t){var n="",i=t.index,r=e.length-1;return e.firstLevel&&0===i&&(n+="k-top "),n+=0===i&&i!=r?"k-top":i==r?"k-bot":"k-mid"},textClass:function(e){var t="k-in";return e.enabled===!1&&(t+=" k-state-disabled"),e.selected===!0&&(t+=" k-state-selected"),t},toggleButtonClass:function(e){var t="k-icon";return t+=e.expanded!==!0?" k-plus":" k-minus",e.enabled===!1&&(t+="-disabled"),t},groupAttributes:function(e){var t="";return e.firstLevel||(t="role='group'"),t+(e.expanded!==!0?" style='display:none'":"")},groupCssClass:function(e){var t="k-group";return e.firstLevel&&(t+=" k-treeview-lines"),t},dragClue:i("<div class='k-header k-drag-clue'><span class='k-icon k-drag-status' />#= data.treeview.template(data) #</div>"),group:i("<ul class='#= data.r.groupCssClass(data.group) #'#= data.r.groupAttributes(data.group) #>#= data.renderItems(data) #</ul>"),itemContent:i("# var imageUrl = "+n("imageUrl")+"(data.item); ## var spriteCssClass = "+n("spriteCssClass")+"(data.item); ## if (imageUrl) { #<img class='k-image' alt='' src='#= imageUrl #'># } ## if (spriteCssClass) { #<span class='k-sprite #= spriteCssClass #' /># } ##= data.treeview.template(data) #"),itemElement:i("# var item = data.item, r = data.r; ## var url = "+n("url")+"(item); #<div class='#= r.cssClass(data.group, item) #'># if (item.hasChildren) { #<span class='#= r.toggleButtonClass(item) #' role='presentation' /># } ## if (data.treeview.checkboxes) { #<span class='k-checkbox' role='presentation'>#= data.treeview.checkboxes.template(data) #</span># } ## var tag = url ? 'a' : 'span'; ## var textAttr = url ? ' href=\\'' + url + '\\'' : ''; #<#=tag#  class='#= r.textClass(item) #'#= textAttr #>#= r.itemContent(data) #</#=tag#></div>"),item:i("# var item = data.item, r = data.r; #<li role='treeitem' class='#= r.wrapperCssClass(data.group, item) #' "+f.attr("uid")+"='#= item.uid #' aria-selected='#= item.selected ? \"true\" : \"false \" #' #=item.enabled === false ? \"aria-disabled='true'\" : ''## if (item.expanded) { #data-expanded='true' aria-expanded='true'# } #>#= r.itemElement(data) #</li>"),loading:i("<div class='k-icon k-loading' /> #: data.messages.loading #"),retry:i("#: data.messages.requestFailed # <button class='k-button k-request-retry'>#: data.messages.retry #</button>")}},items:function(){return this.element.find(".k-item > div:first-child")},setDataSource:function(e){var t=this.options;t.dataSource=e,this._dataSource(),this.dataSource.fetch(),t.checkboxes&&t.checkboxes.checkChildren&&this.updateIndeterminate()},_bindDataSource:function(){this._refreshHandler=k(this.refresh,this),this._errorHandler=k(this._error,this),this.dataSource.bind(E,this._refreshHandler),this.dataSource.bind(I,this._errorHandler)},_unbindDataSource:function(){var e=this.dataSource;e&&(e.unbind(E,this._refreshHandler),e.unbind(I,this._errorHandler))},_dataSource:function(e){function t(e){for(var n=0;e.length>n;n++)e[n]._initChildren(),e[n].children.fetch(),t(e[n].children.view())}var n=this,i=n.options,r=i.dataSource;r=w(r)?{data:r}:r,n._unbindDataSource(),r.fields||(r.fields=[{field:"text"},{field:"url"},{field:"spriteCssClass"},{field:"imageUrl"}]),n.dataSource=r=b.create(r),e&&(r.fetch(),t(r.view())),n._bindDataSource()},events:[z,R,B,H,L,A,F,T,E,D,S],options:{name:"TreeView",dataSource:{},animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:100}},messages:{loading:"Loading...",requestFailed:"Request failed.",retry:"Retry"},dragAndDrop:!1,checkboxes:!1,autoBind:!0,loadOnDemand:!0,template:"",dataTextField:null},_accessors:function(){var e,t,n,i=this,r=i.options,o=i.element;for(e in Q)t=r[Q[e]],n=o.attr(f.attr(e+"-field")),!t&&n&&(t=n),t||(t=e),w(t)||(t=[t]),r[Q[e]]=t},_fieldAccessor:function(t){var n=this.options[Q[t]],i=n.length,r="(function(item) {";return 0===i?r+="return item['"+t+"'];":(r+="var levels = ["+e.map(n,function(e){return"function(d){ return "+f.expr(e)+"}"}).join(",")+"];",r+="return levels[Math.min(item.level(), "+i+"-1)](item)"),r+="})"},setOptions:function(e){y.fn.setOptions.call(this,e),this._animation(),this._dragging(),this._templates()},_trigger:function(e,t){return this.trigger(e,{node:t.closest(q)[0]})},_setChecked:function(t,n){if(t&&e.isFunction(t.view))for(var i=0,r=t.view();r.length>i;i++)r[i][P]=n,r[i].children&&this._setChecked(r[i].children,n)},_setIndeterminate:function(e){var t,n,i,o=d(e),a=!0;if(o.length&&(t=r(o.children()),n=t.length)){if(n>1){for(i=1;n>i;i++)if(t[i].checked!=t[i-1].checked||t[i].indeterminate||t[i-1].indeterminate){a=!1;break}}else a=!t[0].indeterminate;return r(e).data(M,!a).prop(M,!a).prop(P,a&&t[0].checked)}},updateIndeterminate:function(e){var t,n,i;if(e=e||this.wrapper,t=d(e).children(),t.length){for(n=0;t.length>n;n++)this.updateIndeterminate(t.eq(n));i=this._setIndeterminate(e),i&&i.prop(P)&&(this.dataItem(e).checked=!0)}},_bubbleIndeterminate:function(e){if(e.length){var t,n=this.parent(e);n.length&&(this._setIndeterminate(n),t=n.children("div").find(".k-checkbox :checkbox"),t.prop(M)===!1?this.dataItem(n).set(P,t.prop(P)):this.dataItem(n).checked=!1,this._bubbleIndeterminate(n))}},_checkboxChange:function(t){var n=e(t.target),i=n.prop(P),r=n.closest(q);this.dataItem(r).set(P,i),this._trigger(S,r)},_toggleButtonClick:function(t){this.toggle(e(t.target).closest(q))},_mousedown:function(t){var n=e(t.currentTarget).closest(q);this._clickTarget=n,this.current(n)},_focusable:function(e){return e&&e.length&&e.is(":visible")&&!e.find(".k-in:first").hasClass("k-state-disabled")},_focus:function(){var t=this.select(),n=this._clickTarget;f.support.touch||(n&&n.length&&(t=n),this._focusable(t)||(t=this.current()),this._focusable(t)||(t=this._nextVisible(e())),this.current(t))},focus:function(){var e,t=this.wrapper,n=t[0],i=[],r=[],o=document.documentElement;do n=n.parentNode,n.scrollHeight>n.clientHeight&&(i.push(n),r.push(n.scrollTop));while(n!=o);for(t.focus(),e=0;i.length>e;e++)i[e].scrollTop=r[e]},_blur:function(){this.current().find(".k-in:first").removeClass("k-state-focused")},_enabled:function(e){return!e.children("div").children(".k-in").hasClass("k-state-disabled")},parent:function(t){var n,i,r=/\bk-treeview\b/,o=/\bk-item\b/;typeof t==G&&(t=this.element.find(t)),K(t)||(t=t[0]),i=o.test(t.className);do t=t.parentNode,o.test(t.className)&&(i?n=t:i=!0);while(!r.test(t.className)&&!n);return e(n)},_nextVisible:function(e){function t(e){for(;e.length&&!e.next().length;)e=i.parent(e);return e.next().length?e.next():e}var n,i=this,r=i._expanded(e);return e.length&&e.is(":visible")?r?(n=d(e).children().first(),n.length||(n=t(e))):n=t(e):n=i.root.children().eq(0),i._enabled(n)||(n=i._nextVisible(n)),n},_previousVisible:function(e){var t,n,i=this;if(!e.length||e.prev().length)for(n=e.length?e.prev():i.root.children().last();i._expanded(n)&&(t=d(n).children().last(),t.length);)n=t;else n=i.parent(e)||e;return i._enabled(n)||(n=i._previousVisible(n)),n},_keydown:function(n){var i,r=this,o=n.keyCode,a=r.current(),s=r._expanded(a),l=a.find(".k-checkbox:first :checkbox"),c=f.support.isRtl(r.element);n.target==n.currentTarget&&(!c&&o==x.RIGHT||c&&o==x.LEFT?s?i=r._nextVisible(a):r.expand(a):!c&&o==x.LEFT||c&&o==x.RIGHT?s?r.collapse(a):(i=r.parent(a),r._enabled(i)||(i=t)):o==x.DOWN?i=r._nextVisible(a):o==x.UP?i=r._previousVisible(a):o==x.HOME?i=r._nextVisible(e()):o==x.END?i=r._previousVisible(e()):o==x.ENTER?a.find(".k-in:first").hasClass("k-state-selected")||r._trigger(T,a)||r.select(a):o==x.SPACEBAR&&l.length&&(l.prop(P,!l.prop(P)).data(M,!1).prop(M,!1),r._checkboxChange({target:l}),i=a),i&&(n.preventDefault(),a[0]!=i[0]&&(r._trigger(D,i),r.current(i))))},_click:function(t){var n,i=this,r=e(t.currentTarget),o=u(r.closest(q)),a=r.attr("href");n=a?"#"==a||a.indexOf("#"+this.element.id+"-")>=0:o.length&&!o.children().length,n&&t.preventDefault(),r.hasClass(".k-state-selected")||i._trigger(T,r)||i.select(r)},_wrapper:function(){var e,t,n=this,i=n.element,r="k-widget k-treeview";i.is("ul")?(e=i.wrap("<div />").parent(),t=i):(e=i,t=e.children("ul").eq(0)),n.wrapper=e.addClass(r),n.root=t},_group:function(e){var t=this,n=e.hasClass(W),i={firstLevel:n,expanded:n||t._expanded(e)},r=e.children("ul");r.addClass(t.templates.groupCssClass(i)).css("display",i.expanded?"":"none"),t._nodes(r,i)},_nodes:function(t,n){var i,r=this,o=t.children("li");n=v({length:o.length},n),o.each(function(t,o){o=e(o),i={index:t,expanded:r._expanded(o)},s(o),r._updateNodeClasses(o,n,i),r._group(o)})},_checkboxes:function(){var e,t=this.options,n=t.checkboxes;n&&(e="<input type='checkbox' #= (item.enabled === false) ? 'disabled' : '' # #= item.checked ? 'checked' : '' #",n.name&&(e+=" name='"+n.name+"'"),e+=" />",n=v({template:e},t.checkboxes),typeof n.template==G&&(n.template=_(n.template)),t.checkboxes=n)},_updateNodeClasses:function(e,t,n){var i=e.children("div"),r=e.children("ul"),o=this.templates;e.hasClass("k-treeview")||(n=n||{},n.expanded=typeof n.expanded!=V?n.expanded:this._expanded(e),n.index=typeof n.index!=V?n.index:e.index(),n.enabled=typeof n.enabled!=V?n.enabled:!i.children(".k-in").hasClass("k-state-disabled"),t=t||{},t.firstLevel=typeof t.firstLevel!=V?t.firstLevel:e.parent().parent().hasClass(W),t.length=typeof t.length!=V?t.length:e.parent().children().length,e.removeClass("k-first k-last").addClass(o.wrapperCssClass(t,n)),i.removeClass("k-top k-mid k-bot").addClass(o.cssClass(t,n)),i.children(".k-in").removeClass("k-in k-state-default k-state-disabled").addClass(o.textClass(n)),(r.length||"true"==e.attr("data-hasChildren"))&&(i.children(".k-icon").removeClass("k-plus k-minus k-plus-disabled k-minus-disabled").addClass(o.toggleButtonClass(n)),r.addClass("k-group")))},_processNodes:function(t,n){var i=this;i.element.find(t).each(function(t,r){n.call(i,t,e(r).closest(q))})},dataItem:function(t){var n=e(t).closest(q).attr(f.attr("uid")),i=this.dataSource;return i&&i.getByUid(n)},_insertNode:function(t,n,i,r,o){var a,l,c,u,h=this,p=d(i),f=p.children().length+1,g={firstLevel:i.hasClass(W),expanded:!o,length:f},m="",v=function(e,t){e.appendTo(t)};for(c=0;t.length>c;c++)u=t[c],u.index=n+c,m+=h._renderItem({group:g,item:u});if(l=e(m),l.length){for(h.angular("compile",function(){return{elements:l.get(),data:t.map(function(e){return{dataItem:e}})}}),p.length||(p=e(h._renderGroup({group:g})).appendTo(i)),r(l,p),i.hasClass("k-item")&&(s(i),h._updateNodeClasses(i)),h._updateNodeClasses(l.prev().first()),h._updateNodeClasses(l.next().last()),c=0;t.length>c;c++)u=t[c],u.hasChildren&&(a=u.children.data(),a.length&&h._insertNode(a,u.index,l.eq(c),v,!h._expanded(l.eq(c))));return l}},_updateNodes:function(e,t){function n(e,t){e.find(".k-checkbox :checkbox").prop(P,t).data(M,!1).prop(M,!1)}var i,r,o,a,s,l=this,c={treeview:l.options,item:o};if("selected"==t)o=e[0],r=l.findByUid(o.uid).find(".k-in:first").removeClass("k-state-hover").toggleClass("k-state-selected",o[t]).end(),o[t]&&l.current(r),r.attr($,!!o[t]);else for(i=0;e.length>i;i++)c.item=o=e[i],l.findByUid(o.uid).find(">div>.k-in").html(l.templates.itemContent(c)),t==P?(r=l.findByUid(o.uid),a=o[t],n(r.children("div"),a),l.options.checkboxes.checkChildren&&(n(r.children(".k-group"),a),l._setChecked(o.children,a),l._bubbleIndeterminate(r))):"expanded"==t?l._toggle(l.findByUid(o.uid),o,o[t]):"enabled"==t&&(r=l.findByUid(o.uid),r.find(".k-checkbox :checkbox").prop("disabled",!o[t]),s=!u(r).is(j),r.removeAttr(Y),o[t]||(o.selected&&o.set("selected",!1),o.expanded&&o.set("expanded",!1),s=!0,r.attr($,!1).attr(Y,!0)),l._updateNodeClasses(r,{},{enabled:o[t],expanded:!s}))},_appendItems:function(e,t,n){var i=d(n),r=i.children(),o=!this._expanded(n);typeof e==V&&(e=r.length),this._insertNode(t,e,n,function(t,n){e>=r.length?t.appendTo(n):t.insertBefore(r.eq(e))},o),this._expanded(n)&&(this._updateNodeClasses(n),d(n).css("display","block"))},refresh:function(n){var i,r,o,a,l,c,u=this.wrapper,h=n.node,p=n.action,f=n.items,m=this.options,v=m.loadOnDemand,_=m.checkboxes&&m.checkboxes.checkChildren;if(n.field){if(!f[0]||!f[0].level)return;return this._updateNodes(f,n.field)}if(h&&(u=this.findByUid(h.uid),this._progress(u,!1)),_&&"remove"!=p){for(r=!1,i=0;f.length>i;i++)if("checked"in f[i]){r=!0;break}if(!r&&h&&h.checked)for(i=0;f.length>i;i++)f[i].checked=!0}if("add"==p)this._appendItems(n.index,f,u);else if("remove"==p)this._remove(this.findByUid(f[0].uid),!1);else if("itemchange"==p)this._updateNodes(f);else if(h)if(d(u).empty(),f.length)for(this._appendItems(n.index,f,u),o=d(u).children(),v&&_&&this._bubbleIndeterminate(o.last()),i=0;o.length>i;i++)a=o.eq(i),this.trigger("itemChange",{item:a,data:this.dataItem(a),ns:g});else s(u),this.trigger("itemChange",{item:u,data:h,ns:g});else l=this._renderGroup({items:f,group:{firstLevel:!0,expanded:!0}}),this.root.length?(this._angularItems("cleanup"),c=e(l),this.root.attr("class",c.attr("class")).html(c.html())):this.root=this.wrapper.html(l).children("ul"),this.root.attr("role","tree"),this._angularItems("compile");for(i=0;f.length>i;i++)(!v||f[i].expanded)&&f[i].load();this.trigger(L,{node:h?u:t})},_error:function(e){var t=e.node&&this.findByUid(e.node.uid),n=this.templates.retry({messages:this.options.messages});t?(this._progress(t,!1),this._expanded(t,!1),h(t).addClass("k-i-refresh"),e.node.loaded(!1)):(this._progress(!1),this.element.html(n))},_retryRequest:function(e){e.preventDefault(),this.dataSource.fetch()},expand:function(e){this._processNodes(e,function(e,t){this.toggle(t,!0)})},collapse:function(e){this._processNodes(e,function(e,t){this.toggle(t,!1)})},enable:function(e,t){t=2==arguments.length?!!t:!0,this._processNodes(e,function(e,n){this.dataItem(n).set("enabled",t)})},current:function(n){var i=this,r=i._current,o=i.element,a=i._ariaId;return arguments.length>0&&n&&n.length?(r&&(r[0].id===a&&r.removeAttr("id"),r.find(".k-in:first").removeClass("k-state-focused")),r=i._current=e(n,o).closest(q),r.find(".k-in:first").addClass("k-state-focused"),a=r[0].id||a,a&&(i.wrapper.removeAttr("aria-activedescendant"),r.attr("id",a),i.wrapper.attr("aria-activedescendant",a)),t):(r||(r=i._nextVisible(e())),r)},select:function(n){var i=this,r=i.element;return arguments.length?(n=e(n,r).closest(q),r.find(".k-state-selected").each(function(){var e=i.dataItem(this);e.set("selected",!1),delete e.selected}),n.length&&i.dataItem(n).set("selected",!0),i.trigger(E),t):r.find(".k-state-selected").closest(q)},_toggle:function(e,t,n){var i,r,o=this.options,a=u(e),s=n?"expand":"collapse";if(!a.data("animating")&&!this._trigger(s,e))if(this._expanded(e,n),i=t&&t.loaded(),r=!a.children().length,!n||i&&!r){if(this._updateNodeClasses(e,{},{expanded:n}),a.css("display")==(n?"block":"none"))return;n||a.css("height",a.height()).css("height"),a.kendoStop(!0,!0).kendoAnimate(v({reset:!0},o.animation[s],{complete:function(){n&&a.css("height","")}}))}else o.loadOnDemand&&this._progress(e,!0),a.remove(),t.load()},toggle:function(t,n){t=e(t),h(t).is(".k-minus,.k-plus,.k-minus-disabled,.k-plus-disabled")&&(1==arguments.length&&(n=!this._expanded(t)),this._expanded(t,n))},destroy:function(){var e=this;y.fn.destroy.call(e),e.wrapper.off(C),e._unbindDataSource(),e.dragging&&e.dragging.destroy(),f.destroy(e.element),e.root=e.wrapper=e.element=null},_expanded:function(e,n){var i=f.attr("expanded"),r=this.dataItem(e);return 1==arguments.length?"true"===e.attr(i)||r&&r.expanded:(u(e).data("animating")||(r&&(r.set("expanded",n),n=r.expanded),n?(e.attr(i,"true"),e.attr("aria-expanded","true")):(e.removeAttr(i),e.attr("aria-expanded","false"))),t)},_progress:function(e,t){var n=this.element,i=this.templates.loading({messages:this.options.messages});1==arguments.length?(t=e,t?n.html(i):n.empty()):h(e).toggleClass("k-loading",t).removeClass("k-i-refresh")},text:function(e,n){var i=this.dataItem(e),r=this.options[Q.text],o=i.level(),a=r.length,s=r[Math.min(o,a-1)];return n?(i.set(s,n),t):i[s]},_objectOrSelf:function(t){return e(t).closest("[data-role=treeview]").data("kendoTreeView")||this},_dataSourceMove:function(t,n,i,r){var o,a=this._objectOrSelf(i||n),s=a.dataSource,l=e.Deferred().resolve().promise();return i&&i[0]!=a.element[0]&&(o=a.dataItem(i),o.loaded()||(a._progress(i,!0),l=o.load()),i!=this.root&&(s=o.children,s&&s instanceof b||(o._initChildren(),o.loaded(!0),s=o.children))),t=this._toObservableData(t),r.call(this,s,t,l)},_toObservableData:function(t){var n,i,r=t;return(t instanceof window.jQuery||K(t))&&(n=this._objectOrSelf(t).dataSource,i=e(t).attr(f.attr("uid")),r=n.getByUid(i),r&&(r=n.remove(r))),r},_insert:function(e,t,n){t instanceof f.data.ObservableArray?t=t.toJSON():w(t)||(t=[t]);var i=e.parent();return i&&i._initChildren&&(i.hasChildren=!0,i._initChildren()),e.splice.apply(e,[n,0].concat(t)),this.findByUid(e[n].uid)},insertAfter:o(1),insertBefore:o(0),append:function(t,n,i){var r=this,o=r.root;return n&&(o=d(n)),r._dataSourceMove(t,o,n,function(t,o,a){function s(){n&&r._expanded(n,!0);var e=t.data(),i=Math.max(e.length,0);return r._insert(e,o,i)}var l;return a.then(function(){l=s(),(i=i||e.noop)(l)}),l||null})},_remove:function(t,n){var i,r,o,a=this;return t=e(t,a.element),this.angular("cleanup",function(){return{elements:t.get()}}),i=t.parent().parent(),r=t.prev(),o=t.next(),t[n?"detach":"remove"](),i.hasClass("k-item")&&(s(i),a._updateNodeClasses(i)),a._updateNodeClasses(r),a._updateNodeClasses(o),t},remove:function(e){var t=this.dataItem(e);t&&this.dataSource.remove(t)},detach:function(e){return this._remove(e,!0)},findByText:function(t){return e(this.element).find(".k-in").filter(function(n,i){return e(i).text()==t}).closest(q)},findByUid:function(e){return this.element.find(".k-item["+f.attr("uid")+"="+e+"]")},expandPath:function(n,i){var r,o,a;for(n=n.slice(0),r=this,o=this.dataSource,a=o.get(n[0]),i=i||e.noop;n.length>0&&(a.expanded||a.loaded());)a.set("expanded",!0),n.shift(),a=o.get(n[0]);return n.length?(o.bind("change",function(e){var t,a=e.node&&e.node.id;a&&a===n[0]&&(n.shift(),n.length?(t=o.get(n[0]),t&&!t.loaded()?t.set("expanded",!0):i.call(r)):i.call(r))}),a.set("expanded",!0),t):i.call(r)},_parents:function(e){for(var t=e&&e.parentNode(),n=[];t;)n.push(t),t=t.parentNode();return n},expandTo:function(e){var t,n;for(e instanceof f.data.Node||(e=this.dataSource.get(e)),t=this._parents(e),n=0;t.length>n;n++)t[n].set("expanded",!0)},_renderItem:function(e){return e.group||(e.group={}),e.treeview=this.options,e.r=this.templates,this.templates.item(e)},_renderGroup:function(e){var t=this;return e.renderItems=function(e){var n="",i=0,r=e.items,o=r?r.length:0,a=e.group;for(a.length=o;o>i;i++)e.group=a,e.item=r[i],e.item.index=i,n+=t._renderItem(e);return n},e.r=t.templates,t.templates.group(e)}}),l.prototype={_removeTouchHover:function(){var e=this;f.support.touch&&e.hovered&&(e.hovered.find("."+U).removeClass(U),e.hovered=!1)},_hintStatus:function(n){var i=this._draggable.hint.find(".k-drag-status")[0];return n?(i.className="k-icon k-drag-status "+n,t):e.trim(i.className.replace(/k-(icon|drag-status)/g,""))},dragstart:function(t){var n=this,i=n.treeview,r=n.sourceNode=t.currentTarget.closest(q);i.trigger(z,{sourceNode:r[0]})&&t.preventDefault(),n.dropHint=e("<div class='k-drop-hint' />").css(O,"hidden").appendTo(i.element)},drag:function(t){var n,i,r,o,a,s,l,c,d,u,h=this,p=h.treeview,g=h.sourceNode,m=h.dropTarget=e(f.eventTarget(t)),v=m.closest(".k-treeview");v.length?e.contains(g[0],m[0])?n="k-denied":(n="k-insert-middle",i=m.closest(".k-top,.k-mid,.k-bot"),i.length?(o=i.outerHeight(),a=f.getOffset(i).top,s=m.closest(".k-in"),l=o/(s.length>0?4:2),c=a+l>t.y.location,d=t.y.location>a+o-l,h._removeTouchHover(),u=s.length&&!c&&!d,h.hovered=u?v:!1,h.dropHint.css(O,u?"hidden":"visible"),s.toggleClass(U,u),u?n="k-add":(r=i.position(),r.top+=c?0:o,h.dropHint.css(r)[c?"prependTo":"appendTo"](m.closest(q).children("div:first")),c&&i.hasClass("k-top")&&(n="k-insert-top"),d&&i.hasClass("k-bot")&&(n="k-insert-bottom"))):m[0]!=h.dropHint[0]&&(n=v[0]!=p.element[0]?"k-add":"k-denied")):(n="k-denied",h._removeTouchHover()),p.trigger(R,{sourceNode:g[0],dropTarget:m[0],pageY:t.y.location,pageX:t.x.location,statusClass:n.substring(2),setStatusClass:function(e){n=e}}),0!==n.indexOf("k-insert")&&h.dropHint.css(O,"hidden"),h._hintStatus(n)},dragcancel:function(){this.dropHint.remove()},dragend:function(){function e(e){a.updateIndeterminate(),a.trigger(H,{sourceNode:e&&e[0],destinationNode:n[0],dropPosition:s})}var n,i,r,o=this,a=o.treeview,s="over",l=o.sourceNode,c=o.dropHint,d=o.dropTarget;return"visible"==c.css(O)?(s=c.prevAll(".k-in").length>0?"after":"before",n=c.closest(q)):d&&(n=d.closest(".k-treeview .k-item"),n.length||(n=d.closest(".k-treeview"))),i={sourceNode:l[0],destinationNode:n[0],valid:"k-denied"!=o._hintStatus(),setValid:function(e){this.valid=e},dropTarget:d[0],dropPosition:s},r=a.trigger(B,i),c.remove(),o._removeTouchHover(),!i.valid||r?(o._draggable.dropped=i.valid,t):(o._draggable.dropped=!0,"over"==s?a.append(l,n,e):("before"==s?l=a.insertBefore(l,n):"after"==s&&(l=a.insertAfter(l,n)),e(l)),t)},destroy:function(){this._draggable.destroy()}},g.plugin(c)}(window.kendo.jQuery),function(e,t){function n(e,t){var n,i,r=[];for(n=0,i=e.length;i>n;n++)e[n].field!==t&&r.push(e[n]);return r}function i(e,t,n){var i,r,o,a;if(!e)return[];for(e=e.filters,i=0,r=[],o=e.length;o>i;i++)a=e[i].operator,(n||"in"===a)&&a!==n||e[i].field!==t||r.push(e[i]);return r}function r(t,n,r){var o,a=0,s=r.length;if(t=i(t,n,"in")[0])for(o=t.value.split(",");s>a;a++)r[a].checked=e.inArray(r[a].uniqueName,o)>=0;else for(;s>a;a++)r[a].checked=!0}function o(e,t){var n,i=e.length;for(n=0;i>n;n++)e[n].checked&&0!==e[n].level()&&t.push(e[n].uniqueName),e[n].hasChildren&&o(e[n].children.view(),t)}var a=window.kendo,s=a.ui,l="kendoContextMenu",c=e.proxy,d=".kendoPivotFieldMenu",u=s.Widget,h=u.extend({init:function(e,t){u.fn.init.call(this,e,t),this._dataSource(),this._layout(),a.notify(this)},events:[],options:{name:"PivotFieldMenu",filter:null,filterable:!0,sortable:!0,messages:{info:"Show items with value that:",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filterFields:"Fields Filter",filter:"Filter",include:"Include Fields...",title:"Fields to include",clear:"Clear",ok:"OK",cancel:"Cancel",operators:{contains:"Contains",doesnotcontain:"Does not contain",startswith:"Starts with",endswith:"Ends with",eq:"Is equal to",neq:"Is not equal to"}}},_layout:function(){var t=this.options;this.wrapper=e(a.template(f)({ns:a.ns,filterable:t.filterable,sortable:t.sortable,messages:t.messages})),this.menu=this.wrapper[l]({filter:t.filter,target:this.element,orientation:"vertical",showOn:"click",closeOnClick:!1,open:c(this._menuOpen,this),select:c(this._select,this),copyAnchorStyles:!1}).data(l),this._createWindow(),t.filterable&&this._initFilterForm()},_initFilterForm:function(){var e=this.menu.element.find(".k-filter-item"),t=c(this._filter,this);this._filterOperator=new a.ui.DropDownList(e.find("select")),this._filterValue=e.find(".k-textbox"),e.on("submit"+d,t).on("click"+d,".k-button-filter",t).on("click"+d,".k-button-clear",c(this._reset,this))},_setFilterForm:function(e){var t="",n="";e&&(t=e.operator,n=e.value),this._filterOperator.value(t),this._filterValue.val(n)},_clearFilters:function(e){var t,n,r=this.dataSource.filter()||{},o=0;for(r.filters=r.filters||[],t=i(r,e),n=t.length;n>o;o++)r.filters.splice(r.filters.indexOf(t[o]),1);return r},_filter:function(e){var n,i,r=this,o=r._filterValue.val();return e.preventDefault(),o?(n={field:r.currentMember,operator:r._filterOperator.value(),value:o},i=r._clearFilters(r.currentMember),i.filters.push(n),r.dataSource.filter(i),r.menu.close(),t):(r.menu.close(),t)},_reset:function(e){var t=this,n=t._clearFilters(t.currentMember);e.preventDefault(),n.filters[0]||(n={}),t.dataSource.filter(n),t._setFilterForm(null),t.menu.close()},_sort:function(e){var t=this.currentMember,i=this.dataSource.sort()||[];i=n(i,t),i.push({field:t,dir:e}),this.dataSource.sort(i),this.menu.close()},setDataSource:function(e){this.options.dataSource=e,this._dataSource()},_dataSource:function(){this.dataSource=a.data.PivotDataSource.create(this.options.dataSource)},_createWindow:function(){var t=this.options.messages;this.includeWindow=e(a.template(g)({messages:t})).on("click"+d,".k-button-ok",c(this._applyIncludes,this)).on("click"+d,".k-button-cancel",c(this._closeWindow,this)),this.includeWindow=new s.Window(this.includeWindow,{title:t.title,visible:!1,resizable:!1,open:c(this._windowOpen,this)})},_applyIncludes:function(e){var t,n=[],r=this.treeView.dataSource.view(),a=r[0].checked,s=this.dataSource.filter(),l=i(s,this.currentMember,"in")[0];o(r,n),l&&(a?(s.filters.splice(s.filters.indexOf(l),1),s.filters.length||(s={})):l.value=n.join(","),t=s),n.length&&(t||a||(t={field:this.currentMember,operator:"in",value:n.join(",")},s&&(s.filters.push(t),t=s))),t&&this.dataSource.filter(t),this._closeWindow(e)},_closeWindow:function(e){e.preventDefault(),this.includeWindow.close()},_treeViewDataSource:function(){var e=this;return a.data.HierarchicalDataSource.create({schema:{model:{id:"uniqueName",hasChildren:function(e){return parseInt(e.childrenCardinality,10)>0}}},transport:{read:function(t){var n={},i=e.treeView.dataSource.get(t.data.uniqueName),o=t.data.uniqueName;o?(n.memberUniqueName=i.uniqueName.replace(/\&/g,"&amp;"),n.treeOp=1):n.levelUniqueName=e.currentMember+".[(ALL)]",e.dataSource.schemaMembers(n).done(function(n){r(e.dataSource.filter(),e.currentMember,n),t.success(n)}).fail(t.error)}}})},_createTreeView:function(e){var t=this;t.treeView=new s.TreeView(e,{autoBind:!1,dataSource:t._treeViewDataSource(),dataTextField:"caption",template:"#: data.item.caption || data.item.name #",checkboxes:{checkChildren:!0},dataBound:function(){s.progress(t.includeWindow.element,!1)}})},_menuOpen:function(t){var n;t.event&&(n=a.attr("name"),this.currentMember=e(t.event.target).closest("["+n+"]").attr(n),this.options.filterable&&this._setFilterForm(i(this.dataSource.filter(),this.currentMember)[0]))},_select:function(t){var n=e(t.item);e(".k-pivot-filter-window").not(this.includeWindow.element).kendoWindow("close"),n.hasClass("k-include-item")?this.includeWindow.center().open():n.hasClass("k-sort-asc")?this._sort("asc"):n.hasClass("k-sort-desc")&&this._sort("desc")},_windowOpen:function(){this.treeView||this._createTreeView(this.includeWindow.element.find(".k-treeview")),s.progress(this.includeWindow.element,!0),this.treeView.dataSource.read()},destroy:function(){u.fn.destroy.call(this),this.menu&&(this.menu.destroy(),this.menu=null),this.treeView&&(this.treeView.destroy(),this.treeView=null),this.includeWindow&&(this.includeWindow.destroy(),this.includeWindow=null),this.wrapper=null,this.element=null}}),p='<div class="k-filterable k-content" tabindex="-1" data-role="fieldmenu"><form class="k-filter-menu"><div><div class="k-filter-help-text">#=messages.info#</div><select>#for(var op in messages.operators){#<option value="#=op#">#=messages.operators[op]#</option>#}#</select><input class="k-textbox" type="text" /><div><a class="k-button k-primary k-button-filter" href="\\#">#=messages.filter#</a><a class="k-button k-button-clear" href="\\#">#=messages.clear#</a></div></div></form></div>',f='<ul class="k-pivot-fieldmenu"># if (sortable) {#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-icon k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-icon k-i-sort-desc"></span>${messages.sortDescending}</span></li># if (filterable) {#<li class="k-separator"></li># } ## } ## if (filterable) {#<li class="k-item k-include-item"><span class="k-link"><span class="k-icon k-filter"></span>${messages.include}</span></li><li class="k-separator"></li><li class="k-item k-filter-item"><span class="k-link"><span class="k-icon k-filter"></span>${messages.filterFields}</span><ul><li>'+p+"</li></ul></li># } #</ul>",g='<div class="k-popup-edit-form k-pivot-filter-window"><div class="k-edit-form-container"><div class="k-treeview"></div><div class="k-edit-buttons k-state-default"><a class="k-button k-primary k-button-ok" href="\\#">${messages.ok}</a><a class="k-button k-button-cancel" href="\\#">${messages.cancel}</a></div></div>';s.plugin(h)}(window.kendo.jQuery),function(e,t){function n(t,i){var r,o,a=[];if(e.isPlainObject(t))if(t.hasOwnProperty("filters"))a=t.filters;else if(t.field==i)return t;for(e.isArray(t)&&(a=t),r=0;a.length>r;r++)if(o=n(a[r],i))return o}function i(t,n){t.filters&&(t.filters=e.grep(t.filters,function(e){return i(e,n),e.filters?e.filters.length:e.field!=n}))}function r(e,t){var n=o.getter(t,!0);return function(t){for(var i,r,o=e(t),a=[],s=0,l={};o.length>s;)i=o[s++],r=n(i),l.hasOwnProperty(r)||(a.push(i),l[r]=!0);return a}}var o=window.kendo,a=o.ui,s=o.data.DataSource,l=a.Widget,c="change",d="boolean",u="enums",h="string",p="Is equal to",f="Is not equal to",g=e.proxy,m=l.extend({init:function(n,i){var r,a,s,p,f,m,v,_,w,y,b,k;
if(n=e(n).addClass("k-filtercell"),r=this.wrapper=e("<span/>").appendTo(n),a=this,f=i,_=a.operators=i.operators||{},w=a.input=e("<input/>").attr(o.attr("bind"),"value: value").appendTo(r),l.fn.init.call(a,n[0],i),i=a.options,s=a.dataSource=i.dataSource,a.model=s.reader.model,v=i.type=h,y=o.getter("reader.model.fields",!0)(s)||{},b=y[i.field],b&&b.type&&(v=i.type=b.type),i.values&&(i.type=v=u),_=_[v]||i.operators[v],!f.operator)for(m in _){i.operator=m;break}a._parse=function(e){return e+""},a.model&&a.model.fields&&(k=a.model.fields[i.field],k&&k.parse&&(a._parse=g(k.parse,k))),a.viewModel=p=o.observable({operator:i.operator,value:null,operatorVisible:function(){var e=this.get("value");return null!==e&&e!==t&&"undefined"!=e}}),p.bind(c,g(a.updateDsFilter,a)),v==h&&a.initSuggestDataSource(i),null!==i.inputWidth&&w.width(i.inputWidth),a._setInputType(i,v),v!=d&&i.showOperators!==!1?a._createOperatorDropDown(_):r.addClass("k-operator-hidden"),a._createClearIcon(),o.bind(this.wrapper,p),v==h&&(i.template||a.setAutoCompleteSource()),v==u&&a.setComboBoxSource(a.options.values),a._refreshUI(),a._refreshHandler=g(a._refreshUI,a),a.dataSource.bind(c,a._refreshHandler)},_setInputType:function(t,n){var i,r,a,s,l,c=this,p=c.input;"function"==typeof t.template?t.template.call(c.viewModel,{element:c.input,dataSource:c.suggestDataSource}):n==h?p.attr(o.attr("role"),"autocomplete").attr(o.attr("text-field"),t.dataTextField||t.field).attr(o.attr("filter"),t.suggestionOperator).attr(o.attr("delay"),t.delay).attr(o.attr("min-length"),t.minLength).attr(o.attr("value-primitive"),!0):"date"==n?p.attr(o.attr("role"),"datepicker"):n==d?(p.remove(),i=e("<input type='radio'/>"),r=c.wrapper,a=o.guid(),s=e("<label/>").text(t.messages.isTrue).append(i),i.attr(o.attr("bind"),"checked:value").attr("name",a).val("true"),l=s.clone().text(t.messages.isFalse),i.clone().val("false").appendTo(l),r.append([s,l])):"number"==n?p.attr(o.attr("role"),"numerictextbox"):n==u&&p.attr(o.attr("role"),"combobox").attr(o.attr("text-field"),"text").attr(o.attr("suggest"),!0).attr(o.attr("filter"),"contains").attr(o.attr("value-field"),"value").attr(o.attr("value-primitive"),!0)},_createOperatorDropDown:function(t){var n,i,r=[];for(n in t)r.push({text:t[n],value:n});i=e('<input class="k-dropdown-operator" '+o.attr("bind")+'="value: operator"/>').appendTo(this.wrapper),this.operatorDropDown=i.kendoDropDownList({dataSource:r,dataTextField:"text",dataValueField:"value",open:function(){this.popup.element.width(150)},valuePrimitive:!0}).data("kendoDropDownList"),this.operatorDropDown.wrapper.find(".k-i-arrow-s").removeClass("k-i-arrow-s").addClass("k-filter")},initSuggestDataSource:function(e){var n=e.suggestDataSource;n instanceof s||(!e.customDataSource&&n&&(n.group=t),n=this.suggestDataSource=s.create(n)),e.customDataSource||(n._pageSize=t,n.reader.data=r(n.reader.data,this.options.field)),this.suggestDataSource=n},setAutoCompleteSource:function(){var e=this.input.data("kendoAutoComplete");e&&e.setDataSource(this.suggestDataSource)},setComboBoxSource:function(e){var t=s.create({data:e}),n=this.input.data("kendoComboBox");n&&n.setDataSource(t)},_refreshUI:function(){var t=this,i=n(t.dataSource.filter(),this.options.field)||{},r=t.viewModel;t.manuallyUpdatingVM=!0,i=e.extend(!0,{},i),t.options.type==d&&r.value!==i.value&&t.wrapper.find(":radio").prop("checked",!1),i.operator&&r.set("operator",i.operator),r.set("value",i.value),t.manuallyUpdatingVM=!1},updateDsFilter:function(n){var i,r,o,a=this,s=a.viewModel;a.manuallyUpdatingVM||"operator"==n.field&&s.value===t||(i=e.extend({},a.viewModel.toJSON(),{field:a.options.field}),r={logic:"and",filters:[]},i.value!==t&&null!==i.value&&r.filters.push(i),o=a._merge(r),a.dataSource.filter(o.filters.length?o:{}))},_merge:function(t){var n,r,o,a=this,s=t.logic||"and",l=t.filters,c=a.dataSource.filter()||{filters:[],logic:"and"};for(i(c,a.options.field),r=0,o=l.length;o>r;r++)n=l[r],n.value=a._parse(n.value);return l=e.grep(l,function(e){return""!==e.value&&null!==e.value}),l.length&&(c.filters.length?(t.filters=l,"and"!==c.logic&&(c.filters=[{logic:c.logic,filters:c.filters}],c.logic="and"),c.filters.push(l.length>1?t:l[0])):(c.filters=l,c.logic=s)),c},_createClearIcon:function(){var t=this;e("<button type='button' class='k-button k-button-icon'/>").attr(o.attr("bind"),"visible:operatorVisible").html("<span class='k-icon k-i-close'/>").click(g(t.clearFilter,t)).appendTo(t.wrapper)},clearFilter:function(){this.viewModel.set("value",null)},destroy:function(){var e=this;e.filterModel=null,l.fn.destroy.call(e),o.destroy(e.element)},events:[c],options:{name:"FilterCell",delay:200,minLength:1,inputWidth:null,values:t,customDataSource:!1,field:"",dataTextField:"",type:"string",suggestDataSource:null,suggestionOperator:"startswith",operator:"eq",showOperators:!0,template:null,messages:{isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",operator:"Operator"},operators:{string:{eq:p,neq:f,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with"},number:{eq:p,neq:f,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"},date:{eq:p,neq:f,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before"},enums:{eq:p,neq:f}}}});a.plugin(m)}(window.kendo.jQuery),function(e,t){function n(t){t=e(t),t.children(v).children(".k-icon").remove(),t.filter(":has(.k-panel),:has(.k-content)").children(".k-link:not(:has([class*=k-i-arrow]))").each(function(){var t=e(this),n=t.parent();t.append("<span class='k-icon "+(n.hasClass(M)?"k-i-arrow-n k-panelbar-collapse":"k-i-arrow-s k-panelbar-expand")+"'/>")})}function i(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(x),t.filter(".k-last:not(:last-child)").removeClass(g),t.filter(":first-child").addClass(x),t.filter(":last-child").addClass(g)}var r=window.kendo,o=r.ui,a=r.keys,s=e.extend,l=e.each,c=r.template,d=o.Widget,u=/^(ul|a|div)$/i,h=".kendoPanelBar",p="img",f="href",g="k-last",m="k-link",v="."+m,_="error",w=".k-item",y=".k-group",b=y+":visible",k="k-image",x="k-first",C="expand",T="select",S="k-content",D="activate",A="collapse",E="mouseenter",I="mouseleave",P="contentLoad",M="k-state-active",F="> .k-panel",z="> .k-content",R="k-state-focused",B="k-state-disabled",H="k-state-selected",L="."+H,N="k-state-highlight",O=w+":not(.k-state-disabled)",V="> "+O+" > "+v+", .k-panel > "+O+" > "+v,U=w+".k-state-disabled > .k-link",W="> li > "+L+", .k-panel > li > "+L,j="k-state-default",q="aria-disabled",G="aria-expanded",$="aria-hidden",Y="aria-selected",Q=":visible",K=":empty",X="single",Z={content:c("<div role='region' class='k-content'#= contentAttributes(data) #>#= content(item) #</div>"),group:c("<ul role='group' aria-hidden='true' class='#= groupCssClass(group) #'#= groupAttributes(group) #>#= renderItems(data) #</ul>"),itemWrapper:c("<#= tag(item) # class='#= textClass(item, group) #' #= contentUrl(item) ##= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:c("<li role='menuitem' #=aria(item)#class='#= wrapperCssClass(group, item) #'>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, panelBar: panelBar, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:c("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:c("<span class='#= arrowClass(item) #'></span>"),sprite:c("<span class='k-sprite #= spriteCssClass #'></span>"),empty:c("")},J={aria:function(e){var t="";return(e.items||e.content||e.contentUrl)&&(t+=G+"='"+(e.expanded?"true":"false")+"' "),e.enabled===!1&&(t+=q+"='true'"),t},wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" "+B:t.expanded===!0?" "+M:" k-state-default",0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),n},textClass:function(e,t){var n=m;return t.firstLevel&&(n+=" k-header"),n},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},arrowClass:function(e){var t="k-icon";return t+=e.expanded?" k-i-arrow-n k-panelbar-collapse":" k-i-arrow-s k-panelbar-expand"},text:function(e){return e.encoded===!1?e.text:r.htmlEncode(e.text)},tag:function(e){return e.url||e.contentUrl?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-panel"},contentAttributes:function(e){return e.item.expanded!==!0?" style='display:none'":""},content:function(e){return e.content?e.content:e.contentUrl?"":"&nbsp;"},contentUrl:function(e){return e.contentUrl?'href="'+e.contentUrl+'"':""}},et=d.extend({init:function(t,n){var i,o=this;d.fn.init.call(o,t,n),t=o.wrapper=o.element.addClass("k-widget k-reset k-header k-panelbar"),n=o.options,t[0].id&&(o._itemId=t[0].id+"_pb_active"),o._tabindex(),o._initData(n),o._updateClasses(),o._animations(n),t.on("click"+h,V,function(t){o._click(e(t.currentTarget))&&t.preventDefault()}).on(E+h+" "+I+h,V,o._toggleHover).on("click"+h,U,!1).on("keydown"+h,e.proxy(o._keydown,o)).on("focus"+h,function(){var e=o.select();o._current(e[0]?e:o._first())}).on("blur"+h,function(){o._current(null)}).attr("role","menu"),i=t.find("li."+M+" > ."+S),i[0]&&o.expand(i.parent(),!1),r.notify(o)},events:[C,A,T,D,_,P],options:{name:"PanelBar",animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:200}},expandMode:"multiple"},destroy:function(){d.fn.destroy.call(this),this.element.off(h),r.destroy(this.element)},_initData:function(e){var t=this;e.dataSource&&(t.element.empty(),t.append(e.dataSource,t.element))},setOptions:function(e){var t=this.options.animation;this._animations(e),e.animation=s(!0,t,e.animation),"dataSource"in e&&this._initData(e),d.fn.setOptions.call(this,e)},expand:function(t,n){var i=this,r={};return n=n!==!1,t=this.element.find(t),t.each(function(o,a){a=e(a);var s=a.find(F).add(a.find(z));if(!a.hasClass(B)&&s.length>0){if(i.options.expandMode==X&&i._collapseAllExpanded(a))return i;t.find("."+N).removeClass(N),a.addClass(N),n||(r=i.options.animation,i.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}}),i._triggerEvent(C,a)||i._toggleItem(a,!1),n||(i.options.animation=r)}}),i},collapse:function(t,n){var i=this,r={};return n=n!==!1,t=i.element.find(t),t.each(function(t,o){o=e(o);var a=o.find(F).add(o.find(z));!o.hasClass(B)&&a.is(Q)&&(o.removeClass(N),n||(r=i.options.animation,i.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}}),i._triggerEvent(A,o)||i._toggleItem(o,!0),n||(i.options.animation=r))}),i},_toggleDisabled:function(e,t){e=this.element.find(e),e.toggleClass(j,t).toggleClass(B,!t).attr(q,!t)},select:function(n){var i=this;return n===t?i.element.find(W).parent():(n=i.element.find(n),n.length?n.each(function(){var n=e(this),r=n.children(v);return n.hasClass(B)?i:(i._triggerEvent(T,n)||i._updateSelected(r),t)}):this._updateSelected(n),i)},clearSelection:function(){this.select(e())},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},append:function(e,t){t=this.element.find(t);var r=this._insert(e,t,t.length?t.find(F):null);return l(r.items,function(){r.group.append(this),i(this)}),n(t),i(r.group.find(".k-first, .k-last")),r.group.height("auto"),this},insertBefore:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return l(n.items,function(){t.before(this),i(this)}),i(t),n.group.height("auto"),this},insertAfter:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return l(n.items,function(){t.after(this),i(this)}),i(t),n.group.height("auto"),this},remove:function(e){e=this.element.find(e);var t=this,r=e.parentsUntil(t.element,w),o=e.parent("ul");return e.remove(),!o||o.hasClass("k-panelbar")||o.children(w).length||o.remove(),r.length&&(r=r.eq(0),n(r),i(r)),t},reload:function(t){var n=this;t=n.element.find(t),t.each(function(){var t=e(this);n._ajaxRequest(t,t.children("."+S),!t.is(Q))})},_first:function(){return this.element.children(O).first()},_last:function(){var e=this.element.children(O).last(),t=e.children(b);return t[0]?t.children(O).last():e},_current:function(e){var n=this,i=n._focused,r=n._itemId;return e===t?i:(n.element.removeAttr("aria-activedescendant"),i&&(i[0].id===r&&i.removeAttr("id"),i.children(v).removeClass(R)),e&&(r=e[0].id||r,e.attr("id",r).children(v).addClass(R),n.element.attr("aria-activedescendant",r)),n._focused=e,t)},_keydown:function(e){var t=this,n=e.keyCode,i=t._current();e.target==e.currentTarget&&(n==a.DOWN||n==a.RIGHT?(t._current(t._nextItem(i)),e.preventDefault()):n==a.UP||n==a.LEFT?(t._current(t._prevItem(i)),e.preventDefault()):n==a.ENTER||n==a.SPACEBAR?(t._click(i.children(v)),e.preventDefault()):n==a.HOME?(t._current(t._first()),e.preventDefault()):n==a.END&&(t._current(t._last()),e.preventDefault()))},_nextItem:function(e){if(!e)return this._first();var t=e.children(b),n=e.nextAll(":visible").first();return t[0]&&(n=t.children("."+x)),n[0]||(n=e.parent(b).parent(w).next()),n[0]||(n=this._first()),n.hasClass(B)&&(n=this._nextItem(n)),n},_prevItem:function(e){if(!e)return this._last();var t,n=e.prevAll(":visible").first();if(n[0])for(t=n;t[0];)t=t.children(b).children("."+g),t[0]&&(n=t);else n=e.parent(b).parent(w),n[0]||(n=this._last());return n.hasClass(B)&&(n=this._prevItem(n)),n},_insert:function(t,n,i){var o,a,l=this,c=e.isPlainObject(t),d=n&&n[0];return d||(i=l.element),a={firstLevel:i.hasClass("k-panelbar"),expanded:i.parent().hasClass(M),length:i.children().length},d&&!i.length&&(i=e(et.renderGroup({group:a})).appendTo(n)),t instanceof r.Observable&&(t=t.toJSON()),c||e.isArray(t)?(o=e.map(c?[t]:t,function(t,n){return e("string"==typeof t?t:et.renderItem({group:a,item:s(t,{index:n})}))}),d&&n.attr(G,!1)):(o="string"==typeof t&&"<"!=t.charAt(0)?l.element.find(t):e(t),l._updateItemsClasses(o)),{items:o,group:i}},_toggleHover:function(t){var n=e(t.currentTarget);n.parents("li."+B).length||n.toggleClass("k-state-hover",t.type==E)},_updateClasses:function(){var t,r,o=this;t=o.element.find("li > ul").not(function(){return e(this).parentsUntil(".k-panelbar","div").length}).addClass("k-group k-panel").attr("role","group"),t.parent().attr(G,!1).not("."+M).children("ul").attr($,!0).hide(),r=o.element.add(t).children(),o._updateItemsClasses(r),n(r),i(r)},_updateItemsClasses:function(e){for(var t=e.length,n=0;t>n;n++)this._updateItemClasses(e[n],n)},_updateItemClasses:function(t,n){var i,o,a=this._selected,s=this.options.contentUrls,l=s&&s[n],c=this.element[0];t=e(t).addClass("k-item").attr("role","menuitem"),r.support.browser.msie&&t.css("list-style-position","inside").css("list-style-position",""),t.children(p).addClass(k),o=t.children("a").addClass(m),o[0]&&(o.attr("href",l),o.children(p).addClass(k)),t.filter(":not([disabled]):not([class*=k-state])").addClass("k-state-default"),t.filter("li[disabled]").addClass("k-state-disabled").attr(q,!0).removeAttr("disabled"),t.children("div").addClass(S).attr("role","region").attr($,!0).hide().parent().attr(G,!1),o=t.children(L),o[0]&&(a&&a.removeAttr(Y).children(L).removeClass(H),o.addClass(H),this._selected=t.attr(Y,!0)),t.children(v)[0]||(i="<span class='"+m+"'/>",s&&s[n]&&t[0].parentNode==c&&(i='<a class="k-link k-header" href="'+s[n]+'"/>'),t.contents().filter(function(){return!(this.nodeName.match(u)||3==this.nodeType&&!e.trim(this.nodeValue))}).wrapAll(i)),t.parent(".k-panelbar")[0]&&t.children(v).addClass("k-header")},_click:function(e){var t,n,i,r,o,a,s,l=this,c=l.element;if(!e.parents("li."+B).length&&e.closest(".k-widget")[0]==c[0]){if(o=e.closest(v),a=o.closest(w),l._updateSelected(o),n=a.find(F).add(a.find(z)),i=o.attr(f),r=i&&("#"==i.charAt(i.length-1)||-1!=i.indexOf("#"+l.element[0].id+"-")),t=!(!r&&!n.length),n.data("animating"))return t;if(l._triggerEvent(T,a)&&(t=!0),t!==!1)return l.options.expandMode==X&&l._collapseAllExpanded(a)?t:(n.length&&(s=n.is(Q),l._triggerEvent(s?A:C,a)||(t=l._toggleItem(a,s))),t)}},_toggleItem:function(e,n){var i,r,o=this,a=e.find(F),s=e.find(v),l=s.attr(f);return a.length?(this._toggleGroup(a,n),i=!0):(r=e.children("."+S),r.length&&(i=!0,r.is(K)&&l!==t?o._ajaxRequest(e,r,n):o._toggleGroup(r,n))),i},_toggleGroup:function(e,t){var n=this,i=n.options.animation,r=i.expand,o=s({},i.collapse),a=o&&"effects"in o;e.is(Q)==t&&(e.parent().attr(G,!t).attr($,t).toggleClass(M,!t).find("> .k-link > .k-icon").toggleClass("k-i-arrow-n",!t).toggleClass("k-panelbar-collapse",!t).toggleClass("k-i-arrow-s",t).toggleClass("k-panelbar-expand",t),r=t?s(a?o:s({reverse:!0},r),{hide:!0}):s({complete:function(e){n._triggerEvent(D,e.closest(w))}},r),e.kendoStop(!0,!0).kendoAnimate(r))},_collapseAllExpanded:function(t){var n,i=this,r=!1,o=t.find(F).add(t.find(z));return o.is(Q)&&(r=!0),o.is(Q)||0===o.length||(n=t.siblings(),n.find(F).add(n.find(z)).filter(function(){return e(this).is(Q)}).each(function(t,n){n=e(n),r=i._triggerEvent(A,n.closest(w)),r||i._toggleGroup(n,!0)})),r},_ajaxRequest:function(t,n,i){var r=this,o=t.find(".k-panelbar-collapse, .k-panelbar-expand"),a=t.find(v),s=setTimeout(function(){o.addClass("k-loading")},100),l={},c=a.attr(f);e.ajax({type:"GET",cache:!1,url:c,dataType:"html",data:l,error:function(e,t){o.removeClass("k-loading"),r.trigger(_,{xhr:e,status:t})&&this.complete()},complete:function(){clearTimeout(s),o.removeClass("k-loading")},success:function(e){function o(){return{elements:n.get()}}try{r.angular("cleanup",o),n.html(e),r.angular("compile",o)}catch(a){var s=window.console;s&&s.error&&s.error(a.name+": "+a.message+" in "+c),this.error(this.xhr,"error")}r._toggleGroup(n,i),r.trigger(P,{item:t[0],contentElement:n[0]})}})},_triggerEvent:function(e,t){var n=this;return n.trigger(e,{item:t[0]})},_updateSelected:function(e){var t=this,n=t.element,i=e.parent(w),r=t._selected;r&&r.removeAttr(Y),t._selected=i.attr(Y,!0),n.find(W).removeClass(H),n.find("> ."+N+", .k-panel > ."+N).removeClass(N),e.addClass(H),e.parentsUntil(n,w).filter(":has(.k-header)").addClass(N),t._current(i[0]?i:null)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}})}});s(et,{renderItem:function(e){e=s({panelBar:{},group:{}},e);var t=Z.empty,n=e.item;return Z.item(s(e,{image:n.imageUrl?Z.image:t,sprite:n.spriteCssClass?Z.sprite:t,itemWrapper:Z.itemWrapper,renderContent:et.renderContent,arrow:n.items||n.content||n.contentUrl?Z.arrow:t,subGroup:et.renderGroup},J))},renderGroup:function(e){return Z.group(s({renderItems:function(e){for(var t="",n=0,i=e.items,r=i?i.length:0,o=s({length:r},e.group);r>n;n++)t+=et.renderItem(s(e,{group:o,item:s({index:n},i[n])}));return t}},e,J))},renderContent:function(e){return Z.content(s(e,J))}}),r.ui.plugin(et)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui,r=i.Widget,o="horizontal",a="vertical",s=0,l=100,c=0,d=5,u="k-progressbar",h="k-progressbar-reverse",p="k-progressbar-indeterminate",f="k-complete",g="k-state-selected",m="k-progress-status",v="k-state-selected",_="k-state-default",w="k-state-disabled",y={VALUE:"value",PERCENT:"percent",CHUNK:"chunk"},b="change",k="complete",x="boolean",C=Math,T=e.extend,S=e.proxy,D=100,A=400,E=3,I={progressStatus:"<span class='k-progress-status-wrap'><span class='k-progress-status'></span></span>"},P=r.extend({init:function(e,t){var n=this;r.fn.init.call(this,e,t),t=n.options,n._progressProperty=t.orientation===o?"width":"height",n._fields(),t.value=n._validateValue(t.value),n._validateType(t.type),n._wrapper(),n._progressAnimation(),t.value!==t.min&&t.value!==!1&&n._updateProgress()},setOptions:function(e){var t=this;r.fn.setOptions.call(t,e),e.hasOwnProperty("reverse")&&t.wrapper.toggleClass("k-progressbar-reverse",e.reverse),e.hasOwnProperty("enable")&&t.enable(e.enable),t._progressAnimation(),t._validateValue(),t._updateProgress()},events:[b,k],options:{name:"ProgressBar",orientation:o,reverse:!1,min:s,max:l,value:c,enable:!0,type:y.VALUE,chunkCount:d,showStatus:!0,animation:{}},_fields:function(){var t=this;t._isStarted=!1,t.progressWrapper=t.progressStatus=e()},_validateType:function(i){var r=!1;if(e.each(y,function(e,n){return n===i?(r=!0,!1):t}),!r)throw Error(n.format("Invalid ProgressBar type '{0}'",i))},_wrapper:function(){var e,t=this,n=t.wrapper=t.element,i=t.options,r=i.orientation;n.addClass("k-widget "+u),n.addClass(u+"-"+(r===o?o:a)),i.enable===!1&&n.addClass(w),i.reverse&&n.addClass(h),i.value===!1&&n.addClass(p),i.type===y.CHUNK?t._addChunkProgressWrapper():i.showStatus&&(t.progressStatus=t.wrapper.prepend(I.progressStatus).find("."+m),e=i.value!==!1?i.value:i.min,t.progressStatus.text(i.type===y.VALUE?e:t._calculatePercentage(e)+"%"))},value:function(e){return this._value(e)},_value:function(e){var n,i=this,r=i.options;return e===t?r.value:(typeof e!==x?(e=i._roundValue(e),isNaN(e)||(n=i._validateValue(e),n!==r.value&&(i.wrapper.removeClass(p),r.value=n,i._isStarted=!0,i._updateProgress()))):e||(i.wrapper.addClass(p),r.value=!1),t)},_roundValue:function(e){e=parseFloat(e);var t=C.pow(10,E);return C.floor(e*t)/t},_validateValue:function(e){var t=this,n=t.options;if(e!==!1){if(n.min>=e||e===!0)return n.min;if(e>=n.max)return n.max}else if(e===!1)return!1;return isNaN(t._roundValue(e))?n.min:e},_updateProgress:function(){var e=this,t=e.options,n=e._calculatePercentage();t.type===y.CHUNK?(e._updateChunks(n),e._onProgressUpdateAlways(t.value)):e._updateProgressWrapper(n)},_updateChunks:function(e){var t,n=this,i=n.options,r=i.chunkCount,s=parseInt(D/r*100,10)/100,l=parseInt(100*e,10)/100,c=C.floor(l/s);t=n.wrapper.find(i.orientation===o&&!i.reverse||i.orientation===a&&i.reverse?"li.k-item:lt("+c+")":"li.k-item:gt(-"+(c+1)+")"),n.wrapper.find("."+v).removeClass(v).addClass(_),t.removeClass(_).addClass(v)},_updateProgressWrapper:function(e){var t=this,n=t.options,i=t.wrapper.find("."+g),r=t._isStarted?t._animation.duration:0,o={};0===i.length&&t._addRegularProgressWrapper(),o[t._progressProperty]=e+"%",t.progressWrapper.animate(o,{duration:r,start:S(t._onProgressAnimateStart,t),progress:S(t._onProgressAnimate,t),complete:S(t._onProgressAnimateComplete,t,n.value),always:S(t._onProgressUpdateAlways,t,n.value)})},_onProgressAnimateStart:function(){this.progressWrapper.show()},_onProgressAnimate:function(e){var t,n=this,i=n.options,r=parseFloat(e.elem.style[n._progressProperty],10);i.showStatus&&(t=1e4/parseFloat(n.progressWrapper[0].style[n._progressProperty]),n.progressWrapper.find(".k-progress-status-wrap").css(n._progressProperty,t+"%")),i.type!==y.CHUNK&&98>=r&&n.progressWrapper.removeClass(f)},_onProgressAnimateComplete:function(e){var t=this,n=t.options,i=parseFloat(t.progressWrapper[0].style[t._progressProperty]);n.type!==y.CHUNK&&i>98&&t.progressWrapper.addClass(f),n.showStatus&&t.progressStatus.text(n.type===y.VALUE?e:C.floor(t._calculatePercentage(e))+"%"),e===n.min&&t.progressWrapper.hide()},_onProgressUpdateAlways:function(e){var t=this,n=t.options;t._isStarted&&t.trigger(b,{value:e}),e===n.max&&t._isStarted&&t.trigger(k,{value:n.max})},enable:function(e){var n=this,i=n.options;i.enable=t===e?!0:e,n.wrapper.toggleClass(w,!i.enable)},destroy:function(){var e=this;r.fn.destroy.call(e)},_addChunkProgressWrapper:function(){var e,t=this,n=t.options,i=t.wrapper,r=D/n.chunkCount,o="";for(1>=n.chunkCount&&(n.chunkCount=d),o+="<ul class='k-reset'>",e=n.chunkCount-1;e>=0;e--)o+="<li class='k-item k-state-default'></li>";o+="</ul>",i.append(o).find(".k-item").css(t._progressProperty,r+"%").first().addClass("k-first").end().last().addClass("k-last"),t._normalizeChunkSize()},_normalizeChunkSize:function(){var e=this,t=e.options,n=e.wrapper.find(".k-item:last"),i=parseFloat(n[0].style[e._progressProperty]),r=D-t.chunkCount*i;r>0&&n.css(e._progressProperty,i+r+"%")},_addRegularProgressWrapper:function(){var t=this;t.progressWrapper=e("<div class='"+g+"'></div>").appendTo(t.wrapper),t.options.showStatus&&(t.progressWrapper.append(I.progressStatus),t.progressStatus=t.wrapper.find("."+m))},_calculateChunkSize:function(){var e=this,t=e.options.chunkCount,n=e.wrapper.find("ul.k-reset");return(parseInt(n.css(e._progressProperty),10)-(t-1))/t},_calculatePercentage:function(e){var n=this,i=n.options,r=e!==t?e:i.value,o=i.min,a=i.max;return n._onePercent=C.abs((a-o)/100),C.abs((r-o)/n._onePercent)},_progressAnimation:function(){var e=this,t=e.options,n=t.animation;e._animation=n===!1?{duration:0}:T({duration:A},t.animation)}});n.ui.plugin(P)}(window.kendo.jQuery),function(e,t){function n(t){t.children(g).addClass(C),t.children("a").addClass(w).children(g).addClass(C),t.filter(":not([disabled]):not([class*=k-state-disabled])").addClass(z),t.filter("li[disabled]").addClass(F).removeAttr("disabled"),t.filter(":not([class*=k-state])").children("a").filter(":focus").parent().addClass(R+" "+L),t.attr("role","tab"),t.filter("."+R).attr("aria-selected",!0),t.each(function(){var t=e(this);t.children("."+w).length||t.contents().filter(function(){return!(this.nodeName.match(p)||3==this.nodeType&&!c(this.nodeValue))}).wrapAll("<span class='"+w+"'/>")})}function i(e){var t=e.children(".k-item");t.filter(".k-first:not(:first-child)").removeClass(T),t.filter(".k-last:not(:last-child)").removeClass(y),t.filter(":first-child").addClass(T),t.filter(":last-child").addClass(y)}var r=window.kendo,o=r.ui,a=r.keys,s=e.map,l=e.each,c=e.trim,d=e.extend,u=r.template,h=o.Widget,p=/^(a|div)$/i,f=".kendoTabStrip",g="img",m="href",v="prev",_="show",w="k-link",y="k-last",b="click",k="error",x=":empty",C="k-image",T="k-first",S="select",D="activate",A="k-content",E="contentUrl",I="mouseenter",P="mouseleave",M="contentLoad",F="k-state-disabled",z="k-state-default",R="k-state-active",B="k-state-focused",H="k-state-hover",L="k-tab-on-top",N=".k-item:not(."+F+")",O=".k-tabstrip-items > "+N+":not(."+R+")",V={content:u("<div class='k-content'#= contentAttributes(data) # role='tabpanel'>#= content(item) #</div>"),itemWrapper:u("<#= tag(item) # class='k-link'#= contentUrl(item) ##= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) #</#= tag(item) #>"),item:u("<li class='#= wrapperCssClass(group, item) #' role='tab' #=item.active ? \"aria-selected='true'\" : ''#>#= itemWrapper(data) #</li>"),image:u("<img class='k-image' alt='' src='#= imageUrl #' />"),sprite:u("<span class='k-sprite #= spriteCssClass #'></span>"),empty:u("")},U={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" k-state-disabled":" k-state-default",0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),n},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},text:function(e){return e.encoded===!1?e.text:r.htmlEncode(e.text)},tag:function(e){return e.url?"a":"span"},contentAttributes:function(e){return e.active!==!0?" style='display:none' aria-hidden='true' aria-expanded='false'":""},content:function(e){return e.content?e.content:e.contentUrl?"":"&nbsp;"},contentUrl:function(e){return e.contentUrl?r.attr("content-url")+'="'+e.contentUrl+'"':""}},W=h.extend({init:function(t,n){var i,o,a=this;h.fn.init.call(a,t,n),a._animations(a.options),n=a.options,a._wrapper(),a._isRtl=r.support.isRtl(a.wrapper),a._tabindex(),a._updateClasses(),a._dataSource(),n.dataSource&&a.dataSource.fetch(),a.options.contentUrls&&a.wrapper.find(".k-tabstrip-items > .k-item").each(function(t,n){e(n).find(">."+w).data(E,a.options.contentUrls[t])}),a.wrapper.on(I+f+" "+P+f,O,a._toggleHover).on("focus"+f,e.proxy(a._active,a)).on("blur"+f,function(){a._current(null)}),a._keyDownProxy=e.proxy(a._keydown,a),n.navigatable&&a.wrapper.on("keydown"+f,a._keyDownProxy),a.wrapper.children(".k-tabstrip-items").on(b+f,".k-state-disabled .k-link",!1).on(b+f," > "+N,function(t){var n,i=a.wrapper[0];if(i!==document.activeElement)if(n=r.support.browser.msie)try{i.setActive()}catch(o){i.focus()}else i.focus();a._click(e(t.currentTarget))&&t.preventDefault()}),i=a.tabGroup.children("li."+R),o=a.contentHolder(i.index()),i[0]&&o.length>0&&0===o[0].childNodes.length&&a.activateTab(i.eq(0)),a.element.attr("role","tablist"),a.element[0].id&&(a._ariaId=a.element[0].id+"_ts_active"),r.notify(a)},_active:function(){var e=this.tabGroup.children().filter("."+R);e=e[0]?e:this._endItem("first"),e[0]&&this._current(e)},_endItem:function(e){return this.tabGroup.children(N)[e]()},_item:function(e,t){var n;return n=t===v?"last":"first",e?(e=e[t](),e[0]||(e=this._endItem(n)),e.hasClass(F)&&(e=this._item(e,t)),e):this._endItem(n)},_current:function(e){var n=this,i=n._focused,r=n._ariaId;return e===t?i:(i&&(i[0].id===r&&i.removeAttr("id"),i.removeClass(B)),e&&(e.hasClass(R)||e.addClass(B),n.element.removeAttr("aria-activedescendant"),r=e[0].id||r,r&&(e.attr("id",r),n.element.attr("aria-activedescendant",r))),n._focused=e,t)},_keydown:function(e){var n,i=this,r=e.keyCode,o=i._current(),s=i._isRtl;if(e.target==e.currentTarget){if(r==a.DOWN||r==a.RIGHT)n=s?v:"next";else if(r==a.UP||r==a.LEFT)n=s?"next":v;else if(r==a.ENTER||r==a.SPACEBAR)i._click(o),e.preventDefault();else{if(r==a.HOME)return i._click(i._endItem("first")),e.preventDefault(),t;if(r==a.END)return i._click(i._endItem("last")),e.preventDefault(),t}n&&(i._click(i._item(o,n)),e.preventDefault())}},_dataSource:function(){var t=this;t.dataSource&&t._refreshHandler?t.dataSource.unbind("change",t._refreshHandler):t._refreshHandler=e.proxy(t.refresh,t),t.dataSource=r.data.DataSource.create(t.options.dataSource).bind("change",t._refreshHandler)},setDataSource:function(e){var t=this;t.options.dataSource=e,t._dataSource(),t.dataSource.fetch()},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={open:{effects:{}},close:{effects:{}}})},refresh:function(e){var t,n,i,o,a=this,s=a.options,l=r.getter(s.dataTextField),c=r.getter(s.dataContentField),d=r.getter(s.dataContentUrlField),u=r.getter(s.dataImageUrlField),h=r.getter(s.dataUrlField),p=r.getter(s.dataSpriteCssClass),f=[],g=a.dataSource.view();for(e=e||{},i=e.action,i&&(g=e.items),t=0,o=g.length;o>t;t++)n={text:l(g[t])},s.dataContentField&&(n.content=c(g[t])),s.dataContentUrlField&&(n.contentUrl=d(g[t])),s.dataUrlField&&(n.url=h(g[t])),s.dataImageUrlField&&(n.imageUrl=u(g[t])),s.dataSpriteCssClass&&(n.spriteCssClass=p(g[t])),f[t]=n;if("add"==e.action)e.index<a.tabGroup.children().length?a.insertBefore(f,a.tabGroup.children().eq(e.index)):a.append(f);else if("remove"==e.action)for(t=0;g.length>t;t++)a.remove(e.index);else"itemchange"==e.action?(t=a.dataSource.view().indexOf(g[0]),e.field===s.dataTextField&&a.tabGroup.children().eq(t).find(".k-link").text(g[0].get(e.field))):(a.trigger("dataBinding"),a.remove("li"),a.append(f),a.trigger("dataBound"))},value:function(n){var i=this;return n===t?i.select().text():(n!=i.value()&&i.tabGroup.children().each(function(){e.trim(e(this).text())==n&&i.select(this)}),t)},items:function(){return this.tabGroup[0].children},setOptions:function(e){var t=this,n=t.options.animation;t._animations(e),e.animation=d(!0,n,e.animation),e.navigatable?t.wrapper.on("keydown"+f,t._keyDownProxy):t.wrapper.off("keydown"+f,t._keyDownProxy),h.fn.setOptions.call(t,e)},events:[S,D,_,k,M,"change","dataBinding","dataBound"],options:{name:"TabStrip",dataTextField:"",dataContentField:"",dataImageUrlField:"",dataUrlField:"",dataSpriteCssClass:"",dataContentUrlField:"",animation:{open:{effects:"expand:vertical fadeIn",duration:200},close:{duration:200}},collapsible:!1,navigatable:!0,contentUrls:!1},destroy:function(){var e=this;h.fn.destroy.call(e),e._refreshHandler&&e.dataSource.unbind("change",e._refreshHandler),e.wrapper.off(f),e.wrapper.children(".k-tabstrip-items").off(f),e.scrollWrap.children(".k-tabstrip").unwrap(),r.destroy(e.wrapper)},select:function(t){var n=this;return 0===arguments.length?n.tabGroup.children("li."+R):(isNaN(t)||(t=n.tabGroup.children().get(t)),t=n.tabGroup.find(t),e(t).each(function(t,i){i=e(i),i.hasClass(R)||n.trigger(S,{item:i[0],contentElement:n.contentHolder(i.index())[0]})||n.activateTab(i)}),n)},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this
},disable:function(e){return this._toggleDisabled(e,!1),this},reload:function(t){t=this.tabGroup.find(t);var n=this;return t.each(function(){var t=e(this),i=t.find("."+w).data(E),r=n.contentHolder(t.index());i&&n.ajaxRequest(t,r,null,i)}),n},append:function(e){var t=this,n=t._create(e);return l(n.tabs,function(e){var i=n.contents[e];t.tabGroup.append(this),t.wrapper.append(i),t.angular("compile",function(){return{elements:[i]}})}),i(t.tabGroup),t._updateContentElements(),t},insertBefore:function(t,n){n=this.tabGroup.find(n);var r=this,o=r._create(t),a=e(r.contentElement(n.index()));return l(o.tabs,function(e){var t=o.contents[e];n.before(this),a.before(t),r.angular("compile",function(){return{elements:[t]}})}),i(r.tabGroup),r._updateContentElements(),r},insertAfter:function(t,n){n=this.tabGroup.find(n);var r=this,o=r._create(t),a=e(r.contentElement(n.index()));return l(o.tabs,function(e){var t=o.contents[e];n.after(this),a.after(t),r.angular("compile",function(){return{elements:[t]}})}),i(r.tabGroup),r._updateContentElements(),r},remove:function(t){var n,i=this,o=typeof t;return"string"===o?t=i.tabGroup.find(t):"number"===o&&(t=i.tabGroup.children().eq(t)),n=t.map(function(){var t=i.contentElement(e(this).index());return r.destroy(t),t}),t.remove(),n.remove(),i._updateContentElements(),i},_create:function(i){var r,o,a,l=e.isPlainObject(i),c=this;return l||e.isArray(i)?(i=e.isArray(i)?i:[i],r=s(i,function(t,n){return e(W.renderItem({group:c.tabGroup,item:d(t,{index:n})}))}),o=s(i,function(n,i){return"string"==typeof n.content||n.contentUrl?e(W.renderContent({item:d(n,{index:i})})):t})):(r="string"==typeof i&&"<"!=i[0]?c.element.find(i):e(i),o=e(),r.each(function(){if(a=e("<div class='"+A+"'/>"),/k-tabstrip-items/.test(this.parentNode.className)){var t=parseInt(this.getAttribute("aria-controls").replace(/^.*-/,""),10)-1;a=e(c.contentElement(t))}o=o.add(a)}),n(r)),{tabs:r,contents:o}},_toggleDisabled:function(t,n){t=this.tabGroup.find(t),t.each(function(){e(this).toggleClass(z,n).toggleClass(F,!n)})},_updateClasses:function(){var r,o,a,s=this;s.wrapper.addClass("k-widget k-header k-tabstrip"),s.tabGroup=s.wrapper.children("ul").addClass("k-tabstrip-items k-reset"),s.tabGroup[0]||(s.tabGroup=e("<ul class='k-tabstrip-items k-reset'/>").appendTo(s.wrapper)),r=s.tabGroup.find("li").addClass("k-item"),r.length&&(o=r.filter("."+R).index(),a=o>=0?o:t,s.tabGroup.contents().filter(function(){return 3==this.nodeType&&!c(this.nodeValue)}).remove()),o>=0&&r.eq(o).addClass(L),s.contentElements=s.wrapper.children("div"),s.contentElements.addClass(A).eq(a).addClass(R).css({display:"block"}),r.length&&(n(r),i(s.tabGroup),s._updateContentElements())},_updateContentElements:function(){var t=this,n=t.options.contentUrls||[],i=t.tabGroup.find(".k-item"),o=(t.element.attr("id")||r.guid())+"-",a=t.wrapper.children("div");a.length&&i.length>a.length?(a.each(function(e){var t=parseInt(this.id.replace(o,""),10),n=i.filter("[aria-controls="+o+t+"]"),r=o+(e+1);n.data("aria",r),this.setAttribute("id",r)}),i.each(function(){var t=e(this);this.setAttribute("aria-controls",t.data("aria")),t.removeData("aria")})):i.each(function(i){var r=a.eq(i),s=o+(i+1);this.setAttribute("aria-controls",s),!r.length&&n[i]?e("<div class='"+A+"'/>").appendTo(t.wrapper).attr("id",s):(r.attr("id",s),e(this).children(".k-loading")[0]||n[i]||e("<span class='k-loading k-complete'/>").prependTo(this)),r.attr("role","tabpanel"),r.filter(":not(."+R+")").attr("aria-hidden",!0).attr("aria-expanded",!1),r.filter("."+R).attr("aria-expanded",!0)}),t.contentElements=t.contentAnimators=t.wrapper.children("div"),t.tabsHeight=t.tabGroup.outerHeight()+parseInt(t.wrapper.css("border-top-width"),10)+parseInt(t.wrapper.css("border-bottom-width"),10),r.kineticScrollNeeded&&r.mobile.ui.Scroller&&(r.touchScroller(t.contentElements),t.contentElements=t.contentElements.children(".km-scroll-container"))},_wrapper:function(){var e=this;e.wrapper=e.element.is("ul")?e.element.wrapAll("<div />").parent():e.element,e.scrollWrap=e.wrapper.parent(".k-tabstrip-wrapper"),e.scrollWrap[0]||(e.scrollWrap=e.wrapper.wrapAll("<div class='k-tabstrip-wrapper' />").parent())},_sizeScrollWrap:function(e){this.scrollWrap.css("height",Math.floor(e.outerHeight(!0))+this.tabsHeight).css("height")},_toggleHover:function(t){e(t.currentTarget).toggleClass(H,t.type==I)},_click:function(e){var t,n,i=this,r=e.find("."+w),o=r.attr(m),a=i.options.collapsible,s=i.contentHolder(e.index());if(e.closest(".k-widget")[0]==i.wrapper[0]){if(e.is("."+F+(a?"":",."+R)))return!0;if(n=r.data(E)||o&&("#"==o.charAt(o.length-1)||-1!=o.indexOf("#"+i.element[0].id+"-")),t=!o||n,i.tabGroup.children("[data-animating]").length)return t;if(i.trigger(S,{item:e[0],contentElement:s[0]}))return!0;if(t!==!1)return a&&e.is("."+R)?(i.deactivateTab(e),!0):(i.activateTab(e)&&(t=!0),t)}},deactivateTab:function(e){var t=this,n=t.options.animation,i=n.open,o=d({},n.close),a=o&&"effects"in o;e=t.tabGroup.find(e),o=d(a?o:d({reverse:!0},i),{hide:!0}),r.size(i.effects)?(e.kendoAddClass(z,{duration:i.duration}),e.kendoRemoveClass(R,{duration:i.duration})):(e.addClass(z),e.removeClass(R)),e.removeAttr("aria-selected"),t.contentAnimators.filter("."+R).kendoStop(!0,!0).kendoAnimate(o).removeClass(R).attr("aria-hidden",!0)},activateTab:function(e){var t,n,i,o,a,s,l,c,u,h,p,f,g,m,v;if(!this.tabGroup.children("[data-animating]").length)return e=this.tabGroup.find(e),t=this,n=t.options.animation,i=n.open,o=d({},n.close),a=o&&"effects"in o,s=e.parent().children(),l=s.filter("."+R),c=s.index(e),o=d(a?o:d({reverse:!0},i),{hide:!0}),r.size(i.effects)?(l.kendoRemoveClass(R,{duration:o.duration}),e.kendoRemoveClass(H,{duration:o.duration})):(l.removeClass(R),e.removeClass(H)),u=t.contentAnimators,t.inRequest&&(t.xhr.abort(),t.inRequest=!1),0===u.length?(l.removeClass(L),e.addClass(L).css("z-index"),e.addClass(R),t._current(e),t.trigger("change"),!1):(h=u.filter("."+R),p=t.contentHolder(c),f=p.closest(".k-content"),t.tabsHeight=t.tabGroup.outerHeight()+parseInt(t.wrapper.css("border-top-width"),10)+parseInt(t.wrapper.css("border-bottom-width"),10),t._sizeScrollWrap(h),0===p.length?(h.removeClass(R).attr("aria-hidden",!0).kendoStop(!0,!0).kendoAnimate(o),!1):(e.attr("data-animating",!0),g=(e.children("."+w).data(E)||!1)&&p.is(x),m=function(){l.removeClass(L),e.addClass(L).css("z-index"),r.size(i.effects)?(l.kendoAddClass(z,{duration:i.duration}),e.kendoAddClass(R,{duration:i.duration})):(l.addClass(z),e.addClass(R)),l.removeAttr("aria-selected"),e.attr("aria-selected",!0),t._current(e),t._sizeScrollWrap(f),f.addClass(R).removeAttr("aria-hidden").kendoStop(!0,!0).attr("aria-expanded",!0).kendoAnimate(d({init:function(){t.trigger(_,{item:e[0],contentElement:p[0]}),r.resize(p)}},i,{complete:function(){e.removeAttr("data-animating"),t.trigger(D,{item:e[0],contentElement:p[0]}),r.resize(p),t.scrollWrap.css("height","").css("height")}}))},v=function(){g?(e.removeAttr("data-animating"),t.ajaxRequest(e,p,function(){e.attr("data-animating",!0),m(),t.trigger("change")})):(m(),t.trigger("change"))},h.removeClass(R),h.attr("aria-hidden",!0),h.attr("aria-expanded",!1),h.length?h.kendoStop(!0,!0).kendoAnimate(d({complete:v},o)):v(),!0))},contentElement:function(e){var n,i,o,a;if(isNaN(e-0))return t;if(n=this.contentElements&&this.contentElements[0]&&!r.kineticScrollNeeded?this.contentElements:this.contentAnimators,e=n&&0>e?n.length+e:e,i=RegExp("-"+(e+1)+"$"),n)for(o=0,a=n.length;a>o;o++)if(i.test(n.eq(o).closest(".k-content")[0].id))return n[o];return t},contentHolder:function(t){var n=e(this.contentElement(t)),i=n.children(".km-scroll-container");return r.support.touch&&i[0]?i:n},ajaxRequest:function(t,n,i,o){var a,s,l,c,d,u,h,p,f;t=this.tabGroup.find(t),a=this,s=e.ajaxSettings.xhr,l=t.find("."+w),c={},d=t.width()/2,u=!1,h=t.find(".k-loading").removeClass("k-complete"),h[0]||(h=e("<span class='k-loading'/>").prependTo(t)),p=2*d-h.width(),f=function(){h.animate({marginLeft:(parseInt(h.css("marginLeft"),10)||0)<d?p:0},500,f)},r.support.browser.msie&&10>r.support.browser.version&&setTimeout(f,40),o=o||l.data(E)||l.attr(m),a.inRequest=!0,a.xhr=e.ajax({type:"GET",cache:!1,url:o,dataType:"html",data:c,xhr:function(){var t=this,n=s(),i=t.progressUpload?"progressUpload":t.progress?"progress":!1;return n&&e.each([n,n.upload],function(){this.addEventListener&&this.addEventListener("progress",function(e){i&&t[i](e)},!1)}),t.noProgress=!(window.XMLHttpRequest&&"upload"in new XMLHttpRequest),n},progress:function(e){if(e.lengthComputable){var t=parseInt(e.loaded/e.total*100,10)+"%";h.stop(!0).addClass("k-progress").css({width:t,marginLeft:0})}},error:function(e,t){a.trigger("error",{xhr:e,status:t})&&this.complete()},stopProgress:function(){clearInterval(u),h.stop(!0).addClass("k-progress")[0].style.cssText=""},complete:function(e){a.inRequest=!1,this.noProgress?setTimeout(this.stopProgress,500):this.stopProgress(),"abort"==e.statusText&&h.remove()},success:function(e){var s,l,c;h.addClass("k-complete");try{s=this,l=10,s.noProgress&&(h.width(l+"%"),u=setInterval(function(){s.progress({lengthComputable:!0,loaded:Math.min(l,100),total:100}),l+=10},40)),a.angular("cleanup",function(){return{elements:n.get()}}),r.destroy(n),n.html(e)}catch(d){c=window.console,c&&c.error&&c.error(d.name+": "+d.message+" in "+o),this.error(this.xhr,"error")}i&&i.call(a,n),a.angular("compile",function(){return{elements:n.get()}}),a.trigger(M,{item:t[0],contentElement:n[0]})}})}});d(W,{renderItem:function(e){e=d({tabStrip:{},group:{}},e);var t=V.empty,n=e.item;return V.item(d(e,{image:n.imageUrl?V.image:t,sprite:n.spriteCssClass?V.sprite:t,itemWrapper:V.itemWrapper},U))},renderContent:function(e){return V.content(d(e,U))}}),r.ui.plugin(W)}(window.kendo.jQuery),function(e,t){function n(e,t,n){var i,r=e.getTimezoneOffset();e.setTime(e.getTime()+t),n||(i=e.getTimezoneOffset()-r,e.setTime(e.getTime()+i*F))}function i(){var e=new $,t=new $(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),n=new $(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);return-1*(t.getTimezoneOffset()-n.getTimezoneOffset())}function r(e){return 60*e.getHours()*F+e.getMinutes()*F+1e3*e.getSeconds()+e.getMilliseconds()}function o(e,t,n){var i,o=r(t),a=r(n);return e&&o!=a?(i=r(e),o>i&&(i+=z),o>a&&(a+=z),i>=o&&a>=i):!0}function a(e){var t=e.parseFormats;e.format=f(e.format||d.getCulture(e.culture).calendars.standard.patterns.t),t=j(t)?t:[t],t.splice(0,0,e.format),e.parseFormats=t}function s(e){e.preventDefault()}var l,c,d=window.kendo,u=d.keys,h=d.parseDate,p=d._activeElement,f=d._extractFormat,g=d.support,m=g.browser,v=d.ui,_=v.Widget,w="open",y="close",b="change",k=".kendoTimePicker",x="click"+k,C="k-state-default",T="disabled",S="readonly",D="li",A="<span/>",E="k-state-focused",I="k-state-hover",P="mouseenter"+k+" mouseleave"+k,M="mousedown"+k,F=6e4,z=864e5,R="k-state-selected",B="k-state-disabled",H="aria-selected",L="aria-expanded",N="aria-hidden",O="aria-disabled",V="aria-readonly",U="aria-activedescendant",W="id",j=e.isArray,q=e.extend,G=e.proxy,$=Date,Y=new $;Y=new $(Y.getFullYear(),Y.getMonth(),Y.getDate(),0,0,0),l=function(t){var n=this,i=t.id;n.options=t,n.ul=e('<ul tabindex="-1" role="listbox" aria-hidden="true" unselectable="on" class="k-list k-reset"/>').css({overflow:g.kineticScrollNeeded?"":"auto"}).on(x,D,G(n._click,n)).on("mouseenter"+k,D,function(){e(this).addClass(I)}).on("mouseleave"+k,D,function(){e(this).removeClass(I)}),n.list=e("<div class='k-list-container'/>").append(n.ul).on(M,s),i&&(n._timeViewID=i+"_timeview",n._optionID=i+"_option_selected",n.ul.attr(W,n._timeViewID)),n._popup(),n._heightHandler=G(n._height,n),n.template=d.template('<li tabindex="-1" role="option" class="k-item" unselectable="on">#=data#</li>',{useWithBlock:!1})},l.prototype={current:function(n){var i=this,r=i.options.active;return n===t?i._current:(i._current&&i._current.removeClass(R).removeAttr(H).removeAttr(W),n&&(n=e(n).addClass(R).attr(W,i._optionID).attr(H,!0),i.scroll(n[0])),i._current=n,r&&r(n),t)},close:function(){this.popup.close()},destroy:function(){var e=this;e.ul.off(k),e.list.off(k),e._touchScroller&&e._touchScroller.destroy(),e.popup.destroy()},open:function(){var e=this;e.ul[0].firstChild||e.bind(),e.popup.open(),e._current&&e.scroll(e._current[0])},dataBind:function(e){for(var t,n=this,i=n.options,r=i.format,a=d.toString,s=n.template,l=e.length,c=0,u="";l>c;c++)t=e[c],o(t,i.min,i.max)&&(u+=s(a(t,r,i.culture)));n._html(u)},refresh:function(){var e,t,o,a=this,s=a.options,l=s.format,c=i(),u=0>c,h=s.min,p=s.max,f=r(h),g=r(p),m=s.interval*F,v=d.toString,_=a.template,w=new $(+h),y=w.getDate(),b=0,k="";for(o=u?(z+c*F)/m:z/m,f!=g&&(f>g&&(g+=z),o=(g-f)/m+1),t=parseInt(o,10);o>b;b++)b&&n(w,m,u),g&&t==b&&(e=r(w),y<w.getDate()&&(e+=z),e>g&&(w=new $(+p))),k+=_(v(w,l,s.culture));a._html(k)},bind:function(){var e=this,t=e.options.dates;t&&t[0]?e.dataBind(t):e.refresh()},_html:function(e){var t=this;t.ul[0].innerHTML=e,t.popup.unbind(w,t._heightHandler),t.popup.one(w,t._heightHandler),t.current(null),t.select(t._value)},scroll:function(e){if(e){var t,n=this.ul[0],i=e.offsetTop,r=e.offsetHeight,o=n.scrollTop,a=n.clientHeight,s=i+r,l=this._touchScroller;l?(t=this.list.height(),i>t&&(i=i-t+r),l.scrollTo(0,-i)):n.scrollTop=o>i?i:s>o+a?s-a:o}},select:function(t){var n=this,i=n.options,r=n._current;t instanceof Date&&(t=d.toString(t,i.format,i.culture)),"string"==typeof t&&(r&&r.text()===t?t=r:(t=e.grep(n.ul[0].childNodes,function(e){return(e.textContent||e.innerText)==t}),t=t[0]?t:null)),n.current(t)},setOptions:function(e){var t=this.options;e.min=h(e.min),e.max=h(e.max),this.options=q(t,e,{active:t.active,change:t.change,close:t.close,open:t.open}),this.bind()},toggle:function(){var e=this;e.popup.visible()?e.close():e.open()},value:function(e){var t=this;t._value=e,t.ul[0].firstChild&&t.select(e)},_click:function(t){var n=this,i=e(t.currentTarget);t.isDefaultPrevented()||(n.select(i),n.options.change(i.text(),!0),n.close())},_height:function(){var e=this,t=e.list,n=t.parent(".k-animation-container"),i=e.options.height;e.ul[0].children.length&&t.add(n).show().height(e.ul[0].scrollHeight>i?i:"auto").hide()},_parse:function(e){var t=this,n=t.options,i=t._value||Y;return e instanceof $?e:(e=h(e,n.parseFormats,n.culture),e&&(e=new $(i.getFullYear(),i.getMonth(),i.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())),e)},_adjustListWidth:function(){var e,t,n=this.list,i=n[0].style.width,r=this.options.anchor;(n.data("width")||!i)&&(e=window.getComputedStyle?window.getComputedStyle(r[0],null):0,t=e?parseFloat(e.width):r.outerWidth(),e&&(m.mozilla||m.msie)&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),i=t-(n.outerWidth()-n.width()),n.css({fontFamily:r.css("font-family"),width:i}).data("width",i))},_popup:function(){var e=this,t=e.list,n=e.options,i=n.anchor;e.popup=new v.Popup(t,q(n.popup,{anchor:i,open:n.open,close:n.close,animation:n.animation,isRtl:g.isRtl(n.anchor)})),e._touchScroller=d.touchScroller(e.popup.element)},move:function(e){var n=this,i=e.keyCode,r=n.ul[0],o=n._current,a=i===u.DOWN;if(i===u.UP||a){if(e.altKey)return n.toggle(a),t;o=a?o?o[0].nextSibling:r.firstChild:o?o[0].previousSibling:r.lastChild,o&&n.select(o),n.options.change(n._current.text()),e.preventDefault()}else(i===u.ENTER||i===u.TAB||i===u.ESC)&&(e.preventDefault(),o&&n.options.change(o.text(),!0),n.close())}},l.getMilliseconds=r,d.TimeView=l,c=_.extend({init:function(e,t){var n,i,r,o=this;_.fn.init.call(o,e,t),e=o.element,t=o.options,t.min=h(e.attr("min"))||h(t.min),t.max=h(e.attr("max"))||h(t.max),a(t),o._wrapper(),o.timeView=i=new l(q({},t,{id:e.attr(W),anchor:o.wrapper,format:t.format,change:function(t,n){n?o._change(t):e.val(t)},open:function(t){o.timeView._adjustListWidth(),o.trigger(w)?t.preventDefault():(e.attr(L,!0),n.attr(N,!1))},close:function(t){o.trigger(y)?t.preventDefault():(e.attr(L,!1),n.attr(N,!0))},active:function(t){e.removeAttr(U),t&&e.attr(U,i._optionID)}})),n=i.ul,o._icon(),o._reset();try{e[0].setAttribute("type","text")}catch(s){e[0].type="text"}e.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":i._timeViewID}),r=e.is("[disabled]"),r?o.enable(!1):o.readonly(e.is("[readonly]")),o._old=o._update(t.value||o.element.val()),o._oldText=e.val(),d.notify(o)},options:{name:"TimePicker",min:Y,max:Y,format:"",dates:[],parseFormats:[],value:null,interval:30,height:200,animation:{}},events:[w,y,b],setOptions:function(e){var t=this,n=t._value;_.fn.setOptions.call(t,e),e=t.options,a(e),t.timeView.setOptions(e),n&&t.element.val(d.toString(n,e.format,e.culture))},dataBind:function(e){j(e)&&this.timeView.dataBind(e)},_editable:function(e){var t=this,n=e.disable,i=e.readonly,r=t._arrow.off(k),o=t.element.off(k),a=t._inputWrapper.off(k);i||n?(a.addClass(n?B:C).removeClass(n?C:B),o.attr(T,n).attr(S,i).attr(O,n).attr(V,i)):(a.addClass(C).removeClass(B).on(P,t._toggleHover),o.removeAttr(T).removeAttr(S).attr(O,!1).attr(V,!1).on("keydown"+k,G(t._keydown,t)).on("focusout"+k,G(t._blur,t)).on("focus"+k,function(){t._inputWrapper.addClass(E)}),r.on(x,G(t._click,t)).on(M,s))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;_.fn.destroy.call(e),e.timeView.destroy(),e.element.off(k),e._arrow.off(k),e._inputWrapper.off(k),e._form&&e._form.off("reset",e._resetHandler)},close:function(){this.timeView.close()},open:function(){this.timeView.open()},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},value:function(e){var n=this;return e===t?n._value:(n._old=n._update(e),null===n._old&&n.element.val(""),n._oldText=n.element.val(),t)},_blur:function(){var e=this,t=e.element.val();e.close(),t!==e._oldText&&e._change(t),e._inputWrapper.removeClass(E)},_click:function(){var e=this,t=e.element;e.timeView.toggle(),g.touch||t[0]===p()||t.focus()},_change:function(e){var t=this;e=t._update(e),+t._old!=+e&&(t._old=e,t._oldText=t.element.val(),t.element.trigger(b),t.trigger(b))},_icon:function(){var t,n=this,i=n.element;t=i.next("span.k-select"),t[0]||(t=e('<span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-clock">select</span></span>').insertAfter(i)),n._arrow=t.attr({role:"button","aria-controls":n.timeView._timeViewID})},_keydown:function(e){var t=this,n=e.keyCode,i=t.timeView,r=t.element.val();i.popup.visible()||e.altKey?i.move(e):n===u.ENTER&&r!==t._oldText&&t._change(r)},_option:function(e,n){var i=this,r=i.options;return n===t?r[e]:(n=i.timeView._parse(n),n&&(n=new $(+n),r[e]=n,i.timeView.options[e]=n,i.timeView.bind()),t)},_toggleHover:function(t){e(t.currentTarget).toggleClass(I,"mouseenter"===t.type)},_update:function(e){var t=this,n=t.options,i=t.timeView,r=i._parse(e);return o(r,n.min,n.max)||(r=null),t._value=r,t.element.val(r?d.toString(r,n.format,n.culture):e),i.value(r),r},_wrapper:function(){var t,n=this,i=n.element;t=i.parents(".k-timepicker"),t[0]||(t=i.wrap(A).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(A).parent()),t[0].style.cssText=i[0].style.cssText,n.wrapper=t.addClass("k-widget k-timepicker k-header").addClass(i[0].className),i.css({width:"100%",height:i[0].style.height}),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue)},t._form=r.on("reset",t._resetHandler))}}),v.plugin(c)}(window.kendo.jQuery),function(e,t){function n(n){var i=e(n.useButtonTag?"<button></button>":"<a></a>");return i.data({type:"button"}),i.attr($,n.uid),n.attributes&&i.attr(n.attributes),n.togglable&&(i.addClass(m),n.selected&&i.addClass(k)),n.enable===!1&&i.addClass(x),n.url===t||n.useButtonTag||(i.attr("href",n.url),n.mobile&&i.attr(c.attr("role"),"button")),n.group&&i.attr(c.attr("group"),n.group),!n.togglable&&n.click&&h(n.click)&&i.data("click",n.click),n.togglable&&n.toggle&&h(n.toggle)&&i.data("toggle",n.toggle),i}function i(e){var t,n=Y.button.base(e);return n.addClass(f),e.primary&&n.addClass(S),e.align&&n.addClass("k-align-"+e.align),e.id&&n.attr("id",e.id),"overflow"!=e.showText&&e.text&&n.html(e.mobile?'<span class="km-text">'+e.text+"</span>":e.text),t="overflow"!=e.showIcon&&(e.icon||e.spriteCssClass||e.imageUrl),t&&o(e,n),n}function r(e){var t,n=Y.button.base(e);return n.addClass(g+" "+f),e.primary&&n.addClass(S),e.id&&n.attr("id",e.id+"_overflow"),"toolbar"!=e.showText&&e.text&&n.html(e.mobile?'<span class="km-text">'+e.text+"</span>":e.text),t="toolbar"!=e.showIcon&&(e.icon||e.spriteCssClass||e.imageUrl),t&&o(e,n),n}function o(t,n){var i,r,o,a=t.icon,s=t.spriteCssClass,l=t.imageUrl;(s||l||a)&&(i=!0,n.contents().not("span.k-sprite,span."+D+",img.k-image").each(function(t,n){(1==n.nodeType||3==n.nodeType&&e.trim(n.nodeValue).length>0)&&(i=!1)}),n.addClass(i?E:I)),a?(r=n.children("span."+D).first(),r[0]||(r=e('<span class="'+D+'"></span>').prependTo(n)),r.addClass(A+a)):s?(r=n.children("span.k-sprite").first(),r[0]||(r=e('<span class="k-sprite"></span>').prependTo(n)),r.addClass(s)):l&&(o=n.children("img.k-image").first(),o[0]||(o=e('<img alt="icon" class="k-image" />').prependTo(n)),o.attr("src",l))}function a(){var e,t=this.options.anchor,n=t.outerWidth();c.wrap(this.element).addClass("k-split-wrapper"),e="border-box"!==this.element.css("box-sizing")?n-(this.element.outerWidth()-this.element.width()):n,this.element.css({fontFamily:t.css("font-family"),"min-width":e})}function s(e){e.target.is(".k-toggle-button")||e.target.toggleClass(k,"press"==e.type)}function l(t){return t=e(t),t.hasClass("km-actionsheet")?t.closest(".km-popup-wrapper"):t.addClass("km-widget km-actionsheet").wrap('<div class="km-actionsheet-wrapper km-actionsheet-tablet km-widget km-popup"></div>').parent().wrap('<div class="km-popup-wrapper k-popup"></div>').parent()}var c=window.kendo,d=c.ui.Widget,u=e.proxy,h=c.isFunction,p="k-toolbar",f="k-button",g="k-overflow-button",m="k-toggle-button",v="k-button-group",_="k-split-button",w="k-separator",y="k-popup",b="k-toolbar-resizable",k="k-state-active",x="k-state-disabled",C="k-group-start",T="k-group-end",S="k-primary",D="k-icon",A="k-i-",E="k-button-icon",I="k-button-icontext",P="k-list-container k-split-container",M="k-split-button-arrow",F="k-overflow-anchor",z="k-overflow-container",R="k-toolbar-first-visible",B="k-toolbar-last-visible",H="click",L="toggle",N="open",O="close",V="overflowOpen",U="overflowClose",W="never",j="auto",q="always",G="k-overflow-hidden",$=c.attr("uid"),Y={button:{base:n,toolbar:i,overflow:r},buttonGroup:{base:function(t,n,i){var r,o,a=t.buttons;if(a){for(t.attributes&&i.attr(t.attributes),i.data({type:"buttonGroup"}),i.attr($,t.uid),o=0;a.length>o;o++)a[o].uid||(a[o].uid=c.guid()),r=n(e.extend({mobile:t.mobile},a[o])),r.appendTo(i);i.children().first().addClass(C),i.children().last().addClass(T)}},toolbar:function(t){var n=e("<div></div>");return Y.buttonGroup.base(t,Y.button.toolbar,n),n.addClass(v),t.align&&n.addClass("k-align-"+t.align),t.id&&n.attr("id",t.id),n},overflow:function(t){var n=e("<li></li>");return Y.buttonGroup.base(t,Y.button.overflow,n),n.addClass((t.mobile?"":v)+" k-overflow-group"),t.id&&n.attr("id",t.id+"_overflow"),n}},splitButton:{toolbar:function(t){var n,i,r,o=e('<div class="'+_+'"></div>'),s=Y.button.toolbar(t),c=e('<a class="'+f+" "+M+'"><span class="'+(t.mobile?"km-icon km-arrowdown":"k-icon k-i-arrow-s")+'"></span></a>'),d=e('<ul class="'+P+'"></ul>'),u=t.menuButtons;for(s.appendTo(o),c.appendTo(o),d.appendTo(o),r=0;u.length>r;r++)i=Y.button.toolbar(e.extend({mobile:t.mobile,click:t.click},u[r])),i.wrap("<li></li>").parent().appendTo(d);return t.align&&o.addClass("k-align-"+t.align),t.id||(t.id=t.uid),o.attr("id",t.id+"_wrapper"),d.attr("id",t.id+"_optionlist").attr($,t.rootUid),t.mobile&&(d=l(d)),n=d.kendoPopup({appendTo:t.mobile?e(t.mobile).children(".km-pane"):null,anchor:o,copyAnchorStyles:!1,animation:t.animation,open:a}).data("kendoPopup"),o.data({type:"splitButton",kendoPopup:n}),o.attr($,t.uid),o},overflow:function(t){var n,i,r=e('<li class="'+_+'"></li>'),o=Y.button.overflow(t),a=t.menuButtons;for(o.appendTo(r),i=0;a.length>i;i++)n=Y.button.overflow(e.extend({mobile:t.mobile},a[i])),n.appendTo(r);return r.data({type:"splitButton"}),r.attr($,t.uid),r}},separator:{base:function(t,n){var i=e(n?"<li>&nbsp;</li>":"<div>&nbsp;</div>");return i.data({type:"separator"}),i.attr($,t.uid),t.attributes&&i.attr(t.attributes),i.addClass(w),i},toolbar:function(e){var t=Y.separator.base(e,!1);return e.id&&t.attr("id",e.id),t},overflow:function(e){var t=Y.separator.base(e,!0);return e.id&&t.attr("id",e.id+"_overflow"),t}},overflowAnchor:'<div class="k-overflow-anchor"></div>',overflowContainer:'<ul class="k-overflow-container k-list-container"></ul>'},Q=d.extend({init:function(t,n){var i,r=this;if(d.fn.init.call(r,t,n),n=r.options,t=r.wrapper=r.element,t.addClass(p+" k-widget"),this.uid=c.guid(),t.attr($,this.uid),r.isMobile="boolean"==typeof n.mobile?n.mobile:r.element.closest(".km-root")[0],r.animation=r.isMobile?{open:{effects:"fade"}}:{},r.isMobile&&(t.addClass("km-widget"),D="km-icon",A="km-",f="km-button",v="km-buttongroup km-widget",k="km-state-active",x="km-state-disabled"),n.resizable?(r._renderOverflow(),t.addClass(b),r.overflowUserEvents=new c.UserEvents(r.element,{threshold:5,allowSelection:!0,filter:"."+F,tap:u(r._toggleOverflow,r)}),c.onResize(function(){r.resize()})):r.popup={element:e([])},n.items&&n.items.length)for(i=0;n.items.length>i;i++)r.add(n.items[i]);r.userEvents=new c.UserEvents(document,{threshold:5,allowSelection:!0,filter:"["+$+"="+this.uid+"] ."+f+", ["+$+"="+this.uid+"] ."+g,tap:u(r._buttonClick,r),press:s,release:s}),n.resizable&&this._toggleOverflowAnchor(),c.notify(r)},events:[H,L,N,O,V,U],options:{name:"ToolBar",items:[],resizable:!0,mobile:null},destroy:function(){var t=this;t.element.find("."+_).each(function(t,n){e(n).data("kendoPopup").destroy()}),t.userEvents.destroy(),t.options.resizable&&(t.overflowUserEvents.destroy(),t.popup.destroy()),d.fn.destroy.call(t)},add:function(t){var n,i,r=Y[t.type],o=t.template,a=this,s=a.isMobile?"":"k-item k-state-default",l=t.overflowTemplate;e.extend(t,{uid:c.guid(),animation:a.animation,mobile:a.isMobile,rootUid:a.uid}),o&&!l&&(t.overflow=W),t.overflow!==W&&a.options.resizable&&(l?(i=e(h(l)?l(t):l),t.id&&i.attr("id",t.id+"_overflow")):r&&(i=(r.overflow||e.noop)(t)),i&&i.length&&("LI"!==i.prop("tagName")&&(i.removeAttr($),i=i.wrap("<li></li>").parent(),i.attr($,t.uid)),a._attributes(i,t),i.addClass(s).appendTo(a.popup.container),i.data("overflow")===j&&i.addClass(G),a.angular("compile",function(){return{elements:i.get()}}))),t.overflow!==q&&(o?(n=h(o)?o(t):o,n instanceof jQuery||(n=e(n.replace(/^\s+|\s+$/g,""))),n=n.wrap("<div></div>").parent(),t.id&&n.attr("id",t.id),t.attributes&&n.attr(t.attributes),n.attr($,t.uid)):r&&(n=(r.toolbar||e.noop)(t)),n&&n.length&&(a._attributes(n,t),a.options.resizable?(n.appendTo(a.element).css("visibility","hidden"),a._shrink(a.element.innerWidth()),n.css("visibility","visible")):n.appendTo(a.element),a.angular("compile",function(){return{elements:n.get()}})))},remove:function(t){var n,i,r,o,a=this.options.resizable;n=this.element.find(t),a&&(i=this.popup.element.find(t)),n.length?(r=n.data("type"),o=n.attr($),"splitButton"===n.parent("."+_).data("type")&&(r="splitButton",n=n.parent()),i=a?this.popup.element.find("li["+$+"='"+o+"']"):e([])):i.length&&(r=i.data("type"),i=i.parent(),"splitButton"===i.data("type")&&(r="splitButton"),o=i.attr($),n=this.element.find("div."+_+"["+$+"='"+o+"']")),"splitButton"===r&&n.data("kendoPopup")&&n.data("kendoPopup").destroy(),n.remove(),i.remove()},enable:function(n,i){var r=this.element.find(n).attr($);!r&&this.popup&&(r=this.popup.element.find(n).parent("li").attr($)),t===i&&(i=!0),i?e("["+$+"='"+r+"']").removeClass(x):e("["+$+"='"+r+"']").addClass(x)},getSelectedFromGroup:function(e){return this.element.find("."+m+"[data-group='"+e+"']").filter("."+k)},toggle:function(t,n){var i,r=e(t),o=r.data("uid"),a=r.data("group");r.hasClass(m)&&(a&&this.element.add(this.popup.element).find("."+m+"[data-group='"+a+"']").filter("."+k).removeClass(k),e.contains(this.element[0],r[0])?(i=this.popup.element.find("["+$+"='"+o+"']"),"LI"===i.prop("tagName")&&(i=i.find("."+m+":first"))):(o=o?o:r.parent().data("uid"),i=this.element.find("["+$+"='"+o+"']")),r.add(i).toggleClass(k,n))},_attributes:function(e,t){e.attr(c.attr("overflow"),t.overflow||j)},_renderOverflow:function(){var t=this,n=Y.overflowContainer;t.overflowAnchor=e(Y.overflowAnchor).addClass(f),t.element.append(t.overflowAnchor),t.isMobile?(t.overflowAnchor.append('<span class="km-icon km-more"></span>'),n=l(n)):t.overflowAnchor.append('<span class="k-icon k-i-more"></span>'),t.popup=new c.ui.Popup(n,{origin:"bottom right",position:"top right",anchor:t.overflowAnchor,animation:t.animation,appendTo:t.isMobile?e(t.isMobile).children(".km-pane"):null,copyAnchorStyles:!1,open:function(n){var i=c.wrap(t.popup.element).addClass("k-overflow-wrapper");t.isMobile?t.popup.container.css("max-height",parseFloat(e(".km-content:visible").innerHeight())-15+"px"):i.css("margin-left",(i.outerWidth()-i.width())/2+1),t.trigger(V)&&n.preventDefault()},close:function(e){t.trigger(U)&&e.preventDefault()}}),t.popup.container=t.isMobile?t.popup.element.find("."+z):t.popup.element,t.popup.container.attr($,this.uid)},_toggleOverflowAnchor:function(){this.overflowAnchor.css(this.popup.element.children(":not(."+G+", ."+y+")").length>0?{visibility:"visible",width:""}:{visibility:"hidden",width:"1px"})},_buttonClick:function(n){var i,r,o,a,s,l,c,d,u,p=this;if(n.preventDefault(),r=e(n.target).closest("."+f,p.element),!r.hasClass(F)&&(!r.length&&p.popup&&(r=e(n.target).closest("."+g,p.popup.container)),a=r.hasClass(g)?r.parent("li").hasClass(x):r.hasClass(x),!a)){if(n.target.closest("."+M).length)return p._toggle(n),t;u=r.attr("id")?r.attr("id").replace(/(_overflow$)/,""):t,r.hasClass(m)?(l=r.data("group"),c=h(r.data("toggle"))?r.data("toggle"):null,p.toggle(r),s=r.hasClass(k),d={target:r,group:l,checked:s,id:u},c&&c.call(p,d),p.trigger(L,d)):(c=h(r.data("click"))?r.data("click"):null,d={target:r,id:u},c&&c.call(p,d),p.trigger(H,d)),r.hasClass(g)&&p.popup.close(),o=r.closest(".k-split-container"),o[0]&&(i=o.data("kendoPopup"),(i?i:o.parents(".km-popup-wrapper").data("kendoPopup")).close())}},_toggle:function(t){var n,i=e(t.target).closest("."+_),r=i.data("kendoPopup");t.preventDefault(),i.hasClass(x)||(n=r.element.is(":visible")?this.trigger(O,{target:i}):this.trigger(N,{target:i}),n||r.toggle())},_toggleOverflow:function(){this.popup.toggle()},_resize:function(e){var t=e.width;this.options.resizable&&(this.popup.close(),this._shrink(t),this._stretch(t),this._markVisibles(),this._toggleOverflowAnchor())},_childrenWidth:function(){var t=0;return this.element.children(":visible").each(function(){t+=e(this).outerWidth(!0)}),Math.ceil(t)},_shrink:function(e){var t,n,i;if(e<this._childrenWidth())for(n=this.element.children(":visible:not([data-overflow='never'], ."+F+")"),i=n.length-1;i>=0&&(t=n.eq(i),!(e>this._childrenWidth()));i--)this._hideItem(t)},_stretch:function(e){var t,n,i;if(e>this._childrenWidth())for(n=this.element.children(":hidden"),i=0;n.length>i&&(t=n.eq(i),!(e<this._childrenWidth())&&this._showItem(t,e));i++);},_hideItem:function(e){e.hide(),this.popup&&this.popup.container.find(">li[data-uid='"+e.data("uid")+"']").removeClass(G)},_showItem:function(e,t){return e.length&&t>this._childrenWidth()+e.outerWidth(!0)?(e.show(),this.popup&&this.popup.container.find(">li[data-uid='"+e.data("uid")+"']").addClass(G),!0):!1},_markVisibles:function(){var e=this.popup.container.children(),t=this.element.children(":not(.k-overflow-anchor)"),n=e.filter(":not(.k-overflow-hidden)"),i=t.filter(":visible");e.add(t).removeClass(R+" "+B),n.first().add(i.first()).addClass(R),n.last().add(i.last()).addClass(B)
}});c.ui.plugin(Q)}(window.kendo.jQuery),function(e,t){function n(e){var t=new Date(2100,0,1);return t.setMinutes(-e),t}function i(e){e.preventDefault()}function r(t){var n,i=o.getCulture(t.culture).calendars.standard.patterns;t.format=c(t.format||i.g),t.timeFormat=n=c(t.timeFormat||i.t),o.DateView.normalize(t),-1===e.inArray(n,t.parseFormats)&&t.parseFormats.splice(1,0,n)}var o=window.kendo,a=o.TimeView,s=o.parseDate,l=o._activeElement,c=o._extractFormat,d=o.calendar,u=d.isInRange,h=d.restrictValue,p=d.isEqualDatePart,f=a.getMilliseconds,g=o.ui,m=g.Widget,v="open",_="close",w="change",y=".kendoDateTimePicker",b="click"+y,k="disabled",x="readonly",C="k-state-default",T="k-state-focused",S="k-state-hover",D="k-state-disabled",A="mouseenter"+y+" mouseleave"+y,E="mousedown"+y,I="month",P="<span/>",M="aria-activedescendant",F="aria-expanded",z="aria-hidden",R="aria-owns",B="aria-disabled",H="aria-readonly",L=Date,N=new L(1800,0,1),O=new L(2099,11,31),V={view:"date"},U={view:"time"},W=e.extend,j=m.extend({init:function(e,t){var n,i=this;m.fn.init.call(i,e,t),e=i.element,t=i.options,t.min=s(e.attr("min"))||s(t.min),t.max=s(e.attr("max"))||s(t.max),r(t),i._wrapper(),i._views(),i._icons(),i._reset(),i._template();try{e[0].setAttribute("type","text")}catch(a){e[0].type="text"}e.addClass("k-input").attr({role:"combobox","aria-expanded":!1}),i._midnight=f(t.min)+f(t.max)===0,n=e.is("[disabled]"),n?i.enable(!1):i.readonly(e.is("[readonly]")),i._old=i._update(t.value||i.element.val()),i._oldText=e.val(),o.notify(i)},options:{name:"DateTimePicker",value:null,format:"",timeFormat:"",culture:"",parseFormats:[],dates:[],min:new L(N),max:new L(O),interval:30,height:200,footer:"",start:I,depth:I,animation:{},month:{},ARIATemplate:'Current focused date is #=kendo.toString(data.current, "d")#'},events:[v,_,w],setOptions:function(e){var t,n,i,a=this,l=a._value;m.fn.setOptions.call(a,e),e=a.options,e.min=t=s(e.min),e.max=n=s(e.max),r(e),i=e.value||a._value||a.dateView._current,t&&!p(t,i)&&(t=new L(N)),n&&!p(n,i)&&(n=new L(O)),a.dateView.setOptions(e),a.timeView.setOptions(W({},e,{format:e.timeFormat,min:t,max:n})),l&&(a.element.val(o.toString(l,e.format,e.culture)),a._updateARIA(l))},_editable:function(t){var n=this,r=n.element.off(y),a=n._dateIcon.off(y),s=n._timeIcon.off(y),c=n._inputWrapper.off(y),d=t.readonly,u=t.disable;d||u?(c.addClass(u?D:C).removeClass(u?C:D),r.attr(k,u).attr(x,d).attr(B,u).attr(H,d)):(c.addClass(C).removeClass(D).on(A,n._toggleHover),r.removeAttr(k).removeAttr(x).attr(B,!1).attr(H,!1).on("keydown"+y,e.proxy(n._keydown,n)).on("focus"+y,function(){n._inputWrapper.addClass(T)}).on("focusout"+y,function(){n._inputWrapper.removeClass(T),r.val()!==n._oldText&&n._change(r.val()),n.close("date"),n.close("time")}),a.on(E,i).on(b,function(){n.toggle("date"),o.support.touch||r[0]===l()||r.focus()}),s.on(E,i).on(b,function(){n.toggle("time"),o.support.touch||r[0]===l()||r.focus()}))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;m.fn.destroy.call(e),e.dateView.destroy(),e.timeView.destroy(),e.element.off(y),e._dateIcon.off(y),e._timeIcon.off(y),e._inputWrapper.off(y),e._form&&e._form.off("reset",e._resetHandler)},close:function(e){"time"!==e&&(e="date"),this[e+"View"].close()},open:function(e){"time"!==e&&(e="date"),this[e+"View"].open()},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},toggle:function(e){var t="timeView";"time"!==e?e="date":t="dateView",this[e+"View"].toggle(),this[t].close()},value:function(e){var n=this;return e===t?n._value:(n._old=n._update(e),null===n._old&&n.element.val(""),n._oldText=n.element.val(),t)},_change:function(e){var t=this;e=t._update(e),+t._old!=+e&&(t._old=e,t._oldText=t.element.val(),t.trigger(w),t.element.trigger(w))},_option:function(e,i){var r,o,a=this,l=a.options,c=a.timeView,d=c.options,u=a._value||a._old;if(i===t)return l[e];if(i=s(i,l.parseFormats,l.culture)){if(l.min.getTime()===l.max.getTime()&&(d.dates=[]),l[e]=new L(i.getTime()),a.dateView[e](i),a._midnight=f(l.min)+f(l.max)===0,u&&(r=p(l.min,u),o=p(l.max,u)),r||o){if(d[e]=i,r&&!o&&(d.max=n(l.interval)),o){if(a._midnight)return c.dataBind([O]),t;r||(d.min=N)}}else d.max=O,d.min=N;c.bind()}},_toggleHover:function(t){e(t.currentTarget).toggleClass(S,"mouseenter"===t.type)},_update:function(t){var i,r,a,l,c,d=this,f=d.options,g=f.min,m=f.max,v=f.dates,_=d.timeView,w=d._value,y=s(t,f.parseFormats,f.culture),b=null===y&&null===w||y instanceof Date&&w instanceof Date;return+y===+w&&b?(c=o.toString(y,f.format,f.culture),c!==t&&d.element.val(null===y?t:c),y):(null!==y&&p(y,g)?y=h(y,g,m):u(y,g,m)||(y=null),d._value=y,_.value(y),d.dateView.value(y),y&&(a=d._old,r=_.options,v[0]&&(v=e.grep(v,function(e){return p(y,e)}),v[0]&&(_.dataBind(v),l=!0)),l||(p(y,g)&&(r.min=g,r.max=n(f.interval),i=!0),p(y,m)&&(d._midnight?(_.dataBind([O]),l=!0):(r.max=m,i||(r.min=N),i=!0))),!l&&(!a&&i||a&&!p(a,y))&&(i||(r.max=O,r.min=N),_.bind())),d.element.val(y?o.toString(y,f.format,f.culture):t),d._updateARIA(y),y)},_keydown:function(e){var t=this,n=t.dateView,i=t.timeView,r=t.element.val(),a=n.popup.visible();e.altKey&&e.keyCode===o.keys.DOWN?t.toggle(a?"time":"date"):a?(n.move(e),t._updateARIA(n._current)):i.popup.visible()?i.move(e):e.keyCode===o.keys.ENTER&&r!==t._oldText&&t._change(r)},_views:function(){var e,t,n,i,r,l,c=this,d=c.element,h=c.options,p=d.attr("id");c.dateView=e=new o.DateView(W({},h,{id:p,anchor:c.wrapper,change:function(){var t,n=e.calendar.value(),i=+n,r=+h.min,o=+h.max;(i===r||i===o)&&(t=new L(+c._value),t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),u(t,r,o)&&(n=t)),c._change(n),c.close("date")},close:function(e){c.trigger(_,V)?e.preventDefault():(d.attr(F,!1),n.attr(z,!0),t.popup.visible()||d.removeAttr(R))},open:function(t){c.trigger(v,V)?t.preventDefault():(d.val()!==c._oldText&&(l=s(d.val(),h.parseFormats,h.culture),c.dateView[l?"current":"value"](l)),n.attr(z,!1),d.attr(F,!0).attr(R,e._dateViewID),c._updateARIA(l))}})),n=e.div,r=h.min.getTime(),c.timeView=t=new a({id:p,value:h.value,anchor:c.wrapper,animation:h.animation,format:h.timeFormat,culture:h.culture,height:h.height,interval:h.interval,min:new L(N),max:new L(O),dates:r===h.max.getTime()?[new Date(r)]:[],parseFormats:h.parseFormats,change:function(n,i){n=t._parse(n),h.min>n?(n=new L(+h.min),t.options.min=n):n>h.max&&(n=new L(+h.max),t.options.max=n),i?(c._timeSelected=!0,c._change(n)):(d.val(o.toString(n,h.format,h.culture)),e.value(n),c._updateARIA(n))},close:function(t){c.trigger(_,U)?t.preventDefault():(i.attr(z,!0),d.attr(F,!1),e.popup.visible()||d.removeAttr(R))},open:function(e){t._adjustListWidth(),c.trigger(v,U)?e.preventDefault():(d.val()!==c._oldText&&(l=s(d.val(),h.parseFormats,h.culture),c.timeView.value(l)),i.attr(z,!1),d.attr(F,!0).attr(R,t._timeViewID),t.options.active(t.current()))},active:function(e){d.removeAttr(M),e&&d.attr(M,t._optionID)}}),i=t.ul},_icons:function(){var t,n=this,i=n.element;t=i.next("span.k-select"),t[0]||(t=e('<span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-calendar">select</span><span unselectable="on" class="k-icon k-i-clock">select</span></span>').insertAfter(i)),t=t.children(),n._dateIcon=t.eq(0).attr({role:"button","aria-controls":n.dateView._dateViewID}),n._timeIcon=t.eq(1).attr({role:"button","aria-controls":n.timeView._timeViewID})},_wrapper:function(){var t,n=this,i=n.element;t=i.parents(".k-datetimepicker"),t[0]||(t=i.wrap(P).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(P).parent()),t[0].style.cssText=i[0].style.cssText,i.css({width:"100%",height:i[0].style.height}),n.wrapper=t.addClass("k-widget k-datetimepicker k-header").addClass(i[0].className),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue)},t._form=r.on("reset",t._resetHandler))},_template:function(){this._ariaTemplate=o.template(this.options.ARIATemplate)},_updateARIA:function(e){var t,n=this,i=n.dateView.calendar;n.element.removeAttr(M),i&&(t=i._cell,t.attr("aria-label",n._ariaTemplate({current:e||i.current()})),n.element.attr(M,t.attr("id")))}});g.plugin(j)}(window.kendo.jQuery),function(e,t){function n(e){return v.test(e)}function i(e){return m.test(e)||/^\d+$/.test(e)}function r(e){return!n(e)&&!i(e)}function o(e,t){var i=parseInt(e,10);return n(e)&&(i=Math.floor(i*t/100)),i}function a(e,n){return function(i,r){var o,a=this.element.find(i).data(E);return 1==arguments.length?a[e]:(a[e]=r,n&&(o=this.element.data("kendo"+this.options.name),o.resize(!0)),t)}}function s(e){var t=this,n=e.orientation;t.owner=e,t._element=e.element,t.orientation=n,p(t,n===T?c:l),t._resizable=new d.ui.Resizable(e.element,{orientation:n,handle:".k-splitbar-draggable-"+n+"[data-marker="+e._marker+"]",hint:f(t._createHint,t),start:f(t._start,t),max:f(t._max,t),min:f(t._min,t),invalidClass:"k-restricted-size-"+n,resizeend:f(t._stop,t)})}var l,c,d=window.kendo,u=d.ui,h=d.keys,p=e.extend,f=e.proxy,g=u.Widget,m=/^\d+(\.\d+)?px$/i,v=/^\d+(\.\d+)?%$/i,_=".kendoSplitter",w="expand",y="collapse",b="contentLoad",k="error",x="resize",C="layoutChange",T="horizontal",S="vertical",D="mouseenter",A="click",E="pane",I="mouseleave",P="k-state-focused",M="k-"+E,F="."+M,z=g.extend({init:function(e,t){var n,i=this;g.fn.init.call(i,e,t),i.wrapper=i.element,n=i.options.orientation.toLowerCase()!=S,i.orientation=n?T:S,i._dimension=n?"width":"height",i._keys={decrease:n?h.LEFT:h.UP,increase:n?h.RIGHT:h.DOWN},i._resizeStep=10,i._marker=d.guid().substring(0,8),i._initPanes(),i.resizing=new s(i),i.element.triggerHandler("init"+_)},events:[w,y,b,k,x,C],_attachEvents:function(){var t=this,n=t.options.orientation;t.element.children(".k-splitbar-draggable-"+n).on("keydown"+_,e.proxy(t._keydown,t)).on("mousedown"+_,function(e){e.currentTarget.focus()}).on("focus"+_,function(t){e(t.currentTarget).addClass(P)}).on("blur"+_,function(n){e(n.currentTarget).removeClass(P),t.resizing&&t.resizing.end()}).on(D+_,function(){e(this).addClass("k-splitbar-"+t.orientation+"-hover")}).on(I+_,function(){e(this).removeClass("k-splitbar-"+t.orientation+"-hover")}).on("mousedown"+_,function(){t._panes().append("<div class='k-splitter-overlay k-overlay' />")}).on("mouseup"+_,function(){t._panes().children(".k-splitter-overlay").remove()}).end().children(".k-splitbar").on("dblclick"+_,f(t._togglePane,t)).children(".k-collapse-next, .k-collapse-prev").on(A+_,t._arrowClick(y)).end().children(".k-expand-next, .k-expand-prev").on(A+_,t._arrowClick(w)).end().end(),e(window).on("resize"+_+t._marker,f(t.resize,t))},_detachEvents:function(){var t=this;t.element.children(".k-splitbar-draggable-"+t.orientation).off(_).end().children(".k-splitbar").off("dblclick"+_).children(".k-collapse-next, .k-collapse-prev, .k-expand-next, .k-expand-prev").off(_),e(window).off("resize"+_+t._marker)},options:{name:"Splitter",orientation:T,panes:[]},destroy:function(){g.fn.destroy.call(this),this._detachEvents(),this.resizing&&this.resizing.destroy(),d.destroy(this.element),this.wrapper=this.element=null},_keydown:function(t){var n,i=this,r=t.keyCode,o=i.resizing,a=e(t.currentTarget),s=i._keys,l=r===s.increase,c=r===s.decrease;l||c?(t.ctrlKey?(n=a[c?"next":"prev"](),o&&o.isResizing()&&o.end(),n[i._dimension]()?i._triggerAction(y,a[c?"prev":"next"]()):i._triggerAction(w,n)):o&&o.move((c?-1:1)*i._resizeStep,a),t.preventDefault()):r===h.ENTER&&o&&(o.end(),t.preventDefault())},_initPanes:function(){var e=this.options.panes||[],t=this;this.element.addClass("k-widget").addClass("k-splitter").children().each(function(n,i){"script"!=i.nodeName.toLowerCase()&&t._initPane(i,e[n])}),this.resize()},_initPane:function(t,n){t=e(t).attr("role","group").addClass(M),t.data(E,n?n:{}).toggleClass("k-scrollable",n?n.scrollable!==!1:!0),this.ajaxRequest(t)},ajaxRequest:function(e,t,n){var i,r=this;e=r.element.find(e),i=e.data(E),t=t||i.contentUrl,t&&(e.append("<span class='k-icon k-loading k-pane-loading' />"),d.isLocalUrl(t)?jQuery.ajax({url:t,data:n||{},type:"GET",dataType:"html",success:function(t){r.angular("cleanup",function(){return{elements:e.get()}}),e.html(t),r.angular("compile",function(){return{elements:e.get()}}),r.trigger(b,{pane:e[0]})},error:function(t,n){r.trigger(k,{pane:e[0],status:n,xhr:t})}}):e.removeClass("k-scrollable").html("<iframe src='"+t+"' frameborder='0' class='k-content-frame'>This page requires frames in order to show content</iframe>"))},_triggerAction:function(e,t){this.trigger(e,{pane:t[0]})||this[e](t[0])},_togglePane:function(t){var n,i=this,r=e(t.target);r.closest(".k-splitter")[0]==i.element[0]&&(n=r.children(".k-icon:not(.k-resize-handle)"),1===n.length&&(n.is(".k-collapse-prev")?i._triggerAction(y,r.prev()):n.is(".k-collapse-next")?i._triggerAction(y,r.next()):n.is(".k-expand-prev")?i._triggerAction(w,r.prev()):n.is(".k-expand-next")&&i._triggerAction(w,r.next())))},_arrowClick:function(t){var n=this;return function(i){var r,o=e(i.target);o.closest(".k-splitter")[0]==n.element[0]&&(r=o.is(".k-"+t+"-prev")?o.parent().prev():o.parent().next(),n._triggerAction(t,r))}},_updateSplitBar:function(e,t,n){var i=function(e,t){return t?"<div class='k-icon "+e+"' />":""},r=this.orientation,o=t.resizable!==!1&&n.resizable!==!1,a=t.collapsible,s=t.collapsed,l=n.collapsible,c=n.collapsed;e.addClass("k-splitbar k-state-default k-splitbar-"+r).attr("role","separator").attr("aria-expanded",!(s||c)).removeClass("k-splitbar-"+r+"-hover").toggleClass("k-splitbar-draggable-"+r,o&&!s&&!c).toggleClass("k-splitbar-static-"+r,!o&&!a&&!l).html(i("k-collapse-prev",a&&!s&&!c)+i("k-expand-prev",a&&s&&!c)+i("k-resize-handle",o)+i("k-collapse-next",l&&!c&&!s)+i("k-expand-next",l&&c&&!s)),o||a||l||e.removeAttr("tabindex")},_updateSplitBars:function(){var t=this;this.element.children(".k-splitbar").each(function(){var n=e(this),i=n.prevAll(F).first().data(E),r=n.nextAll(F).first().data(E);r&&t._updateSplitBar(n,i,r)})},_removeSplitBars:function(){this.element.children(".k-splitbar").remove()},_panes:function(){return this.element.children(F)},_resize:function(){var n,i,a,s,l,c,u,h,p,f,g=this,m=g.element,v=m.children(F),_=g.orientation==T,w=m.children(".k-splitbar"),y=w.length,b=_?"width":"height",k=m[b]();0===y?(y=v.length-1,v.slice(0,y).after("<div tabindex='0' class='k-splitbar' data-marker='"+g._marker+"' />"),g._updateSplitBars(),w=m.children(".k-splitbar")):g._updateSplitBars(),w.each(function(){k-=this[_?"offsetWidth":"offsetHeight"]}),n=0,i=0,a=e(),v.css({position:"absolute",top:0})[b](function(){var s,l=e(this),c=l.data(E)||{};if(l.removeClass("k-state-collapsed"),c.collapsed)s=c.collapsedSize?o(c.collapsedSize,k):0,l.css("overflow","hidden").addClass("k-state-collapsed");else{if(r(c.size))return a=a.add(this),t;s=o(c.size,k)}return i++,n+=s,s}),k-=n,s=a.length,l=Math.floor(k/s),a.slice(0,s-1).css(b,l).end().eq(s-1).css(b,k-(s-1)*l),c=0,u=_?"height":"width",h=_?"left":"top",p=_?"offsetWidth":"offsetHeight",0===s&&(f=v.filter(function(){return!(e(this).data(E)||{}).collapsed}).last(),f[b](k+f[0][p])),m.children().css(u,m[u]()).each(function(e,t){"script"!=t.tagName.toLowerCase()&&(t.style[h]=Math.floor(c)+"px",c+=t[p])}),g._detachEvents(),g._attachEvents(),d.resize(v),g.trigger(C)},toggle:function(e,n){var i,r=this;e=r.element.find(e),i=e.data(E),(n||i.collapsible)&&(1==arguments.length&&(n=i.collapsed===t?!1:i.collapsed),i.collapsed=!n,i.collapsed?e.css("overflow","hidden"):e.css("overflow",""),r.resize(!0))},collapse:function(e){this.toggle(e,!1)},expand:function(e){this.toggle(e,!0)},_addPane:function(e,t,n){var i=this;return n.length&&(i.options.panes.splice(t,0,e),i._initPane(n,e),i._removeSplitBars(),i.resize(!0)),n},append:function(t){t=t||{};var n=this,i=e("<div />").appendTo(n.element);return n._addPane(t,n.options.panes.length,i)},insertBefore:function(t,n){n=e(n),t=t||{};var i=this,r=i.wrapper.children(".k-pane").index(n),o=e("<div />").insertBefore(e(n));return i._addPane(t,r,o)},insertAfter:function(t,n){n=e(n),t=t||{};var i=this,r=i.wrapper.children(".k-pane").index(n),o=e("<div />").insertAfter(e(n));return i._addPane(t,r+1,o)},remove:function(t){t=e(t);var n=this;return t.length&&(d.destroy(t),t.each(function(t,i){n.options.panes.splice(n.wrapper.children(".k-pane").index(i),1),e(i).remove()}),n._removeSplitBars(),n.options.panes.length&&n.resize(!0)),n},size:a("size",!0),min:a("min"),max:a("max")});u.plugin(z),l={sizingProperty:"height",sizingDomProperty:"offsetHeight",alternateSizingProperty:"width",positioningProperty:"top",mousePositioningProperty:"pageY"},c={sizingProperty:"width",sizingDomProperty:"offsetWidth",alternateSizingProperty:"height",positioningProperty:"left",mousePositioningProperty:"pageX"},s.prototype={press:function(e){this._resizable.press(e)},move:function(e,t){this.pressed||(this.press(t),this.pressed=!0),this._resizable.target||this._resizable.press(t),this._resizable.move(e)},end:function(){this._resizable.end(),this.pressed=!1},destroy:function(){this._resizable.destroy(),this._resizable=this._element=this.owner=null},isResizing:function(){return this._resizable.resizing},_createHint:function(t){var n=this;return e("<div class='k-ghost-splitbar k-ghost-splitbar-"+n.orientation+" k-state-default' />").css(n.alternateSizingProperty,t[n.alternateSizingProperty]())},_start:function(t){var n=this,r=e(t.currentTarget),o=r.prev(),a=r.next(),s=o.data(E),l=a.data(E),c=parseInt(o[0].style[n.positioningProperty],10),d=parseInt(a[0].style[n.positioningProperty],10)+a[0][n.sizingDomProperty]-r[0][n.sizingDomProperty],u=parseInt(n._element.css(n.sizingProperty),10),h=function(e){var t=parseInt(e,10);return(i(e)?t:u*t/100)||0},p=h(s.min),f=h(s.max)||d-c,g=h(l.min),m=h(l.max)||d-c;n.previousPane=o,n.nextPane=a,n._maxPosition=Math.min(d-g,c+f),n._minPosition=Math.max(c+p,d-m)},_max:function(){return this._maxPosition},_min:function(){return this._minPosition},_stop:function(t){var n,i,o,a,s,l,c,u,h=this,p=e(t.currentTarget),f=h.owner;return f._panes().children(".k-splitter-overlay").remove(),t.keyCode!==d.keys.ESC&&(n=t.position,i=p.prev(),o=p.next(),a=i.data(E),s=o.data(E),l=n-parseInt(i[0].style[h.positioningProperty],10),c=parseInt(o[0].style[h.positioningProperty],10)+o[0][h.sizingDomProperty]-n-p[0][h.sizingDomProperty],u=h._element.children(F).filter(function(){return r(e(this).data(E).size)}).length,(!r(a.size)||u>1)&&(r(a.size)&&u--,a.size=l+"px"),(!r(s.size)||u>1)&&(s.size=c+"px"),f.resize(!0)),!1}}}(window.kendo.jQuery),function(e){function t(e,t){function n(e,r){var o,a;if(r=r[t])for(o=i[e]=i[e]||[],a=0;r.length>a;a++)o.push(r[a]),n(e+1,r[a])}var i=[];return n(0,e),i}function n(){return I.support.cssBorderSpacing?"":'cellspacing="0"'}function i(t,i){return t.length?"<table "+n()+' class="'+e.trim("k-scheduler-table "+(i||""))+'"><tr>'+t.join("</tr><tr>")+"</tr></table>":""}function r(e,t){return e.length?"<div style='position:relative'>"+i(e,t)+"</div>":""}function o(t,n,r){var o,a=[];if(r>0)for(o=0;t>o;o++)a.push("<th>&nbsp;</th>");return n&&a.push('<th class="k-scheduler-times-all-day">'+n.text+"</th>"),1>r?e():e('<div class="k-scheduler-times">'+i(a)+"</div>")}function a(t,n,o){var a,s,l,c,d,u,h,p,f,g,m=[];for(s=0;t.length>s;s++){for(l=t[s],c=[],d=n/l.length,a=0;l.length>a;a++)u=l[a],c.push('<th colspan="'+(u.colspan||d)+'" class="'+(u.className||"")+'">'+u.text+"</th>");m.push(c.join(""))}if(h=[],o){for(p=t[t.length-1],f=[],g=o.cellContent,a=0;p.length>a;a++)f.push('<td class="'+(p[a].className||"")+'">'+(g?g(a):"&nbsp;")+"</th>");h.push(f.join(""))}return e('<div class="k-scheduler-header k-state-default"><div class="k-scheduler-header-wrap">'+i(m)+r(h,"k-scheduler-header-all-day")+"</div></div>")}function s(t,n){var r,o,a,s,l,c=Array(n).join().split(","),d=[];for(o=0;t.length>o;o++)for(a=t[o],s=n/a.length,r=0;a.length>r;r++)l=a[r].className||"",a[r].allDay&&(l="k-scheduler-times-all-day"),c[s*r]+='<th class="'+l+'" rowspan="'+s+'">'+a[r].text+"</th>";for(r=0;n>r;r++)d.push(c[r]);return 1>n?e():e('<div class="k-scheduler-times">'+i(d)+"</div>")}function l(){return e('<div class="k-scheduler-content"><table '+n()+' class="k-scheduler-table"/></div>')}function c(){return D=D?D:I.support.scrollbar()}function d(e,t,n){var i,r,o,a,s;for(i=e.length-1;i>=0;i--)r=u(e[i]),o=r.start,s=r.end,a=t>=o&&s>=t,(a||o>=t&&n>=s||o>=t&&n>=o)&&(t>o&&(t=o),s>n&&(n=s));return h(e,t,n)}function u(e){return{start:e.start,end:e.end}}function h(e,t,n){var i,r,o=[];for(i=0;e.length>i;i++)r=u(e[i]),(t>r.start&&r.end>t||r.start>=t&&n>=r.end)&&o.push(e[i]);return o}function p(e){return g(e)}function f(e){return g(e)}function g(e){var t,n,i,r,o,a,s,l=[];for(t=0;e.length>t;t++){for(n=e[t],i=u(n),r=null,o=0,a=l.length;a>o;o++)if(s=i.start>l[o].end,l[o].start>i.start||s){r=l[o],i.end>r.end&&(r.end=i.end);break}r||(r={start:i.start,end:i.end,events:[]},l.push(r)),r.events.push(n)}return l}function m(e,t,n,i){var r,o,a,s,l=t[0];if(l){for(r=[],o=l.dataSource.view(),a=0;o.length>a;a++)s={text:i({text:I.htmlEncode(I.getter(l.dataTextField)(o[a])),color:I.getter(l.dataColorField)(o[a]),field:l.field,title:l.title,name:l.name,value:I.getter(l.dataValueField)(o[a])}),className:"k-slot-cell"},s[e]=m(e,t.slice(1),n,i),r.push(s);return r}return n}function v(t){return function(n){if(e.isArray(n)||n instanceof I.data.ObservableArray){for(var i=0;n.length>i;i++)if(n[i]==t)return!0;return!1}return n==t}}function _(e){e.className=e.className.replace(E,"")+" k-state-selected"}var w,y,b,k,x,C,T,S,D,A,E,I=window.kendo,P=I.ui,M=P.Widget,F=I.keys,z=".kendoSchedulerView",R=Math,B='<div class="k-marquee k-scheduler-marquee"><div class="k-marquee-color"></div><div class="k-marquee-text"><div class="k-label-top"></div><div class="k-label-bottom"></div></div></div>';I.ui.scheduler={},w=I.Class.extend({init:function(e){this._index=e,this._timeSlotCollections=[],this._daySlotCollections=[]},addTimeSlotCollection:function(e,t){return this._addCollection(e,t,this._timeSlotCollections)},addDaySlotCollection:function(e,t){return this._addCollection(e,t,this._daySlotCollections)},_addCollection:function(e,t,n){var i=new x(e,t,this._index,n.length);return n.push(i),i},timeSlotCollectionCount:function(){return this._timeSlotCollections.length},daySlotCollectionCount:function(){return this._daySlotCollections.length},daySlotByPosition:function(e,t){return this._slotByPosition(e,t,this._daySlotCollections)},timeSlotByPosition:function(e,t){return this._slotByPosition(e,t,this._timeSlotCollections)},_slotByPosition:function(e,t,n){var i,r,o,a;for(i=0;n.length>i;i++)for(r=n[i],o=0;o<r.count();o++)if(a=r.at(o),e>=a.offsetLeft&&a.offsetLeft+a.clientWidth>e&&t>=a.offsetTop&&a.offsetTop+a.clientHeight>=t)return a},refresh:function(){var e;for(e=0;this._daySlotCollections.length>e;e++)this._daySlotCollections[e].refresh();for(e=0;this._timeSlotCollections.length>e;e++)this._timeSlotCollections[e].refresh()},timeSlotRanges:function(e,t){var n,i=this._timeSlotCollections,r=this._startSlot(e,i);return!r.inRange&&e>=r.slot.end&&(r=null),n=r,t>e&&(n=this._endSlot(t,i)),n&&!n.inRange&&n.slot.start>=t&&(n=null),null===r&&null===n?[]:(null===r&&(r={inRange:!0,slot:i[n.slot.collectionIndex].first()}),null===n&&(n={inRange:!0,slot:i[r.slot.collectionIndex].last()}),this._continuousRange(b,i,r,n))},daySlotRanges:function(e,t,n){var i,r=this._daySlotCollections,o=this._startSlot(e,r,n);if(!o.inRange&&e>=o.slot.end&&(o=null),i=o,t>e&&(i=this._endSlot(t,r,n)),i&&!i.inRange&&i.slot.start>=t&&(i=null),null===o&&null===i)return[];if(null===o)do e+=I.date.MS_PER_DAY,o=this._startSlot(e,r,n);while(!o.inRange&&e>=o.slot.end);if(null===i)do t-=I.date.MS_PER_DAY,i=this._endSlot(t,r,n);while(!i.inRange&&i.slot.start>=t);return this._continuousRange(k,r,o,i)},_continuousRange:function(e,t,n,i){var r,o,a,s,l,c,d=n.slot,u=i.slot,h=d.collectionIndex,p=u.collectionIndex,f=[];for(r=h;p>=r;r++)o=t[r],a=o.first(),s=o.last(),l=!1,c=!1,r==h&&(c=!n.inRange),r==p&&(l=!i.inRange),d.start>a.start&&(a=d),s.start>u.start&&(s=u),p>h&&(r==h?l=!0:r==p?c=!0:l=c=!0),f.push(new e({start:a,end:s,collection:o,head:l,tail:c}));return f},slotRanges:function(e,t){var n=e._startTime||I.date.toUtcTime(e.start),i=e._endTime||I.date.toUtcTime(e.end);return void 0===t&&(t=e.isMultiDay()),t?this.daySlotRanges(n,i,e.isAllDay):this.timeSlotRanges(n,i)},ranges:function(e,t,n,i){return"number"!=typeof e&&(e=I.date.toUtcTime(e)),"number"!=typeof t&&(t=I.date.toUtcTime(t)),n?this.daySlotRanges(e,t,i):this.timeSlotRanges(e,t)},_startCollection:function(e,t){var n,i;for(n=0;t.length>n;n++)if(i=t[n],i.startInRange(e))return i;return null},_endCollection:function(e,t,n){var i,r;for(i=0;t.length>i;i++)if(r=t[i],r.endInRange(e,n))return r;return null},_getCollections:function(e){return e?this._daySlotCollections:this._timeSlotCollections},continuousSlot:function(e,t){var n=t?-1:1,i=this._getCollections(e.isDaySlot),r=i[e.collectionIndex+n];return r?r[t?"last":"first"]():void 0},firstSlot:function(){var e=this._getCollections(this.daySlotCollectionCount());return e[0].first()},lastSlot:function(){var e=this._getCollections(this.daySlotCollectionCount());return e[e.length-1].last()},upSlot:function(e,t){var n=this,i=function(e,i,r){var o=0===r;return!t&&!e&&o&&n.daySlotCollectionCount()?n._daySlotCollections[0].at(i):void 0};return this.timeSlotCollectionCount()||(t=!0),this._verticalSlot(e,-1,i)},downSlot:function(e,t){var n=this,i=function(e,i,r){return!t&&e&&n.timeSlotCollectionCount()?n._timeSlotCollections[r].at(0):void 0};return this.timeSlotCollectionCount()||(t=!0),this._verticalSlot(e,1,i)},leftSlot:function(e){return this._horizontalSlot(e,-1)},rightSlot:function(e){return this._horizontalSlot(e,1)},_horizontalSlot:function(e,t){var n,i=e.index,r=e.isDaySlot,o=e.collectionIndex,a=this._getCollections(r);return r?i+=t:o+=t,n=a[o],n?n.at(i):void 0},_verticalSlot:function(e,t,n){var i,r=e.index,o=e.isDaySlot,a=e.collectionIndex,s=this._getCollections(o);return(e=n(o,a,r))?e:(o?a+=t:r+=t,i=s[a],i?i.at(r):void 0)},_collection:function(e,t){var n=t?this._daySlotCollections:this._timeSlotCollections;return n[e]},_startSlot:function(e,t,n){var i,r=this._startCollection(e,t),o=!0;return r||(r=t[0],o=!1),i=r.slotByStartDate(e,n),i||(i=r.first(),o=!1),{slot:i,inRange:o}},_endSlot:function(e,t,n){var i,r=this._endCollection(e,t,n),o=!0;return r||(r=t[t.length-1],o=!1),i=r.slotByEndDate(e,n),i||(i=r.last(),o=!1),{slot:i,inRange:o}},getSlotCollection:function(e,t){return this[t?"getDaySlotCollection":"getTimeSlotCollection"](e)},getTimeSlotCollection:function(e){return this._timeSlotCollections[e]},getDaySlotCollection:function(e){return this._daySlotCollections[e]}}),y=I.Class.extend({init:function(t){e.extend(this,t)},innerHeight:function(){var e,t=this.collection,n=this.start.index,i=this.end.index,r=0;for(e=n;i>=e;e++)r+=t.at(e).offsetHeight;return r},events:function(){return this.collection.events()},addEvent:function(e){this.events().push(e)},startSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.end:this.start},endSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.start:this.end}}),b=y.extend({innerHeight:function(){var e,t=this.collection,n=this.start.index,i=this.end.index,r=0;for(e=n;i>=e;e++)r+=t.at(e).offsetHeight;return r},outerRect:function(e,t,n){return this._rect("offset",e,t,n)},_rect:function(e,t,n,i){var r,o,a,s,l,c,d,u,h=this.start,p=this.end,f=I.support.isRtl(h.element);return"number"!=typeof t&&(t=I.date.toUtcTime(t)),"number"!=typeof n&&(n=I.date.toUtcTime(n)),i?(r=h.offsetTop,o=p.offsetTop+p[e+"Height"],f?(a=p.offsetLeft,s=h.offsetLeft+h[e+"Width"]):(a=h.offsetLeft,s=p.offsetLeft+p[e+"Width"])):(l=t-h.start,0>l&&(l=0),c=h.end-h.start,r=h.offsetTop+h[e+"Height"]*l/c,d=p.end-n,0>d&&(d=0),u=p.end-p.start,o=p.offsetTop+p[e+"Height"]-p[e+"Height"]*d/u,f?(a=Math.round(p.offsetLeft+p[e+"Width"]*d/u),s=Math.round(h.offsetLeft+h[e+"Width"]-h[e+"Width"]*l/c)):(a=Math.round(h.offsetLeft+h[e+"Width"]*l/c),s=Math.round(p.offsetLeft+p[e+"Width"]-p[e+"Width"]*d/u))),{top:r,bottom:o,left:0===a?a:a+1,right:s}},innerRect:function(e,t,n){return this._rect("client",e,t,n)}}),k=y.extend({innerWidth:function(){var e,t=this.collection,n=this.start.index,i=this.end.index,r=0,o=n!==i?"offsetWidth":"clientWidth";for(e=n;i>=e;e++)r+=t.at(e)[o];return r}}),x=I.Class.extend({init:function(e,t,n,i){this._slots=[],this._events=[],this._start=I.date.toUtcTime(e),this._end=I.date.toUtcTime(t),this._groupIndex=n,this._collectionIndex=i},refresh:function(){for(var e=0;this._slots.length>e;e++)this._slots[e].refresh()},startInRange:function(e){return e>=this._start&&this._end>e},endInRange:function(e,t){var n=t?this._end>e:this._end>=e;return e>=this._start&&n},slotByStartDate:function(e){var t,n,i=e;for("number"!=typeof i&&(i=I.date.toUtcTime(e)),t=0;this._slots.length>t;t++)if(n=this._slots[t],n.startInRange(i))return n;return null},slotByEndDate:function(e,t){var n,i,r=e;if("number"!=typeof r&&(r=I.date.toUtcTime(e)),t)return this.slotByStartDate(e,!1);for(n=0;this._slots.length>n;n++)if(i=this._slots[n],i.endInRange(r))return i;return null},count:function(){return this._slots.length},events:function(){return this._events},addTimeSlot:function(e,t,n,i){var r=new T(e,t,n,this._groupIndex,this._collectionIndex,this._slots.length,i);this._slots.push(r)},addDaySlot:function(e,t,n,i){var r=new S(e,t,n,this._groupIndex,this._collectionIndex,this._slots.length,i);this._slots.push(r)},first:function(){return this._slots[0]},last:function(){return this._slots[this._slots.length-1]},at:function(e){return this._slots[e]}}),C=I.Class.extend({init:function(e,t,n,i,r,o){this.element=e,this.clientWidth=e.clientWidth,this.clientHeight=e.clientHeight,this.offsetWidth=e.offsetWidth,this.offsetHeight=e.offsetHeight,this.offsetTop=e.offsetTop,this.offsetLeft=e.offsetLeft,this.start=t,this.end=n,this.element=e,this.groupIndex=i,this.collectionIndex=r,this.index=o,this.isDaySlot=!1},startDate:function(){return I.timezone.toLocalDate(this.start)},endDate:function(){return I.timezone.toLocalDate(this.end)},startInRange:function(e){return e>=this.start&&this.end>e},endInRange:function(e){return e>this.start&&this.end>=e},startOffset:function(){return this.start},endOffset:function(){return this.end}}),T=C.extend({init:function(e,t,n,i,r,o,a){C.fn.init.apply(this,arguments),this.isHorizontal=a?!0:!1},refresh:function(){var e=this.element;this.clientWidth=e.clientWidth,this.clientHeight=e.clientHeight,this.offsetWidth=e.offsetWidth,this.offsetHeight=e.offsetHeight,this.offsetTop=e.offsetTop,this.offsetLeft=e.offsetLeft},offsetX:function(e,t){return e?this.offsetLeft+t:this.offsetLeft+t},startInRange:function(e){return e>=this.start&&this.end>e},endInRange:function(e){return e>this.start&&this.end>=e},startOffset:function(t,n,i){var r,o,a,s,l;if(i)return this.start;if(r=e(this.element).offset(),o=this.end-this.start,this.isHorizontal){if(l=I.support.isRtl(this.element),a=t-r.left,s=Math.floor(o*(a/this.offsetWidth)),l)return this.start+o-s}else a=n-r.top,s=Math.floor(o*(a/this.offsetHeight));return this.start+s},endOffset:function(t,n,i){var r,o,a,s,l;if(i)return this.end;if(r=e(this.element).offset(),o=this.end-this.start,this.isHorizontal){if(l=I.support.isRtl(this.element),a=t-r.left,s=Math.floor(o*(a/this.offsetWidth)),l)return this.start+o-s}else a=n-r.top,s=Math.floor(o*(a/this.offsetHeight));return this.start+s}}),S=C.extend({init:function(e,t,n,i,r,o,a){C.fn.init.apply(this,arguments),this.eventCount=a,this.isDaySlot=!0,this.element.children.length?(this.firstChildHeight=this.element.children[0].offsetHeight+3,this.firstChildTop=this.element.children[0].offsetTop):(this.firstChildHeight=3,this.firstChildTop=0)},refresh:function(){this.clientHeight=this.element.clientHeight,this.offsetTop=this.element.offsetTop},startDate:function(){var e=new Date(this.start);return I.timezone.apply(e,"Etc/UTC")
},endDate:function(){var e=new Date(this.end);return I.timezone.apply(e,"Etc/UTC")},startInRange:function(e){return e>=this.start&&this.end>e},endInRange:function(e){return e>this.start&&this.end>=e}}),I.ui.SchedulerView=M.extend({init:function(t,n){M.fn.init.call(this,t,n),this._scrollbar=c(),this._isRtl=I.support.isRtl(t),this._resizeHint=e(),this._moveHint=e(),this._cellId=I.guid(),this._resourcesForGroups(),this._selectedSlots=[]},_isMobile:function(){var e=this.options;return e.mobile===!0&&I.support.mobileOS||"phone"===e.mobile||"tablet"===e.mobile},_isMobilePhoneView:function(){var e=this.options;return e.mobile===!0&&I.support.mobileOS&&!I.support.mobileOS.tablet||"phone"===e.mobile},_addResourceView:function(){var e=new w(this.groups.length);return this.groups.push(e),e},dateForTitle:function(){return I.format(this.options.selectedDateFormat,this.startDate(),this.endDate())},_changeGroup:function(e,t){var n=t?"prevGroupSlot":"nextGroupSlot",i=this[n](e.start,e.groupIndex,e.isAllDay);return i&&(e.groupIndex+=t?-1:1),i},_changeGroupContinuously:function(){return null},_changeViewPeriod:function(){return!1},_horizontalSlots:function(e,t,n,i){var r,o,a=i?"leftSlot":"rightSlot",s=t[0].start,l=t[t.length-1].end,c=this.groups[e.groupIndex];return n||(r=this._normalizeHorizontalSelection(e,t,i),r&&(s=l=r)),s=c[a](s),l=c[a](l),n||this._isVerticallyGrouped()||s&&l||(s=l=this._changeGroup(e,i)),s&&l||(o=this._continuousSlot(e,t,i),o=this._changeGroupContinuously(e,o,n,i),o&&(s=l=o)),{startSlot:s,endSlot:l}},_verticalSlots:function(e,t,n,i){var r,o,a=t[0].start,s=t[t.length-1].end,l=this.groups[e.groupIndex];return n||(r=this._normalizeVerticalSelection(e,t,i),r&&(a=s=r)),o=i?"upSlot":"downSlot",a=l[o](a,n),s=l[o](s,n),n||!this._isVerticallyGrouped()||a&&s||(a=s=this._changeGroup(e,i)),{startSlot:a,endSlot:s}},_normalizeHorizontalSelection:function(){return null},_normalizeVerticalSelection:function(e,t,n){var i;return i=n?t[0].start:t[t.length-1].end},_continuousSlot:function(){return null},constrainSelection:function(e){var t,n=this.groups[0];this.inRange(e)?n.daySlotCollectionCount()||(e.isAllDay=!1):(t=n.firstSlot(),e.isAllDay=t.isDaySlot,e.start=t.startDate(),e.end=t.endDate()),this.groups[e.groupIndex]||(e.groupIndex=0)},move:function(e,t,n){var i,r,o,a,s,l,c=!1,d=this.groups[e.groupIndex];if(d.timeSlotCollectionCount()||(e.isAllDay=!0),i=d.ranges(e.start,e.end,e.isAllDay,!1),t===F.DOWN||t===F.UP){if(c=!0,a=t===F.UP,this._updateDirection(e,i,n,a,!0),s=this._verticalSlots(e,i,n,a),!s.startSlot&&!n&&this._changeViewPeriod(e,a,!0))return c}else if((t===F.LEFT||t===F.RIGHT)&&(c=!0,a=t===F.LEFT,this._updateDirection(e,i,n,a,!1),s=this._horizontalSlots(e,i,n,a),!s.startSlot&&!n&&this._changeViewPeriod(e,a,!1)))return c;return c&&(r=s.startSlot,o=s.endSlot,n?(l=e.backward,l&&r?e.start=r.startDate():!l&&o&&(e.end=o.endDate())):r&&o&&(e.isAllDay=r.isDaySlot,e.start=r.startDate(),e.end=o.endDate()),e.events=[]),c},moveToEventInGroup:function(t,n,i,r){for(var o,a,s=t._continuousEvents||[],l=r?-1:1,c=s.length,d=r?c-1:0;c>d&&d>-1;){if(a=s[d],(!r&&a.start.startDate()>=n.startDate()||r&&a.start.startDate()<=n.startDate())&&(i.length&&(a=s[d+l]),a&&-1===e.inArray(a.uid,i))){o=!!a;break}d+=l}return a},moveToEvent:function(e,t){for(var n,i=e.groupIndex,r=this.groups[i],o=r.ranges(e.start,e.end,e.isAllDay,!1)[0].start,a=this.groups.length,s=t?-1:1,l=e.events;a>i&&i>-1&&(n=this.moveToEventInGroup(r,o,l,t),i+=s,r=this.groups[i],r&&!n);)l=[],o=t?r.lastSlot():r.firstSlot(!0);return n&&(e.events=[n.uid],e.start=n.start.startDate(),e.end=n.end.endDate(),e.isAllDay=n.start.isDaySlot,e.groupIndex=n.start.groupIndex),!!n},current:function(e){return void 0===e?this._current:(this._current=e,void this._scrollTo(e,this.content[0]))},select:function(e){this.clearSelection(),this._selectEvents(e)||this._selectSlots(e)},_selectSlots:function(e){var t,n,i,r,o,a,s,l=e.isAllDay,c=this.groups[e.groupIndex];for(c.timeSlotCollectionCount()||(l=!0),this._selectedSlots=[],t=c.ranges(e.start,e.end,l,!1),r=0;t.length>r;r++)for(o=t[r],a=o.collection,s=o.start.index;o.end.index>=s;s++)i=a.at(s),n=i.element,n.setAttribute("aria-selected",!0),_(n),this._selectedSlots.push({start:i.startDate(),end:i.endDate(),element:n});e.backward&&(n=t[0].start.element),this.current(n)},_selectEvents:function(t){var n,i,r=!1,o=t.events,a=this.groups[t.groupIndex]._continuousEvents||[],s=a.length;if(!o[0]||!a[0])return r;for(i=e(),t.events=[],n=0;s>n;n++)e.inArray(a[n].uid,o)>-1&&(i=i.add(a[n].element),t.events.push(a[n].uid));return i[0]&&(i.addClass("k-state-selected").attr("aria-selected",!0),this.current(i.last()[0]),this._selectedSlots=[],r=!0),r},inRange:function(e){var t=this.startDate(),n=I.date.addDays(this.endDate(),1),i=e.start,r=e.end;return i>=t&&n>i&&r>t&&n>=r},_resourceValue:function(e,t){return e.valuePrimitive&&(t=I.getter(e.dataValueField)(t)),t},_resourceBySlot:function(e){var t,n,i,r,o,a=this.groupedResources,s={};if(a.length)for(t=e.groupIndex,n=a.length-1;n>=0;n--)i=a[n],r=this._resourceValue(i,i.dataSource.view()[t%i.dataSource.total()]),i.multiple&&(r=[r]),o=I.setter(i.field),o(s,r),t=Math.floor(t/i.dataSource.total());return s},_createResizeHint:function(t,n,i,r){return e(B).css({left:t,top:n,width:i,height:r})},_removeResizeHint:function(){this._resizeHint.remove(),this._resizeHint=e()},_removeMoveHint:function(){this._moveHint.remove(),this._moveHint=e()},_scrollTo:function(e,t){var n=e.offsetTop,i=e.offsetHeight,r=t.scrollTop,o=t.clientHeight,a=n+i,s=0;s=r>n?n:a>r+o?o>=i?a-o:n:r,t.scrollTop=s},_shouldInverseResourceColor:function(e){var t=new A(e.color).isDark(),n=this.element.css("color"),i=new A(n).isDark();return t==i},_eventTmpl:function(t,n){var i,r=this.options,o=e.extend({},I.Template,r.templateSettings),a=o.paramName,s="",l=typeof t,c={storage:{},count:0};return"function"===l?(c.storage["tmpl"+c.count]=t,s+="#=this.tmpl"+c.count+"("+a+")#",c.count++):"string"===l&&(s+=t),i=I.template(I.format(n,s),o),c.count>0&&(i=e.proxy(i,c.storage)),i},eventResources:function(e){var t,n,i,r,o,a,s,l,c,d,u=[],h=this.options;if(!h.resources)return u;for(t=0;h.resources.length>t;t++)if(n=h.resources[t],i=n.field,r=I.getter(i)(e))for(n.multiple||(r=[r]),o=n.dataSource.view(),a=0;r.length>a;a++){for(s=null,l=r[a],n.valuePrimitive||(l=I.getter(n.dataValueField)(l)),c=0;o.length>c;c++)if(o[c].get(n.dataValueField)==l){s=o[c];break}null!==s&&(d=I.getter(n.dataColorField)(s),u.push({field:n.field,title:n.title,name:n.name,text:I.getter(n.dataTextField)(s),value:l,color:d}))}return u},createLayout:function(i){var r,o,a,s,l,c=-1;for(i.rows||(i.rows=[]),r=0;i.rows.length>r;r++)if(i.rows[r].allDay){c=r;break}o=i.rows[c],c>=0&&i.rows.splice(c,1),a=this.columnLevels=t(i,"columns"),s=this.rowLevels=t(i,"rows"),this.table=e("<table "+n()+' class="k-scheduler-layout k-scheduler-'+this.name+'view"/>'),l=s[s.length-1].length,this.table.append(this._topSection(a,o,l)),this.table.append(this._bottomSection(a,s,l)),this.element.append(this.table),this._scroller()},refreshLayout:function(){var t,n,i,r,o,a,s=this,l=s.element.find(">.k-scheduler-toolbar"),c=s.element.innerHeight(),d=this._scrollbar,u=0,h=this._isRtl?"left":"right";for(t=0;l.length>t;t++)c-=l.eq(t).outerHeight();s.datesHeader&&(u=s.datesHeader.outerHeight()),s.timesHeader&&s.timesHeader.outerHeight()>u&&(u=s.timesHeader.outerHeight()),s.datesHeader&&s.timesHeader&&(n=s.datesHeader.find("table:first tr"),s.timesHeader.find("tr").height(function(t){e(this).height(n.eq(t).height())})),u&&(c-=u),s.footer&&(c-=s.footer.outerHeight()),i=function(e){var t,n;return e[0].style.height?!0:(t=e.height(),e.height("auto"),n=e.height(),t!=n?(e.height(""),!0):(e.height(""),!1))},r=s.content[0],o=I.support.kineticScrollNeeded?0:d,i(s.element)&&(s.content.height(c>2*d?c:2*d+1),s.times.height(r.clientHeight),a=s.times.find("table"),a.length&&a.height(s.content.find("table")[0].clientHeight)),r.offsetWidth-r.clientWidth>0?(s.table.addClass("k-scrollbar-v"),s.datesHeader.css("padding-"+h,o-parseInt(s.datesHeader.children().css("border-"+h+"-width"),10))):s.datesHeader.css("padding-"+h,""),r.offsetHeight-r.clientHeight>0||r.clientHeight>s.content.children(".k-scheduler-table").height()?s.table.addClass("k-scrollbar-h"):s.table.removeClass("k-scrollbar-h")},_topSection:function(t,n,i){this.timesHeader=o(t.length,n,i);var r=t[t.length-1].length;return this.datesHeader=a(t,r,n),e("<tr>").append(this.timesHeader.add(this.datesHeader).wrap("<td>").parent())},_bottomSection:function(t,n,i){return this.times=s(n,i),this.content=l(t[t.length-1],n[n.length-1]),e("<tr>").append(this.times.add(this.content).wrap("<td>").parent())},_scroller:function(){var t,n=this;this.content.bind("scroll"+z,function(){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(this.scrollLeft),n.times.scrollTop(this.scrollTop)}),t=I.touchScroller(this.content,{avoidScrolling:function(t){return e(t.event.target).closest(".k-event.k-event-active").length>0}}),t&&t.movable&&(this._touchScroller=t,this.content=t.scrollElement,t.movable.bind("change",function(e){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(-e.sender.x),n.times.scrollTop(-e.sender.y)}))},_resourcesForGroups:function(){var e,t,n,i,r=[],o=this.options.group,a=this.options.resources;if(o=o&&o.resources?o.resources:[],a&&o.length)for(e=0,t=a.length;t>e;e++)for(n=0,i=o.length;i>n;n++)a[e].name===o[n]&&r.push(a[e]);this.groupedResources=r},_createColumnsLayout:function(e,t,n){return m("columns",e,t,n)},_groupOrientation:function(){var e=this.options.group;return e&&e.resources?e.orientation:"horizontal"},_isVerticallyGrouped:function(){return this.groupedResources.length&&"vertical"===this._groupOrientation()},_createRowsLayout:function(e,t,n){return m("rows",e,t,n)},selectionByElement:function(){return null},clearSelection:function(){this.content.find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},destroy:function(){var e=this;M.fn.destroy.call(this),e.table&&(I.destroy(e.table),e.table.remove()),e.groups=null,e.table=null,e.content=null,e.times=null,e.datesHeader=null,e.timesHeader=null,e.footer=null,e._resizeHint=null,e._moveHint=null},calendarInfo:function(){return I.getCulture().calendars.standard},prevGroupSlot:function(e,t,n){var i,r=this.groups[t],o=r.ranges(e,e,n,!1)[0].start;if(!(0>=t))return this._isVerticallyGrouped()?r.timeSlotCollectionCount()?(i=r._collection(n?o.index:o.collectionIndex,!1),i.last()):(i=r._collection(r.daySlotCollectionCount()-1,!0),i.at(o.index)):r.timeSlotCollectionCount()?(i=r._collection(n?0:r.timeSlotCollectionCount()-1,n),n?i.last():i.at(o.index)):(i=r._collection(o.collectionIndex,!0),i.last())},nextGroupSlot:function(e,t,n){var i,r,o=this.groups[t],a=o.ranges(e,e,n,!1)[0].start;if(!(t>=this.groups.length-1))return this._isVerticallyGrouped()?o.timeSlotCollectionCount()?(r=o.daySlotCollectionCount(),i=o._collection(r?0:a.collectionIndex,r),n?i.first():i.at(a.collectionIndex)):(i=o._collection(0,!0),i.at(a.index)):o.timeSlotCollectionCount()?(i=o._collection(0,n),n?i.first():i.at(a.index)):(i=o._collection(a.collectionIndex,!0),i.first())},_updateEventForMove:function(){},_updateEventForResize:function(){},_updateEventForSelection:function(e){return e}}),A=function(e){var t,n,i,r,o,a=this,s=A.formats;if(1===arguments.length)for(e=a.resolveColor(e),r=0;s.length>r;r++)t=s[r].re,n=s[r].process,i=t.exec(e),i&&(o=n(i),a.r=o[0],a.g=o[1],a.b=o[2]);else a.r=arguments[0],a.g=arguments[1],a.b=arguments[2];a.r=a.normalizeByte(a.r),a.g=a.normalizeByte(a.g),a.b=a.normalizeByte(a.b)},A.prototype={resolveColor:function(e){return e=e||"#000","#"==e.charAt(0)&&(e=e.substr(1,6)),e=e.replace(/ /g,""),e=e.toLowerCase(),e=A.namedColors[e]||e},normalizeByte:function(e){return 0>e||isNaN(e)?0:e>255?255:e},percBrightness:function(){var e=this;return R.sqrt(.241*e.r*e.r+.691*e.g*e.g+.068*e.b*e.b)},isDark:function(){var e=this,t=e.percBrightness();return 180>t}},A.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(e){return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],A.namedColors={aqua:"00ffff",azure:"f0ffff",beige:"f5f5dc",black:"000000",blue:"0000ff",brown:"a52a2a",coral:"ff7f50",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgray:"a9a9a9",darkgreen:"006400",darkorange:"ff8c00",darkred:"8b0000",dimgray:"696969",fuchsia:"ff00ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lightblue:"add8e6",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumblue:"0000cd",navy:"000080",olive:"808000",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",pink:"ffc0cb",plum:"dda0dd",purple:"800080",red:"ff0000",royalblue:"4169e1",salmon:"fa8072",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",steelblue:"4682b4",tan:"d2b48c",teal:"008080",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},E=/\s*k-state-selected/,e.extend(P.SchedulerView,{createColumns:p,createRows:f,rangeIndex:u,collidingEvents:d,groupEqFilter:v})}(window.kendo.jQuery),function(e,t){function n(e){var t=new Date(1980,1,1,0,0,0);return c(t,m(e)),t}function i(e,t,n){return e>=t&&n>=e}function r(e,t,n,i){return i=i?n>=e:n>e,e>t&&i}function o(e,t,n,i){var r,o=e._continuousEvents,a=o[o.length-1],l=p(t.start.startDate()).getTime();if(i&&a&&p(a.start.startDate()).getTime()==l){for(r=o.length-1;r>-1&&!(o[r].isAllDay||p(o[r].start.startDate()).getTime()<l);r--);o.splice(r+1,0,{element:n,isAllDay:!0,uid:n.attr(s.attr("uid")),start:t.start,end:t.end})}else o.push({element:n,isAllDay:i,uid:n.attr(s.attr("uid")),start:t.start,end:t.end})}function a(e){var t=[],n=e.workWeekStart;for(t.push(n);e.workWeekEnd!=n;)n>6?n-=7:n++,t.push(n);return t}var s=window.kendo,l=s.ui,c=s.date.setTime,d=l.SchedulerView,u=e.extend,h=e.proxy,p=s.date.getDate,f=s.date.MS_PER_MINUTE,g=s.date.MS_PER_DAY,m=s.date.getMilliseconds,v=".kendoMultiDayView",_=s.template('<div title="(#=kendo.format("{0:t} - {1:t}", start, end)#): #=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template k-event-time">#:kendo.format("{0:t} - {1:t}", start, end)#</div><div class="k-event-template">${title}</div></div>'),w=s.template('<div title="(#=kendo.format("{0:t}", start)#): #=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template">${title}</div></div>'),y=s.template("<span class='k-link k-nav-day'>#=kendo.toString(date, 'ddd M/dd')#</span>"),b='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color#; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#" #} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-w"></span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}## if(data.head || data.middle) {#<span class="k-icon k-i-arrow-e"></span>#}#</span>#if(resizable && !singleDay && !data.tail && !data.middle){#<span class="k-resize-handle k-resize-w"></span>#}##if(resizable && !singleDay && !data.head && !data.middle){#<span class="k-resize-handle k-resize-e"></span>#}#</div>',k='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#" #if (resources[0]) { #style="background-color:#=resources[0].color #; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#"#} else {#class="k-event"#}#><span class="k-event-actions"># if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}#</span><span class="k-event-top-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-n"></span># } #</span><span class="k-event-bottom-actions"># if(data.head || data.middle) {#<span class="k-icon k-i-arrow-s"></span># } #</span># if(resizable && !data.tail && !data.middle) {#<span class="k-resize-handle k-resize-n"></span># } ## if(resizable && !data.head && !data.middle) {#<span class="k-resize-handle k-resize-s"></span># } #</div>',x=d.extend({init:function(e,t){var n=this;d.fn.init.call(n,e,t),n.title=n.options.title||n.options.name,n._workDays=a(n.options),n._templates(),n._editable(),n.calculateDateRange(),n._groups(),n._currentTime()},_currentTimeMarkerUpdater:function(){var t,n,i,r,o,a,l,c,d,u,h=new Date,p=this.options;for(p.currentTimeMarker.useLocalTimezone===!1&&(t=p.dataSource.options.schema.timezone,p.dataSource&&t&&(n=s.timezone.offset(h,t),h=s.timezone.convert(h,h.getTimezoneOffset(),n))),this.times.find(".k-current-time").remove(),i=p.group&&"horizontal"!=p.group.orientation?this.groups.length:1,r=0;i>r;r++){if(o=this.groups[r],a=s.date.toUtcTime(h),l=o.timeSlotRanges(a,a+1),0===l.length)return;c=l[0].collection,d=c.slotByStartDate(h),d&&(u=e("<div class='k-current-time'></div>"),u.appendTo(this.times).css({top:Math.round(l[0].innerRect(h,new Date(h.getTime()+1),!1).top),height:"1px",right:"1px",left:0}))}},_currentTime:function(){var e,n=this,i=n.options.currentTimeMarker;i!==!1&&i.updateInterval!==t&&(e=i.updateInterval,n._currentTimeMarkerUpdater(),n._currentTimeUpdateTimer=setInterval(h(this._currentTimeMarkerUpdater,n),e))},_updateResizeHint:function(e,t,n,i){var r,o,a,l,c,u,h,p,f,g,m=e.isMultiDay(),v=this.groups[t],_=v.ranges(n,i,m,e.isAllDay);for(this._removeResizeHint(),r=0;_.length>r;r++)o=_[r],a=o.startSlot(),l=a.offsetWidth,c=a.clientHeight,u=a.offsetTop,m?l=o.innerWidth():(h=o.outerRect(n,i,this.options.snap),u=h.top,c=h.bottom-h.top),p=d.fn._createResizeHint.call(this,a.offsetLeft,u,l,c),this._resizeHint=this._resizeHint.add(p);f="t",g=this.content,m&&(f="M/dd",g=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),g.length||(g=this.content)),this._resizeHint.appendTo(g),this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(s.toString(s.timezone.toLocalDate(n),f)),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(s.toString(s.timezone.toLocalDate(i),f))},_updateMoveHint:function(e,t,n){var i,r,o,a,l,c,d,u=e.isMultiDay(),h=this.groups[t],p=s.date.toUtcTime(e.start)+n,f=p+e.duration(),g=h.ranges(p,f,u,e.isAllDay);for(p=s.timezone.toLocalDate(p),f=s.timezone.toLocalDate(f),this._removeMoveHint(),!u&&(0===m(f)||m(f)<m(this.startTime()))&&g.length>1&&g.pop(),i=0;g.length>i;i++)r=g[i],o=r.start,a=this._createEventElement(e.clone({start:p,end:f}),!u),a.addClass("k-event-drag-hint"),l={left:o.offsetLeft+2,top:o.offsetTop},this._isRtl&&(l.left=.1*o.clientWidth+o.offsetLeft+2),u?l.width=r.innerWidth()-4:(c=r.outerRect(p,f,this.options.snap),l.top=c.top,l.height=c.bottom-c.top,l.width=.9*o.clientWidth-4),a.css(l),this._moveHint=this._moveHint.add(a);d=this.content,u&&(d=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),d.length||(d=this.content)),this._moveHint.appendTo(d)},_slotByPosition:function(e,t){var n,i,r,o;for(this._isVerticallyGrouped()?(i=this.content.offset(),t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft):i=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day)").find(">div").offset(),i&&(e-=i.left,t-=i.top),e=Math.ceil(e),t=Math.ceil(t),o=0;this.groups.length>o;o++)if(r=this.groups[o],n=r.daySlotByPosition(e,t))return n;for(i&&(e+=i.left,t+=i.top),i=this.content.offset(),e-=i.left,t-=i.top,this._isVerticallyGrouped()||(t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft),e=Math.ceil(e),t=Math.ceil(t),o=0;this.groups.length>o;o++)if(r=this.groups[o],n=r.timeSlotByPosition(e,t))return n;return null},_groupCount:function(){var e=this.groupedResources;return e.length?"vertical"===this._groupOrientation()?this._rowCountForLevel(e.length-1):this._columnCountForLevel(e.length)/this._columnOffsetForResource(e.length):1},_columnCountInResourceView:function(){var e=this.groupedResources;return!e.length||this._isVerticallyGrouped()?this._columnCountForLevel(0):this._columnOffsetForResource(e.length)},_timeSlotGroups:function(e,t){var n,i,r,o,a,s,l,c,d,u,h,p,f,g,v,_,w=this._timeSlotInterval(),y=this.content.find("tr:not(.k-scheduler-header-all-day)");for(y.attr("role","row"),n=y.length,this._isVerticallyGrouped()&&(n=Math.floor(n/e)),i=0;e>i;i++)for(r=0,this._isVerticallyGrouped()&&(r=i),o=r*n,s=0,this._isVerticallyGrouped()||(s=i);(r+1)*n>o;){for(l=y[o].children,c=this.groups[i],o%n===0&&(a=m(new Date(+this.startTime()))),d=s*t;(s+1)*t>d;d++)u=l[d],h=d%t,p=c.getTimeSlotCollection(h),f=this._dates[h],g=Date.UTC(f.getFullYear(),f.getMonth(),f.getDate()),v=g+a,_=v+w,u.setAttribute("role","gridcell"),u.setAttribute("aria-selected",!1),p.addTimeSlot(u,v,_);a+=w,o++}},_daySlotGroups:function(e,t){var n,i,r,o,a,l,c,d,u,h,p,f;for(n=this.element.find(this._isVerticallyGrouped()?".k-scheduler-header-all-day":".k-scheduler-header-all-day tr"),n.attr("role","row"),i=0;e>i;i++)for(r=0,this._isVerticallyGrouped()&&(r=i),o=this.groups[i],a=o.getDaySlotCollection(0),l=n[r].children,c=0,this._isVerticallyGrouped()||(c=i),d=0,u=c*t;(c+1)*t>u;u++)h=l[u],u%t===0&&(d=0),p=this._dates[d],f=Date.UTC(p.getFullYear(),p.getMonth(),p.getDate()),d++,h.setAttribute("role","gridcell"),h.setAttribute("aria-selected",!1),a.addDaySlot(h,f,f+s.date.MS_PER_DAY)},_groups:function(){var e,t,n,i=this._groupCount(),r=this._columnCountInResourceView();for(this.groups=[],e=0;i>e;e++){for(t=this._addResourceView(e),n=0;r>n;n++)t.addTimeSlotCollection(this._dates[n],s.date.addDays(this._dates[n],1));this.options.allDaySlot&&t.addDaySlotCollection(this._dates[0],s.date.addDays(this._dates[this._dates.length-1],1))}this._timeSlotGroups(i,r),this.options.allDaySlot&&this._daySlotGroups(i,r)},options:{name:"MultiDayView",selectedDateFormat:"{0:D}",allDaySlot:!0,showWorkHours:!1,title:"",startTime:s.date.today(),endTime:s.date.today(),minorTickCount:2,majorTick:60,majorTimeHeaderTemplate:"#=kendo.toString(date, 't')#",minorTimeHeaderTemplate:"&nbsp;",groupHeaderTemplate:"#=text#",slotTemplate:"&nbsp;",allDaySlotTemplate:"&nbsp;",eventTemplate:_,allDayEventTemplate:w,dateHeaderTemplate:y,editable:!0,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,footer:{command:"workDay"},messages:{allDay:"all day",showFullDay:"Show full day",showWorkDay:"Show business hours"},currentTimeMarker:{updateInterval:1e4,useLocalTimezone:!0}},events:["remove","add","edit"],_templates:function(){var e=this.options,t=u({},s.Template,e.templateSettings);this.eventTemplate=this._eventTmpl(e.eventTemplate,k),this.allDayEventTemplate=this._eventTmpl(e.allDayEventTemplate,b),this.majorTimeHeaderTemplate=s.template(e.majorTimeHeaderTemplate,t),this.minorTimeHeaderTemplate=s.template(e.minorTimeHeaderTemplate,t),this.dateHeaderTemplate=s.template(e.dateHeaderTemplate,t),this.slotTemplate=s.template(e.slotTemplate,t),this.allDaySlotTemplate=s.template(e.allDaySlotTemplate,t),this.groupHeaderTemplate=s.template(e.groupHeaderTemplate,t)},_editable:function(){this.options.editable&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+v,".k-event a:has(.k-si-close)",function(n){t.trigger("remove",{uid:e(this).closest(".k-event").attr(s.attr("uid"))}),n.preventDefault()}),t.options.editable.create!==!1&&t.element.on("dblclick"+v,".k-scheduler-content td",function(n){var i,r;e(this).parent().hasClass("k-scheduler-header-all-day")||(i=t._slotByPosition(n.pageX,n.pageY),i&&(r=t._resourceBySlot(i),t.trigger("add",{eventInfo:u({start:i.startDate(),end:i.endDate()},r)})),n.preventDefault())}).on("dblclick"+v,".k-scheduler-header-all-day td",function(e){var n,i=t._slotByPosition(e.pageX,e.pageY);i&&(n=t._resourceBySlot(i),t.trigger("add",{eventInfo:u({},{isAllDay:!0,start:s.date.getDate(i.startDate()),end:s.date.getDate(i.startDate())},n)})),e.preventDefault()}),t.options.editable.update!==!1&&t.element.on("dblclick"+v,".k-event",function(n){t.trigger("edit",{uid:e(this).closest(".k-event").attr(s.attr("uid"))}),n.preventDefault()})},_touchEditable:function(){var t=this;t.options.editable.create!==!1&&(t._addUserEvents=new s.UserEvents(t.element,{filter:".k-scheduler-content td",tap:function(n){var i,r;e(n.target).parent().hasClass("k-scheduler-header-all-day")||(i=t._slotByPosition(n.x.location,n.y.location),i&&(r=t._resourceBySlot(i),t.trigger("add",{eventInfo:u({start:i.startDate(),end:i.endDate()},r)})),n.preventDefault())}}),t._allDayUserEvents=new s.UserEvents(t.element,{filter:".k-scheduler-header-all-day td",tap:function(e){var n,i=t._slotByPosition(e.x.location,e.y.location);i&&(n=t._resourceBySlot(i),t.trigger("add",{eventInfo:u({},{isAllDay:!0,start:s.date.getDate(i.startDate()),end:s.date.getDate(i.startDate())},n)})),e.preventDefault()}})),t.options.editable.update!==!1&&(t._editUserEvents=new s.UserEvents(t.element,{filter:".k-event",tap:function(n){var i=e(n.target).closest(".k-event");i.hasClass("k-event-active")||t.trigger("edit",{uid:i.attr(s.attr("uid"))}),n.preventDefault()}}))},_layout:function(e){var t,n,i,r=[],o=[],a=this.options,l=this;for(t=0;e.length>t;t++)n={},n.text=l.dateHeaderTemplate({date:e[t]}),s.date.isToday(e[t])&&(n.className="k-today"),r.push(n);return i=this.groupedResources,a.allDaySlot&&o.push({text:a.messages.allDay,allDay:!0,cellContent:function(t){var n=t;return t=i.length&&"vertical"!==l._groupOrientation()?t%e.length:t,l.allDaySlotTemplate({date:e[t],resources:function(){return l._resourceBySlot({groupIndex:n})}})}}),this._forTimeRange(this.startTime(),this.endTime(),function(e,t,n,i){var r=t?l.majorTimeHeaderTemplate:l.minorTimeHeaderTemplate,a={text:r({date:e}),className:i?"k-slot-cell":""};o.push(a)}),i.length&&("vertical"===this._groupOrientation()?o=this._createRowsLayout(i,o,this.groupHeaderTemplate):r=this._createColumnsLayout(i,r,this.groupHeaderTemplate)),{columns:r,rows:o}},_footer:function(){var t,n,i,r=this.options;r.footer!==!1&&(t='<div class="k-header k-scheduler-footer">',n=r.footer.command,n&&"workDay"===n?(t+='<ul class="k-reset k-header">',t+='<li class="k-state-default k-scheduler-fullday"><a href="#" class="k-link"><span class="k-icon k-i-clock"></span>',t+=(r.showWorkHours?r.messages.showFullDay:r.messages.showWorkDay)+"</a></li>",t+="</ul>"):t+="&nbsp;",t+="</div>",this.footer=e(t).appendTo(this.element),i=this,this.footer.on("click"+v,".k-scheduler-fullday",function(e){e.preventDefault(),i.trigger("navigate",{view:i.name||r.name,date:i.startDate(),isWorkDay:!r.showWorkHours})}))},_forTimeRange:function(e,t,i,r){var o,a,s,l,d,u,h,p,v,_,w,y,b,k,x,C;for(e=n(e),t=n(t),o=this,a=m(e),s=m(t),l=o.options.minorTickCount,d=o.options.majorTick*f,u=d/l||1,h=new Date(+e),p=h.getDate(),_=0,y="",w=g/u,a!=s&&(a>s&&(s+=g),w=(s-a)/u),w=Math.round(w);w>_;_++)b=_%(d/u),k=0===b,x=l-1>b,C=b===l-1,y+=i(h,k,x,C),c(h,u,!1);return s&&(v=m(h),p<h.getDate()&&(v+=g),v>s&&(h=new Date(+t))),r&&(y+=r(h)),y},_content:function(e){var t,n,i,r=this,o=r.options,a=r.startTime(),l=this.endTime(),c=1,d=1,u=e.length,h="",p=this.groupedResources,f=this.slotTemplate,g=this.allDaySlotTemplate,m=!1;for(p.length&&(m="vertical"===r._groupOrientation(),m?(d=this._rowCountForLevel(this.rowLevels.length-2),o.allDaySlot&&(t=function(t){var n,i,o='<tr class="k-scheduler-header-all-day">',a=function(){return r._resourceBySlot({groupIndex:t})};for(n=0,i=e.length;i>n;n++)o+="<td>"+g({date:e[n],resources:a})+"</td>";return o+"</tr>"})):c=this._columnCountForLevel(this.columnLevels.length-2)),h+="<tbody>",n=function(t,n){var o,a,l,d,h="",p="",g=0;for(h="<tr"+(n?' class="k-middle-row"':"")+">",d=function(e){return function(){return r._resourceBySlot({groupIndex:e})}};c>g;g++)for(o=0,a=u;a>o;o++)p="",s.date.isToday(e[o])&&(p+="k-today"),(s.date.getMilliseconds(t)<s.date.getMilliseconds(r.options.workDayStart)||s.date.getMilliseconds(t)>=s.date.getMilliseconds(r.options.workDayEnd)||!r._isWorkDay(e[o]))&&(p+=" k-nonwork-hour"),h+="<td"+(""!==p?' class="'+p+'"':"")+">",l=s.date.getDate(e[o]),s.date.setTime(l,s.date.getMilliseconds(t)),h+=f({date:l,resources:d(m?i:g)}),h+="</td>";return h+="</tr>"},i=0;d>i;i++)h+=t?t(i):"",h+=this._forTimeRange(a,l,n);h+="</tbody>",this.content.find("table").append(h)},_isWorkDay:function(e){var t,n=e.getDay(),i=this._workDays;for(t=0;i.length>t;t++)if(i[t]===n)return!0;return!1},_render:function(t){var n,i=this;t=t||[],this._dates=t,this._startDate=t[0],this._endDate=t[t.length-1||0],this.createLayout(this._layout(t)),this._content(t),this._footer(),this.refreshLayout(),n=this.element.find(".k-scheduler-header-all-day td"),n.length&&(this._allDayHeaderHeight=n.first()[0].clientHeight),i.datesHeader.on("click"+v,".k-nav-day",function(t){var n=e(t.currentTarget).closest("th"),r=n.offset(),o=i._slotByPosition(r.left,r.top+n.outerHeight());i.trigger("navigate",{view:"day",date:o.startDate()})})},startTime:function(){var e=this.options;return e.showWorkHours?e.workDayStart:e.startTime},endTime:function(){var e=this.options;return e.showWorkHours?e.workDayEnd:e.endTime},startDate:function(){return this._startDate},endDate:function(){return this._endDate},_end:function(e){var t=m(this.endTime())||g;return e&&(t=0),new Date(this._endDate.getTime()+t)},nextDate:function(){return s.date.nextDay(this.endDate())},previousDate:function(){return s.date.previousDay(this.startDate())},calculateDateRange:function(){this._render([this.options.date])},destroy:function(){var e=this;e._currentTimeUpdateTimer&&clearInterval(e._currentTimeUpdateTimer),e.datesHeader&&e.datesHeader.off(v),e.element&&e.element.off(v),e.footer&&e.footer.remove(),d.fn.destroy.call(this),this._isMobile()&&e.options.editable&&(e.options.editable.create!==!1&&(e._addUserEvents.destroy(),e._allDayUserEvents.destroy()),e.options.editable.update!==!1&&e._editUserEvents.destroy())},inRange:function(e){var t=d.fn.inRange.call(this,e),n=m(this.startTime()),i=m(this.endTime())||s.date.MS_PER_DAY,r=m(e.start),o=m(e.end)||s.date.MS_PER_DAY;return t&&r>=n&&i>=o},selectionByElement:function(e){var t=e.offset();return this._slotByPosition(t.left,t.top)},_timeSlotInterval:function(){var e=this.options;return e.majorTick/e.minorTickCount*f},_timeSlotIndex:function(e){var t=this.options,n=m(e),i=m(this.startTime()),r=t.majorTick/t.minorTickCount*f;return(n-i)/r},_slotIndex:function(e,t){return t?this._dateSlotIndex(e):this._timeSlotIndex(e)},_dateSlotIndex:function(e,t){var n,r,o,a,l=this._dates||[],c=1;for(n=0,r=l.length;r>n;n++)if(o=s.date.getDate(l[n]),a=new Date(s.date.getDate(l[n]).getTime()+g-(t?0:1)),i(e,o,a))return n*c;return-1},_positionAllDayEvent:function(t,n){var i,r,o,a,s,l,c,u=n.innerWidth(),h=n.start.index,p=n.end.index,f=d.collidingEvents(n.events(),h,p),g=this._headerColumnCount||0,m=2,v=h!==p?5:4,_=this._allDayHeaderHeight,w=n.startSlot();for(t.css({left:w.offsetLeft+m,width:u-v}),n.addEvent({slotIndex:h,start:h,end:p,element:t}),f.push({slotIndex:h,start:h,end:p,element:t}),i=d.createRows(f),i.length&&i.length>g&&(this._headerColumnCount=i.length),r=n.start.offsetTop,o=0,a=i.length;a>o;o++)for(s=i[o].events,l=0,c=s.length;c>l;l++)e(s[l].element).css({top:r+o*_})
},_arrangeColumns:function(e,t,n,i){var r,o,a,s,l,c,u,h,p,f,g,m=i.start;for(e={element:e,slotIndex:m.index,start:t,end:t+n},o=m.clientWidth,a=.1*o,l=i.events(),c=d.collidingEvents(l,e.start,e.end),i.addEvent(e),c.push(e),r=d.createColumns(c),u=(o-a)/r.length,h=0,p=r.length;p>h;h++)for(s=r[h].events,f=0,g=s.length;g>f;f++)s[f].element[0].style.width=u-4+"px",s[f].element[0].style.left=(this._isRtl?a:0)+m.offsetLeft+h*u+2+"px"},_positionEvent:function(e,t,n){var i=e._startTime||e.start,r=e._endTime||e.end,o=n.innerRect(i,r,!1),a=o.bottom-o.top-2;0>a&&(a=0),t.css({top:o.top,height:a}),this._arrangeColumns(t,o.top,t[0].clientHeight,n)},_createEventElement:function(t,n,r,o){var a,l,c,d,h,f,v=n?this.eventTemplate:this.allDayEventTemplate,_=this.options,w=_.editable,y=this._isMobile(),b=w&&w.destroy!==!1&&!y,k=w&&w.resize!==!1,x=p(this.startDate()),C=p(this.endDate()),T=m(this.startTime()),S=m(this.endTime()),D=t._time("start"),A=t._time("end");return T>=S&&(S=m(new Date(this.endTime().getTime()+g-1))),n||t.isAllDay||(C=new Date(C.getTime()+g)),l=t.start,c=t.end,t.isAllDay&&(c=p(t.end)),!i(p(l),x,C)&&!i(c,x,C)||n&&T>D&&A>S?a=!0:p(l)<x||n&&T>D?o=!0:(c>C&&!n||n&&A>S)&&(r=!0),d=this.eventResources(t),t._startTime&&(l=new Date(D),l=s.timezone.apply(l,"Etc/UTC")),t.endTime&&(c=new Date(A),c=s.timezone.apply(c,"Etc/UTC")),h=u({},{ns:s.ns,resizable:k,showDelete:b,middle:a,head:r,tail:o,singleDay:1==this._dates.length,resources:d,inverseColor:d&&d[0]?this._shouldInverseResourceColor(d[0]):!1},t,{start:l,end:c}),f=e(v(h)),this.angular("compile",function(){return{elements:f,data:[{dataItem:h}]}}),f},_isInTimeSlot:function(e){var t,n=this.startTime(),i=this.endTime(),o=e._startTime||e.start,a=e._endTime||e.end;return m(i)===m(s.date.getDate(i))&&(i=s.date.getDate(i),c(i,g-1)),e._date("end")>e._date("start")&&(a=+e._date("end")+(g-1)),a-=e._date("end"),o-=e._date("start"),i=m(i),n=m(n),n===o&&o===a?!0:(t=o!==i,r(o,n,i,t)||r(a,n,i,t)||r(n,o,a)||r(i,o,a))},_isInDateSlot:function(e){var t=this.groups[0],n=t.firstSlot().start,r=t.lastSlot().end-1,o=s.date.toUtcTime(e.start),a=s.date.toUtcTime(e.end);return(i(o,n,r)||i(a,n,r)||i(n,o,a)||i(r,o,a))&&(!i(a,n,n)||i(a,o,o)||e.isAllDay)},_updateAllDayHeaderHeight:function(e){var t,n;if(this._height!==e&&(this._height=e,t=this.element.find(".k-scheduler-header-all-day td"),t.length))for(t.parent().add(this.element.find(".k-scheduler-times-all-day").parent()).height(e),n=0;this.groups.length>n;n++)this.groups[n].refresh()},_renderEvents:function(e,t){var n,i,r,a,s,l,c,d,u,h,p,f,m,v,_,w=this.datesHeader.find(".k-scheduler-header-wrap > div");for(i=0,r=e.length;r>i;i++)if(n=e[i],this._isInDateSlot(n))if(a=n.isAllDay||n.end.getTime()-n.start.getTime()>=g,s=a&&!this._isVerticallyGrouped()?w:this.content,a)this.options.allDaySlot&&(d=this.groups[t],d._continuousEvents||(d._continuousEvents=[]),c=d.slotRanges(n),c.length&&(l=this._createEventElement(n,!a),this._positionAllDayEvent(l,c[0]),o(d,c[0],l,!0),l.appendTo(s)));else if(this._isInTimeSlot(n))for(d=this.groups[t],d._continuousEvents||(d._continuousEvents=[]),c=d.slotRanges(n),u=c.length,h=0;u>h;h++)p=c[h],f=n.start,m=n.end,u>1&&(0===h?m=p.end.endDate():h==u-1?f=p.start.startDate():(f=p.start.startDate(),m=p.end.endDate())),v=n.clone({start:f,end:m,_startTime:n._startTime,_endTime:n.endTime}),this._isInTimeSlot(v)&&(_=p.head,l=this._createEventElement(n,!a,_,p.tail),l.appendTo(s),this._positionEvent(v,l,p),o(d,p,l,!1))},render:function(t){var n,r,o,a,l;for(this._headerColumnCount=0,this._groups(),this.element.find(".k-event").remove(),t=new s.data.Query(t).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray(),n=[],this._eventsByResource(t,this.groupedResources,n),r=this,o=e.map(this._dates,function(t){return Math.max.apply(null,e.map(n,function(n){return e.grep(n,function(e){return e.isMultiDay()&&i(t,p(e.start),p(e.end))}).length}))}),a=Math.max.apply(null,o),this._updateAllDayHeaderHeight((a+1)*this._allDayHeaderHeight),l=0;n.length>l;l++)this._renderEvents(n[l],l);this.refreshLayout(),this.trigger("activate")},_eventsByResource:function(e,t,n){var i,r,o,a,l=t[0];if(l)for(i=l.dataSource.view(),r=0;i.length>r;r++)o=this._resourceValue(l,i[r]),a=new s.data.Query(e).filter({field:l.field,operator:d.groupEqFilter(o)}).toArray(),t.length>1?this._eventsByResource(a,t.slice(1),n):n.push(a);else n.push(e)},_columnOffsetForResource:function(e){return this._columnCountForLevel(e)/this._columnCountForLevel(e-1)},_columnCountForLevel:function(e){var t=this.columnLevels[e];return t?t.length:0},_rowCountForLevel:function(e){var t=this.rowLevels[e];return t?t.length:0},clearSelection:function(){this.content.add(this.datesHeader).find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},_updateDirection:function(e,t,n,i,r){var o=e.isAllDay,a=t[0].start,s=t[t.length-1].end;n&&(r?o||a.index!==s.index||a.collectionIndex!==s.collectionIndex||(e.backward=i):(o&&a.index===s.index||!o&&a.collectionIndex===s.collectionIndex)&&(e.backward=i))},_changeViewPeriod:function(e,n,i){var r,o,a,s;return i?t:(r=n?this.previousDate():this.nextDate(),o=e.start,a=e.end,e.start=new Date(r),e.end=new Date(r),s=e.isAllDay?g:m(a),c(e.start,m(o)),c(e.end,s),this._isVerticallyGrouped()||(e.groupIndex=n?this.groups.length-1:0),e.events=[],!0)}});u(!0,l,{MultiDayView:x,DayView:x.extend({options:{name:"DayView",title:"Day"},name:"day"}),WeekView:x.extend({options:{name:"WeekView",title:"Week",selectedDateFormat:"{0:D} - {1:D}"},name:"week",calculateDateRange:function(){var e,t,n=this.options.date,i=s.date.dayOfWeek(n,this.calendarInfo().firstDay,-1),r=[];for(e=0,t=7;t>e;e++)r.push(i),i=s.date.nextDay(i);this._render(r)}}),WorkWeekView:x.extend({options:{name:"WorkWeekView",title:"Work Week",selectedDateFormat:"{0:D} - {1:D}"},name:"workWeek",nextDate:function(){return s.date.dayOfWeek(s.date.nextDay(this.endDate()),this.options.workWeekStart,1)},previousDate:function(){return s.date.previousDay(this.startDate())},calculateDateRange:function(){for(var e=this.options.date,t=s.date.dayOfWeek(e,this.options.workWeekStart,-1),n=s.date.dayOfWeek(t,this.options.workWeekEnd,1),i=[];n>=t;)i.push(t),t=s.date.nextDay(t);this._render(i)}})})}(window.kendo.jQuery),function(e){function t(e){var t,n,i=0;for(t=0,n=e.length;n>t;t++)i+=e[t].items.length;return i}function n(e,t){return e.valuePrimitive&&(t=o.getter(e.dataValueField)(t)),t}function i(e){for(var t,n=0,i=e.length,o=[];i>n;n++)t=e[n],t.groups?(t=r(t.groups),o=o.concat(t)):o=o.concat(r(t.items));return o}function r(e){for(var t=[].concat(e),n=t.shift(),i=[],r=[].push;n;)n.groups?r.apply(t,n.groups):n.items?r.apply(t,n.items):r.call(i,n),n=t.shift();return i}var o=window.kendo,a=o.ui,s=".kendoAgendaView",l='<div class="k-task" title="#:title.replace(/"/g,"\'")#" data-#=kendo.ns#uid="#=uid#"># if (resources[0]) {#<span class="k-scheduler-mark" style="background-color:#=resources[0].color#"></span># } ## if (data.isException()) { #<span class="k-icon k-i-exception"></span># } else if (data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #{0}#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}#</div>';a.AgendaView=a.SchedulerView.extend({init:function(t,n){a.SchedulerView.fn.init.call(this,t,n),n=this.options,n.editable&&(n.editable=e.extend({"delete":!0},n.editable,{create:!1,update:!1})),this.title=n.title,this.name="agenda",this._eventTemplate=this._eventTmpl(n.eventTemplate,l),this._dateTemplate=o.template(n.eventDateTemplate),this._groupTemplate=o.template(n.eventGroupTemplate),this._timeTemplate=o.template(n.eventTimeTemplate),this.element.on("mouseenter"+s,".k-scheduler-agenda .k-scheduler-content tr","_mouseenter").on("mouseleave"+s,".k-scheduler-agenda .k-scheduler-content tr","_mouseleave").on("click"+s,".k-scheduler-agenda .k-scheduler-content .k-link:has(.k-si-close)","_remove"),this._renderLayout(n.date)},_mouseenter:function(t){e(t.currentTarget).addClass("k-state-hover")},_mouseleave:function(t){e(t.currentTarget).removeClass("k-state-hover")},_remove:function(t){t.preventDefault(),this.trigger("remove",{uid:e(t.currentTarget).closest(".k-task").attr(o.attr("uid"))})},nextDate:function(){return o.date.nextDay(this.startDate())},startDate:function(){return this._startDate},endDate:function(){return this._endDate},previousDate:function(){return o.date.previousDay(this.startDate())},_renderLayout:function(e){this._startDate=e,this._endDate=o.date.addDays(e,7),this.createLayout(this._layout()),this.table.addClass("k-scheduler-agenda")},_layout:function(){var e,t,n,i=[{text:this.options.messages.time,className:"k-scheduler-timecolumn"},{text:this.options.messages.event}];if(this._isMobilePhoneView()||i.splice(0,0,{text:this.options.messages.date,className:"k-scheduler-datecolumn"}),e=this.groupedResources,e.length){for(t=[],n=0;e.length>n;n++)t.push({text:"",className:"k-scheduler-groupcolumn"});i=t.concat(i)}return{columns:i}},_tasks:function(e){var t,n,i,r,a,s,l,c=[];for(t=0;e.length>t;t++)if(n=e[t],i=n.start,r=n.end,a=(o.date.getDate(r)-o.date.getDate(i))/o.date.MS_PER_DAY+1,s=n.clone(),s.startDate=o.date.getDate(i),s.startDate>=this.startDate()&&c.push(s),a>1)for(s.end=o.date.nextDay(i),s.head=!0,l=1;a>l;l++)i=s.end,s=n.clone(),s.start=i,s.startDate=o.date.getDate(i),s.end=o.date.nextDay(i),l==a-1?(s.end=new Date(s.start.getFullYear(),s.start.getMonth(),s.start.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),s.tail=!0):(s.isAllDay=!0,s.middle=!0),s.end<=this.endDate()&&s.start>=this.startDate()&&c.push(s);return new o.data.Query(c).sort([{field:"start",dir:"asc"},{field:"end",dir:"asc"}]).groupBy({field:"startDate"}).toArray()},_renderTaskGroups:function(e,t){var n,i,r,a,s,l,c,d,u,h=[],p=this.options.editable,f=p&&p.destroy!==!1&&!this._isMobile(),g=this._isMobilePhoneView();for(n=0;e.length>n;n++)for(i=e[n].value,r=e[n].items,a=o.date.isToday(i),s=0;r.length>s;s++){if(l=r[s],c=[],d=g?[]:c,0===n&&0===s&&t.length)for(u=0;t.length>u;u++)d.push(o.format('<td class="k-scheduler-groupcolumn{2}" rowspan="{0}">{1}</td>',t[u].rowSpan,this._groupTemplate({value:t[u].text}),t[u].className));0===s&&(g?(d.push(o.format('<td class="k-scheduler-datecolumn" colspan="2">{0}</td>',this._dateTemplate({date:i}))),h.push('<tr role="row" aria-selected="false"'+(a?' class="k-today">':">")+d.join("")+"</tr>")):c.push(o.format('<td class="k-scheduler-datecolumn{3}{2}" rowspan="{0}">{1}</td>',r.length,this._dateTemplate({date:i}),n!=e.length-1||t.length?"":" k-last",t.length?"":" k-first"))),l.format=l.head?"{0:t}":l.tail?"{1:t}":"{0:t}-{1:t}",l.resources=this.eventResources(l),c.push(o.format('<td class="k-scheduler-timecolumn"><div>{0}{1}{2}</div></td><td>{3}</td>',l.tail||l.middle?'<span class="k-icon k-i-arrow-w"></span>':"",this._timeTemplate(l.clone({start:l._startTime||l.start,end:l.endTime||l.end})),l.head||l.middle?'<span class="k-icon k-i-arrow-e"></span>':"",this._eventTemplate(l.clone({showDelete:f})))),h.push('<tr role="row" aria-selected="false"'+(a?' class="k-today">':">")+c.join("")+"</tr>")}return h.join("")},render:function(e){var t,n,r=this.content.find("table").empty(),o=[];e.length>0&&(t=this.groupedResources,t.length?(o=this._createGroupConfiguration(e,t,null),this._renderGroups(o,r,[])):(o=this._tasks(e),r.append(this._renderTaskGroups(o,[])))),n=this._eventsList=i(o),this._angularItems(r,n),this.refreshLayout(),this.trigger("activate")},_angularItems:function(e,t){this.angular("compile",function(){var n=[],i=t.map(function(t){return n.push({dataItem:t}),e.find(".k-task["+o.attr("uid")+"="+t.uid+"]")});return{elements:i,data:n}})},_renderGroups:function(e,t,n){var i,r,o;for(i=0,r=e.length;r>i;i++)o=n.splice(0),o.push(e[i]),e[i].groups?this._renderGroups(e[i].groups,t,o):t.append(this._renderTaskGroups(e[i].items,o))},_createGroupConfiguration:function(e,i,r){var s,l,c,d,u,h,p,f=i[0],g=[],m=f.dataSource.view(),v=this._isMobilePhoneView();for(s=0;m.length>s;s++)l=n(f,m[s]),c=new o.data.Query(e).filter({field:f.field,operator:a.SchedulerView.groupEqFilter(l)}).toArray(),c.length&&(d=this._tasks(c),u=r?"":" k-first",s===m.length-1&&(!r||r.className.indexOf("k-last")>-1)&&(u+=" k-last"),h={text:o.getter(f.dataTextField)(m[s]),value:l,rowSpan:0,className:u},i.length>1?(h.groups=this._createGroupConfiguration(c,i.slice(1),h),r&&(r.rowSpan+=h.rowSpan)):(h.items=d,p=t(h.items),v&&(p+=h.items.length),h.rowSpan=p,r&&(r.rowSpan+=p)),g.push(h));return g},selectionByElement:function(t){var n,i,r;return t=e(t),t.hasClass("k-scheduler-datecolumn")?void 0:(this._isMobile()?(r=t.parent(),n=r.parent().children().filter(function(){return e(this).children(":not(.k-scheduler-datecolumn)").length}).index(r)):n=t.parent().index(),i=this._eventsList[n],{index:n,start:i.start,end:i.end,isAllDay:i.isAllDay,uid:i.uid})},select:function(e){this.clearSelection();var t=this.table.find(".k-task").eq(e.index).closest("tr").addClass("k-state-selected").attr("aria-selected",!0)[0];this.current(t)},move:function(e,t){var n,i=!1,r=e.index;return t==o.keys.UP?(r--,i=!0):t==o.keys.DOWN&&(r++,i=!0),i&&(n=this._eventsList[r],n&&(e.start=n.start,e.end=n.end,e.isAllDay=n.isAllDay,e.events=[n.uid],e.index=r)),i},moveToEvent:function(){return!1},constrainSelection:function(e){var t=this._eventsList[0];t&&(e.start=t.start,e.end=t.end,e.isAllDay=t.isAllDay,e.events=[t.uid],e.index=0)},isInRange:function(){return!0},destroy:function(){this.element&&this.element.off(s),a.SchedulerView.fn.destroy.call(this)},options:{title:"Agenda",name:"agenda",editable:!0,selectedDateFormat:"{0:D}-{1:D}",eventTemplate:"#:title#",eventTimeTemplate:"#if(data.isAllDay) {##=this.options.messages.allDay##} else { ##=kendo.format(format, start, end)## } #",eventDateTemplate:'<strong class="k-scheduler-agendaday">#=kendo.toString(date, "dd")#</strong><em class="k-scheduler-agendaweek">#=kendo.toString(date,"dddd")#</em><span class="k-scheduler-agendadate">#=kendo.toString(date, "y")#</span>',eventGroupTemplate:'<strong class="k-scheduler-adgendagroup">#=value#</strong>',messages:{event:"Event",date:"Date",time:"Time",allDay:"all day"}}})}(window.kendo.jQuery),function(e){function t(e,t){return e.slice(t).concat(e.slice(0,t))}function n(e,t){for(var n=t.firstDay,i=new Date(e.getFullYear(),e.getMonth(),0,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());i.getDay()!=n;)r.date.setTime(i,-1*d);return i}function i(e,t,n){var i,r=t,o=n;return i=e,i>=r&&o>=i}var r=window.kendo,o=r.ui,a=o.SchedulerView,s=".kendoMonthView",l=e.extend,c=r.date.getDate,d=r.date.MS_PER_DAY,u=6,h=7,p=r.template('<span class="k-link k-nav-day">#:kendo.toString(date, "dd")#</span>'),f='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color #; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#"#} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-w"></span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span>#}#</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}## if(data.head || data.middle) {#<span class="k-icon k-i-arrow-e"></span>#}#</span># if(resizable && !data.tail && !data.middle) {#<span class="k-resize-handle k-resize-w"></span>#}## if(resizable && !data.head && !data.middle) {#<span class="k-resize-handle k-resize-e"></span>#}#</div>',g=r.template('<div title="#=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template">#:title#</div></div>'),m=r.template('<div style="width:#=width#px;left:#=left#px;top:#=top#px" class="k-more-events k-button"><span>...</span></div>');o.MonthView=a.extend({init:function(e,t){var n=this;a.fn.init.call(n,e,t),n.title=n.options.title,n.name="month",n._templates(),n._editable(),n._renderLayout(n.options.date),n._groups()},_updateDirection:function(e,t,n,i,r){var o,a,s,l,c;n&&(o=t[0].start,a=t[t.length-1].end,s=o.index===a.index,l=o.collectionIndex===a.collectionIndex,c=r?s&&l||l:s&&l,c&&(e.backward=i))},_changeViewPeriod:function(e,t,n){var i=n?7:1;return t&&(i*=-1),e.start=r.date.addDays(e.start,i),e.end=r.date.addDays(e.end,i),(!n||n&&this._isVerticallyGrouped())&&(e.groupIndex=t?this.groups.length-1:0),e.events=[],!0},_continuousSlot:function(e,t,n){var i=e.backward?0:t.length-1,r=this.groups[e.groupIndex];return r.continuousSlot(t[i].start,n)},_changeGroupContinuously:function(e,t,n,i){var r,o,a,s;return n||(r=e.groupIndex,o=this.groups.length-1,a=this._isVerticallyGrouped(),s=this.groups[r],!t&&a?(t=s[i?"lastSlot":"firstSlot"](),r+=i?-1:1):t&&!a&&(r=i?o:0),(0>r||r>o)&&(r=i?o:0,t=null),e.groupIndex=r),t},_normalizeHorizontalSelection:function(e,t,n){var i;return i=n?t[0].start:t[t.length-1].end},_normalizeVerticalSelection:function(e,t){var n;return n=e.backward?t[0].start:t[t.length-1].end},_templates:function(){var e=this.options,t=l({},r.Template,e.templateSettings);this.eventTemplate=this._eventTmpl(e.eventTemplate,f),this.dayTemplate=r.template(e.dayTemplate,t),this.groupHeaderTemplate=r.template(e.groupHeaderTemplate,t)},dateForTitle:function(){return r.format(this.options.selectedDateFormat,this._firstDayOfMonth,this._lastDayOfMonth)},nextDate:function(){return r.date.nextDay(this._lastDayOfMonth)},previousDate:function(){return r.date.previousDay(this._firstDayOfMonth)},startDate:function(){return this._startDate},endDate:function(){return this._endDate},_renderLayout:function(t){var i=this;this._firstDayOfMonth=r.date.firstDayOfMonth(t),this._lastDayOfMonth=r.date.lastDayOfMonth(t),this._startDate=n(t,this.calendarInfo()),this.createLayout(this._layout()),this._content(),this.refreshLayout(),this.content.on("click"+s,".k-nav-day,.k-more-events",function(t){var n=e(t.currentTarget).offset(),r=i._slotByPosition(n.left,n.top);t.preventDefault(),i.trigger("navigate",{view:"day",date:r.startDate()})})},_editable:function(){this.options.editable&&!this._isMobilePhoneView()&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+s,".k-scheduler-monthview .k-event a:has(.k-si-close)",function(n){t.trigger("remove",{uid:e(this).closest(".k-event").attr(r.attr("uid"))}),n.preventDefault()}),t.options.editable.create!==!1&&t.element.on("dblclick"+s,".k-scheduler-monthview .k-scheduler-content td",function(n){var i,r=e(n.currentTarget).offset(),o=t._slotByPosition(r.left,r.top);o&&(i=t._resourceBySlot(o),t.trigger("add",{eventInfo:l({isAllDay:!0,start:o.startDate(),end:o.startDate()},i)})),n.preventDefault()}),t.options.editable.update!==!1&&t.element.on("dblclick"+s,".k-scheduler-monthview .k-event",function(n){t.trigger("edit",{uid:e(this).closest(".k-event").attr(r.attr("uid"))}),n.preventDefault()})},_touchEditable:function(){var t=this;t.options.editable.create!==!1&&(t._addUserEvents=new r.UserEvents(t.element,{filter:".k-scheduler-monthview .k-scheduler-content td",tap:function(n){var i,r=e(n.target).offset(),o=t._slotByPosition(r.left,r.top);o&&(i=t._resourceBySlot(o),t.trigger("add",{eventInfo:l({isAllDay:!0,start:o.startDate(),end:o.startDate()},i)})),n.preventDefault()}})),t.options.editable.update!==!1&&(t._editUserEvents=new r.UserEvents(t.element,{filter:".k-scheduler-monthview .k-event",tap:function(n){0===e(n.event.target).closest("a:has(.k-si-close)").length&&(t.trigger("edit",{uid:e(n.target).closest(".k-event").attr(r.attr("uid"))}),n.preventDefault())}}))},selectionByElement:function(t){var n=e(t).offset();return this._slotByPosition(n.left,n.top)},_columnCountForLevel:function(e){var t=this.columnLevels[e];return t?t.length:0},_rowCountForLevel:function(e){var t=this.rowLevels[e];return t?t.length:0},_content:function(){var e,t="<tbody>",n=1,i=this.groupedResources;for(i.length&&this._isVerticallyGrouped()&&(n=this._rowCountForLevel(i.length-1)),e=0;n>e;e++)t+=this._createCalendar(e);t+="</tbody>",this.content.find("table").html(t)},_createCalendar:function(e){var t,n,i,o,a=this.startDate(),s=h*u,l=h,c=[a],d="",p=1,f=this._isVerticallyGrouped(),g=this.groupedResources;for(g.length&&(f||(p=this._columnCountForLevel(g.length-1))),this._slotIndices={},t=0,n=s/l;n>t;t++){for(d+="<tr>",c.push(a),i=t*l,o=0;p>o;o++)d+=this._createRow(a,i,l,f?e:o);a=r.date.addDays(a,l),d+="</tr>"}return this._weekStartDates=c,this._endDate=r.date.previousDay(a),d},_createRow:function(e,t,n,i){var o,a=this,s=a._firstDayOfMonth,l=a._lastDayOfMonth,d=a.dayTemplate,u="",h="",p=function(){return a._resourceBySlot({groupIndex:i})};for(o=0;n>o;o++)u="",r.date.isToday(e)&&(u+="k-today"),r.date.isInDateRange(e,s,l)||(u+=" k-other-month"),h+="<td ",""!==u&&(h+='class="'+u+'"'),h+=">",h+=d({date:e,resources:p}),h+="</td>",a._slotIndices[c(e).getTime()]=t+o,e=r.date.nextDay(e);return h},_layout:function(){var n,i,r,o=this.calendarInfo(),a=this._isMobile()?o.days.namesShort:o.days.names,s=t(a,o.firstDay),l=e.map(s,function(e){return{text:e}}),c=this.groupedResources;if(c.length)if(this._isVerticallyGrouped()){for(i=[],r=0;6>r;r++)i.push({text:"<div>&nbsp;</div>",className:"k-hidden k-slot-cell"});n=this._createRowsLayout(c,i,this.groupHeaderTemplate)}else l=this._createColumnsLayout(c,l,this.groupHeaderTemplate);return{columns:l,rows:n}},_createEventElement:function(t){var n,i=this.options,o=i.editable,a=this._isMobile();return t.showDelete=o&&o.destroy!==!1&&!a,t.resizable=o&&o.resize!==!1&&!a,t.ns=r.ns,t.resources=this.eventResources(t),t.inverseColor=t.resources&&t.resources[0]?this._shouldInverseResourceColor(t.resources[0]):!1,n=e(this.eventTemplate(t)),this.angular("compile",function(){return{elements:n,data:[{dataItem:t}]}}),n},_isInDateSlot:function(e){var t=this.groups[0],n=t.firstSlot().start,o=t.lastSlot().end-1,a=r.date.toUtcTime(e.start),s=r.date.toUtcTime(e.end);return(i(a,n,o)||i(s,n,o)||i(n,a,s)||i(o,a,s))&&(!i(s,n,n)||i(s,a,a)||e.isAllDay)},_slotIndex:function(e){return this._slotIndices[c(e).getTime()]},_positionMobileEvent:function(t,n,i){var o,s,l,c,d,u,h,p=t.start;t.start.offsetLeft>t.end.offsetLeft&&(p=t.end),o=t.start.index,s=o,l=3,c=a.collidingEvents(t.events(),o,s),c.push({element:n,start:o,end:s}),d=a.createRows(c),u=t.collection.at(o),h=u.container,h||(h=e(r.format('<div class="k-events-container" style="top:{0};left:{1};width:{2}"/>',p.offsetTop+p.firstChildTop+p.firstChildHeight-3+"px",p.offsetLeft+"px",p.offsetWidth+"px")),u.container=h,this.content[0].appendChild(h[0])),l>=d.length&&(t.addEvent({element:n,start:o,end:s,groupIndex:p.groupIndex}),i._continuousEvents.push({element:n,uid:n.attr(r.attr("uid")),start:t.start,end:t.end}),h[0].appendChild(n[0]))},_positionEvent:function(t,n,i){var o,s,l,c,d,u,h,p,f,g,v,_,w,y,b,k=this.options.eventHeight,x=t.start;for(t.start.offsetLeft>t.end.offsetLeft&&(x=t.end),o=t.start.index,s=t.end.index,l=x.eventCount,c=a.collidingEvents(t.events(),o,s),d=o!==s?5:4,c.push({element:n,start:o,end:s}),u=a.createRows(c),h=0,p=Math.min(u.length,l);p>h;h++)for(f=u[h].events,g=x.offsetTop+x.firstChildHeight+h*k+3*h+"px",v=0,_=f.length;_>v;v++)f[v].element[0].style.top=g;if(u.length>l)for(w=o;s>=w;w++){if(y=t.collection,b=y.at(w),b.more)return;b.more=e(m({ns:r.ns,start:w,end:w,width:b.clientWidth-2,left:b.offsetLeft+2,top:b.offsetTop+b.firstChildHeight+l*k+3*l})),this.content[0].appendChild(b.more[0])}else t.addEvent({element:n,start:o,end:s,groupIndex:x.groupIndex}),n[0].style.width=t.innerWidth()-d+"px",n[0].style.left=x.offsetLeft+2+"px",n[0].style.height=k+"px",i._continuousEvents.push({element:n,uid:n.attr(r.attr("uid")),start:t.start,end:t.end}),this.content[0].appendChild(n[0])},_slotByPosition:function(e,t){var n,i,r=this.content.offset();for(e-=r.left,t-=r.top,t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft,e=Math.ceil(e),t=Math.ceil(t),n=0;this.groups.length>n;n++)if(i=this.groups[n].daySlotByPosition(e,t))return i;return null},_createResizeHint:function(e){var t=e.startSlot().offsetLeft,n=e.start.offsetTop,i=e.innerWidth(),r=e.start.clientHeight-2,o=a.fn._createResizeHint.call(this,t,n,i,r);o.appendTo(this.content),this._resizeHint=this._resizeHint.add(o)},_updateResizeHint:function(e,t,n,i){var o,a,s;for(this._removeResizeHint(),o=this.groups[t],a=o.ranges(n,i,!0,e.isAllDay),s=0;a.length>s;s++)this._createResizeHint(a[s]);this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(r.toString(r.timezone.toLocalDate(n),"M/dd")),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(r.toString(r.timezone.toLocalDate(i),"M/dd"))},_updateMoveHint:function(e,t,n){var i,o,a,s,l,c=r.date.toUtcTime(e.start)+n,d=c+e.duration(),u=this.groups[t],h=u.ranges(c,d,!0,e.isAllDay);for(this._removeMoveHint(),i=0;h.length>i;i++)o=h[i],a=o.startSlot(),s=o.endSlot(),l=this._createEventElement(e.clone({head:o.head,tail:o.tail})),l.css({left:a.offsetLeft+2,top:a.offsetTop+a.firstChildHeight,height:this.options.eventHeight,width:o.innerWidth()-(a.index!==s.index?5:4)}),l.addClass("k-event-drag-hint"),l.appendTo(this.content),this._moveHint=this._moveHint.add(l)},_groups:function(){var e,t,n,i,o,a,s,l,c,d,p,f,g,m,v,_,w,y=this._groupCount(),b=h,k=u;for(this.groups=[],e=0;y>e;e++)this._addResourceView(e);for(t=this.content[0].getElementsByTagName("tr"),n=0;y>n;n++)for(i=0,o=0,this._isVerticallyGrouped()&&(o=n),a=o*k;(o+1)*k>a;a++)for(s=this.groups[n],l=s.addDaySlotCollection(r.date.addDays(this.startDate(),i),r.date.addDays(this.startDate(),i+b)),c=t[a],d=c.children,p=0,c.setAttribute("role","row"),this._isVerticallyGrouped()||(p=n),f=p*b;(p+1)*b>f;f++)g=d[f],m=g.clientHeight,v=g.children.length?g.children[0].offsetHeight+3:0,_=r.date.toUtcTime(r.date.addDays(this.startDate(),i)),i++,w=Math.floor((m-v-this.options.moreButtonHeight)/(this.options.eventHeight+3)),g.setAttribute("role","gridcell"),g.setAttribute("aria-selected",!1),l.addDaySlot(g,_,_+r.date.MS_PER_DAY,w)},render:function(e){this.content.children(".k-event,.k-more-events,.k-events-container").remove(),this._groups(),e=new r.data.Query(e).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray();var t=this.groupedResources;t.length?this._renderGroups(e,t,0,1):this._renderEvents(e,0),this.refreshLayout(),this.trigger("activate")},_renderEvents:function(e,t){var n,i,r,o,a,s,l,c,d,u,h,p=this._isMobilePhoneView();for(i=0,r=e.length;r>i;i++)if(n=e[i],this._isInDateSlot(n))for(o=this.groups[t],o._continuousEvents||(o._continuousEvents=[]),a=o.slotRanges(n,!0),s=a.length,l=0;s>l;l++)c=a[l],d=n.start,u=n.end,s>1&&(0===l?u=c.end.endDate():l==s-1?d=c.start.startDate():(d=c.start.startDate(),u=c.end.endDate())),h=n.clone({start:d,end:u,head:c.head,tail:c.tail}),p?this._positionMobileEvent(c,this._createEventElement(h),o):this._positionEvent(c,this._createEventElement(h),o)},_renderGroups:function(e,t,n,i){var o,s,l,c,d=t[0];if(d)for(o=d.dataSource.view(),s=0;o.length>s;s++)l=this._resourceValue(d,o[s]),c=new r.data.Query(e).filter({field:d.field,operator:a.groupEqFilter(l)}).toArray(),t.length>1?n=this._renderGroups(c,t.slice(1),n++,i+1):this._renderEvents(c,n++);return n},_groupCount:function(){var e=this.groupedResources;return e.length?this._isVerticallyGrouped()?this._rowCountForLevel(e.length-1):this._columnCountForLevel(e.length)/this._columnOffsetForResource(e.length):1},_columnOffsetForResource:function(e){return this._columnCountForLevel(e)/this._columnCountForLevel(e-1)},destroy:function(){this.table&&this.table.removeClass("k-scheduler-monthview"),this.content&&this.content.off(s),this.element&&this.element.off(s),a.fn.destroy.call(this),this._isMobile()&&!this._isMobilePhoneView()&&this.options.editable&&(this.options.editable.create!==!1&&this._addUserEvents.destroy(),this.options.editable.update!==!1&&this._editUserEvents.destroy())},events:["remove","add","edit","navigate"],options:{title:"Month",name:"month",eventHeight:25,moreButtonHeight:13,editable:!0,selectedDateFormat:"{0:y}",groupHeaderTemplate:"#=text#",dayTemplate:p,eventTemplate:g}})}(window.kendo.jQuery),function(e,t){function n(e,t){var n;return 0!==e&&t>e?n=t-e:(n=e%t,n&&(n=t-n)),n}function i(e){var t=e.getMonth(),n=m(e)?et[t]:tt[t];return n+e.getDate()}function r(e,n){var i,r;return e=new Date(e.getFullYear(),e.getMonth(),e.getDate()),X(e,0),i=e.getFullYear(),n!==t?(K(e,n,-1),e.setDate(e.getDate()+4)):e.setDate(e.getDate()+(4-(e.getDay()||7))),X(e,0),r=Math.floor((e.getTime()-new Date(i,0,1,-6))/864e5),1+Math.floor(r/7)}function o(e,t){var n=Z(e).getDay(),i=7-(n+7-(t||7))||7;return 0>i&&(i+=7),Math.ceil((e.getDate()-i)/7)+1}function a(e,t){return e+(t>e?7:0)}function s(e,t,n){var i,r,s,l,c,d=t.offset;return d?(i=new Date(e.getFullYear(),e.getMonth()+1,0),r=o(i,n),s=a(t.day,n),l=s<a(new Date(e.getFullYear(),e.getMonth(),1).getDay(),n),c=s>a(i.getDay(),n),0>d?d=r+(d+1-(c?1:0)):l&&(d+=1),r-=c?1:0,(l?1:0)>d||d>r?null:d):o(e,n)}function l(e,t){return o(new Date(e.getFullYear(),e.getMonth()+1,0),t)}function c(e,t,n){return o(e,n)===s(e,t,n)}function d(e,t,n){for(var i,r,l,c,d=a(t.getDay(),n),u=e.length,h=[],p=0;u>p;p++)if(r=e[p],c=o(t,n),i=s(t,r,n),null!==i)if(i>c)h.push(r);else if(c===i)if(l=a(r.day,n),l>d)h.push(r);else if(d===l)return null;return h}function u(e,t,n){for(var i,r=0,o=e.length,a=[];o>r;r++){if(i=e[r],n&&(i=n(i)),t===i)return null;i>t&&a.push(i)}return a}function h(e,t){for(var n,i=0,r=e.length;r>i;i++){if(n=parseInt(e[i],10),isNaN(n)||t.start>n||n>t.end||0===n&&0>t.start)return null;e[i]=n}return e.sort(v)}function p(e){for(var n,i,r,o=0,a=e.length;a>o;o++){if(n=e[o],i=n.length,r=n.substring(i-2).toUpperCase(),r=rt[r],r===t)return null;e[o]={offset:parseInt(n.substring(0,i-2),10)||0,day:r}}return e}function f(e){for(var t,n,i=0,r=e.length,o=[];r>i;i++)t=e[i],"string"==typeof t?n=t:(n=""+it[t.day],t.offset&&(n=t.offset+n)),o.push(n);return""+o}function g(e){var t=e.getMonth();return 1===t?1===new Date(e.getFullYear(),1,29).getMonth()?29:28:nt[t]}function m(e){return e=e.getFullYear(),e%4===0&&e%100!==0||e%400===0}function v(e,t){return e-t}function _(e,t){var n,i,r=0,o=[];if(e)for(e=e.split(";"),n=e.length;n>r;r++)i=T(e[r],t),i&&o.push(i);return o}function w(t,n,i){for(var r=e.isArray(t)?t:_(t,i),o=n.getTime()-n.getMilliseconds(),a=0,s=r.length;s>a;a++)if(r[a].getTime()===o)return!0;return!1}function y(e,t){var n,i,r=0,o=[].concat(e);for(n=o.length;n>r;r++)i=o[r],i=U.timezone.convert(i,t||i.getTimezoneOffset(),"Etc/UTC"),o[r]=U.toString(i,lt);return o.join(";")+";"}function b(e,t){var n=new Date(e);switch(t.freq){case"yearly":n.setFullYear(n.getFullYear(),0,1);break;case"monthly":n.setFullYear(n.getFullYear(),n.getMonth(),1);break;case"weekly":K(n,t.weekStart,-1)}return t.hours&&n.setHours(0),t.minutes&&n.setMinutes(0),t.seconds&&n.setSeconds(0),n}function k(e,t){var n=new Date(e);switch(t.freq){case"yearly":n.setFullYear(n.getFullYear(),11,31);break;case"monthly":n.setFullYear(n.getFullYear(),n.getMonth()+1,0);break;case"weekly":K(n,t.weekStart,-1),n.setDate(n.getDate()+6)}return t.hours&&n.setHours(23),t.minutes&&n.setMinutes(59),t.seconds&&n.setSeconds(59),n}function x(e,t,n){var i,r,o,a,s=e.slice(n._startIdx),l=s.length,c=n.positions,d=[];for(o=0,a=c.length;a>o;o++)i=c[o],0>i?i=l+i:i-=1,r=s[i],r&&r.start>=t&&d.push(r);return e=e.slice(0,n._startIdx).concat(d),n._startIdx=e.length,e}function C(e,n,i,r){var o,a,s,l,c,d,u,h,p,f,g,m,v,C,T,S,A,E,I,P,M,F,z=D(e.recurrenceRule,r),R=[];if(!z)return[e];for(P=z.positions,M=P?0:1,f=z.start,g=z.end,(f||g)&&(e=e.clone({start:f?new Date(f.value[0]):t,end:g?new Date(g.value[0]):t})),A=e.start,S=A.getTime(),T=J(A),C=_(e.recurrenceException,r),!C[0]&&z.exdates&&(C=z.exdates.value,e.set("recurrenceException",y(C,r))),h=n=new Date(n),i=new Date(i),v=z.freq,I=mt[v],E=z.count,z.until&&i>z.until&&(i=new Date(z.until)),m="yearly"===v||"monthly"===v||"weekly"===v,S>n||E||z.interval>1||m?n=new Date(S):(l=n.getHours(),c=n.getMinutes(),d=n.getSeconds(),z.hours||(l=A.getHours()),z.minutes||(c=A.getMinutes()),z.seconds||(d=A.getSeconds()),n.setHours(l,c,d,A.getMilliseconds())),z._startPeriod=new Date(n),P&&(n=b(n,z),i=k(i,z),F=J(i)-J(n),0>F&&(l=n.getHours(),i.setHours(l,n.getMinutes(),n.getSeconds(),n.getMilliseconds()),Y.adjustDST(i,l)),z._startPeriod=new Date(n),z._endPeriod=k(n,z),z._startIdx=0),u=e.duration(),z._startTime=o=Y.toInvariantTime(n),I.setup&&I.setup(z,A,n),I.limit(n,i,z);i>=n;)if(s=new Date(n),Q(s,u),p=n>=h||s>h,(p&&!w(C,n,r)||P)&&(o=Y.toUtcTime(Y.getDate(n))+J(z._startTime),a=o+u,S!==n.getTime()||T!==J(z._startTime)?R.push(e.toOccurrence({start:new Date(n),end:s,_startTime:o,_endTime:a})):(e._startTime=o,e._endTime=a,R.push(e))),P){if(I.next(n,z),I.limit(n,i,z),n>z._endPeriod&&(R=x(R,A,z),z._endPeriod=k(n,z),M=R.length),E&&E===M)break
}else{if(E&&E===M)break;M++,I.next(n,z),I.limit(n,i,z)}return R}function T(e,t){return e=U.parseDate(e,ot),e&&t&&(e=W.convert(e,e.getTimezoneOffset(),t)),e}function S(e,n){var i,r,o,a,s,l,c,d,u=e.split(";");for(c=0,d=u.length;d>c;c++)if(i=u[c].split(":"),r=i[0],o=i[1],-1!==r.indexOf("TZID")&&(a=r.substring(r.indexOf("TZID")).split("=")[1]),o)for(o=o.split(","),s=0,l=o.length;l>s;s++)o[s]=T(o[s],a||n);return o?{value:o,tzid:a}:t}function D(n,i){var r,o,a,s,l,c,d,u,f,g={},m=0,v=!1,_=function(e,t){var n=e.day,i=t.day;return u>n&&(n+=7),u>i&&(i+=7),n-i};if(!n)return null;for(c=n.split("\n"),c[1]||-1===n.indexOf("DTSTART")&&-1===n.indexOf("DTEND")&&-1===n.indexOf("EXDATE")||(c=n.split(" ")),m=0,a=c.length;a>m;m++)l=e.trim(c[m]),-1!==l.indexOf("DTSTART")?g.start=S(l,i):-1!==l.indexOf("DTEND")?g.end=S(l,i):-1!==l.indexOf("EXDATE")?g.exdates=S(l,i):-1!==l.indexOf("RRULE")?s=l.substring(6):e.trim(l)&&(s=l);for(s=s.split(";"),m=0,a=s.length;a>m;m++)switch(d=s[m],r=d.split("="),o=e.trim(r[1]).split(","),e.trim(r[0]).toUpperCase()){case"FREQ":g.freq=o[0].toLowerCase();break;case"UNTIL":g.until=T(o[0],i);break;case"COUNT":g.count=parseInt(o[0],10);break;case"INTERVAL":g.interval=parseInt(o[0],10);break;case"BYSECOND":g.seconds=h(o,{start:0,end:60}),v=!0;break;case"BYMINUTE":g.minutes=h(o,{start:0,end:59}),v=!0;break;case"BYHOUR":g.hours=h(o,{start:0,end:23}),v=!0;break;case"BYMONTHDAY":g.monthDays=h(o,{start:-31,end:31}),v=!0;break;case"BYYEARDAY":g.yearDays=h(o,{start:-366,end:366}),v=!0;break;case"BYMONTH":g.months=h(o,{start:1,end:12}),v=!0;break;case"BYDAY":g.weekDays=f=p(o),v=!0;break;case"BYWEEKNO":g.weeks=h(o,{start:-53,end:53}),v=!0;break;case"BYSETPOS":g.positions=h(o,{start:-366,end:366});break;case"WKST":g.weekStart=u=rt[o[0]]}return g.freq===t||g.count!==t&&g.until?null:(g.interval||(g.interval=1),u===t&&(g.weekStart=u=U.culture().calendar.firstDay),f&&(g.weekDays=f.sort(_)),g.positions&&!v&&(g.positions=null),g._hasRuleValue=v,g)}function A(e,t){for(var n,i=e.value,r=e.tzid||"",o=i.length,a=0;o>a;a++)n=i[a],n=W.convert(n,r||t||n.getTimezoneOffset(),"Etc/UTC"),i[a]=U.toString(n,"yyyyMMddTHHmmssZ");return r&&(r=";TZID="+r),r+":"+i.join(",")+" "}function E(e,n){var i=e.weekStart,r="FREQ="+e.freq.toUpperCase(),o=e.exdates||"",a=e.start||"",s=e.end||"",l=e.until;return e.interval>1&&(r+=";INTERVAL="+e.interval),e.count&&(r+=";COUNT="+e.count),l&&(l=W.convert(l,n||l.getTimezoneOffset(),"Etc/UTC"),r+=";UNTIL="+U.toString(l,"yyyyMMddTHHmmssZ")),e.months&&(r+=";BYMONTH="+e.months),e.weeks&&(r+=";BYWEEKNO="+e.weeks),e.yearDays&&(r+=";BYYEARDAY="+e.yearDays),e.monthDays&&(r+=";BYMONTHDAY="+e.monthDays),e.weekDays&&(r+=";BYDAY="+f(e.weekDays)),e.hours&&(r+=";BYHOUR="+e.hours),e.minutes&&(r+=";BYMINUTE="+e.minutes),e.seconds&&(r+=";BYSECOND="+e.seconds),e.positions&&(r+=";BYSETPOS="+e.positions),i!==t&&(r+=";WKST="+it[i]),a&&(a="DTSTART"+A(a,n)),s&&(s="DTEND"+A(s,n)),o&&(o="EXDATE"+A(o,n)),(a||s||o)&&(r=a+s+o+"RRULE:"+r),r}var I,P,M,F,z,R,B,H,L,N,O,V,U=window.kendo,W=U.timezone,j=U.Class,q=U.ui,G=q.Widget,$=q.DropDownList,Y=U.date,Q=Y.setTime,K=Y.setDayOfWeek,X=Y.adjustDST,Z=Y.firstDayOfMonth,J=Y.getMilliseconds,et=[0,31,60,91,121,152,182,213,244,274,305,335,366],tt=[0,31,59,90,120,151,181,212,243,273,304,334,365],nt=[31,28,30,31,30,31,30,31,30,31,30,31],it={0:"SU",1:"MO",2:"TU",3:"WE",4:"TH",5:"FR",6:"SA"},rt={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},ot=["yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm","yyyy-MM-ddTHH","yyyy-MM-dd","yyyyMMddTHHmmssfffzzz","yyyyMMddTHHmmsszzz","yyyyMMddTHHmmss","yyyyMMddTHHmm","yyyyMMddTHH","yyyyMMdd"],at=["months","weeks","yearDays","monthDays","weekDays","hours","minutes","seconds"],st=at.length,lt="yyyyMMddTHHmmssZ",ct={months:function(e,t,n){var i=n.months,r=u(i,e.getMonth()+1),o=!1;return null!==r&&(r.length?e.setMonth(r[0]-1,1):e.setFullYear(e.getFullYear()+1,i[0]-1,1),o=!0),o},monthDays:function(e,t,n){for(var i,r,o,a=!1,s=e.getHours(),l=function(e){return 0>e&&(e=i+e),e};t>=e;){if(r=e.getMonth(),i=g(e),o=u(n.monthDays,e.getDate(),l),null===o)return a;if(a=!0,o.length){if(e.setMonth(r,o.sort(v)[0]),X(e,s),r===e.getMonth())break}else e.setMonth(r+1,1)}return a},yearDays:function(e,t,n){for(var r,o,a=!1,s=e.getHours(),l=function(e){return 0>e&&(e=r+e),e};t>e;){if(r=m(e)?366:365,o=u(n.yearDays,i(e),l),null===o)return a;if(a=!0,r=e.getFullYear(),o.length){e.setFullYear(r,0,o.sort(v)[0]),X(e,s);break}e.setFullYear(r+1,0,1)}return a},weeks:function(e,t,n){for(var i,o,a,s=n.weekStart,l=!1,c=e.getHours(),d=function(e){return 0>e&&(e=53+e),e};t>e;){if(o=u(n.weeks,r(e,s),d),null===o)return l;if(l=!0,i=e.getFullYear(),o.length){a=7*o.sort(v)[0]-1,e.setFullYear(i,0,a),K(e,s,-1),X(e,c);break}e.setFullYear(i+1,0,1)}return l},weekDays:function(e,t,n){var i,r,a=n.weekDays,s=n.weekStart,u=d(a,e,s),h=e.getHours();if(null===u)return!1;if(i=u[0],i||(i=a[0],K(e,s)),r=i.day,i.offset)for(;t>=e&&!c(e,i,s);)o(e,s)===l(e,s)?(e.setMonth(e.getMonth()+1,1),X(e,h)):(e.setDate(e.getDate()+7),X(e,h),K(e,s,-1));return e.getDay()!==r&&K(e,r),!0},hours:function(e,t,n){var i=n.hours,r=n._startTime,o=r.getHours(),a=u(i,o),s=!1;return null!==a&&(s=!0,e.setHours(o),X(e,o),a.length?(a=a[0],e.setHours(a)):(a=e.getHours(),e.setDate(e.getDate()+1),X(e,a),a=i[0],e.setHours(a),X(e,a)),n.minutes&&e.setMinutes(0),r.setHours(a,e.getMinutes())),s},minutes:function(e,t,n){var i=n.minutes,r=e.getMinutes(),o=u(i,r),a=n._startTime.getHours(),s=!1;return null!==o&&(s=!0,o.length?o=o[0]:(a+=1,o=i[0]),n.seconds&&e.setSeconds(0),e.setHours(a,o),a%=24,X(e,a),n._startTime.setHours(a,o,e.getSeconds())),s},seconds:function(e,t,n){var i=n.seconds,r=n._startTime.getHours(),o=u(i,e.getSeconds()),a=e.getMinutes(),s=!1;return null!==o&&(s=!0,o.length?e.setSeconds(o[0]):(a+=1,e.setMinutes(a,i[0]),a>59&&(a%=60,r=(r+1)%24)),n._startTime.setHours(r,a,e.getSeconds())),s}},dt=j.extend({next:function(e,t){var n,i,r=t._startTime,o=r.getDate();if(t.seconds)i=e.getSeconds()+1,e.setSeconds(i),r.setSeconds(i),r.setDate(o);else{if(!t.minutes)return!1;n=e.getMinutes()+1,e.setMinutes(n),r.setMinutes(n),r.setDate(o)}return!0},normalize:function(e){var t=e.rule;4===e.idx&&t.hours&&(t._startTime.setHours(0),this._hour(e.date,t))},limit:function(e,n,i){for(var r,o,a,s,l,c=i.interval;n>=e;){for(a=o=t,l=e.getDate(),s=0;st>s;s++){if(r=at[s],i[r]){if(a=ct[r](e,n,i),o!==t&&a)break;o=a}a&&this.normalize({date:e,rule:i,day:l,idx:s})}if((1===c||!this.interval(i,e))&&s===st)break}},interval:function(e,t){var i,o,a=new Date(e._startPeriod),s=new Date(t),l=t.getHours(),c=e.weekStart,d=e.interval,u=e.freq,h=!1,p=0,f=0,g=1;return"hourly"===u?(i=s.getTimezoneOffset()-a.getTimezoneOffset(),o=e._startTime.getHours(),s=s.getTime(),l!==o&&(s+=(o-l)*Y.MS_PER_HOUR),s-=a,i&&(s-=i*Y.MS_PER_MINUTE),i=Math.floor(s/Y.MS_PER_HOUR),p=n(i,d),0!==p&&(this._hour(t,e,p),h=!0)):"daily"===u?(Y.setTime(s,-a),i=Math.floor(s/Y.MS_PER_DAY),p=n(i,d),0!==p&&(this._date(t,e,p),h=!0)):"weekly"===u?(i=52*(t.getFullYear()-a.getFullYear()),p=r(t,c)-r(a,c)+i,p=n(p,d),0!==p&&(Y.setDayOfWeek(t,e.weekStart,-1),t.setDate(t.getDate()+7*p),X(t,l),h=!0)):"monthly"===u?(i=t.getFullYear()-a.getFullYear(),i=t.getMonth()-a.getMonth()+12*i,p=n(i,d),0!==p&&(g=e._hasRuleValue?1:t.getDate(),t.setFullYear(t.getFullYear(),t.getMonth()+p,g),X(t,l),h=!0)):"yearly"===u&&(i=t.getFullYear()-a.getFullYear(),p=n(i,d),e.months||(f=t.getMonth()),e.yearDays||e.monthDays||e.weekDays||(g=t.getDate()),0!==p&&(t.setFullYear(t.getFullYear()+p,f,g),X(t,l),h=!0)),h},_hour:function(e,t,n){var i=t._startTime,r=i.getHours();n&&(r+=n),e.setHours(r),r%=24,i.setHours(r),X(e,r)},_date:function(e,t,n){var i=e.getHours();e.setDate(e.getDate()+n),X(e,i)||this._hour(e,t)}}),ut=dt.extend({next:function(e,t){dt.fn.next(e,t)||this._hour(e,t,1)},normalize:function(e){var t=e.rule;4===e.idx&&(t._startTime.setHours(0),this._hour(e.date,t))}}),ht=dt.extend({next:function(e,t){dt.fn.next(e,t)||this[t.hours?"_hour":"_date"](e,t,1)}}),pt=ht.extend({setup:function(e,t){e.weekDays||(e.weekDays=[{day:t.getDay(),offset:0}])}}),ft=dt.extend({next:function(e,t){var n,i;if(!dt.fn.next(e,t))if(t.hours)this._hour(e,t,1);else if(t.monthDays||t.weekDays||t.yearDays||t.weeks)this._date(e,t,1);else{for(n=e.getDate(),i=e.getHours(),e.setMonth(e.getMonth()+1),X(e,i);e.getDate()!==n;)e.setDate(n),X(e,i);this._hour(e,t)}},normalize:function(e){var t=e.rule,n=e.date,i=n.getHours();0!==e.idx||t.monthDays||t.weekDays?dt.fn.normalize(e):(n.setDate(e.day),X(n,i))},setup:function(e,t,n){e.monthDays||e.weekDays||n.setDate(t.getDate())}}),gt=ft.extend({next:function(e,t){var n,i=e.getHours();if(!dt.fn.next(e,t))if(t.hours)this._hour(e,t,1);else if(t.monthDays||t.weekDays||t.yearDays||t.weeks)this._date(e,t,1);else if(t.months){for(n=e.getDate(),e.setMonth(e.getMonth()+1),X(e,i);e.getDate()!==n;)e.setDate(n),X(e,i);this._hour(e,t)}else e.setFullYear(e.getFullYear()+1),X(e,i),this._hour(e,t)},setup:function(){}}),mt={hourly:new ut,daily:new ht,weekly:new pt,monthly:new ft,yearly:new gt},vt="click";U.recurrence={rule:{parse:D,serialize:E},expand:C,dayInYear:i,weekInYear:r,weekInMonth:o,numberOfWeeks:l,isException:w,toExceptionString:y},I=function(e){for(var t=U.culture().calendar.days.namesShort,n=t.length,i="",r=0,o=[];n>r;r++)o.push(r);for(t=t.slice(e).concat(t.slice(0,e)),o=o.slice(e).concat(o.slice(0,e)),r=0;n>r;r++)i+='<label class="k-check"><input class="k-recur-weekday-checkbox" type="checkbox" value="'+o[r]+'" /> '+t[r]+"</label>";return i},P=U.template('# if (frequency !== "never") { #<div class="k-edit-label"><label>#:messages.repeatEvery#</label></div><div class="k-edit-field"><input class="k-recur-interval"/>#:messages.interval#</div># } ## if (frequency === "weekly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field">#=weekDayCheckBoxes(firstWeekDay)#</div># } else if (frequency === "monthly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field"><ul class="k-reset"><li><label><input class="k-recur-month-radio" type="radio" name="month" value="monthday" />#:messages.day#</label><input class="k-recur-monthday" /></li><li><input class="k-recur-month-radio" type="radio" name="month" value="weekday" /><input class="k-recur-weekday-offset" /><input class="k-recur-weekday" /></li></ul></div># } else if (frequency === "yearly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field"><ul class="k-reset"><li><input class="k-recur-year-radio" type="radio" name="year" value="monthday" /><input class="k-recur-month" /><input class="k-recur-monthday" /></li><li><input class="k-recur-year-radio" type="radio" name="year" value="weekday" /><input class="k-recur-weekday-offset" /><input class="k-recur-weekday" />#:messages.of#<input class="k-recur-month" /></li></ul></div># } ## if (frequency !== "never") { #<div class="k-edit-label"><label>#:end.label#</label></div><div class="k-edit-field"><ul class="k-reset"><li><label><input class="k-recur-end-never" type="radio" name="end" value="never" />#:end.never#</label></li><li><label><input class="k-recur-end-count" type="radio" name="end" value="count" />#:end.after#</label><input class="k-recur-count" />#:end.occurrence#</li><li><label><input class="k-recur-end-until" type="radio" name="end" value="until" />#:end.on#</label><input class="k-recur-until" /></li></ul></div># } #'),M=[{day:0,offset:0},{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0},{day:6,offset:0}],F=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],z=[{day:0,offset:0},{day:6,offset:0}],R=G.extend({init:function(e,t){var n,i=this,r=t&&t.frequencies;G.fn.init.call(i,e,t),i.wrapper=i.element,t=i.options,t.start=n=t.start||Y.today(),r&&(t.frequencies=r),"string"==typeof n&&(t.start=U.parseDate(n,"yyyyMMddTHHmmss")),null===t.firstWeekDay&&(t.firstWeekDay=U.culture().calendar.firstDay),i._namespace="."+t.name},options:{value:"",start:"",timezone:"",spinners:!0,firstWeekDay:null,frequencies:["never","daily","weekly","monthly","yearly"],mobile:!1,messages:{frequencies:{never:"Never",hourly:"Hourly",daily:"Daily",weekly:"Weekly",monthly:"Monthly",yearly:"Yearly"},hourly:{repeatEvery:"Repeat every: ",interval:" hour(s)"},daily:{repeatEvery:"Repeat every: ",interval:" day(s)"},weekly:{interval:" week(s)",repeatEvery:"Repeat every: ",repeatOn:"Repeat on: "},monthly:{repeatEvery:"Repeat every: ",repeatOn:"Repeat on: ",interval:" month(s)",day:"Day "},yearly:{repeatEvery:"Repeat every: ",repeatOn:"Repeat on: ",interval:" year(s)",of:" of "},end:{label:"End:",mobileLabel:"Ends",never:"Never",after:"After ",occurrence:" occurrence(s)",on:"On "},offsetPositions:{first:"first",second:"second",third:"third",fourth:"fourth",last:"last"},weekdays:{day:"day",weekday:"weekday",weekend:"weekend day"}}},events:["change"],_initInterval:function(){var e=this,t=e._value;e._container.find(".k-recur-interval").kendoNumericTextBox({spinners:e.options.spinners,value:t.interval||1,decimals:0,format:"#",min:1,change:function(){t.interval=this.value(),e._trigger()}})},_weekDayRule:function(e){var t=this,n=(t._weekDay.element||t._weekDay).val(),i=+(t._weekDayOffset.element||t._weekDayOffset).val(),r=null,o=null;e||("day"===n?(r=M,o=i):"weekday"===n?(r=F,o=i):"weekend"===n?(r=z,o=i):r=[{offset:i,day:+n}]),t._value.weekDays=r,t._value.positions=o},_weekDayView:function(){var e,t,n,i,r=this,o=r._value.weekDays,a=r._value.positions,s=r._weekDayOffset;o&&(n=o.length,a&&(7===n?(t="day",e=a):5===n?(t="weekday",e=a):2===n&&(t="weekend",e=a)),t||(o=o[0],t=o.day,e=o.offset||""),i=s.value?"value":"val",s[i](e),r._weekDay[i](t))},_initWeekDay:function(){var t,n=this,i=n.options.messages.weekdays,r=n.options.messages.offsetPositions,o=n._container.find(".k-recur-weekday"),a=function(){n._weekDayRule(),n._trigger()};o[0]&&(n._weekDayOffset=new $(n._container.find(".k-recur-weekday-offset"),{change:a,dataTextField:"text",dataValueField:"value",dataSource:[{text:r.first,value:"1"},{text:r.second,value:"2"},{text:r.third,value:"3"},{text:r.fourth,value:"4"},{text:r.last,value:"-1"}]}),t=[{text:i.day,value:"day"},{text:i.weekday,value:"weekday"},{text:i.weekend,value:"weekend"}],n._weekDay=new $(o,{value:n.options.start.getDay(),change:a,dataTextField:"text",dataValueField:"value",dataSource:t.concat(e.map(U.culture().calendar.days.names,function(e,t){return{text:e,value:t}}))}),n._weekDayView())},_initWeekDays:function(){var t,n,i,r,o,a=this,s=a._value,l=a._container.find(".k-recur-weekday-checkbox");if(l[0]&&(l.on(vt+a._namespace,function(){s.weekDays=e.map(l.filter(":checked"),function(e){return{day:+e.value,offset:0}}),a.options.mobile||a._trigger()}),s.weekDays))for(i=0,r=l.length,o=s.weekDays.length;r>i;i++)for(n=l[i],t=0;o>t;t++)n.value==s.weekDays[t].day&&(n.checked=!0)},_initMonthDay:function(){var e=this,t=e._value,n=e._container.find(".k-recur-monthday");n[0]&&(e._monthDay=new U.ui.NumericTextBox(n,{spinners:e.options.spinners,min:1,max:31,decimals:0,format:"#",value:t.monthDays?t.monthDays[0]:e.options.start.getDate(),change:function(){var n=this.value();t.monthDays=n?[n]:n,e._trigger()}}))},_initCount:function(){var e=this,t=e._container.find(".k-recur-count"),n=e._value;e._count=t.kendoNumericTextBox({spinners:e.options.spinners,value:n.count||1,decimals:0,format:"#",min:1,change:function(){n.count=this.value(),e._trigger()}}).data("kendoNumericTextBox")},_initUntil:function(){var e=this,t=e._container.find(".k-recur-until"),n=e.options.start,i=e._value,r=i.until;e._until=t.kendoDatePicker({min:r&&n>r?r:n,value:r||n,change:function(){i.until=this.value(),e._trigger()}}).data("kendoDatePicker")},_trigger:function(){this.options.mobile||this.trigger("change")}}),B=R.extend({init:function(e,t){var n=this;R.fn.init.call(n,e,t),n._initFrequency(),n._initContainer(),n.value(n.options.value)},options:{name:"RecurrenceEditor"},events:["change"],destroy:function(){var e=this;e._frequency.destroy(),e._container.find("input[type=radio],input[type=checkbox]").off(vt+e._namespace),U.destroy(e._container),R.fn.destroy.call(e)},value:function(e){var n=this,i=n.options.timezone;return e===t?n._value.freq?E(n._value,i):"":(n._value=D(e,i)||{},n._frequency.value(n._value.freq||""),n._initView(n._frequency.value()),t)},_initContainer:function(){var t=this.element,n=e('<div class="k-recur-view" />'),i=t.parent(".k-edit-field");i[0]?n.insertAfter(i):t.append(n),this._container=n},_initFrequency:function(){var t,n=this,i=n.options,r=i.frequencies,o=i.messages.frequencies,a=e("<input />");r=e.map(r,function(e){return{text:o[e],value:e}}),t=r[0],t&&"never"===t.value&&(t.value=""),n.element.append(a),n._frequency=new $(a,{dataTextField:"text",dataValueField:"value",dataSource:r,change:function(){n._value={},n._initView(n._frequency.value()),n.trigger("change")}})},_initView:function(e){var n=this,i=n._value,r=n.options,o={frequency:e||"never",weekDayCheckBoxes:I,firstWeekDay:r.firstWeekDay,messages:r.messages[e],end:r.messages.end};return U.destroy(n._container),n._container.html(P(o)),e?(i.freq=e,"weekly"!==e||i.weekDays||(i.weekDays=[{day:r.start.getDay(),offset:0}]),n._initInterval(),n._initWeekDays(),n._initMonthDay(),n._initWeekDay(),n._initMonth(),n._initCount(),n._initUntil(),n._period(),n._end(),t):(n._value={},t)},_initMonth:function(){var t,n=this,i=n._value,r=i.months||[n.options.start.getMonth()+1],o=n._container.find(".k-recur-month");o[0]&&(t={change:function(){i.months=[+this.value()],n.trigger("change")},dataTextField:"text",dataValueField:"value",dataSource:e.map(U.culture().calendar.months.names,function(e,t){return{text:e,value:t+1}})},n._month1=new $(o[0],t),n._month2=new $(o[1],t),r&&(r=r[0],n._month1.value(r),n._month2.value(r)))},_end:function(){var e,t=this,n=t._value,i=t._container,r=t._namespace,o=function(e){t._toggleEnd(e.currentTarget.value),t.trigger("change")};t._buttonNever=i.find(".k-recur-end-never").on(vt+r,o),t._buttonCount=i.find(".k-recur-end-count").on(vt+r,o),t._buttonUntil=i.find(".k-recur-end-until").on(vt+r,o),n.count?e="count":n.until&&(e="until"),t._toggleEnd(e)},_period:function(){var e=this,t=e._value,n="monthly"===t.freq,i=n?e._toggleMonthDay:e._toggleYear,r=".k-recur-"+(n?"month":"year")+"-radio",o=e._container.find(r);(n||"yearly"===t.freq)&&(o.on(vt+e._namespace,function(t){i.call(e,t.currentTarget.value),e.trigger("change")}),e._buttonMonthDay=o.eq(0),e._buttonWeekDay=o.eq(1),i.call(e,t.weekDays?"weekday":"monthday"))},_toggleEnd:function(e){var t,n,i,r,o=this;"count"===e?(o._buttonCount.prop("checked",!0),i=!0,r=!1,t=o._count.value(),n=null):"until"===e?(o._buttonUntil.prop("checked",!0),i=!1,r=!0,t=null,n=o._until.value()):(o._buttonNever.prop("checked",!0),i=r=!1,t=n=null),o._count.enable(i),o._until.enable(r),o._value.count=t,o._value.until=n},_toggleMonthDay:function(e){var t,n=this,i=!1,r=!0,o=!1;"monthday"===e?(n._buttonMonthDay.prop("checked",!0),t=[n._monthDay.value()],i=!0,r=!1,o=!0):(n._buttonWeekDay.prop("checked",!0),t=null),n._weekDay.enable(r),n._weekDayOffset.enable(r),n._monthDay.enable(i),n._value.monthDays=t,n._weekDayRule(o)},_toggleYear:function(e){var t,n=this,i=!1,r=!0;"monthday"===e?(i=!0,r=!1,t=n._month1.value()):t=n._month2.value(),n._month1.enable(i),n._month2.enable(r),n._value.months=[t],n._toggleMonthDay(e)}}),q.plugin(B),H=U.template('<div class="k-edit-label"><label>#:headerTitle#</label></div><div class="k-edit-field k-recur-pattern k-scheduler-toolbar"></div><div class="k-recur-view"></div>'),L=U.template('# if (frequency !== "never") { #<div class="k-edit-label"><label>#:messages.repeatEvery#</label></div><div class="k-edit-field"><input class="k-recur-interval" pattern="\\\\d*"/>#:messages.interval#</div># } ## if (frequency === "weekly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field">#=weekDayCheckBoxes(firstWeekDay)#</div># } else if (frequency === "monthly") { #<div class="k-edit-label"><label>#:messages.repeatBy#</label></div><div class="k-edit-field k-scheduler-toolbar k-repeat-rule"></div><div class="k-monthday-view" style="display:none"><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><input class="k-recur-monthday" pattern="\\\\d*"/></div></div><div class="k-weekday-view" style="display:none"><div class="k-edit-label"><label>#:messages.every#</label></div><div class="k-edit-field"><select class="k-recur-weekday-offset"></select></div><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><select class="k-recur-weekday"></select></div></div># } else if (frequency === "yearly") { #<div class="k-edit-label"><label>#:messages.repeatBy#</label></div><div class="k-edit-field k-scheduler-toolbar k-repeat-rule"></div><div class="k-monthday-view" style="display:none"><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><input class="k-recur-monthday" pattern="\\\\d*"/></div></div><div class="k-weekday-view" style="display:none"><div class="k-edit-label"><label>#:messages.every#</label></div><div class="k-edit-field"><select class="k-recur-weekday-offset"></select></div><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><select class="k-recur-weekday"></select></div></div><div class="k-edit-label"><label>#:messages.month#</label></div><div class="k-edit-field"><select class="k-recur-month"></select></div># } #'),N=U.template('# if (endPattern === "count") { #<div class="k-edit-label"><label>#:messages.after#</label></div><div class="k-edit-field"><input class="k-recur-count" pattern="\\\\d*" /></div># } else if (endPattern === "until") { #<div class="k-edit-label"><label>#:messages.on#</label></div><div class="k-edit-field"><input type="date" class="k-recur-until" /></div># } #'),O=U.template('<ul class="k-reset k-header k-scheduler-navigation">#for (var i = 0, length = dataSource.length; i < length; i++) {#<li class="k-state-default #= value === dataSource[i].value ? "k-state-selected" : "" #"><a role="button" href="\\#" class="k-link" data-#=ns#value="#=dataSource[i].value#">#:dataSource[i].text#</a></li>#}#</ul>'),V=R.extend({init:function(e,t){var n=this;R.fn.init.call(n,e,t),t=n.options,n._optionTemplate=U.template('<option value="#:value#">#:text#</option>'),n.value(t.value),n._pane=t.pane,n._initRepeatButton(),n._initRepeatEnd(),n._defaultValue=n._value},options:{name:"MobileRecurrenceEditor",animations:{left:"slide",right:"slide:right"},mobile:!0,messages:{cancel:"Cancel",update:"Save",endTitle:"Repeat ends",repeatTitle:"Repeat pattern",headerTitle:"Repeat event",end:{patterns:{never:"Never",after:"After...",on:"On..."},never:"Never",after:"End repeat after",on:"End repeat on"},daily:{interval:""},hourly:{interval:""},weekly:{interval:""},monthly:{interval:"",repeatBy:"Repeat by: ",dayOfMonth:"Day of the month",dayOfWeek:"Day of the week",repeatEvery:"Repeat every",every:"Every",day:"Day "},yearly:{interval:"",repeatBy:"Repeat by: ",dayOfMonth:"Day of the month",dayOfWeek:"Day of the week",repeatEvery:"Repeat every: ",every:"Every",month:"Month",day:"Day"}}},events:["change"],value:function(e){var n=this,i=n.options.timezone;return e===t?n._value.freq?E(n._value,i):"":(n._value=D(e,i)||{},t)},destroy:function(){this._destroyView(),U.destroy(this._endFields),this._repeatButton.off(vt+this._namespace),R.fn.destroy.call(this)},_initRepeatButton:function(){var t=this,n=t.options.messages.frequencies[this._value.freq||"never"];t._repeatButton=e('<a href="#" class="k-button k-scheduler-recur">'+n+"</a>").on(vt+t._namespace,function(e){e.preventDefault(),t._createView("repeat"),t._pane.navigate("recurrence",t.options.animations.left)}),t.element.append(t._repeatButton)},_initRepeatEnd:function(){var t=this,n=e('<div class="k-edit-label"><label>'+t.options.messages.end.mobileLabel+"</label></div>").insertAfter(t.element.parent(".k-edit-field")),i=e('<div class="k-edit-field"><a href="#" class="k-button k-scheduler-recur-end"></a></div>').on(vt+t._namespace,function(e){e.preventDefault(),t._value.freq&&(t._createView("end"),t._pane.navigate("recurrence",t.options.animations.left))}).insertAfter(n);t._endFields=n.add(i).toggleClass("k-state-disabled",!t._value.freq),t._endButton=i.find(".k-scheduler-recur-end").text(t._endText())},_endText:function(){var e=this._value,t=this.options.messages.end,n=t.never;return e.count?n=U.format("{0} {1}",t.after,e.count):e.until&&(n=U.format("{0} {1:d}",t.on,e.until)),n},_initFrequency:function(){var t=this,n=t.options.messages.frequencies,i=O({dataSource:e.map(this.options.frequencies,function(e){return{text:n[e],value:"never"!==e?e:""}}),value:t._value.freq||"",ns:U.ns});t._view.element.find(".k-recur-pattern").append(i).on(vt+t._namespace,".k-scheduler-navigation li",function(n){var i=e(this);n.preventDefault(),i.addClass("k-state-selected").siblings().removeClass("k-state-selected"),t._value={freq:i.children("a").attr(U.attr("value"))},t._initRepeatView()})},_initEndNavigation:function(){var t,n=this,i=n.options.messages.end.patterns,r=n._value,o="";r.count?o="count":r.until&&(o="until"),t=O({dataSource:[{text:i.never,value:""},{text:i.after,value:"count"},{text:i.on,value:"until"}],value:o,ns:U.ns}),n._view.element.find(".k-recur-pattern").append(t).on(vt+n._namespace,".k-scheduler-navigation li",function(t){var i=e(this),o=null,a=null;t.preventDefault(),i.addClass("k-state-selected").siblings().removeClass("k-state-selected"),n._initEndView(i.children("a").attr(U.attr("value"))),n._count?(o=n._count.value(),a=null):n._until&&(o=null,a=n._until.val?U.parseDate(n._until.val(),"yyyy-MM-dd"):n._until.value()),r.count=o,r.until=a})},_createView:function(t){var n=this,i=n.options,r=i.messages,o=r["repeat"===t?"repeatTitle":"endTitle"],a='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list" id="recurrence"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+r.cancel+"</a>"+r.headerTitle+'<a href="#" class="k-button k-scheduler-update">'+r.update+"</a></div>",s=n._pane.view().id;n._view=n._pane.append(a+H({headerTitle:o})),n._view.element.on(vt+n._namespace,"a.k-scheduler-cancel, a.k-scheduler-update",function(t){t.preventDefault(),t.stopPropagation(),e(this).hasClass("k-scheduler-update")?(n.trigger("change"),n._defaultValue=e.extend({},n._value)):n._value=n._defaultValue;var i=n._value.freq;n._endButton.text(n._endText()),n._endFields.toggleClass("k-state-disabled",!i),n._repeatButton.text(r.frequencies[i||"never"]),n._pane.one("viewShow",function(){n._destroyView()}),n._pane.navigate(s,n.options.animations.right)}),n._container=n._view.element.find(".k-recur-view"),"repeat"===t?(n._initFrequency(),n._initRepeatView()):(n._initEndNavigation(),n._initEndView())},_destroyView:function(){this._view&&(this._view.destroy(),this._view.element.remove()),this._view=null},_initRepeatView:function(){var e=this,n=e._value.freq||"never",i={frequency:n,weekDayCheckBoxes:I,firstWeekDay:e.options.firstWeekDay,messages:e.options.messages[n]},r=L(i),o=e._container,a=e._value;return U.destroy(o),o.html(r),r?("weekly"!==n||a.weekDays||(a.weekDays=[{day:e.options.start.getDay(),offset:0}]),e._initInterval(),e._initMonthDay(),e._initWeekDays(),e._initWeekDay(),e._initMonth(),e._period(),t):(e._value={},t)},_initEndView:function(e){var n,i=this,r=i._value;e===t&&(r.count?e="count":r.until&&(e="until")),n={endPattern:e,messages:i.options.messages.end},U.destroy(i._container),i._container.html(N(n)),i._initCount(),i._initUntil()},_initWeekDay:function(){var t,n=this,i=n.options.messages.weekdays,r=n.options.messages.offsetPositions,o=n._container.find(".k-recur-weekday"),a=function(){n._weekDayRule(),n.trigger("change")};o[0]&&(n._weekDayOffset=n._container.find(".k-recur-weekday-offset").html(n._options([{text:r.first,value:"1"},{text:r.second,value:"2"},{text:r.third,value:"3"},{text:r.fourth,value:"4"},{text:r.last,value:"-1"}])).change(a),t=[{text:i.day,value:"day"},{text:i.weekday,value:"weekday"},{text:i.weekend,value:"weekend"}],t=t.concat(e.map(U.culture().calendar.days.names,function(e,t){return{text:e,value:t}})),n._weekDay=o.html(n._options(t)).change(a).val(n.options.start.getDay()),n._weekDayView())},_initMonth:function(){var t,n=this,i=n._value,r=n.options.start,o=i.months||[r.getMonth()+1],a=n._container.find(".k-recur-month"),s=U.culture().calendar.months.names;a[0]&&(t=e.map(s,function(e,t){return{text:e,value:t+1}}),a.html(n._options(t)).change(function(){i.months=[+this.value]}),n._monthSelect=a,o&&a.val(o[0]))},_period:function(){var t,n,i,r=this,o=r._value,a=r._container,s=r.options.messages[o.freq],l=a.find(".k-repeat-rule"),c=a.find(".k-weekday-view"),d=a.find(".k-monthday-view");l[0]&&(t=o.weekDays?"weekday":"monthday",n=O({value:t,dataSource:[{text:s.dayOfMonth,value:"monthday"},{text:s.dayOfWeek,value:"weekday"}],ns:U.ns}),i=function(e){var t=r._weekDay.val(),n=r._weekDayOffset.val(),i=r._monthDay.value(),a=r._monthSelect?r._monthSelect.val():null;"monthday"===e?(o.weekDays=null,o.monthDays=i?[i]:i,o.months=a?[+a]:a,c.hide(),d.show()):(o.monthDays=null,o.months=a?[+a]:a,o.weekDays=[{offset:+n,day:+t}],c.show(),d.hide())},l.append(n).on(vt+r._namespace,".k-scheduler-navigation li",function(t){var n,r=e(this).addClass("k-state-selected");t.preventDefault(),r.siblings().removeClass("k-state-selected"),n=r.children("a").attr(U.attr("value")),i(n)}),i(t))},_initUntil:function(){var e=this,t=e._container.find(".k-recur-until"),n=e.options.start,i=e._value,r=i.until,o=r&&n>r?r:n;e._until=U.support.input.date?t.attr("min",U.toString(o,"yyyy-MM-dd")).val(U.toString(r||n,"yyyy-MM-dd")).on("change",function(){i.until=U.parseDate(this.value,"yyyy-MM-dd")}):t.kendoDatePicker({min:o,value:r||n,change:function(){i.until=this.value()}}).data("kendoDatePicker")},_options:function(e,t){var n=0,i="",r=e.length,o=this._optionTemplate;for(t&&(i+=o({value:"",text:t}));r>n;n++)i+=o(e[n]);return i}}),q.plugin(V)}(window.kendo.jQuery),function(e,t){function n(e){var t=new Date(1980,1,1,0,0,0);return l(t,p(e)),t}function i(e,t,n){return e>=t&&n>=e}function r(e){var t=[],n=e.workWeekStart;for(t.push(n);e.workWeekEnd!=n;)n>6?n-=7:n++,t.push(n);return t}function o(e){var t,n=0;if(e.columns){for(t=0;e.columns.length>t;t++)n+=o(e.columns[t]);return e.colspan=n,n}return e.colspan=1,1}var a=window.kendo,s=a.ui,l=a.date.setTime,c=s.SchedulerView,d=e.extend,u=e.proxy,h=a.date.getDate,p=a.date.getMilliseconds,f=a.date.MS_PER_DAY,g=a.date.MS_PER_MINUTE,m=".kendoTimelineView",v=a.template('<div><div class="k-event-template k-event-time">#:kendo.format("{0:t} - {1:t}", start, end)#</div><div class="k-event-template">${title}</div></div>'),_=a.template("<span class='k-link k-nav-day'>#=kendo.format('{0:m}', date)#</span>"),w='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color#; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#" #} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail) {#<span class="k-icon k-i-arrow-w"></span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}## if(data.head) {#<span class="k-icon k-i-arrow-e"></span>#}#</span>#if(resizable && !data.tail){#<span class="k-resize-handle k-resize-w"></span>#}##if(resizable && !data.head){#<span class="k-resize-handle k-resize-e"></span>#}#</div>',y=c.extend({init:function(e,t){var n=this;c.fn.init.call(n,e,t),n.title=n.options.title||n.options.name,n._workDays=r(n.options),n._templates(),n._editable(),n.calculateDateRange(),n._groups(),n._currentTime()},name:"timeline",_currentTimeMarkerUpdater:function(){var t,n,i,r,o,s,l,c,d,u,h,p=new Date,f=this.options;
if(this.datesHeader.find(".k-current-time").remove(),this._isInDateSlot({start:p,end:p}))for(f.currentTimeMarker.useLocalTimezone===!1&&(t=f.dataSource.options.schema.timezone,f.dataSource&&t&&(n=a.timezone.offset(p,t),p=a.timezone.convert(p,p.getTimezoneOffset(),n))),i=f.group&&"vertical"!=f.group.orientation?this.groups.length:1,r=0;i>r;r++){if(o=this.groups[r],s=a.date.toUtcTime(p),l=o.timeSlotRanges(s,s+1),0===l.length)return;c=l[0].collection,d=c.slotByStartDate(p),d&&(u=e("<div class='k-current-time'></div>"),h=this.datesHeader,u.appendTo(h.find(".k-scheduler-header-wrap")).css({left:Math.round(l[0].innerRect(p,new Date(p.getTime()+1),!1).left),width:"1px",bottom:"1px",top:0}))}},_currentTime:function(){var e,n=this,i=n.options.currentTimeMarker;i!==!1&&i.updateInterval!==t&&(e=i.updateInterval,n._currentTimeMarkerUpdater(),n._currentTimeUpdateTimer=setInterval(u(this._currentTimeMarkerUpdater,n),e))},_editable:function(){this.options.editable&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+m,".k-event a:has(.k-si-close)",function(n){t.trigger("remove",{uid:e(this).closest(".k-event").attr(a.attr("uid"))}),n.preventDefault()}),t.options.editable.create!==!1&&t.element.on("dblclick"+m,".k-scheduler-content td",function(e){var n,i=t._slotByPosition(e.pageX,e.pageY);i&&(n=t._resourceBySlot(i),t.trigger("add",{eventInfo:d({start:i.startDate(),end:i.endDate()},n)})),e.preventDefault()}),t.options.editable.update!==!1&&t.element.on("dblclick"+m,".k-event",function(n){t.trigger("edit",{uid:e(this).closest(".k-event").attr(a.attr("uid"))}),n.preventDefault()})},_touchEditable:function(){var t=this;t.options.editable.create!==!1&&(t._addUserEvents=new a.UserEvents(t.element,{filter:".k-scheduler-content td",tap:function(e){var n,i=t._slotByPosition(e.x.location,e.y.location);i&&(n=t._resourceBySlot(i),t.trigger("add",{eventInfo:d({start:i.startDate(),end:i.endDate()},n)})),e.preventDefault()}})),t.options.editable.update!==!1&&(t._editUserEvents=new a.UserEvents(t.element,{filter:".k-event",tap:function(n){var i=e(n.target).closest(".k-event");i.hasClass("k-event-active")||t.trigger("edit",{uid:i.attr(a.attr("uid"))}),n.preventDefault()}}))},_slotByPosition:function(e,t){var n,i,r,o,s=this.content,l=s.offset();for(e-=l.left,t-=l.top,this._isRtl?(o=a.support.browser,o.mozilla?(e+=s[0].scrollWidth-s[0].offsetWidth,e+=s[0].scrollLeft):o.msie?(e-=s.scrollLeft(),e+=s[0].scrollWidth-this.content[0].offsetWidth):o.webkit&&(e+=s[0].scrollLeft)):e+=s[0].scrollLeft,t+=s[0].scrollTop,e=Math.ceil(e),t=Math.ceil(t),r=0;this.groups.length>r;r++)if(i=this.groups[r],n=i.timeSlotByPosition(e,t))return n;return null},options:{name:"TimelineView",title:"Timeline",selectedDateFormat:"{0:D}",date:a.date.today(),startTime:a.date.today(),endTime:a.date.today(),showWorkHours:!1,minorTickCount:2,editable:!0,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,majorTick:60,eventHeight:25,columnWidth:100,groupHeaderTemplate:"#=text#",majorTimeHeaderTemplate:"#=kendo.toString(date, 't')#",slotTemplate:"&nbsp;",eventTemplate:v,dateHeaderTemplate:_,footer:{command:"workDay"},currentTimeMarker:{updateInterval:1e4,useLocalTimezone:!0},messages:{defaultRowText:"All events",showFullDay:"Show full day",showWorkDay:"Show business hours"}},events:["remove","add","edit"],_templates:function(){var e=this.options,t=d({},a.Template,e.templateSettings);this.eventTemplate=this._eventTmpl(e.eventTemplate,w),this.majorTimeHeaderTemplate=a.template(e.majorTimeHeaderTemplate,t),this.dateHeaderTemplate=a.template(e.dateHeaderTemplate,t),this.slotTemplate=a.template(e.slotTemplate,t),this.groupHeaderTemplate=a.template(e.groupHeaderTemplate,t)},_render:function(t){var n=this;t=t||[],n._dates=t,n._startDate=t[0],n._endDate=t[t.length-1||0],n._calculateSlotRanges(),n.createLayout(n._layout(t)),n._content(t),n._footer(),n._setContentWidth(),n.refreshLayout(),n.datesHeader.on("click"+m,".k-nav-day",function(t){var i=e(t.currentTarget).closest("th"),r=n._slotByPosition(i.offset().left,n.content.offset().top);n.trigger("navigate",{view:"timeline",date:r.startDate()})}),n.timesHeader.find("table tr:last").hide(),n.datesHeader.find("table tr:last").hide()},_setContentWidth:function(){var e=this.content,t=e.width(),n=this.content.find("table"),i=n.find("tr:first").children().length,r=100,o=i*this.options.columnWidth;o>t&&(r=Math.ceil(o/t*100)),n.add(this.datesHeader.find("table")).css("width",r+"%")},_calculateSlotRanges:function(){var e,t,n,i,r=this._dates,o=this.startTime(),s=this.endTime();for(p(s)===p(a.date.getDate(s))&&(s=a.date.getDate(s),l(s,f-1)),s=p(s),o=p(o),e=[],t=0;r.length>t;t++)n=h(r[t]),l(n,o),i=h(r[t]),l(i,s),e.push({start:a.date.toUtcTime(n),end:a.date.toUtcTime(i)});this._slotRanges=e},_forTimeRange:function(e,t,i,r){var o,a,s,c,d,u,h,m,v,_,w,y,b,k,x,C,T,S;for(e=n(e),t=n(t),o=this,a=p(e),s=p(t),c=o.options.minorTickCount,d=o.options.majorTick*g,u=d/c||1,h=new Date(+e),m=h.getDate(),_=0,y="",w=f/u,a!=s&&(a>s&&(s+=f),w=(s-a)/u),w=Math.round(w);w>_;_++)b=_%(d/u),k=0===b,x=c-1>b,C=b===c-1,T=c,w%c!==0&&(S=c>w-(_+1),k&&S&&(T=w%c)),y+=i(h,k,x,C,T),l(h,u,!1);return s&&(v=p(h),m<h.getDate()&&(v+=f),v>s&&(h=new Date(+t))),r&&(y+=r(h)),y},_layout:function(e){var t,n,i,r=[],a=[],s=this,l=[{text:s.options.messages.defaultRowText}],c=[];for(t=0;s.options.minorTickCount>t;t++)c.push({text:"",className:""});for(this._forTimeRange(s.startTime(),s.endTime(),function(e,t,n,i,a){var l,d=s.majorTimeHeaderTemplate;t&&(l={text:d({date:e}),className:i?"k-slot-cell":"",columns:c.slice(0,a)},o(l),r.push(l))}),n=0;e.length>n;n++)a.push({text:s.dateHeaderTemplate({date:e[n]}),className:"k-slot-cell",columns:r.slice(0)});return i=this.groupedResources,i.length&&("vertical"===this._groupOrientation()?l=s._createRowsLayout(i,null,this.groupHeaderTemplate):a=s._createColumnsLayout(i,a,this.groupHeaderTemplate)),{columns:a,rows:l}},_footer:function(){var t,n,i,r=this.options;r.footer!==!1&&(t='<div class="k-header k-scheduler-footer">',n=r.footer.command,n&&"workDay"===n?(t+='<ul class="k-reset k-header">',t+='<li class="k-state-default k-scheduler-fullday"><a href="#" class="k-link"><span class="k-icon k-i-clock"></span>',t+=(r.showWorkHours?r.messages.showFullDay:r.messages.showWorkDay)+"</a></li>",t+="</ul>"):t+="&nbsp;",t+="</div>",this.footer=e(t).appendTo(this.element),i=this,this.footer.on("click"+m,".k-scheduler-fullday",function(e){e.preventDefault(),i.trigger("navigate",{view:i.name||r.name,date:i.startDate(),isWorkDay:!r.showWorkHours})}))},_columnCountForLevel:function(e){var t=this.columnLevels[e];return t?t.length:0},_rowCountForLevel:function(e){var t=this.rowLevels[e];return t?t.length:0},_isWorkDay:function(e){var t,n=e.getDay(),i=this._workDays;for(t=0;i.length>t;t++)if(i[t]===n)return!0;return!1},_content:function(e){var t,n,i,r,o,s=this,l=s.options,c=s.startTime(),d=this.endTime(),u=1,h=1,p=e.length,f="",g=this.groupedResources,m=this.slotTemplate,v=!1;for(g.length&&(v="vertical"===s._groupOrientation(),v?h=s._groupCount():u=s._groupCount()),f+="<tbody>",t=function(t){var o,c="",d="",u=function(e){return function(){return s._resourceBySlot({groupIndex:e})}};return a.date.isToday(e[r])&&(d+="k-today"),(a.date.getMilliseconds(t)<a.date.getMilliseconds(l.workDayStart)||a.date.getMilliseconds(t)>=a.date.getMilliseconds(l.workDayEnd)||!s._isWorkDay(e[r]))&&(d+=" k-nonwork-hour"),c+="<td"+(""!==d?' class="'+d+'"':"")+">",o=a.date.getDate(e[r]),a.date.setTime(o,a.date.getMilliseconds(t)),c+=m({date:o,resources:u(v?n:i)}),c+="</td>"},n=0;h>n;n++){for(f+="<tr>",i=0;u>i;i++)for(r=0,o=p;o>r;r++)f+=this._forTimeRange(c,d,t);f+="</tr>"}f+="</tbody>",this.content.find("table").append(f)},_groups:function(){var e,t,n,i,r=this._groupCount(),o=this._dates,s=o.length;for(this.groups=[],e=0;r>e;e++)t=this._addResourceView(e),n=o[0],i=o[o.length-1||0],t.addTimeSlotCollection(n,a.date.addDays(i,1));this._timeSlotGroups(r,s)},_isVerticallyGrouped:function(){return this.groupedResources.length&&"vertical"===this._groupOrientation()},_isHorizontallyGrouped:function(){return this.groupedResources.length&&"horizontal"===this._groupOrientation()},_timeSlotGroups:function(e,t){var n,i,r,o,a,s,l,c,d,u,h,f,g,m,v,_,w,y,b=this._timeSlotInterval(),k=this._isVerticallyGrouped(),x=this.content.find("tr"),C=x.length;for(x.attr("role","row"),k&&(C=Math.floor(C/e)),n=0;e>n;n++)for(i=0,r=this.groups[n],k&&(i=n),a=i*C,s=0,k||(s=n),l=x[a].children,c=l.length/(k?1:e),d=c/t,u=0;t>u;u++)for(h=u*d+c*s,o=p(new Date(+this.startTime())),f=0;d>f;f++)g=l[f+h],m=r.getTimeSlotCollection(0),v=this._dates[u],_=Date.UTC(v.getFullYear(),v.getMonth(),v.getDate()),w=_+o,y=w+b,g.setAttribute("role","gridcell"),g.setAttribute("aria-selected",!1),m.addTimeSlot(g,w,y,!0),o+=b},startDate:function(){return this._startDate},endDate:function(){return this._endDate},startTime:function(){var e=this.options;return e.showWorkHours?e.workDayStart:e.startTime},endTime:function(){var e=this.options;return e.showWorkHours?e.workDayEnd:e.endTime},_timeSlotInterval:function(){var e=this.options;return e.majorTick/e.minorTickCount*g},nextDate:function(){return a.date.nextDay(this.endDate())},previousDate:function(){return a.date.previousDay(this.startDate())},calculateDateRange:function(){this._render([this.options.date])},render:function(t){var n,r,o,s,l,c;for(this._headerColumnCount=0,this._groups(),this.element.find(".k-event").remove(),t=new a.data.Query(t).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray(),n=[],this._eventsByResource(t,this.groupedResources,n),r=e.map(this._dates,function(t){return Math.max.apply(null,e.map(n,function(n){return e.grep(n,function(e){return i(t,h(e.start),h(e.end))}).length}))}),o=[],s=0,l=0;n.length>l;l++)c={groupIndex:l,maxRowCount:0,events:{}},o.push(c),this._renderEvents(n[l],l,c),c.maxRowCount>s&&(s=c.maxRowCount);this._setRowsHeight(o,n.length,s),this._positionEvents(o,n.length),this.trigger("activate")},_positionEvents:function(e,t){var n,i,r,o;for(n=0;t>n;n++){i=e[n].events;for(r in i)o=i[r],this._positionEvent(o)}},_setRowsHeight:function(e,t,n){var i,r,o,s,l,c=this.options.eventHeight+2,d=this._getBottomRowOffset();for(t=this._isVerticallyGrouped()?t:1,i=0;t>i;i++)r=this._isVerticallyGrouped()?e[i].maxRowCount:n,r=r?r:1,o=(c+2)*r+d,s=this.times.find(a.format("tr:nth-child({0})",i+1)),l=this.content.find(a.format("tr:nth-child({0})",i+1)),s.height(o),l.height(o);this._setContentWidth(),this.refreshLayout(),this._refreshSlots()},_getBottomRowOffset:function(){var e,t,n=.5*this.options.eventHeight,i=this._isMobile();return i?(e=30,t=60):(e=15,t=30),n>t?n=t:e>n&&(n=e),n},_positionEvent:function(e){var t,n,i=this.options.eventHeight+2,r=e.slotRange.innerRect(e.start,e.end,!1);r.top=e.slotRange.start.offsetTop,t=r.right-r.left-2,0>t&&(t=0),n=r.left,this._isRtl&&(n-=this.content[0].scrollWidth-this.content[0].offsetWidth),e.element.css({top:e.slotRange.start.offsetTop+e.rowIndex*(i+2)+"px",left:n,width:t})},_refreshSlots:function(){for(var e=0;this.groups.length>e;e++)this.groups[e].refresh()},_eventsByResource:function(e,t,n){var i,r,o,s,l=t[0];if(l)for(i=l.dataSource.view(),r=0;i.length>r;r++)o=this._resourceValue(l,i[r]),s=new a.data.Query(e).filter({field:l.field,operator:c.groupEqFilter(o)}).toArray(),t.length>1?this._eventsByResource(s,t.slice(1),n):n.push(s);else n.push(e)},_isInDateSlot:function(e){var t=e.start,n=e.end,i=h(this._startDate),r=a.date.addDays(h(this._endDate),1);return r>t&&n>=i?!0:!1},_isInTimeSlot:function(e){var t,n=e._startTime||a.date.toUtcTime(e.start),i=e._endTime||a.date.toUtcTime(e.end),r=this._slotRanges;for(n===i&&(i+=1),t=0;r.length>t;t++)if(r[t].end>n&&i>r[t].start)return!0;return!1},_adjustEvent:function(e){var t,n=e.start,i=e.end,r=e._time("start"),o=e._time("end"),s=p(this.startTime()),c=p(this.endTime()),d=null,u=null,g=!1,m=!1;return e.isAllDay?(d=h(n),s>r&&(l(d,s),m=!0),u=h(i),c===p(h(this.endTime()))?u=a.date.addDays(u,1):(l(u,c),g=!0)):(c=0===c?f:c,s>r?(d=h(n),l(d,s),m=!0):r>c&&(d=h(n),d=a.date.addDays(d,1),l(d,s),m=!0),o>c?(u=h(i),l(u,c),g=!0):s>o&&(u=h(i),u=a.date.addDays(u,-1),l(u,c),g=!0)),t=e.clone({start:d?d:n,end:u?u:i,_startTime:d?a.date.toUtcTime(d):e._startTime,_endTime:u?a.date.toUtcTime(u):e._endTime,isAllDay:!1}),{occurrence:t,head:g,tail:m}},_renderEvents:function(e,t,n){var i,r,o,a,s,l,c,d,u,h,p;for(r=0,o=e.length;o>r;r++)i=e[r],this._isInDateSlot(i)&&(a=i.isAllDay||i.end.getTime()-i.start.getTime()>=f,s=this.content,(a||this._isInTimeSlot(i))&&(l=this._adjustEvent(i),c=this.groups[t],c._continuousEvents||(c._continuousEvents=[]),d=c.slotRanges(l.occurrence,!1),u=d[0],this._isInTimeSlot(l.occurrence)&&(h=this._createEventElement(l.occurrence,i,u.head||l.head,u.tail||l.tail),h.appendTo(s).css({top:0,height:this.options.eventHeight}),p={start:l.occurrence._startTime||l.occurrence.start,end:l.occurrence._endTime||l.occurrence.end,element:h,uid:i.uid,slotRange:u,rowIndex:0,offsetTop:0},n.events[i.uid]=p,this.addContinuousEvent(c,u,h,i.isAllDay),this._arrangeRows(p,u,n))))},addContinuousEvent:function(e,t,n,i){var r=e._continuousEvents;r.push({element:n,isAllDay:i,uid:n.attr(a.attr("uid")),start:t.start,end:t.end})},_createEventElement:function(t,n,i,r){var o,s,l=this.eventTemplate,c=this.options.editable,u=this._isMobile(),h=c&&c.destroy!==!1&&!u,p=c&&c.resize!==!1,f=n._time("start"),g=n._time("end"),m=n.start,v=n.end,_=this.eventResources(n);return n._startTime&&(m=new Date(f),m=a.timezone.apply(m,"Etc/UTC")),n.endTime&&(v=new Date(g),v=a.timezone.apply(v,"Etc/UTC")),o=d({},{ns:a.ns,resizable:p,showDelete:h,head:i,tail:r,singleDay:1==this._dates.length,resources:_,inverseColor:_&&_[0]?this._shouldInverseResourceColor(_[0]):!1},n,{start:m,end:v}),s=e(l(o)),this.angular("compile",function(){return{elements:s,data:[{dataItem:o}]}}),s},_arrangeRows:function(e,t,n){var i,r,o,a,s,l,d=t.start.index,u=t.end.index,h=c.collidingEvents(t.events(),d,u);for(t.addEvent({slotIndex:d,start:d,end:u,element:e.element,uid:e.uid}),h.push({slotIndex:d,start:d,end:u,element:e.element,uid:e.uid}),i=c.createRows(h),i.length>n.maxRowCount&&(n.maxRowCount=i.length),r=0,o=i.length;o>r;r++)for(a=i[r].events,s=0,l=a.length;l>s;s++)n.events[a[s].uid].rowIndex=r},_groupCount:function(){var e=this.groupedResources;return e.length?"vertical"===this._groupOrientation()?this._rowCountForLevel(e.length-1):this._columnCountForLevel(e.length-1):1},_updateEventForSelection:function(e){var t=this._adjustEvent(e.clone());return t.occurrence},_updateEventForMove:function(e){e.isAllDay&&e.set("isAllDay",!1)},_updateEventForResize:function(e){e.isAllDay&&e.set("isAllDay",!1)},_updateMoveHint:function(e,t,n){var i,r,o,a,s,l,c,d,u,h,p,f=this.groups[t],g=e.clone({start:e.start,end:e.end}),m=g.duration();for(g.start=new Date(g.start.getTime()+n),g.end=new Date(+g.start+m),i=this._adjustEvent(g),r=f.slotRanges(i.occurrence,!1),this._removeMoveHint(),o=0;r.length>o;o++)a=r[o],s=a.start,l=this._createEventElement(i.occurrence,i.occurrence,!1,!1),l.addClass("k-event-drag-hint"),c=a.innerRect(i.occurrence.start,i.occurrence.end,this.options.snap),d=c.right-c.left-2,0>d&&(d=0),u=c.left,this._isRtl&&(u-=this.content[0].scrollWidth-this.content[0].offsetWidth),h={left:u,top:s.offsetTop,height:s.offsetHeight-2,width:d},l.css(h),this._moveHint=this._moveHint.add(l);p=this.content,this._moveHint.appendTo(p)},_updateResizeHint:function(e,t,n,i){var r,o,s,l,d,u,h,p,f,g,m,v=this.groups[t],_=v.ranges(n,i,!1,!1);for(this._removeResizeHint(),r=0;_.length>r;r++)o=_[r],s=o.startSlot(),l=o.innerRect(n,i,!1),l.top=s.offsetTop,d=l.right-l.left,u=s.offsetHeight,h=l.left,p=this.content,this._isRtl&&(h-=p[0].scrollWidth-p[0].offsetWidth),f=c.fn._createResizeHint.call(this,h,l.top,d,u),this._resizeHint=this._resizeHint.add(f);g="t",m=this.content,this._resizeHint.appendTo(m),this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(a.toString(a.timezone.toLocalDate(n),g)),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(a.toString(a.timezone.toLocalDate(i),g))},selectionByElement:function(e){var t=e.offset();return this._slotByPosition(t.left,t.top)},_updateDirection:function(e,t,n,i,r){var o=t[0].start,a=t[t.length-1].end;n&&!r&&o.index===a.index&&o.collectionIndex===a.collectionIndex&&(e.backward=i)},_changeGroup:function(e,t){var n=t?"prevGroupSlot":"nextGroupSlot",i=this[n](e.start,e.groupIndex,!1);return i&&(e.groupIndex+=t?-1:1),i},prevGroupSlot:function(e,t,n){var i,r=this.groups[t],o=r.ranges(e,e,n,!1)[0].start;if(!(0>=t))return this._isVerticallyGrouped()?o:(i=r._collection(0,n),i.last())},nextGroupSlot:function(e,t,n){var i,r=this.groups[t],o=r.ranges(e,e,n,!1)[0].start;if(!(t>=this.groups.length-1))return this._isVerticallyGrouped()?o:(i=r._collection(0,n),i.first())},_verticalSlots:function(e,t,n,i){var r=i?"leftSlot":"rightSlot",o=t[0].start,a=t[t.length-1].end,s=this.groups[e.groupIndex];return o=s[r](o),a=s[r](a),n||!this._isVerticallyGrouped()||o&&a||(o=a=this._changeGroup(e,i)),{startSlot:o,endSlot:a}},_horizontalSlots:function(e,t,n,i){var r=i?"upSlot":"downSlot",o=t[0].start,a=t[t.length-1].end,s=this.groups[e.groupIndex];return o=s[r](o),a=s[r](a),n||!this._isHorizontallyGrouped()||o&&a||(o=a=this._changeGroup(e,i)),{startSlot:o,endSlot:a}},_changeViewPeriod:function(e,t){var n,i=t?this.previousDate():this.nextDate(),r=e.start,o=e.end;return e.start=new Date(i),e.end=new Date(i),this._isHorizontallyGrouped()&&(e.groupIndex=t?this.groups.length-1:0),n=o-r,t?(o=p(this.endTime()),o=0===o?f:o,l(e.start,o-n),l(e.end,o)):(r=p(this.startTime()),l(e.start,r),l(e.end,r+n)),e.events=[],!0},move:function(e,t,n){var i,r,o,s,l,c=!1,d=this.groups[e.groupIndex],u=a.keys,h=d.ranges(e.start,e.end,!1,!1);if(t===u.DOWN||t===u.UP)c=!0,o=t===u.UP,this._updateDirection(e,h,n,o,!0),s=this._verticalSlots(e,h,n,o);else if(!(t!==u.LEFT&&t!==u.RIGHT||(c=!0,o=t===u.LEFT,this._updateDirection(e,h,n,o,!1),s=this._horizontalSlots(e,h,n,o),s.startSlot&&s.endSlot||n||!this._changeViewPeriod(e,o,!1))))return c;return c&&(i=s.startSlot,r=s.endSlot,n?(l=e.backward,l&&i?e.start=i.startDate():!l&&r&&(e.end=r.endDate())):i&&r&&(e.start=i.startDate(),e.end=r.endDate()),e.events=[]),c},destroy:function(){var e=this;e.element&&e.element.off(m),e.footer&&e.footer.remove(),e._currentTimeUpdateTimer&&clearInterval(e._currentTimeUpdateTimer),c.fn.destroy.call(this),this._isMobile()&&e.options.editable&&(e.options.editable.create!==!1&&e._addUserEvents.destroy(),e.options.editable.update!==!1&&e._editUserEvents.destroy())}});d(!0,s,{TimelineView:y,TimelineWeekView:y.extend({options:{name:"TimelineWeekView",title:"Timeline Week",selectedDateFormat:"{0:D} - {1:D}",majorTick:120},name:"timelineWeek",calculateDateRange:function(){var e,t,n=this.options.date,i=a.date.dayOfWeek(n,this.calendarInfo().firstDay,-1),r=[];for(e=0,t=7;t>e;e++)r.push(i),i=a.date.nextDay(i);this._render(r)}}),TimelineWorkWeekView:y.extend({options:{name:"TimelineWorkWeekView",title:"Timeline Work Week",selectedDateFormat:"{0:D} - {1:D}",majorTick:120},name:"timelineWorkWeek",nextDate:function(){return a.date.dayOfWeek(a.date.nextDay(this.endDate()),this.options.workWeekStart,1)},previousDate:function(){return a.date.previousDay(this.startDate())},calculateDateRange:function(){for(var e=this.options.date,t=a.date.dayOfWeek(e,this.options.workWeekStart,-1),n=a.date.dayOfWeek(t,this.options.workWeekEnd,1),i=[];n>=t;)i.push(t),t=a.date.nextDay(t);this._render(i)}}),TimelineMonthView:y.extend({options:{name:"TimelineMonthView",title:"Timeline Month",selectedDateFormat:"{0:D} - {1:D}",workDayStart:new Date(1980,1,1,0,0,0),workDayEnd:new Date(1980,1,1,0,0,0),footer:!1,majorTick:1440,minorTickCount:1},name:"timelineMonth",calculateDateRange:function(){var e,t,n=this.options.date,i=a.date.firstDayOfMonth(n),r=a.date.lastDayOfMonth(n),o=[];for(e=0,t=r.getDate();t>e;e++)o.push(i),i=a.date.nextDay(i);this._render(o)}})})}(window.kendo.jQuery),function(e,t){function n(e,t){return t=t||"",e.startTimezone&&(t=e.startTimezone,e.endTimezone&&(t+=" | "+e.endTimezone)),t}function i(e,t){var n=t.timezone;n&&(e[P.attr("timezone")]=n)}function r(e,t){var n,i=t.model.fields[t.field].validation;i&&(n=i.dateCompare,n&&G(n)&&n.message&&(e[P.attr("dateCompare-msg")]=n.message))}function o(e,t){return function(n){return n=e(n),s(n,"apply",t),n||[]}}function a(e,t){return function(n){return n&&("[object Array]"===Q.call(n)||n instanceof P.data.ObservableArray||(n=[n])),s(n,"remove",t,!0),n=e(n),n||[]}}function s(e,t,n,i){var r,o,a;for(e=e||[],o=0,a=e.length;a>o;o++)r=e[o],i?r.startTimezone||r.endTimezone?n?(r.start=P.timezone.convert(r.start,r.startTimezone||r.endTimezone,n),r.end=P.timezone.convert(r.end,r.endTimezone||r.startTimezone,n),r.start=P.timezone[t](r.start,n),r.end=P.timezone[t](r.end,n)):(r.start=P.timezone[t](r.start,r.startTimezone||r.endTimezone),r.end=P.timezone[t](r.end,r.endTimezone||r.startTimezone)):n&&(r.start=P.timezone[t](r.start,n),r.end=P.timezone[t](r.end,n)):r.startTimezone||r.endTimezone?(r.start=P.timezone[t](r.start,r.startTimezone||r.endTimezone),r.end=P.timezone[t](r.end,r.endTimezone||r.startTimezone),n&&(r.start=P.timezone.convert(r.start,r.startTimezone||r.endTimezone,n),r.end=P.timezone.convert(r.end,r.endTimezone||r.startTimezone,n))):n&&(r.start=P.timezone[t](r.start,n),r.end=P.timezone[t](r.end,n)),i&&delete r.uid;return e}function l(e,t){for(var n,i=e.length,r=0;i>r;r++)if(n=e[r],n.uid===t)return n}function c(e,t,n){return e=n?P.timezone.convert(e,t,n):P.timezone.remove(e,t)}function d(e){var t,n,i,r,o,a,s,l,d,u,h,p;return e.filter("[name=end]").length&&(t=e.closest(".k-scheduler-edit-form"),n=t.find("[name=start]:visible"),i=t.find("[name=end]:visible"),i[0]&&n[0]&&(a=P.widgetInstance(n,P.ui),s=P.widgetInstance(i,P.ui),l=t.data("kendoEditable"),d=l?l.options.model:null,a&&s?(r=a.value(),o=s.value()):(r=P.parseDate(n.val()),o=P.parseDate(i.val())),r&&o))?(d&&(u=n.attr(P.attr("timezone")),h=d.startTimezone,p=d.endTimezone,h=h||p,p=p||h,h&&(r=c(r,h,u),o=c(o,p,u))),o>=r):!0}function u(e,t,n,i){for(var r=e.length,o=[],a=0;r>a;a++)o=o.concat(e[a].expand(t,n,i));return o}function h(e){return delete e.name,delete e.prefix,delete e.remove,delete e.edit,delete e.add,delete e.navigate,e}function p(t){return t=null!=t?t:"",t.type||e.type(t)||"string"}function f(t,n){var i,r,o=(t.fields||t)[n],a=["url","email","number","date","boolean"],s=o?o.validation:{},l=(p(o),P.attr("type")),c=e.inArray,d={};for(i in s)r=s[i],c(i,a)>=0?d[l]=i:P.isFunction(r)||(d[i]=G(r)?r.value||i:r),d[P.attr(i+"-msg")]=r.message;return d}function g(t,n){var i=f(n,t.field);return function(n){e(P.format('<select data-{0}bind="value:{1}">',P.ns,t.field)).appendTo(n).attr(i).kendoDropDownList({dataTextField:t.dataTextField,dataValueField:t.dataValueField,dataSource:t.dataSource,valuePrimitive:t.valuePrimitive,optionLabel:"None",template:P.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"></span>#={1}#',t.dataColorField,t.dataTextField)})}}function m(t){var n=f(t.model,t.field);return function(t){e('<textarea name="description" class="k-textbox"/>').attr(n).appendTo(t)}}function v(t,n){var i=f(n,t.field);return function(n){e(P.format('<select data-{0}bind="value:{1}">',P.ns,t.field)).appendTo(n).attr(i).kendoMultiSelect({dataTextField:t.dataTextField,dataValueField:t.dataValueField,dataSource:t.dataSource,valuePrimitive:t.valuePrimitive,itemTemplate:P.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"></span>#={1}#',t.dataColorField,t.dataTextField),tagTemplate:P.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"></span>#={1}#',t.dataColorField,t.dataTextField)})}}function _(t,n){var i=f(n,t.field);return function(n){var r,o,a="",s=t.dataSource.view();for(r=0,o=s.length;o>r;r++)a+=P.format('<option value="{0}">{1}</option>',P.getter(t.dataValueField)(s[r]),P.getter(t.dataTextField)(s[r]));e(P.format('<select data-{0}bind="value:{1}" multiple="multiple" data-{0}value-primitive="{3}">{2}</select>',P.ns,t.field,a,t.valuePrimitive)).appendTo(n).attr(i)}}function w(e,t){var n,i=e.end.getTime()-e.start.getTime(),r=new Date(e.start.getTime());return P.date.setTime(r,t),n=new Date(r.getTime()),P.date.setTime(n,i,!0),{start:r,end:n}}var y,b,k,x,C,T,S,D,A,E,I,P=window.kendo,M=P.date,F=P.support.input,z=M.MS_PER_DAY,R=M.getDate,B=P.date.getMilliseconds,H=P.recurrence,L=P.keys,N=P.ui,O=N.Widget,V=N.DataBoundWidget,U="string",W=N.Popup,j=N.Calendar,q=P.data.DataSource,G=e.isPlainObject,$=e.extend,Y=e.proxy,Q=Object.prototype.toString,K=e.isArray,X=".kendoScheduler",Z="click",J="change",et="cancel",tt="remove",nt="save",it="add",rt="edit",ot=/(?:value:start|value:end)(?:,|$)/,at=R(new Date),st="recurrenceException",lt="Are you sure you want to delete this event?",ct="Do you want to delete only this event occurrence or the whole series?",dt="Do you want to edit only this event occurrence or the whole series?",ut='<a class="k-button #=className#" #=attr# href="\\#">#=text#</a>',ht=P.template('<div class="k-floatwrap k-header k-scheduler-toolbar"># if (pdf) { #<ul class="k-reset k-scheduler-tools"><li><a role="button" href="\\#" class="k-button k-pdf"><span class="k-icon k-i-pdf"></span>${messages.pdf}</a></li></ul># } #<ul class="k-reset k-scheduler-navigation"><li class="k-state-default k-header k-nav-today"><a role="button" href="\\#" class="k-link">${messages.today}</a></li><li class="k-state-default k-header k-nav-prev"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-w"></span></a></li><li class="k-state-default k-header k-nav-next"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-e"></span></a></li><li class="k-state-default k-nav-current"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-calendar"></span><span data-#=ns#bind="text: formattedDate"></span></a></li></ul><ul class="k-reset k-header k-scheduler-views">#for(var view in views){#<li class="k-state-default k-view-#= view.toLowerCase() #" data-#=ns#name="#=view#"><a role="button" href="\\#" class="k-link">${views[view].title}</a></li>#}#</ul></div>'),pt=P.template('<div class="k-floatwrap k-header k-scheduler-toolbar"><ul class="k-reset k-header k-scheduler-navigation"><li class="k-state-default k-nav-today"><a role="button" href="\\#" class="k-link">${messages.today}</a></li></ul><ul class="k-reset k-header k-scheduler-views">#for(var view in views){#<li class="k-state-default k-view-#= view.toLowerCase() #" data-#=ns#name="#=view#"><a role="button" href="\\#" class="k-link">${views[view].title}</a></li>#}#</ul></div><div class="k-floatwrap k-header k-scheduler-toolbar"><ul class="k-reset k-header k-scheduler-navigation"><li class="k-state-default k-nav-prev"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-w"></span></a></li><li class="k-state-default k-nav-current"><span data-#=ns#bind="text: formattedDate"></span></li><li class="k-state-default k-nav-next"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-e"></span></a></li></ul></div>'),ft=function(t,n){var o={name:n.field},a=F.date?"":P.attr("role")+'="datepicker" ',s=P.attr("role")+'="datetimepicker" ',l=n.model.isAllDay,c=P.attr("validate")+"='"+!l+"'",d=P.attr("validate")+"='"+l+"'";i(o,n),r(o,n),e('<input type="datetime-local" required '+P.attr("type")+'="date" '+s+P.attr("bind")+'="value:'+n.field+',invisible:isAllDay" '+c+"/>").attr(o).appendTo(t),e('<input type="date" required '+P.attr("type")+'="date" '+a+P.attr("bind")+'="value:'+n.field+',visible:isAllDay" '+d+"/>").attr(o).appendTo(t),e("<span "+P.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},gt=function(t,n){var o={name:n.field},a=n.model.isAllDay,s=P.attr("validate")+"='"+!a+"' ",l=P.attr("validate")+"='"+a+"' ";i(o,n),r(o,n),e('<input type="text" required '+P.attr("type")+'="date" '+P.attr("role")+'="datetimepicker" '+P.attr("bind")+'="value:'+n.field+',invisible:isAllDay" '+s+"/>").attr(o).appendTo(t),e('<input type="text" required '+P.attr("type")+'="date" '+P.attr("role")+'="datepicker" '+P.attr("bind")+'="value:'+n.field+',visible:isAllDay" '+l+"/>").attr(o).appendTo(t),e("<span "+P.attr("bind")+'="text: '+n.field+'Timezone"></span>').appendTo(t),"end"===n.field&&e("<span "+P.attr("bind")+'="text: startTimezone, invisible: endTimezone"></span>').appendTo(t),e("<span "+P.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},mt=function(t,n){e("<div "+P.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).appendTo(t).kendoRecurrenceEditor({start:n.model.start,timezone:n.timezone,messages:n.messages})},vt=function(t,n){e("<div "+P.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).appendTo(t).kendoMobileRecurrenceEditor({start:n.model.start,timezone:n.timezone,messages:n.messages,pane:n.pane,value:n.model[n.field]})},_t=function(t,i){var r=n(i.model,i.messages.noTimezone);e('<a href="#" class="k-button k-timezone-button" data-bind="invisible:isAllDay">'+r+"</a>").click(i.click).appendTo(t)},wt=function(t,n){e('<a href="#" class="k-button" data-bind="invisible:isAllDay">'+n.messages.timezoneEditorButton+"</a>").click(n.click).appendTo(t)},yt=function(t,n){e("<div "+P.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).toggle(n.visible).appendTo(t).kendoMobileTimezoneEditor({optionLabel:n.noTimezone})},bt=function(t,n){e("<div "+P.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).toggle(n.visible).appendTo(t).kendoTimezoneEditor({optionLabel:n.noTimezone})},kt=P.Class.extend({init:function(t,n){var i=t.timezone;this.reader=n,n.model&&(this.model=n.model),this.timezone=i,this.data=o(e.proxy(this.data,this),i),this.serialize=a(e.proxy(this.serialize,this),i)},errors:function(e){return this.reader.errors(e)},parse:function(e){return this.reader.parse(e)},data:function(e){return this.reader.data(e)},total:function(e){return this.reader.total(e)},groups:function(e){return this.reader.groups(e)},aggregates:function(e){return this.reader.aggregates(e)},serialize:function(e){return this.reader.serialize(e)}}),xt=P.data.Model.define({init:function(e){var t=this;P.data.Model.fn.init.call(t,e),t._defaultId=t.defaults[t.idField]},_time:function(e){var t=this[e],n="_"+e+"Time";return this[n]?this[n]-P.date.toUtcTime(P.date.getDate(t)):B(t)},_date:function(e){var t="_"+e+"Time";return this[t]?this[t]-this._time(e):P.date.getDate(this[e])},clone:function(t,n){var i=this.uid,r=new this.constructor(e.extend({},this.toJSON(),t));return n||(r.uid=i),r},duration:function(){var e=this.end,t=this.start,n=(e.getTimezoneOffset()-t.getTimezoneOffset())*P.date.MS_PER_MINUTE;return e-t-n},expand:function(e,t,n){return H?H.expand(this,e,t,n):[this]},update:function(e){for(var t in e)this.set(t,e[t]);this._startTime&&this.set("_startTime",P.date.toUtcTime(this.start)),this._endTime&&this.set("_endTime",P.date.toUtcTime(this.end))},isMultiDay:function(){return this.isAllDay||this.duration()>=P.date.MS_PER_DAY},isException:function(){return!this.isNew()&&this.recurrenceId},isOccurrence:function(){return this.isNew()&&this.recurrenceId},isRecurring:function(){return!(!this.recurrenceRule&&!this.recurrenceId)},isRecurrenceHead:function(){return!(!this.id||!this.recurrenceRule)},toOccurrence:function(t){return t=e.extend(t,{recurrenceException:null,recurrenceRule:null,recurrenceId:this.id||this.recurrenceId}),t[this.idField]=this.defaults[this.idField],this.clone(t,!0)},toJSON:function(){var e=P.data.Model.fn.toJSON.call(this);return e.uid=this.uid,delete e._startTime,delete e._endTime,e},shouldSerialize:function(e){return P.data.Model.fn.shouldSerialize.call(this,e)&&"_defaultId"!==e},set:function(e,t){var n,i,r,o=this.isAllDay||!1;P.data.Model.fn.set.call(this,e,t),"isAllDay"==e&&t!=o&&(n=P.date.getDate(this.start),i=new Date(this.end),r=P.date.getMilliseconds(i),0===r&&t&&(r=z),this.set("start",n),t===!0?(P.date.setTime(i,-r),n>i&&(i=n)):P.date.setTime(i,z-r),this.set("end",i))
},id:"id",fields:{id:{type:"number"},title:{defaultValue:"",type:"string"},start:{type:"date",validation:{required:!0}},startTimezone:{type:"string"},end:{type:"date",validation:{required:!0,dateCompare:{value:d,message:"End date should be greater than or equal to the start date"}}},endTimezone:{type:"string"},recurrenceRule:{defaultValue:"",type:"string"},recurrenceException:{defaultValue:"",type:"string"},isAllDay:{type:"boolean",defaultValue:!1},description:{type:"string"}}}),Ct=q.extend({init:function(e){q.fn.init.call(this,$(!0,{},{schema:{modelBase:xt,model:xt}},e)),this.reader=new kt(this.options.schema,this.reader)},expand:function(e,t){var n=this.view(),i={};return e&&t&&(t=new Date(t.getTime()+z-1),i={logic:"or",filters:[{logic:"and",filters:[{field:"start",operator:"gte",value:e},{field:"end",operator:"gte",value:e},{field:"start",operator:"lte",value:t}]},{logic:"and",filters:[{field:"start",operator:"lte",value:new Date(e.getTime()+z-1)},{field:"end",operator:"gte",value:e}]}]},n=new P.data.Query(u(n,e,t,this.reader.timezone)).filter(i).toArray()),n},cancelChanges:function(e){e&&e.isOccurrence()&&this._removeExceptionDate(e),q.fn.cancelChanges.call(this,e)},insert:function(e,t){if(t){if(!(t instanceof xt)){var n=t;t=this._createNewModel(),t.accept(n)}return(!this._pushCreated&&t.isRecurrenceHead()||t.recurrenceId)&&(t=t.recurrenceId?t:t.toOccurrence(),this._addExceptionDate(t)),q.fn.insert.call(this,e,t)}},pushCreate:function(e){this._pushCreated=!0,q.fn.pushCreate.call(this,e),this._pushCreated=!1},remove:function(e){return e.isRecurrenceHead()?this._removeExceptions(e):e.isRecurring()&&this._addExceptionDate(e),q.fn.remove.call(this,e)},_removeExceptions:function(e){for(var t=this.data().slice(0),n=t.shift(),i=e.id;n;)n.recurrenceId===i&&q.fn.remove.call(this,n),n=t.shift();e.set(st,"")},_removeExceptionDate:function(e){var t,n;e.recurrenceId&&(t=this.get(e.recurrenceId),t&&(n=e.start,t.set(st,t.recurrenceException.replace(H.toExceptionString(n,this.reader.timezone),""))))},_addExceptionDate:function(e){var t=e.start,n=this.reader.timezone,i=this.get(e.recurrenceId),r=i.recurrenceException||"";H.isException(r,t,n)||i.set(st,r+H.toExceptionString(t,n))}});Ct.create=function(e){e=e&&e.push?{data:e}:e;var t=e||{},n=t.data;if(t.data=n,!(t instanceof Ct)&&t instanceof P.data.DataSource)throw Error("Incorrect DataSource type. Only SchedulerDataSource instances are supported");return t instanceof Ct?t:new Ct(t)},$(!0,P.data,{SchedulerDataSource:Ct,SchedulerDataReader:kt,SchedulerEvent:xt}),y={update:{text:"Save",className:"k-primary k-scheduler-update"},canceledit:{text:"Cancel",className:"k-scheduler-cancel"},destroy:{text:"Delete",imageClass:"k-delete",className:"k-primary k-scheduler-delete",iconClass:"k-icon"}},b={mobile:{dateRange:ft,timezonePopUp:_t,timezone:yt,recurrence:vt,description:m,multipleResources:_,resources:g},desktop:{dateRange:gt,timezonePopUp:wt,timezone:bt,recurrence:mt,description:m,multipleResources:v,resources:g}},k=P.Observable.extend({init:function(e,t){P.Observable.fn.init.call(this),this.element=e,this.options=$(!0,{},this.options,t),this.createButton=this.options.createButton,this.toggleDateValidationHandler=Y(this._toggleDateValidation,this)},_toggleDateValidation:function(t){if("isAllDay"==t.field){var n,i,r,o=this.container,a=this.editable.options.model.isAllDay,s=P.attr("bind");o.find("["+s+"*=end],["+s+"*=start]").each(function(){n=e(this),ot.test(n.attr(s))&&(i=n.is("["+P.attr("role")+"=datetimepicker],[type*=datetime]"),r=a!==i,n.attr(P.attr("validate"),r))})}},fields:function(e,t){var n,i,r=this,o=r.options.messages,a=r.options.timezone,s=function(e){e.preventDefault(),r._initTimezoneEditor(t,this)},l=[{field:"title",title:o.editor.title},{field:"start",title:o.editor.start,editor:e.dateRange,timezone:a},{field:"end",title:o.editor.end,editor:e.dateRange,timezone:a},{field:"isAllDay",title:o.editor.allDayEvent}];P.timezone.windows_zones&&(l.push({field:"timezone",title:o.editor.timezone,editor:e.timezonePopUp,click:s,messages:o.editor,model:t}),l.push({field:"startTimezone",title:o.editor.startTimezone,editor:e.timezone,noTimezone:o.editor.noTimezone}),l.push({field:"endTimezone",title:o.editor.endTimezone,editor:e.timezone,noTimezone:o.editor.noTimezone})),t.recurrenceId||l.push({field:"recurrenceRule",title:o.editor.repeat,editor:e.recurrence,timezone:a,messages:o.recurrenceEditor,pane:this.pane}),"description"in t&&l.push({field:"description",title:o.editor.description,editor:e.description({model:t,field:"description"})});for(n=0;this.options.resources.length>n;n++)i=this.options.resources[n],l.push({field:i.field,title:i.title,editor:i.multiple?e.multipleResources(i,t):e.resources(i,t)});return l},end:function(){return this.editable.end()},_buildEditTemplate:function(e,t,n){var i,r,o,a,s=this.options.messages,l=$({},P.Template,this.options.templateSettings),c=l.paramName,d=this.options.editable.template,u="";if(d)typeof d===U&&(d=window.unescape(d)),u+=P.template(d,l)(e);else for(i=0,r=t.length;r>i;i++)o=t[i],"startTimezone"===o.field&&(u+='<div class="k-popup-edit-form k-scheduler-edit-form k-scheduler-timezones" style="display:none">',u+='<div class="k-edit-form-container">',u+='<div class="k-edit-label"></div>',u+='<div class="k-edit-field"><label class="k-check"><input class="k-timezone-toggle" type="checkbox" />'+s.editor.separateTimezones+"</label></div>"),u+='<div class="k-edit-label"><label for="'+o.field+'">'+(o.title||o.field||"")+"</label></div>",!e.editable||e.editable(o.field)?(n.push(o),u+="<div "+P.attr("container-for")+'="'+o.field+'" class="k-edit-field"></div>'):(a="#:",o.field?(o=P.expr(o.field,c),a+=o+"==null?'':"+o):a+="''",a+="#",a=P.template(a,l),u+='<div class="k-edit-field">'+a(e)+"</div>"),"endTimezone"===o.field&&(u+=this._createEndTimezoneButton());return u},_createEndTimezoneButton:function(){return"</div></div>"},_revertTimezones:function(e){e.set("startTimezone",this._startTimezone),e.set("endTimezone",this._endTimezone),delete this._startTimezone,delete this._endTimezone}}),x=k.extend({init:function(){k.fn.init.apply(this,arguments),this.pane=P.mobile.ui.Pane.wrap(this.element),this.pane.element.parent().css("height",this.options.height),this.view=this.pane.view(),this._actionSheetButtonTemplate=P.template('<li><a #=attr# class="k-button #=className#" href="\\#">#:text#</a></li>'),this._actionSheetPopupOptions=e(document.documentElement).hasClass("km-root")?{modal:!1}:{align:"bottom center",position:"bottom center",effect:"slideIn:up"}},options:{animations:{left:"slide",right:"slide:right"}},destroy:function(){this.close(),this.unbind(),this.pane.destroy()},_initTimezoneEditor:function(t){var i,r=this,o=r.pane,a=r.options.messages,s=r.timezoneView,l=r.container.find(".k-scheduler-timezones"),c=l.find(".k-timezone-toggle"),d=l.find(".k-edit-label:last").add(l.find(".k-edit-field:last")),u=function(e){if("startTimezone"===e.field){var n=t.startTimezone;c.prop("disabled",!n),n||(d.hide(),t.set("endTimezone",""),c.prop("checked",!1))}};r._startTimezone=t.startTimezone||"",r._endTimezone=t.endTimezone||"",s||(i='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+a.cancel+"</a>"+a.editor.timezoneTitle+'<a href="#" class="k-button k-scheduler-update">'+a.save+"</a></div></div>",this.timezoneView=s=o.append(i),s.contentElement().append(l.show()),s.element.on(Z+X,".k-scheduler-cancel, .k-scheduler-update",function(i){var s,l;i.preventDefault(),i.stopPropagation(),e(this).hasClass("k-scheduler-cancel")&&r._revertTimezones(t),t.unbind("change",u),s=o.element.find("#edit").data("kendoMobileView"),l=n(t,a.editor.noTimezone),s.contentElement().find(".k-timezone-button").text(l),o.navigate(s,r.options.animations.right)}),c.click(function(){d.toggle(c.prop("checked")),t.set("endTimezone","")}),t.bind("change",u)),c.prop("checked",t.endTimezone).prop("disabled",!t.startTimezone),t.endTimezone?d.show():d.hide(),o.navigate(s,r.options.animations.left)},_createActionSheetButton:function(e){return e.template=this._actionSheetButtonTemplate,this.createButton(e)},showDialog:function(t){var n,i,r="",o='<ul><li class="km-actionsheet-title">'+t.title+"</li>",a=this.element.find(".k-event["+P.attr("uid")+"='"+t.model.uid+"']");for(this.container&&(a=this.container.find(".k-scheduler-delete"),a[0]&&(r="phone")),n=0;t.buttons.length>n;n++)o+=this._createActionSheetButton(t.buttons[n]);o+="</ul>",i=e(o).appendTo(this.pane.view().element).kendoMobileActionSheet({type:r,cancel:this.options.messages.cancel,cancelTemplate:'<li class="km-actionsheet-cancel"><a class="k-button" href="\\#">#:cancel#</a></li>',close:function(){this.destroy()},command:function(n){var r=i.element.find("li:not(.km-actionsheet-cancel) > .k-button").index(e(n.currentTarget));r>-1&&(i.close(),t.buttons[r].click())},popup:this._actionSheetPopupOptions}).data("kendoMobileActionSheet"),i.open(a)},editEvent:function(t){var n,i,r,o,a,s=this.pane,l="",c=this.options.messages,d=c.save,u=c.destroy,h=c.cancel,p=c.editor.editorTitle;return l+='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list" id="edit" '+P.attr("uid")+'="'+t.uid+'"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+h+"</a>"+p+'<a href="#" class="k-button k-scheduler-update">'+d+"</a></div>",n=this.fields(b.mobile,t),i=this,r=[],l+=this._buildEditTemplate(t,n,r),!t.isNew()&&this.options.editable&&this.options.editable.destroy!==!1&&(l+='<div class="k-edit-buttons"><a href="#" class="k-scheduler-delete k-button">'+u+"</a></div>"),l+="</div>",o=s.append(l),a=this.container=o.element,this.editable=a.kendoEditable({fields:r,model:t,clearContainer:!1,target:i.options.target,validateOnBlur:!0}).data("kendoEditable"),a.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){e(this).next().children("input").click()}),this.trigger("edit",{container:a,model:t})?this.trigger("cancel",{container:a,model:t}):(a.on(Z+X,"a.k-scheduler-edit, a.k-scheduler-cancel, a.k-scheduler-update, a.k-scheduler-delete",function(n){var r,o;n.preventDefault(),n.stopPropagation(),r=e(this),r.hasClass("k-scheduler-edit")?s.navigate("#edit",i.options.animations.right):(o="cancel",r.hasClass("k-scheduler-update")?o="save":r.hasClass("k-scheduler-delete")&&(o="remove"),i.trigger(o,{container:a,model:t}))}),s.navigate(o,i.options.animations.left),t.bind("change",i.toggleDateValidationHandler)),this.editable},_views:function(){return this.pane.element.find(P.roleSelector("view")).not(this.view.element)},close:function(){var e,t,n,i;if(this.container){for(this.pane.navigate("",this.options.animations.right),e=this._views(),n=0,i=e.length;i>n;n++)t=e.eq(n).data("kendoMobileView"),t&&t.purge();e.remove(),this.container=null,this.editable&&(this.editable.options.model.unbind("change",this.toggleDateValidationHandler),this.editable.destroy(),this.editable=null),this.timezoneView=null}}}),C=k.extend({destroy:function(){this.close(),this.unbind()},editEvent:function(t){var n,i,r,o=this,a=o.options.editable,s="<div "+P.attr("uid")+'="'+t.uid+'" class="k-popup-edit-form k-scheduler-edit-form"><div class="k-edit-form-container">',l=o.options.messages,c=l.save,d=l.cancel,u=l.destroy,h=this.fields(b.desktop,t),p=[];return s+=this._buildEditTemplate(t,h,p),i=G(a)?a.window:{},s+='<div class="k-edit-buttons k-state-default">',s+=this.createButton({name:"update",text:c,attr:n})+this.createButton({name:"canceledit",text:d,attr:n}),t.isNew()||a.destroy===!1||(s+=this.createButton({name:"delete",text:u,attr:n})),s+="</div></div></div>",r=this.container=e(s).appendTo(o.element).eq(0).kendoWindow($({modal:!0,resizable:!1,draggable:!0,title:l.editor.editorTitle,visible:!1,close:function(e){e.userTriggered&&o.trigger(et,{container:r,model:t})&&e.preventDefault()}},i)),o.editable=r.kendoEditable({fields:p,model:t,clearContainer:!1,validateOnBlur:!0,target:o.options.target}).data("kendoEditable"),o.trigger(rt,{container:r,model:t})?o.trigger(et,{container:r,model:t}):(r.data("kendoWindow").center().open(),r.on(Z+X,"a.k-scheduler-cancel",function(e){e.preventDefault(),e.stopPropagation(),o.trigger(et,{container:r,model:t})}),r.on(Z+X,"a.k-scheduler-update",function(e){e.preventDefault(),e.stopPropagation(),o.trigger("save",{container:r,model:t})}),r.on(Z+X,"a.k-scheduler-delete",function(e){e.preventDefault(),e.stopPropagation(),o.trigger(tt,{container:r,model:t})}),t.bind("change",o.toggleDateValidationHandler)),o.editable},close:function(){var e=this,t=function(){e.editable&&(e.editable.options.model.unbind("change",e.toggleDateValidationHandler),e.editable.destroy(),e.editable=null,e.container=null),e.popup&&(e.popup.destroy(),e.popup=null)};e.editable?(e._timezonePopup&&e._timezonePopup.data("kendoWindow")&&(e._timezonePopup.data("kendoWindow").destroy(),e._timezonePopup=null),e.container.is(":visible")?e.container.data("kendoWindow").bind("deactivate",t).close():t()):t()},_createEndTimezoneButton:function(){var e=this.options.messages,t="";return t+='<div class="k-edit-buttons k-state-default">',t+=this.createButton({name:"savetimezone",text:e.save})+this.createButton({name:"canceltimezone",text:e.cancel}),t+="</div></div></div>"},showDialog:function(t){var n,i,r,o=P.format("<div class='k-popup-edit-form'><div class='k-edit-form-container'><p class='k-popup-message'>{0}</p>",t.text);for(o+='<div class="k-edit-buttons k-state-default">',n=0;t.buttons.length>n;n++)o+=this.createButton(t.buttons[n]);o+="</div></div></div>",i=this.element,this.popup&&this.popup.destroy(),r=this.popup=e(o).appendTo(i).eq(0).on("click",".k-button",function(n){n.preventDefault(),r.close();var i=e(n.currentTarget).index();t.buttons[i].click()}).kendoWindow({modal:!0,resizable:!1,draggable:!1,title:t.title,visible:!1,close:function(){this.destroy(),i.focus()}}).getKendoWindow(),r.center().open()},_initTimezoneEditor:function(e,t){var n,i=this,r=i.container.find(".k-scheduler-timezones"),o=r.find(".k-timezone-toggle"),a=r.find(".k-edit-label:last").add(r.find(".k-edit-field:last")),s=r.find(".k-scheduler-savetimezone"),l=r.find(".k-scheduler-canceltimezone"),c=i._timezonePopup,d=function(t){if("startTimezone"===t.field){var n=e.startTimezone;o.prop("disabled",!n),n||(a.hide(),e.set("endTimezone",""),o.prop("checked",!1))}};i._startTimezone=e.startTimezone,i._endTimezone=e.endTimezone,c||(i._timezonePopup=c=r.kendoWindow({modal:!0,resizable:!1,draggable:!0,title:i.options.messages.editor.timezoneEditorTitle,visible:!1,close:function(n){e.unbind("change",d),n.userTriggered&&i._revertTimezones(e),t&&t.focus()}}),o.click(function(){a.toggle(o.prop("checked")),e.set("endTimezone","")}),s.click(function(e){e.preventDefault(),n.close()}),l.click(function(t){t.preventDefault(),i._revertTimezones(e),n.close()}),e.bind("change",d)),o.prop("checked",e.endTimezone).prop("disabled",!e.startTimezone),e.endTimezone?a.show():a.hide(),n=c.data("kendoWindow"),n.center().open()}}),T=V.extend({init:function(t,n){var i=this;O.fn.init.call(i,t,n),i.options.views&&i.options.views.length||(i.options.views=["day","week"]),i.resources=[],i._initModel(),i._wrapper(),i._views(),i._toolbar(),i._dataSource(),i._resources(),i._resizeHandler=Y(i.resize,i),i.wrapper.on("mousedown"+X+" selectstart"+X,function(t){e(t.target).is(":kendoFocusable")||t.preventDefault()}),i.options.editable&&i.options.editable.resize!==!1&&i._resizable(),i._movable(),e(window).on("resize"+X,i._resizeHandler),i.options.messages&&i.options.messages.recurrence&&(H.options=i.options.messages.recurrence),i._selectable(),i._ariaId=P.guid(),i._createEditor()},dataItems:function(){var n,i,r,o,a,s=this,l=s.items(),c=s._data,d=e.map(l,function(t){return e(t).attr("data-uid")}),u={},h=d.length;for(n=0;h>n;n++)u[d[n]]=null;for(r=c.length,n=0;r>n;n++)o=c[n],u[o.uid]!==t&&(u[o.uid]=o);a=[];for(i in u)a.push(u[i]);return a},_isMobile:function(){var e=this.options;return e.mobile===!0&&P.support.mobileOS||"phone"===e.mobile||"tablet"===e.mobile},_isMobilePhoneView:function(){var e=this.options;return e.mobile===!0&&P.support.mobileOS&&!P.support.mobileOS.tablet||"phone"===e.mobile},_selectable:function(){var t,n=this,i=n.wrapper,r=P.support.mobileOS?"touchend":"mousedown";n.options.selectable&&(n._tabindex(),i.on(r+X,".k-scheduler-header-all-day td, .k-scheduler-content td, .k-event",function(e){var t=e.which,r=e.button,o=P.support.browser,a=t&&3===t||r&&2==r;P.support.mobileOS&&e.isDefaultPrevented()||(a||n._createSelection(e.currentTarget),i.focus(),o.msie&&9>o.version&&setTimeout(function(){i.focus()}))}),t=e.proxy(n._mouseMove,n),i.on("mousedown"+X,".k-scheduler-header-all-day td, .k-scheduler-content td",function(e){var n=e.which,r=e.button,o=n&&3===n||r&&2==r;o||i.on("mousemove"+X,".k-scheduler-header-all-day td, .k-scheduler-content td",t)}),i.on("mouseup"+X+" mouseleave"+X,function(){i.off("mousemove"+X,".k-scheduler-header-all-day td, .k-scheduler-content td",t)}),i.on("focus"+X,function(){n._selection||n._createSelection(e(".k-scheduler-content").find("td:first")),n._select()}),i.on("focusout"+X,function(){n.view().clearSelection(),n._ctrlKey=n._shiftKey=!1}),i.on("keydown"+X,Y(n._keydown,n)),i.on("keyup"+X,function(e){n._ctrlKey=e.ctrlKey,n._shiftKey=e.shiftKey}))},_select:function(){var e,t,n,i,r=this,o=r.view(),a=r.wrapper,s=o.current(),l=r._selection;s&&(s.removeAttribute("id"),s.removeAttribute("aria-label"),a.removeAttr("aria-activedescendant")),o.select(l),s=o.current(),s&&r._old!==s&&(t=l,n=r._selectedEvents(),i=o._selectedSlots,n[0]?(t=n[0]||l,e=P.format(r.options.messages.ariaEventLabel,t.title,t.start,t.start)):e=P.format(r.options.messages.ariaSlotLabel,t.start,t.end),s.setAttribute("id",r._ariaId),s.setAttribute("aria-label",e),a.attr("aria-activedescendant",r._ariaId),r._old=s,r.trigger("change",{start:l.start,end:l.end,events:n,slots:i,resources:o._resourceBySlot(l)}))},_selectedEvents:function(){for(var e,t=this._selection.events,n=t.length,i=0,r=[];n>i;i++)e=this.occurrenceByUid(t[i]),e&&r.push(e);return r},_mouseMove:function(t){var n=this;clearTimeout(n._moveTimer),n._moveTimer=setTimeout(function(){var i,r,o,a=n.view(),s=n._selection;s&&(i=a.selectionByElement(e(t.currentTarget)),i&&s.groupIndex===i.groupIndex&&(r=i.startDate(),o=i.endDate(),r>=s.end?s.backward=!1:s.start>=o&&(s.backward=!0),s.backward?s.start=r:s.end=o,n._select()))},5)},_viewByIndex:function(e){var t,n=this.views;for(t in n){if(!e)return t;e--}},_keydown:function(t){var n=this,i=t.keyCode,r=n.view(),o=r.options.editable,a=n._selection,s=t.shiftKey;n._ctrlKey=t.ctrlKey,n._shiftKey=t.shiftKey,i===L.TAB?r.moveToEvent(a,s)&&(n._select(),t.preventDefault()):o&&i===L.ENTER?a.events.length?o.update!==!1&&n.editEvent(a.events[0]):o.create!==!1&&(a.isAllDay&&(a=e.extend({},a,{end:P.date.addDays(a.end,-1)})),n.addEvent($({},a,r._resourceBySlot(a)))):i===L.DELETE&&o!==!1&&o.destroy!==!1?n.removeEvent(a.events[0]):i>=49&&57>=i?n.view(n._viewByIndex(i-49)):r.move(a,i,s)&&(r.inRange(a)?n._select():n.date(a.start),t.preventDefault()),n._adjustSelectedDate()},_createSelection:function(t){var n,i,r;this._selection&&(this._ctrlKey||this._shiftKey)||(this._selection={events:[],groupIndex:0}),t=e(t),r=this._selection,n=t.attr(P.attr("uid")),i=this.view().selectionByElement(t),i&&(r.groupIndex=i.groupIndex||0),n&&(i=l(this._data,n)),i&&i.uid&&(n=[i.uid]),this._updateSelection(i,n),this._adjustSelectedDate()},_updateSelection:function(e,t){var n,i,r=this._selection;e&&r&&(n=this.view(),e.uid&&(e=n._updateEventForSelection(e)),this._shiftKey&&r.start&&r.end?(i=r.end>e.end,r.end=e.endDate?e.endDate():e.end,i&&n._timeSlotInterval&&P.date.setTime(r.end,-n._timeSlotInterval())):(r.start=e.startDate?e.startDate():e.start,r.end=e.endDate?e.endDate():e.end),r.isAllDay="isDaySlot"in e?e.isDaySlot:e.isAllDay,r.index=e.index,r.events=this._ctrlKey?r.events.concat(t||[]):t||[])},options:{name:"Scheduler",date:at,editable:!0,autoBind:!0,snap:!0,mobile:!1,timezone:"",allDaySlot:!0,min:new Date(1900,0,1),max:new Date(2099,11,31),toolbar:null,messages:{today:"Today",pdf:"Export to PDF",save:"Save",cancel:"Cancel",destroy:"Delete",deleteWindowTitle:"Delete event",ariaSlotLabel:"Selected from {0:t} to {1:t}",ariaEventLabel:"{0} on {1:D} at {2:t}",views:{day:"Day",week:"Week",workWeek:"Work Week",agenda:"Agenda",month:"Month",timeline:"Timeline",timelineWeek:"Timeline Week",timelineWorkWeek:"Timeline Work Week",timelineMonth:"Timeline Month"},recurrenceMessages:{deleteWindowTitle:"Delete Recurring Item",deleteWindowOccurrence:"Delete current occurrence",deleteWindowSeries:"Delete the series",editWindowTitle:"Edit Recurring Item",editWindowOccurrence:"Edit current occurrence",editWindowSeries:"Edit the series"},editor:{title:"Title",start:"Start",end:"End",allDayEvent:"All day event",description:"Description",repeat:"Repeat",timezone:" ",startTimezone:"Start timezone",endTimezone:"End timezone",separateTimezones:"Use separate start and end time zones",timezoneEditorTitle:"Timezones",timezoneEditorButton:"Time zone",timezoneTitle:"Time zones",noTimezone:"No timezone",editorTitle:"Event"}},height:null,width:null,resources:[],group:{resources:[],direction:"horizontal"},views:[],selectable:!1},events:[tt,rt,et,nt,"add","dataBinding","dataBound","moveStart","move","moveEnd","resizeStart","resize","resizeEnd","navigate","change"],destroy:function(){var t,n=this;O.fn.destroy.call(n),n.dataSource&&(n.dataSource.unbind(J,n._refreshHandler),n.dataSource.unbind("progress",n._progressHandler),n.dataSource.unbind("error",n._errorHandler)),n.calendar&&(n.calendar.destroy(),n.popup.destroy()),n.view()&&n.view().destroy(),n._editor&&n._editor.destroy(),this._moveDraggable&&this._moveDraggable.destroy(),this._resizeDraggable&&this._resizeDraggable.destroy(),t=n.element.add(n.wrapper).add(n.toolbar).add(n.popup),t.off(X),clearTimeout(n._moveTimer),n._model=null,n.toolbar=null,n.element=null,e(window).off("resize"+X,n._resizeHandler),P.destroy(n.wrapper)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&e.fetch()},items:function(){return this.wrapper.find(".k-scheduler-content").children(".k-event, .k-task")},_movable:function(){var n,i,r,o,a,s,l=this,c=l._isMobile(),d=l.options.editable&&l.options.editable.move!==!1,u=l.options.editable&&l.options.editable.resize!==!1;(d||u&&c)&&(l._moveDraggable=new P.ui.Draggable(l.element,{distance:0,filter:".k-event",ignore:".k-resize-handle",holdToDrag:c}),d&&l._moveDraggable.bind("dragstart",function(e){var o=l.view(),d=e.currentTarget;return o.options.editable&&o.options.editable.move!==!1?c&&!d.hasClass("k-event-active")?(l.element.find(".k-event-active").removeClass("k-event-active"),e.preventDefault(),t):(a=l.occurrenceByUid(d.attr(P.attr("uid"))),s=a.clone(),o._updateEventForMove(s),n=o._slotByPosition(e.x.startLocation,e.y.startLocation),r=n.startOffset(e.x.startLocation,e.y.startLocation,l.options.snap),i=n,(!n||l.trigger("moveStart",{event:a}))&&e.preventDefault(),t):(e.preventDefault(),t)}).bind("drag",function(e){var t,n,c=l.view(),d=c._slotByPosition(e.x.location,e.y.location);d&&(o=d.startOffset(e.x.location,e.y.location,l.options.snap),t=o-r,c._updateMoveHint(s,d.groupIndex,t),n=w(s,t),l.trigger("move",{event:a,slot:{element:d.element,start:d.startDate(),end:d.endDate()},resources:c._resourceBySlot(d),start:n.start,end:n.end})?c._updateMoveHint(s,d.groupIndex,t):i=d)}).bind("dragend",function(t){var c,d,u,h,p,f,g;l.view()._removeMoveHint(),c=o-r,d=w(s,c),u=d.start,h=d.end,p=l.view()._resourceBySlot(i),f=l.view()._resourceBySlot(n),g=l.trigger("moveEnd",{event:a,slot:{element:i.element,start:i.startDate(),end:i.endDate()},start:u,end:h,resources:p}),g||s.start.getTime()==u.getTime()&&s.end.getTime()==h.getTime()&&P.stringify(p)==P.stringify(f)||(l.view()._updateEventForMove(a),l._updateEvent(null,a,e.extend({start:u,end:h},p))),t.currentTarget.removeClass("k-event-active"),this.cancelHold()}).bind("dragcancel",function(){l.view()._removeMoveHint(),this.cancelHold()}),c&&(l._moveDraggable.bind("hold",function(e){l.element.find(".k-scheduler-monthview").length&&e.preventDefault(),l.element.find(".k-event-active").removeClass("k-event-active"),e.currentTarget.addClass("k-event-active")}),l._moveDraggable.userEvents.bind("press",function(e){e.preventDefault()})))},_resizable:function(){function t(e){var t,n={"k-resize-e":"east","k-resize-w":"west","k-resize-n":"north","k-resize-s":"south"};for(t in n)if(e.hasClass(t))return n[t]}var n,i,r,o,a,s=this;s._resizeDraggable=new P.ui.Draggable(s.element,{distance:0,filter:".k-resize-handle",dragstart:function(t){var l=e(t.currentTarget),c=l.closest(".k-event"),d=c.attr(P.attr("uid")),u=s.view();r=s.occurrenceByUid(d),o=r.clone(),u._updateEventForResize(o),a=u._slotByPosition(t.x.startLocation,t.y.startLocation),s.trigger("resizeStart",{event:r})&&t.preventDefault(),n=P.date.toUtcTime(o.start),i=P.date.toUtcTime(o.end)},drag:function(l){var c,d,u,h,p,f;a&&(c=e(l.currentTarget),d=t(c),u=s.view(),h=u._slotByPosition(l.x.location,l.y.location),h&&a.groupIndex==h.groupIndex&&(a=h,p=n,f=i,"south"==d?!a.isDaySlot&&a.end-P.date.toUtcTime(o.start)>=u._timeSlotInterval()&&(i=o.isAllDay?a.startOffset(l.x.location,l.y.location,s.options.snap):a.endOffset(l.x.location,l.y.location,s.options.snap)):"north"==d?!a.isDaySlot&&P.date.toUtcTime(o.end)-a.start>=u._timeSlotInterval()&&(n=a.startOffset(l.x.location,l.y.location,s.options.snap)):"east"==d?a.isDaySlot&&P.date.toUtcTime(P.date.getDate(a.endDate()))>=P.date.toUtcTime(P.date.getDate(o.start))?i=o.isAllDay?a.startOffset(l.x.location,l.y.location,s.options.snap):a.endOffset(l.x.location,l.y.location,s.options.snap):!a.isDaySlot&&a.end-P.date.toUtcTime(o.start)>=u._timeSlotInterval()&&(i=a.endOffset(l.x.location,l.y.location,s.options.snap)):"west"==d&&(a.isDaySlot&&P.date.toUtcTime(P.date.getDate(o.end))>=P.date.toUtcTime(P.date.getDate(a.startDate()))?n=a.startOffset(l.x.location,l.y.location,s.options.snap):!a.isDaySlot&&P.date.toUtcTime(o.end)-a.start>=u._timeSlotInterval()&&(n=a.startOffset(l.x.location,l.y.location,s.options.snap))),s.trigger("resize",{event:r,slot:{element:a.element,start:a.startDate(),end:a.endDate()},start:P.timezone.toLocalDate(n),end:P.timezone.toLocalDate(i),resources:u._resourceBySlot(a)})?(n=p,i=f):u._updateResizeHint(o,a.groupIndex,n,i)))},dragend:function(l){var c,d=e(l.currentTarget),u=new Date(o.start.getTime()),h=new Date(o.end.getTime()),p=t(d);s.view()._removeResizeHint(),"south"==p?h=P.timezone.toLocalDate(i):"north"==p?u=P.timezone.toLocalDate(n):"east"==p?h=a.isDaySlot?P.date.getDate(P.timezone.toLocalDate(i)):P.timezone.toLocalDate(i):"west"==p&&(a.isDaySlot?(u=new Date(P.timezone.toLocalDate(n)),u.setHours(0),u.setMinutes(0)):u=P.timezone.toLocalDate(n)),c=s.trigger("resizeEnd",{event:r,slot:{element:a.element,start:a.startDate(),end:a.endDate()},start:u,end:h,resources:s.view()._resourceBySlot(a)}),!c&&h.getTime()>=u.getTime()&&(o.start.getTime()!=u.getTime()||o.end.getTime()!=h.getTime())&&(s.view()._updateEventForResize(r),s._updateEvent(p,r,{start:u,end:h})),a=null,r=null},dragcancel:function(){s.view()._removeResizeHint(),a=null,r=null}})},_updateEvent:function(e,t,n){var i=this,r=function(e,t){try{i._preventRefresh=!0,e.update(n),i._convertDates(e)}finally{i._preventRefresh=!1}i.trigger(nt,{event:e})||(t&&t(),i._updateSelection(e),i.dataSource.sync())},o=function(e){return e.recurrenceRule?i.dataSource.getByUid(e.uid):i.dataSource.get(e.recurrenceId)},a=function(){var a,s,l=o(t);("south"==e||"north"==e)&&(n.start&&(a=P.date.getDate(l.start),P.date.setTime(a,B(n.start)),n.start=a),n.end&&(s=P.date.getDate(l.end),P.date.setTime(s,B(n.end)),n.end=s)),i.dataSource._removeExceptions(l),r(l)},s=function(){var e=o(t),n=function(){i._convertDates(e)},a=e.toOccurrence({start:t.start,end:t.end});r(i.dataSource.add(a),n)},l=i.options.messages.recurrenceMessages;t.recurrenceRule||t.isOccurrence()?i.showDialog({model:t,title:l.editWindowTitle,text:l.editRecurring?l.editRecurring:dt,buttons:[{text:l.editWindowOccurrence,click:s},{text:l.editWindowSeries,click:a}]}):r(i.dataSource.getByUid(t.uid))},_modelForContainer:function(t){return t=e(t).closest("["+P.attr("uid")+"]"),this.dataSource.getByUid(t.attr(P.attr("uid")))},showDialog:function(e){this._editor.showDialog(e)},focus:function(){this.wrapper.focus()},_confirmation:function(e,t){var n,i,r,o=this.options.editable;o===!0||o.confirmation!==!1?(n=this.options.messages,i=typeof o.confirmation===U?o.confirmation:lt,r=[{name:"destroy",text:n.destroy,click:function(){e()}}],this._isMobile()&&P.mobile.ui.Pane||r.push({name:"canceledit",text:n.cancel,click:function(){e(!0)}}),this.showDialog({model:t,text:i,title:n.deleteWindowTitle,buttons:r})):e()},addEvent:function(e){var t,n,i=this._editor.editable,r=this.dataSource;e=e||{},n=this.trigger("add",{event:e}),!n&&(i&&i.end()||!i)&&(this.cancelEvent(),e&&e.toJSON&&(e=e.toJSON()),t=r.add(e),t&&(this.cancelEvent(),this._editEvent(t)))},saveEvent:function(){var e,t,n,i=this._editor;i&&(e=i.editable,t=i.container,n=this._modelForContainer(t),t&&e&&e.end()&&!this.trigger(nt,{container:t,event:n})&&(n.isRecurrenceHead()&&this.dataSource._removeExceptions(n),n.dirty||n.isOccurrence()||this._convertDates(n,"remove"),this.dataSource.sync()))},cancelEvent:function(){var e,t=this._editor,n=t.container;n&&(e=this._modelForContainer(n),e&&e.isOccurrence()&&(this._convertDates(e,"remove"),this._convertDates(this.dataSource.get(e.recurrenceId),"remove")),this.dataSource.cancelChanges(e),t.close())},editEvent:function(e){var t="string"==typeof e?this.occurrenceByUid(e):e;t&&(this.cancelEvent(),t.isRecurring()?this._editRecurringDialog(t):this._editEvent(t))},_editEvent:function(e){this._createPopupEditor(e)},_editRecurringDialog:function(e){var t=this,n=function(){e.isException()?t._editEvent(e):t.addEvent(e)},i=function(){e.recurrenceId&&(e=t.dataSource.get(e.recurrenceId)),t._editEvent(e)},r=t.options.messages.recurrenceMessages;t.showDialog({model:e,title:r.editWindowTitle,text:r.editRecurring?r.editRecurring:dt,buttons:[{text:r.editWindowOccurrence,click:n},{text:r.editWindowSeries,click:i}]})},_createButton:function(e){var t=e.template||ut,n=typeof e===U?e:e.name||e.text,i={className:"k-scheduler-"+(n||"").replace(/\s/g,""),text:n,attr:""};if(!(n||G(e)&&e.template))throw Error("Custom commands should have name specified");return G(e)?(e.className&&(e.className+=" "+i.className),"edit"===n&&G(e.text)&&(e=$(!0,{},e),e.text=e.text.edit),i=$(!0,i,y[n],e)):i=$(!0,i,y[n]),P.template(t)(i)},_convertDates:function(e,t){var n=this.dataSource.reader.timezone,i=e.startTimezone,r=e.endTimezone,o=e.start,a=e.start;t=t||"apply",i=i||r,r=r||i,i&&(n?"apply"===t?(o=P.timezone.convert(e.start,n,i),a=P.timezone.convert(e.end,n,r)):(o=P.timezone.convert(e.start,i,n),a=P.timezone.convert(e.end,r,n)):(o=P.timezone[t](e.start,i),a=P.timezone[t](e.end,r)),e._set("start",o),e._set("end",a))},_createEditor:function(){var e,n=this;e=n._editor=this._isMobile()&&P.mobile.ui.Pane?new x(this.wrapper,$({},this.options,{target:this,timezone:n.dataSource.reader.timezone,resources:n.resources,createButton:Y(this._createButton,this)})):new C(this.wrapper,$({},this.options,{target:this,createButton:Y(this._createButton,this),timezone:n.dataSource.reader.timezone,resources:n.resources})),e.bind("cancel",function(e){return n.trigger("cancel",{container:e.container,event:e.model})?(e.preventDefault(),t):(n.cancelEvent(),n.focus(),t)}),e.bind("edit",function(e){n.trigger(rt,{container:e.container,event:e.model})&&e.preventDefault()}),e.bind("save",function(){n.saveEvent()}),e.bind("remove",function(e){n.removeEvent(e.model)})},_createPopupEditor:function(e){var t=this._editor;(!e.isNew()||e.isOccurrence())&&(e.isOccurrence()&&this._convertDates(e.recurrenceId?this.dataSource.get(e.recurrenceId):e),this._convertDates(e)),this.editable=t.editEvent(e)
},removeEvent:function(e){var t=this,n="string"==typeof e?t.occurrenceByUid(e):e;n&&(n.isRecurring()?t._deleteRecurringDialog(n):t._confirmation(function(e){e||t._removeEvent(n)},n))},occurrenceByUid:function(e){var t=this.dataSource.getByUid(e);return t||(t=l(this._data,e)),t},occurrencesInRange:function(e,t){return new P.data.Query(this._data).filter({logic:"or",filters:[{logic:"and",filters:[{field:"start",operator:"gte",value:e},{field:"end",operator:"gte",value:e},{field:"start",operator:"lt",value:t}]},{logic:"and",filters:[{field:"start",operator:"lte",value:e},{field:"end",operator:"gt",value:e}]}]}).toArray()},_removeEvent:function(e){this.trigger(tt,{event:e})||this.dataSource.remove(e)&&this.dataSource.sync()},_deleteRecurringDialog:function(e){var t=this,n=e,i=function(){var e=n.recurrenceId?n:n.toOccurrence(),i=t.dataSource.get(e.recurrenceId);t._convertDates(i),t._removeEvent(e)},r=function(){n.recurrenceId&&(n=t.dataSource.get(n.recurrenceId)),t._removeEvent(n)},o=t.options.messages.recurrenceMessages;t.showDialog({model:e,title:o.deleteWindowTitle,text:o.deleteRecurring?o.deleteRecurring:ct,buttons:[{text:o.deleteWindowOccurrence,click:i},{text:o.deleteWindowSeries,click:r}]})},_unbindView:function(e){var t=this;t.angular("cleanup",function(){return{elements:t.items()}}),e.destroy()},_bindView:function(e){var t=this;t.options.editable&&(t._viewRemoveHandler&&e.unbind(tt,t._viewRemoveHandler),t._viewRemoveHandler=function(e){t.removeEvent(e.uid)},e.bind(tt,t._viewRemoveHandler),t._viewAddHandler&&e.unbind(it,t._viewAddHandler),t._viewAddHandler=function(e){t.addEvent(e.eventInfo)},e.bind(it,this._viewAddHandler),t._viewEditHandler&&e.unbind(rt,t._viewEditHandler),t._viewEditHandler=function(e){t.editEvent(e.uid)},e.bind(rt,this._viewEditHandler)),t._viewNavigateHandler&&e.unbind("navigate",t._viewNavigateHandler),t._viewNavigateHandler=function(e){var n,i;e.view&&(n="isWorkDay"in e,i=n?"changeWorkDay":"changeView",t.trigger("navigate",{view:e.view,isWorkDay:e.isWorkDay,action:i,date:e.date})||(n&&(t._workDayMode=e.isWorkDay),t._selectView(e.view),t.date(e.date)))},e.bind("navigate",t._viewNavigateHandler),t._viewActivateHandler&&e.unbind("activate",t._viewActivateHandler),t._viewActivateHandler=function(){var e=this;t._selection&&(e.constrainSelection(t._selection),t._select(),t._adjustSelectedDate())},e.bind("activate",t._viewActivateHandler)},_selectView:function(e){var t=this;e&&t.views[e]&&(t._selectedView&&t._unbindView(t._selectedView),t._selectedView=t._renderView(e),t._selectedViewName=e,t.toolbar.find(".k-scheduler-views li").removeClass("k-state-selected").end().find(".k-view-"+e.replace(/\./g,"\\.").toLowerCase()).addClass("k-state-selected"))},view:function(e){var n=this;return e?(n._selectView(e),n.rebind(),t):n._selectedView},_renderView:function(e){var t=this._initializeView(e);return this._bindView(t),this._model.set("formattedDate",t.dateForTitle()),t},resize:function(e){var t=this.getSize(),n=this._size,i=this.view();i&&i.groups&&(e||!n||t.width!==n.width||t.height!==n.height)&&(this.refresh({action:"resize"}),this._size=t)},_adjustSelectedDate:function(){var e=this._model.selectedDate,t=this._selection,n=t.start;n&&!P.date.isInDateRange(e,R(n),R(t.end))&&e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate())},_initializeView:function(e){var t,n,i=this.views[e];if(i){if(t=G(i),n=i.type,typeof n===U&&(n=P.getter(i.type)(window)),!n)throw Error("There is no such view");i=new n(this.wrapper,h($(!0,{},this.options,t?i:{},{resources:this.resources,date:this.date(),showWorkHours:this._workDayMode})))}return i},_views:function(){var e,t,n,i,r,o,a,s,l,c=this.options.views;for(this.views={},a=0,s=c.length;s>a;a++)l=!1,e=c[a],i=G(e),i?(o=r=e.type?e.type:e,typeof o!==U&&(r=e.title,l=!0)):o=r=e,t=S[r],t&&!l&&(e.type=t.type,t.title=this.options.messages.views[r],"day"===t.type?t.messages={allDay:this.options.messages.allDay}:"agenda"===t.type&&(t.messages={event:this.options.messages.event,date:this.options.messages.date,time:this.options.messages.time})),e=$({title:r},t,i?e:{}),r&&(this.views[r]=e,(!n||e.selected)&&(n=r));n&&(this._selectedViewName=n)},rebind:function(){this.dataSource.fetch()},_dataSource:function(){var e=this,t=e.options,n=t.dataSource;n=K(n)?{data:n}:n,!t.timezone||n instanceof Ct?n instanceof Ct&&(t.timezone=n.schema?n.schema.timezone:""):n=$(!0,n,{schema:{timezone:t.timezone}}),e.dataSource&&e._refreshHandler?e.dataSource.unbind(J,e._refreshHandler).unbind("progress",e._progressHandler).unbind("error",e._errorHandler):(e._refreshHandler=Y(e.refresh,e),e._progressHandler=Y(e._requestStart,e),e._errorHandler=Y(e._error,e)),e.dataSource=P.data.SchedulerDataSource.create(n).bind(J,e._refreshHandler).bind("progress",e._progressHandler).bind("error",e._errorHandler),e.options.dataSource=e.dataSource},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_progress:function(e){var t=this.element.find(".k-scheduler-content");P.ui.progress(t,e)},_resources:function(){var t,n,i,r,o,a=this,s=a.options.resources;for(t=0;s.length>t;t++){if(n=s[t],i=n.field,r=n.dataSource,!i||!r)throw Error('The "field" and "dataSource" options of the scheduler resource are mandatory.');a.resources.push({field:i,name:n.name||i,title:n.title||i,dataTextField:n.dataTextField||"text",dataValueField:n.dataValueField||"value",dataColorField:n.dataColorField||"color",valuePrimitive:null!=n.valuePrimitive?n.valuePrimitive:!0,multiple:n.multiple||!1,dataSource:P.data.DataSource.create(r)})}o=e.map(a.resources,function(e){return e.dataSource.fetch()}),e.when.apply(null,o).then(function(){a.options.autoBind?a.view(a._selectedViewName):a._selectView(a._selectedViewName)})},_initModel:function(){var e=this;e._model=P.observable({selectedDate:new Date(this.options.date),formattedDate:""}),e._model.bind("change",function(t){"selectedDate"===t.field&&e.view(e._selectedViewName)})},_wrapper:function(){var e=this,t=e.options,n=t.height,i=t.width;e.wrapper=e.element.addClass("k-widget k-scheduler k-floatwrap").attr("role","grid").attr("aria-multiselectable",!0),e._isMobile()&&e.wrapper.addClass("k-scheduler-mobile"),e._isMobilePhoneView()&&e.wrapper.addClass("k-scheduler-phone"),n&&e.wrapper.height(n),i&&e.wrapper.width(i)},date:function(e){return null!=e&&R(e)>=R(this.options.min)&&R(e)<=R(this.options.max)&&this._model.set("selectedDate",e),R(this._model.get("selectedDate"))},_toolbar:function(){var n,i,r=this,o=r.options,a=[];o.toolbar&&(a=e.isArray(o.toolbar)?o.toolbar:[o.toolbar]),n=this._isMobilePhoneView()?pt:ht,i=e(n({messages:o.messages,pdf:e.grep(a,function(e){return"pdf"==e||"pdf"==e.name}).length>0,ns:P.ns,views:r.views})),r.wrapper.append(i),r.toolbar=i,P.bind(r.toolbar,r._model),i.on(Z+X,".k-pdf",function(e){e.preventDefault(),r.saveAsPDF()}),i.on(Z+X,".k-scheduler-navigation li",function(n){var i=e(this),o=new Date(r.date()),a="";if(n.preventDefault(),i.hasClass("k-nav-today"))a="today",o=new Date;else if(i.hasClass("k-nav-next"))a="next",o=r.view().nextDate();else if(i.hasClass("k-nav-prev"))a="previous",o=r.view().previousDate();else if(i.hasClass("k-nav-current")&&!r._isMobilePhoneView())return r._showCalendar(),t;r.trigger("navigate",{view:r._selectedViewName,action:a,date:o})||r.date(o)}),i.on(Z+X,".k-scheduler-views li",function(t){t.preventDefault();var n=e(this).attr(P.attr("name"));r.trigger("navigate",{view:n,action:"changeView",date:r.date()})||r.view(n)}),i.find("li").hover(function(){e(this).addClass("k-state-hover")},function(){e(this).removeClass("k-state-hover")})},_showCalendar:function(){var t=this,n=t.toolbar.find(".k-nav-current"),i=e('<div class="k-calendar-container"><div class="k-scheduler-calendar"/></div>');t.popup||(t.popup=new W(i,{anchor:n,activate:function(){t.calendar||(t.calendar=new j(this.element.find(".k-scheduler-calendar"),{change:function(){var e=this.value();t.trigger("navigate",{view:t._selectedViewName,action:"changeDate",date:e})||(t.date(e),t.popup.close())},min:t.options.min,max:t.options.max})),t.calendar.value(t.date())},copyAnchorStyles:!1})),t.popup.open()},refresh:function(e){var t=this,n=this.view();this._progress(!1),this.angular("cleanup",function(){return{elements:t.items()}}),e=e||{},n&&(e&&"itemchange"===e.action&&(this._editor.editable||this._preventRefresh)||this.trigger("dataBinding",{action:e.action||"rebind",index:e.index,items:e.items})||(e&&"resize"===e.action||!this._editor||this._editor.close(),this._data=this.dataSource.expand(n.startDate(),n.endDate()),n.render(this._data),this.trigger("dataBound")))},slotByPosition:function(e,t){var n,i=this.view();return i._slotByPosition?(n=i._slotByPosition(e,t),n?{startDate:n.startDate(),endDate:n.endDate(),groupIndex:n.groupIndex,element:n.element,isDaySlot:n.isDaySlot}:null):null},slotByElement:function(t){var n=e(t).offset();return this.slotByPosition(n.left,n.top)},resourcesBySlot:function(e){return this.view()._resourceBySlot(e)}}),S={day:{type:"kendo.ui.DayView"},week:{type:"kendo.ui.WeekView"},workWeek:{type:"kendo.ui.WorkWeekView"},agenda:{type:"kendo.ui.AgendaView"},month:{type:"kendo.ui.MonthView"},timeline:{type:"kendo.ui.TimelineView"},timelineWeek:{type:"kendo.ui.TimelineWeekView"},timelineWorkWeek:{type:"kendo.ui.TimelineWorkWeekView"},timelineMonth:{type:"kendo.ui.TimelineMonthView"}},N.plugin(T),P.PDFMixin&&P.PDFMixin.extend(T.prototype),D=O.extend({init:function(e,t){var n=this,i=P.timezone.windows_zones;if(!i||!P.timezone.zones_titles)throw Error("kendo.timezones.min.js is not included.");O.fn.init.call(n,e,t),n.wrapper=n.element,n._zonesQuery=new P.data.Query(i),n._zoneTitleId=P.guid(),n._zoneTitlePicker(),n._zonePicker(),n.value(n.options.value)},options:{name:"TimezoneEditor",value:"",optionLabel:"No timezone"},events:["change"],_zoneTitlePicker:function(){var t=this,n=e('<input id="'+t._zoneTitleId+'"/>').appendTo(t.wrapper);t._zoneTitle=new P.ui.DropDownList(n,{dataSource:P.timezone.zones_titles,dataValueField:"other_zone",dataTextField:"name",optionLabel:t.options.optionLabel,cascade:function(){this.value()||t._zone.wrapper.hide()}})},_zonePicker:function(){var t=this,n=e("<input />").appendTo(this.wrapper);t._zone=new P.ui.DropDownList(n,{dataValueField:"zone",dataTextField:"territory",dataSource:t._zonesQuery.data,cascadeFrom:t._zoneTitleId,cascade:function(){t._value=this.value(),t.trigger("change")},dataBound:function(){t._value=this.value(),this.wrapper.toggle(this.dataSource.view().length>1)}}),t._zone.wrapper.hide()},destroy:function(){O.fn.destroy.call(this),P.destroy(this.wrapper)},value:function(e){var n,i=this;return e===t?i._value:(n=i._zonesQuery.filter({field:"zone",operator:"eq",value:e}).data[0],n?(i._zoneTitle.value(n.other_zone),i._zone.value(n.zone)):i._zoneTitle.value(""),t)}}),N.plugin(D),A=P.template('<option value="#=other_zone#">#=name#</option>'),E=P.template('<option value="#=zone#">#=territory#</option>'),I=O.extend({init:function(e,t){var n=this,i=P.timezone.windows_zones;if(!i||!P.timezone.zones_titles)throw Error("kendo.timezones.min.js is not included.");O.fn.init.call(n,e,t),n.wrapper=n.element,n._zonesQuery=new P.data.Query(i),n._zoneTitlePicker(),n._zonePicker(),n.value(n.options.value)},options:{name:"MobileTimezoneEditor",optionLabel:"No timezone",value:""},events:["change"],_bindZones:function(e){var t=e?this._filter(e):[];this._zone.html(this._options(t,E))},_filter:function(e){return this._zonesQuery.filter({field:"other_zone",operator:"eq",value:e}).data},_options:function(e,t,n){var i=0,r="",o=e.length;for(n&&(r+=t({other_zone:"",name:n}));o>i;i++)r+=t(e[i]);return r},_zoneTitlePicker:function(){var t=this,n=t._options(P.timezone.zones_titles,A,t.options.optionLabel);t._zoneTitle=e("<select>"+n+"</select>").appendTo(t.wrapper).change(function(){var e=this.value,n=t._zone;t._bindZones(e),e&&n[0].children.length>1?n.show():n.hide(),t._value=n[0].value,t.trigger("change")})},_zonePicker:function(){var t=this;t._zone=e('<select style="display:none"></select>').appendTo(this.wrapper).change(function(){t._value=this.value,t.trigger("change")}),t._bindZones(t._zoneTitle.val()),t._value=t._zone[0].value},destroy:function(){O.fn.destroy.call(this),P.destroy(this.wrapper)},value:function(e){var n,i=this,r=i._zone,o="",a="";return e===t?i._value:(n=i._zonesQuery.filter({field:"zone",operator:"eq",value:e}).data[0],n&&(a=n.zone,o=n.other_zone),i._zoneTitle.val(o),i._bindZones(o),r.val(a),a=r[0].value,a&&r[0].children.length>1?r.show():r.hide(),i._value=a,t)}}),N.plugin(I)}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.ui.Widget,i=e.proxy,r=Math.abs,o=20,a=t.Class.extend({init:function(n,i,o){o=e.extend({minXDelta:30,maxYDelta:20,maxDuration:1e3},o),new t.UserEvents(n,{surface:o.surface,allowSelection:!0,start:function(e){2*r(e.x.velocity)>=r(e.y.velocity)&&e.sender.capture()},move:function(e){var t=e.touch,n=e.event.timeStamp-t.startTime,a=t.x.initialDelta>0?"right":"left";r(t.x.initialDelta)>=o.minXDelta&&r(t.y.initialDelta)<o.maxYDelta&&o.maxDuration>n&&(i({direction:a,touch:t,target:t.target}),t.cancel())}})}}),s=n.extend({init:function(e,r){function o(e){return function(t){s._triggerTouch(e,t)}}function a(e){return function(t){s.trigger(e,{touches:t.touches,distance:t.distance,center:t.center,event:t.event})}}var s=this;n.fn.init.call(s,e,r),r=s.options,e=s.element,s.wrapper=e,s.events=new t.UserEvents(e,{filter:r.filter,surface:r.surface,minHold:r.minHold,multiTouch:r.multiTouch,allowSelection:!0,press:o("touchstart"),hold:o("hold"),tap:i(s,"_tap"),gesturestart:a("gesturestart"),gesturechange:a("gesturechange"),gestureend:a("gestureend")}),r.enableSwipe?(s.events.bind("start",i(s,"_swipestart")),s.events.bind("move",i(s,"_swipemove"))):(s.events.bind("start",i(s,"_dragstart")),s.events.bind("move",o("drag")),s.events.bind("end",o("dragend"))),t.notify(s)},events:["touchstart","dragstart","drag","dragend","tap","doubletap","hold","swipe","gesturestart","gesturechange","gestureend"],options:{name:"Touch",surface:null,global:!1,multiTouch:!1,enableSwipe:!1,minXDelta:30,maxYDelta:20,maxDuration:1e3,minHold:800,doubleTapTimeout:800},cancel:function(){this.events.cancel()},_triggerTouch:function(e,t){this.trigger(e,{touch:t.touch,event:t.event})&&t.preventDefault()},_tap:function(e){var n=this,i=n.lastTap,r=e.touch;i&&n.options.doubleTapTimeout>r.endTime-i.endTime&&t.touchDelta(r,i).distance<o?(n._triggerTouch("doubletap",e),n.lastTap=null):(n._triggerTouch("tap",e),n.lastTap=r)},_dragstart:function(e){this._triggerTouch("dragstart",e)},_swipestart:function(e){2*r(e.x.velocity)>=r(e.y.velocity)&&e.sender.capture()},_swipemove:function(e){var t=this,n=t.options,i=e.touch,o=e.event.timeStamp-i.startTime,a=i.x.initialDelta>0?"right":"left";r(i.x.initialDelta)>=n.minXDelta&&r(i.y.initialDelta)<n.maxYDelta&&n.maxDuration>o&&(t.trigger("swipe",{direction:a,touch:e.touch}),i.cancel())}});window.jQuery.fn.kendoMobileSwipe=function(e,t){this.each(function(){new a(this,e,t)})},t.ui.plugin(s)}(window.kendo.jQuery),function(e){function t(e){var t,n,i=[],r=e.className;for(t=0,n=e.level;n>t;t++)i.push(o("span",{className:r}));return i}function n(){var t=i._activeElement();"body"!==t.nodeName.toLowerCase()&&e(t).blur()}var i=window.kendo,r=i.dom,o=r.element,a=r.text,s=i.support.mobileOS,l=i.ui,c=l.Widget,d=e.extend,u=e.map,h=e.isFunction,p=i.keys,f={title:"Title",start:"Start Time",end:"End Time",percentComplete:"% Done",parentId:"Predecessor ID",id:"ID",orderId:"Order ID"},g="string",m=".kendoGanttList",v="click",_=".",w={wrapper:"k-treelist k-grid k-widget",header:"k-header",alt:"k-alt",editCell:"k-edit-cell",group:"k-treelist-group",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",gridContentWrap:"k-grid-content",selected:"k-state-selected",icon:"k-icon",iconCollapse:"k-i-collapse",iconExpand:"k-i-expand",iconHidden:"k-i-none",iconPlaceHolder:"k-icon k-i-none",input:"k-input",dropPositions:"k-insert-top k-insert-bottom k-add k-insert-middle",dropTop:"k-insert-top",dropBottom:"k-insert-bottom",dropAdd:"k-add",dropMiddle:"k-insert-middle",dropDenied:"k-denied",dragStatus:"k-drag-status",dragClue:"k-drag-clue",dragClueText:"k-clue-text"},y=l.GanttList=c.extend({init:function(e,t){c.fn.init.call(this,e,t),0===this.options.columns.length&&this.options.columns.push("title"),this.dataSource=this.options.dataSource,this._columns(),this._layout(),this._domTrees(),this._header(),this._sortable(),this._editable(),this._selectable(),this._draggable(),this._attachEvents(),this._adjustHeight()},_adjustHeight:function(){this.content.height(this.element.height()-this.header.parent().outerHeight())},destroy:function(){c.fn.destroy.call(this),this._reorderDraggable&&this._reorderDraggable.destroy(),this._tableDropArea&&this._tableDropArea.destroy(),this._contentDropArea&&this._contentDropArea.destroy(),this.touch&&this.touch.destroy(),this.content.off(m),this.header=null,this.content=null,this.levels=null,i.destroy(this.element)},options:{name:"GanttList",selectable:!0,editable:!0},_attachEvents:function(){var t=this,n=y.styles;t.content.on(v+m,"td > span."+n.icon+":not(."+n.iconHidden+")",function(n){var i=e(this),r=t._modelFromElement(i);r.set("expanded",!r.get("expanded")),n.stopPropagation()})},_domTrees:function(){this.headerTree=new r.Tree(this.header[0]),this.contentTree=new r.Tree(this.content[0])},_columns:function(){var e=this.options.columns,t=function(){this.field="",this.title="",this.editable=!1,this.sortable=!1};this.columns=u(e,function(e){return e="string"==typeof e?{field:e,title:f[e]}:e,d(new t,e)})},_layout:function(){var e=this.element,t=y.styles;e.addClass(t.wrapper).append("<div class='"+t.gridHeader+"'><div class='"+t.gridHeaderWrap+"'></div></div>").append("<div class='"+t.gridContentWrap+"'></div>"),this.header=e.find(_+t.gridHeaderWrap),this.content=e.find(_+t.gridContent)},_header:function(){var e=this.headerTree,t=o("colgroup",null,this._cols()),n=o("thead",{role:"rowgroup"},[o("tr",{role:"row"},this._ths())]),i=o("table",{style:{"min-width":this.options.listWidth+"px"},role:"grid"},[t,n]);e.render([i])},_render:function(e){var t,n,i;this.levels=[{field:null,value:0}],t=o("colgroup",null,this._cols()),n=o("tbody",{role:"rowgroup"},this._trs(e)),i=o("table",{style:{"min-width":this.options.listWidth+"px"},tabIndex:0,role:"treegrid"},[t,n]),this.contentTree.render([i]),this.trigger("render")},_ths:function(){var e,t,n,i,r=this.columns,s=[];for(n=0,i=r.length;i>n;n++)e=r[n],t={"data-field":e.field,"data-title":e.title,className:y.styles.header,role:"columnheader"},s.push(o("th",t,[a(e.title)]));return s},_cols:function(){var e,t,n,i,r,a=this.columns,s=[];for(i=0,r=a.length;r>i;i++)e=a[i],n=e.width,t=n&&0!==parseInt(n,10)?{style:{width:typeof n===g?n:n+"px"}}:null,s.push(o("col",t,[]));return s},_trs:function(e){var t,n,i,r,o,a=[],s=[],l=y.styles;for(r=0,o=e.length;o>r;r++)t=e[r],i=this._levels({idx:t.parentId,id:t.id,summary:t.summary}),n={"data-uid":t.uid,"data-level":i,role:"row"},t.summary&&(n["aria-expanded"]=t.expanded),r%2!==0&&s.push(l.alt),t.summary&&s.push(l.group),s.length&&(n.className=s.join(" ")),a.push(this._tds({task:t,attr:n,level:i})),s=[];return a},_tds:function(e){var t,n,i,r=[],a=this.columns;for(n=0,i=a.length;i>n;n++)t=a[n],r.push(this._td({task:e.task,column:t,level:e.level}));return o("tr",e.attr,r)},_td:function(e){var n,r,s=[],l=this.options.resourcesField,c=y.styles,d=e.task,u=e.column,h=d.get(u.field)||[];if(u.field==l){for(n=[],r=0;h.length>r;r++)n.push(i.format("{0} [{1}]",h[r].get("name"),h[r].get("formatedValue")));n=n.join(", ")}else n=u.format?i.format(u.format,h):h;return"title"===u.field&&(s=t({level:e.level,className:c.iconPlaceHolder}),s.push(o("span",{className:c.icon+" "+(d.summary?d.expanded?c.iconCollapse:c.iconExpand:c.iconHidden)}))),s.push(o("span",null,[a(n)])),o("td",{role:"gridcell"},s)},_levels:function(e){var t,n,i,r=this.levels,o=e.summary,a=e.idx,s=e.id;for(n=0,i=r.length;i>n;n++)if(t=r[n],t.field==a)return o&&r.push({field:s,value:t.value+1}),t.value},_sortable:function(){var e,t,n,r,o,a=this.options.resourcesField,s=this.columns,l=this.header.find("th");for(r=0,o=l.length;o>r;r++)e=s[r],e.sortable&&e.field!==a&&(n=l.eq(r),t=n.data("kendoColumnSorter"),t&&t.destroy(),n.attr("data-"+i.ns+"field",e.field).kendoColumnSorter({dataSource:this.dataSource}));l=null},_selectable:function(){var t=this,n=this.options.selectable;n&&this.content.on(v+m,"tr",function(n){var i=e(this);n.ctrlKey?t.clearSelection():t.select(i)})},select:function(e){var t=this.content.find(e),n=y.styles.selected;return t.length?(t.siblings(_+n).removeClass(n).attr("aria-selected",!1).end().addClass(n).attr("aria-selected",!0),void this.trigger("change")):this.content.find(_+n)},clearSelection:function(){var e=this.select();e.length&&(e.removeClass(y.styles.selected),this.trigger("change"))},_setDataSource:function(e){this.dataSource=e},_editable:function(){var t=this,i=y.styles,r="span."+i.icon+":not("+i.iconHidden+")",o=function(){t.editable&&t.editable.end()&&t._closeCell()},a=function(t){var r=e(t.currentTarget);r.hasClass(i.editCell)||n()};this.options.editable&&(this._startEditHandler=function(n){var i=n.currentTarget?e(n.currentTarget):n,r=t._columnFromElement(i);t.editable||r.editable&&t._editCell({cell:i,column:r})},t.content.on("focusin"+m,function(){clearTimeout(t.timer),t.timer=null}).on("focusout"+m,function(){t.timer=setTimeout(o,1)}).on("keydown"+m,function(e){var i,r,a=e.keyCode;switch(a){case p.ENTER:n(),o();break;case p.ESC:t.editable&&(i=t._editableContainer,r=t._modelFromElement(i),t.trigger("cancel",{model:r,cell:i})||t._closeCell(!0))}}),s?t.touch=t.content.kendoTouch({filter:"td",touchstart:function(e){a(e.touch)},doubletap:function(n){e(n.touch.initialTouch).is(r)||t._startEditHandler(n.touch)}}).data("kendoTouch"):t.content.on("mousedown"+m,"td",function(e){a(e)}).on("dblclick"+m,"td",function(n){e(n.target).is(r)||t._startEditHandler(n)}))},_editCell:function(t){var n,r=this.options.resourcesField,o=y.styles,a=t.cell,s=t.column,l=this._modelFromElement(a),c=this.dataSource._createNewModel(l.toJSON()),d=c.fields[s.field]||c[s.field],u=d.validation,p=i.attr("type"),f=i.attr("bind"),g={name:s.field,required:d.validation?d.validation.required===!0:!1};return s.field===r?void s.editor(a,c):(this._editableContent=a.children().detach(),this._editableContainer=a,a.data("modelCopy",c),"date"!==d.type&&"date"!==e.type(d)||!/H|m|s|F|g|u/.test(s.format)||("start"===s.field&&delete d.validation.dateCompare,g[f]="value:"+s.field,g[p]="date",n=function(t,n){e('<input type="text"/>').attr(g).appendTo(t).kendoDateTimePicker({format:n.format})}),this.editable=a.addClass(o.editCell).kendoEditable({fields:{field:s.field,format:s.format,editor:s.editor||n},model:c,clearContainer:!1}).data("kendoEditable"),u&&u.dateCompare&&h(u.dateCompare)&&u.message&&(e("<span "+i.attr("for")+'="'+s.field+'" class="k-invalid-msg"/>').hide().appendTo(a),a.find("[name="+s.field+"]").attr(i.attr("dateCompare-msg"),u.message)),void(this.trigger("edit",{model:l,cell:a})&&this._closeCell(!0)))},_closeCell:function(e){var t=y.styles,n=this._editableContainer,i=this._modelFromElement(n),r=this._columnFromElement(n),o=r.field,a=n.data("modelCopy"),s={};s[o]=a.get(o),n.empty().removeData("modelCopy").removeClass(t.editCell).append(this._editableContent),this.editable.destroy(),this.editable=null,this._editableContainer=null,this._editableContent=null,e||("start"===o&&(s.end=new Date(s.start.getTime()+i.duration())),this.trigger("update",{task:i,updateInfo:s}))},_draggable:function(){var t,n=this,r=null,o=!0,a=y.styles,l="tr["+i.attr("level")+" = 0]:last",c={},u=function(){r=null,t=null,o=!0,c={}},h=function(e){for(var t=e;t;){if(r.get("id")===t.get("id")){o=!1;break}t=n.dataSource.taskParent(t)}},p=function(){var n=e(t).height(),r=i.getOffset(t).top;d(t,{beforeLimit:r+.25*n,afterLimit:r+.75*n})},f=function(e){var n,r=e.location,o=a.dropAdd,s="add",l=parseInt(t.attr(i.attr("level")),10);t.beforeLimit>=r?(n=t.prev(),o=a.dropTop,s="insert-before"):r>=t.afterLimit&&(n=t.next(),o=a.dropBottom,s="insert-after"),n&&parseInt(n.attr(i.attr("level")),10)===l&&(o=a.dropMiddle),c.className=o,c.command=s},g=function(){return n._reorderDraggable.hint.children(_+a.dragStatus).removeClass(a.dropPositions)};this.options.editable&&(this._reorderDraggable=this.content.kendoDraggable({distance:10,holdToDrag:s,group:"listGroup",filter:"tr[data-uid]",ignore:_+a.input,hint:function(t){return e('<div class="'+a.header+" "+a.dragClue+'"/>').css({width:300,paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).append('<span class="'+a.icon+" "+a.dragStatus+'" /><span class="'+a.dragClueText+'"/>')},cursorOffset:{top:-20,left:0},container:this.content,dragstart:function(e){n.editable&&e.preventDefault(),r=n._modelFromElement(e.currentTarget),this.hint.children(_+a.dragClueText).text(r.get("title"))},drag:function(e){o&&(f(e.y),g().addClass(c.className))},dragend:function(){u()},dragcancel:function(){u()}}).data("kendoDraggable"),this._tableDropArea=this.content.kendoDropTargetArea({distance:0,group:"listGroup",filter:"tr[data-uid]",dragenter:function(e){t=e.dropTarget,h(n._modelFromElement(t)),p(),g().toggleClass(a.dropDenied,!o)},dragleave:function(){o=!0,g()},drop:function(){var e=n._modelFromElement(t),i=e.orderId,a={parentId:e.parentId};if(o){switch(c.command){case"add":a.parentId=e.id;break;case"insert-before":a.orderId=e.parentId===r.parentId&&e.orderId>r.orderId?i-1:i;break;case"insert-after":a.orderId=e.parentId===r.parentId&&e.orderId>r.orderId?i:i+1}n.trigger("update",{task:r,updateInfo:a})}}}).data("kendoDropTargetArea"),this._contentDropArea=this.element.kendoDropTargetArea({distance:0,group:"listGroup",filter:_+a.gridContent,drop:function(){var e=n._modelFromElement(n.content.find(l)),t=e.orderId,i={parentId:null,orderId:null!==r.parentId?t+1:t};n.trigger("update",{task:r,updateInfo:i})}}).data("kendoDropTargetArea"))},_modelFromElement:function(e){var t=e.closest("tr"),n=this.dataSource.getByUid(t.attr(i.attr("uid")));return n},_columnFromElement:function(e){var t=e.closest("td"),n=t.parent(),i=n.children().index(t);return this.columns[i]}});d(!0,l.GanttList,{styles:w})}(window.kendo.jQuery),function(e){function t(e){return delete e.name,delete e.prefix,delete e.views,e}function n(e){var t=[],n=e.workWeekStart;for(t.push(n);e.workWeekEnd!=n;)n>6?n-=7:n++,t.push(n);return t}function i(){var t=kendo._activeElement();"body"!==t.nodeName.toLowerCase()&&e(t).blur()}var r,o,a=kendo.ui.Widget,s=kendo.dom.element,l=kendo.dom.text,c=e.isPlainObject,d=e.extend,u=e.proxy,h=kendo.support.browser,p=kendo.support.mobileOS,f=kendo.keys,g=kendo.data.Query,m=".kendoGanttTimeline",v="click",_="dblclick",w="mousemove",y="mouseenter",b="mouseleave",k="keydown",x=".",C=kendo.template("#=kendo.toString(start, 't')#"),T=kendo.template("#=kendo.toString(start, 'ddd M/dd')#"),S=kendo.template("#=kendo.toString(start, 'ddd M/dd')# - #=kendo.toString(kendo.date.addDays(end, -1), 'ddd M/dd')#"),D=kendo.template("#=kendo.toString(start, 'MMM')#"),A=kendo.template("#=kendo.toString(start, 'yyyy')#"),E=kendo.template('<div class="#=styles.marquee#"><div class="#=styles.marqueeColor#"></div></div>'),I=kendo.template('<div style="z-index: 100002;" class="#=styles.tooltipWrapper#"><div class="#=styles.tooltipContent#"><div>#=messages.start#: #=kendo.toString(start, format)#</div><div>#=messages.end#: #=kendo.toString(end, format)#</div></div></div>'),P=kendo.template('<div style="z-index: 100002;" class="#=styles.tooltipWrapper#" ><div class="#=styles.tooltipContent#">#=text#%</div><div class="#=styles.tooltipCallout#" style="left:13px;"></div></div>'),M=kendo.template('<div class="#=styles.taskDetails#"><strong>#=task.title#</strong><div class="#=styles.taskDetailsPercent#">#=kendo.toString(task.percentComplete, "p0")#</div><ul class="#=styles.reset#"><li>#=messages.start#: #=kendo.toString(task.start, "h:mm tt ddd, MMM d")#</li><li>#=messages.end#: #=kendo.toString(task.end, "h:mm tt ddd, MMM d")#</li></ul></div>'),F={day:{type:"kendo.ui.GanttDayView"},week:{type:"kendo.ui.GanttWeekView"},month:{type:"kendo.ui.GanttMonthView"},year:{type:"kendo.ui.GanttYearView"}},z={alt:"k-alt",reset:"k-reset",nonWorking:"k-nonwork-hour",header:"k-header",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",rowsTable:"k-gantt-rows",columnsTable:"k-gantt-columns",tasksTable:"k-gantt-tasks",resource:"k-resource",resourceAlt:"k-resource k-alt",task:"k-task",taskSingle:"k-task-single",taskMilestone:"k-task-milestone",taskSummary:"k-task-summary",taskWrap:"k-task-wrap",taskMilestoneWrap:"k-milestone-wrap",resourcesWrap:"k-resources-wrap",taskDot:"k-task-dot",taskDotStart:"k-task-start",taskDotEnd:"k-task-end",taskDragHandle:"k-task-draghandle",taskContent:"k-task-content",taskTemplate:"k-task-template",taskActions:"k-task-actions",taskDelete:"k-task-delete",taskComplete:"k-task-complete",taskDetails:"k-task-details",taskDetailsPercent:"k-task-pct",link:"k-link",icon:"k-icon",iconDelete:"k-si-close",taskResizeHandle:"k-resize-handle",taskResizeHandleWest:"k-resize-w",taskResizeHandleEast:"k-resize-e",taskSummaryProgress:"k-task-summary-progress",taskSummaryComplete:"k-task-summary-complete",line:"k-line",lineHorizontal:"k-line-h",lineVertical:"k-line-v",arrowWest:"k-arrow-w",arrowEast:"k-arrow-e",dragHint:"k-drag-hint",dependencyHint:"k-dependency-hint",tooltipWrapper:"k-widget k-tooltip k-popup k-group k-reset",tooltipContent:"k-tooltip-content",tooltipCallout:"k-callout k-callout-s",callout:"k-callout",marquee:"k-marquee k-gantt-marquee",marqueeColor:"k-marquee-color"},R=kendo.ui.GanttView=a.extend({init:function(e,t){a.fn.init.call(this,e,t),this.title=this.options.title||this.options.name,this.header=this.element.find(x+R.styles.gridHeader),this.content=this.element.find(x+R.styles.gridContent),this.contentWidth=this.content.width(),this._workDays=n(this.options),this._headerTree=t.headerTree,this._taskTree=t.taskTree,this._dependencyTree=t.dependencyTree,this._taskCoordinates={},this._currentTime()},destroy:function(){a.fn.destroy.call(this),this.headerRow=null,this.header=null,this.content=null,this._dragHint=null,this._resizeHint=null,this._resizeTooltip=null,this._taskTooltip=null,this._percentCompleteResizeTooltip=null,this._headerTree=null,this._taskTree=null,this._dependencyTree=null},options:{showWorkHours:!1,showWorkDays:!1,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,hourSpan:1,slotSize:100,currentTimeMarker:{updateInterval:1e4}},renderLayout:function(){this._slots=this._createSlots(),this._tableWidth=this._calculateTableWidth(),this.createLayout(this._layout()),this._slotDimensions(),this._adjustHeight()},_adjustHeight:function(){this.content.height(this.element.height()-this.header.outerHeight())},createLayout:function(e){var t=this._headers(e),n=this._colgroup(),i=this._headerTree,r=s("thead",null,t),o=s("table",{style:{width:this._tableWidth+"px"}},[n,r]);i.render([o]),this.headerRow=this.header.find("table:first tr").last()},_slotDimensions:function(){var e,t,n,i,r=this.headerRow[0].children,o=this._timeSlots();for(n=0,i=r.length;i>n;n++)t=r[n],e=o[n],e.offsetLeft=t.offsetLeft,e.offsetWidth=t.offsetWidth},render:function(e){var t,n=e.length,i=R.styles,r=this._rowsTable(n),o=this._columnsTable(n),a=this._tasksTable(e),s=this.options.currentTimeMarker;this._taskTree.render([r,o,a]),t=this.content.find(x+i.rowsTable),this._contentHeight=t.height(),this._rowHeight=t.find("tr").height(),this.content.find(x+i.columnsTable).height(this._contentHeight),s!==!1&&void 0!==s.updateInterval&&this._renderCurrentTime()},_rowsTable:function(e){var t,n,i=[],r=R.styles,o=[null,{className:r.alt}];for(n=0;e>n;n++)t=s("tr",o[n%2],[s("td",null,[l(" ")])]),i.push(t);return this._createTable(1,i,{className:r.rowsTable})
},_columnsTable:function(){var e,t,n,i,r,o=[],a=R.styles,c=this._timeSlots(),d=c.length,u=0;for(r=0;d>r;r++)t=c[r],i={},n=t.span,u+=n,1!==n&&(i.colspan=n),t.isNonWorking&&(i.className=a.nonWorking),o.push(s("td",i,[l(" ")]));return e=s("tr",null,o),this._createTable(u,[e],{className:a.columnsTable})},_tasksTable:function(e){var t,n,i,r,o,a,l,c=[],d=R.styles,u=this._taskCoordinates={},h=this._calculateMilestoneWidth(),p=Math.round(h.width),f=this.options.resourcesField,g=[d.resource,d.resourceAlt],m=this._calculateResourcesMargin(),v=function(e){var t=i.left,n=t+i.width;r.isMilestone()&&(t-=p/2,n=t+p),u[r.id]={start:t,end:n,rowIndex:e}};for(a=0,l=e.length;l>a;a++)r=e[a],i=this._taskPosition(r),t=s("tr",null),n=s("td",null,[this._renderTask(e[a],i)]),r[f]&&r[f].length&&(o=Math.max(i.width||h.clientWidth,0)+i.left,n.children.push(s("div",{className:d.resourcesWrap,style:{left:o+"px",width:this._tableWidth-(o+m)+"px"}},this._renderResources(r[f],g[a%2])))),t.children.push(n),c.push(t),v(a);return this._createTable(1,c,{className:R.styles.tasksTable})},_createTable:function(e,t,n){var i,r,o,a=[];for(o=0;e>o;o++)a.push(s("col"));return i=s("colgroup",null,a),r=s("tbody",null,t),n.style||(n.style={}),n.style.width=this._tableWidth+"px",s("table",n,[i,r])},_calculateTableWidth:function(){var e,t,n,i,r=this._timeSlots(),o=0,a=0;for(n=0,i=r.length;i>n;n++)e=r[n].span,a+=e,e>o&&(o=e);return t=Math.round(a*this.options.slotSize/o)},_calculateMilestoneWidth:function(){var t,n=R.styles.task+" "+R.styles.taskMilestone,i=e("<div class='"+n+"' style='visibility: hidden; position: absolute'>");return this.content.append(i),t={width:i[0].getBoundingClientRect().width,clientWidth:i[0].clientWidth},i.remove(),t},_calculateResourcesMargin:function(){var t,n=e("<div class='"+R.styles.resourcesWrap+"' style='visibility: hidden; position: absolute'>");return this.content.append(n),t=parseInt(n.css("margin-left"),10),n.remove(),t},_renderTask:function(e,t){var n,i,r,o=this.options.editable,a=t.left,l=R.styles,c=l.taskWrap;return e.summary?i=this._renderSummary(e,t):e.isMilestone()?(i=this._renderMilestone(e,t),c+=" "+l.taskMilestoneWrap):i=this._renderSingleTask(e,t),n=s("div",{className:c,style:{left:a+"px"}},[i]),o&&(n.children.push(s("div",{className:l.taskDot+" "+l.taskDotStart})),n.children.push(s("div",{className:l.taskDot+" "+l.taskDotEnd}))),e.summary||e.isMilestone()||!o||(r=Math.round(t.width*e.percentComplete),n.children.push(s("div",{className:l.taskDragHandle,style:{left:r+"px"}}))),n},_renderSingleTask:function(e,t){var n,i=R.styles,r=Math.round(t.width*e.percentComplete),o=s("div",{className:i.taskContent},[s("div",{className:i.taskTemplate},[l(e.title)])]);return this.options.editable&&(o.children.push(s("span",{className:i.taskActions},[s("a",{className:i.link+" "+i.taskDelete,href:"#"},[s("span",{className:i.icon+" "+i.iconDelete})])])),o.children.push(s("span",{className:i.taskResizeHandle+" "+i.taskResizeHandleWest})),o.children.push(s("span",{className:i.taskResizeHandle+" "+i.taskResizeHandleEast}))),n=s("div",{className:i.task+" "+i.taskSingle,"data-uid":e.uid,style:{width:Math.max(t.width-2,0)+"px"}},[s("div",{className:i.taskComplete,style:{width:r+"px"}}),o])},_renderMilestone:function(e){var t=R.styles,n=s("div",{className:t.task+" "+t.taskMilestone,"data-uid":e.uid});return n},_renderSummary:function(e,t){var n=R.styles,i=Math.round(t.width*e.percentComplete),r=s("div",{className:n.task+" "+n.taskSummary,"data-uid":e.uid,style:{width:t.width+"px"}},[s("div",{className:n.taskSummaryProgress,style:{width:i+"px"}},[s("div",{className:n.taskSummaryComplete,style:{width:t.width+"px"}})])]);return r},_renderResources:function(e,t){var n,i,r,o=[];for(i=0,r=e.length;r>i;i++)n=e[i],o.push(s("span",{className:t,style:{color:n.get("color")}},[l(n.get("name"))]));return o},_taskPosition:function(e){var t=Math.round,n=t(this._offset(e.start)),i=t(this._offset(e.end));return{left:n,width:i-n}},_offset:function(e){var t,n,i,r,o,a=this._timeSlots();return a.length?(o=this._slotIndex("start",e),t=a[o],e>t.end?t.offsetLeft+t.offsetWidth:t.start>e?t.offsetLeft:(n=e-t.start,i=t.end-t.start,r=n/i*t.offsetWidth,t.offsetLeft+r)):0},_slotIndex:function(e,t){var n,i=this._timeSlots(),r=0,o=i.length-1;do n=Math.ceil((o+r)/2),t>i[n][e]?r=n:(n===o&&n--,o=n);while(r!==o);return r},_timeByPosition:function(e,t,n){var i,r,o,a=this._slotByPosition(e);return t?n?a.end:a.start:(i=e-(this.content.offset().left-this.content.scrollLeft()),r=a.end-a.start,o=r*((i-a.offsetLeft)/a.offsetWidth),new Date(a.start.getTime()+o))},_slotByPosition:function(e){var t=e-(this.content.offset().left-this.content.scrollLeft()),n=this._slotIndex("offsetLeft",t);return this._timeSlots()[n]},_renderDependencies:function(e){var t,n,i=[],r=this._dependencyTree;for(t=0,n=e.length;n>t;t++)i.push.apply(i,this._renderDependency(e[t]));r.render(i)},_renderDependency:function(e){var t,n,i,r,o=this._taskCoordinates[e.predecessorId],a=this._taskCoordinates[e.successorId];if(!o||!a)return[];for(n="_render"+["FF","FS","SF","SS"][e.type],t=this[n](o,a),i=0,r=t.length;r>i;i++)t[i].attr["data-uid"]=e.uid;return t},_renderFF:function(e,t){var n=this._dependencyFF(e,t,!1);return n[n.length-1].children[0]=this._arrow(!0),n},_renderSS:function(e,t){var n=this._dependencyFF(t,e,!0);return n[0].children[0]=this._arrow(!1),n.reverse()},_renderFS:function(e,t){var n=this._dependencyFS(e,t,!1);return n[n.length-1].children[0]=this._arrow(!1),n},_renderSF:function(e,t){var n=this._dependencyFS(t,e,!0);return n[0].children[0]=this._arrow(!0),n.reverse()},_dependencyFF:function(e,t,n){var i,r=this,o=[],a=0,s=0,l=0,c=0,d=n?"start":"end",u=2,h=1,p=this._rowHeight,f=10,g=e.rowIndex*p+Math.floor(p/2)-1,m=t.rowIndex*p+Math.floor(p/2)-1,v=R.styles,_=function(){o.push(r._line(v.line+" "+v.lineHorizontal,{left:a+"px",top:s+"px",width:l+"px"}))},w=function(){o.push(r._line(v.line+" "+v.lineVertical,{left:a+"px",top:s+"px",height:c+"px"}))};return a=e[d],s=g,l=f,i=t[d]-e[d],i>0!==n&&(l=Math.abs(i)+f),n?(a-=l,l-=h,_()):(_(),a+=l-u),s>m?(c=s-m,c+=u,s=m,w()):(c=m-s,c+=u,w(),s+=c-u),l=Math.abs(a-t[d]),n||(l-=h,a-=l),_(),o},_dependencyFS:function(e,t,n){var i=this,r=[],o=0,a=0,s=0,l=0,c=this._rowHeight,d=Math.floor(c/2),u=10,h=2*u,p=t.start-e.end,f=2,g=1,m=e.rowIndex*c+Math.floor(c/2)-1,v=t.rowIndex*c+Math.floor(c/2)-1,_=R.styles,w=function(){r.push(i._line(_.line+" "+_.lineHorizontal,{left:o+"px",top:a+"px",width:s+"px"}))},y=function(){r.push(i._line(_.line+" "+_.lineVertical,{left:o+"px",top:a+"px",height:l+"px"}))};return o=e.end,a=m,s=u,n&&(o+=g,p>h&&(s=p-(u-f)),s-=g),w(),o+=s-f,h>=p&&(l=n?Math.abs(v-m)-d:d,m>v?(a-=l,l+=f,y()):(y(),a+=l),s=e.end-t.start+h,u>s&&(s=u),o-=s-f,w()),m>v?(l=a-v,a=v,l+=f,y()):(l=v-a,y(),a+=l),s=t.start-o,n||(s-=g),w(),r},_line:function(e,t){return s("div",{className:e,style:t})},_arrow:function(e){return s("span",{className:e?R.styles.arrowWest:R.styles.arrowEast})},_colgroup:function(){var e,t,n,i=this._timeSlots(),r=i.length,o=[];for(e=0;r>e;e++)for(t=0,n=i[e].span;n>t;t++)o.push(s("col"));return s("colgroup",null,o)},_createDragHint:function(e){this._dragHint=e.clone().addClass(R.styles.dragHint).css("cursor","move"),e.parent().append(this._dragHint)},_updateDragHint:function(e){var t=this._offset(e);this._dragHint.css({left:t})},_removeDragHint:function(){this._dragHint.remove(),this._dragHint=null},_createResizeHint:function(t){var n,i,r=R.styles,o=this._taskCoordinates[t.id].rowIndex*this._rowHeight,a=this.options,s=a.messages;this._resizeHint=e(E({styles:r})).css({top:0,height:this._contentHeight}),this.content.append(this._resizeHint),this._resizeTooltip=e(I({styles:r,start:t.start,end:t.end,messages:s.views,format:a.resizeTooltipFormat})).css({top:0,left:0}),this.content.append(this._resizeTooltip),this._resizeTooltipWidth=this._resizeTooltip.outerWidth(),n=this._resizeTooltip.outerHeight(),i=o-n,0>i&&(i=o+this._rowHeight),this._resizeTooltipTop=i},_updateResizeHint:function(t,n,i){var r=this._offset(t),o=this._offset(n),a=o-r,s=i?r:o,l=this._tableWidth-17,c=this._resizeTooltipWidth,d=this.options,u=d.messages;this._resizeHint.css({left:r,width:a}),this._resizeTooltip&&this._resizeTooltip.remove(),s-=Math.round(c/2),0>s?s=0:s+c>l&&(s=l-c),this._resizeTooltip=e(I({styles:R.styles,start:t,end:n,messages:u.views,format:d.resizeTooltipFormat})).css({top:this._resizeTooltipTop,left:s,"min-width":c}),this.content.append(this._resizeTooltip)},_removeResizeHint:function(){this._resizeHint.remove(),this._resizeHint=null,this._resizeTooltip.remove(),this._resizeTooltip=null},_updatePercentCompleteTooltip:function(t,n,i){var r,o,a,s;this._removePercentCompleteTooltip(),r=this._percentCompleteResizeTooltip=e(P({styles:R.styles,text:i})).appendTo(this.element),o=Math.round(r.outerWidth()/2),a=r.find(x+R.styles.callout),s=Math.round(a.outerWidth()/2),r.css({top:t-(r.outerHeight()+s),left:n-o}),a.css("left",o-s)},_removePercentCompleteTooltip:function(){this._percentCompleteResizeTooltip&&this._percentCompleteResizeTooltip.remove(),this._percentCompleteResizeTooltip=null},_updateDependencyDragHint:function(e,t,n){this._removeDependencyDragHint(),n?this._creteVmlDependencyDragHint(e,t):this._creteDependencyDragHint(e,t)},_creteDependencyDragHint:function(t,n){var i=R.styles,r=n.x-t.x,o=n.y-t.y,a=Math.sqrt(r*r+o*o),s=Math.atan(o/r);0>r&&(s+=Math.PI),e("<div class='"+i.line+" "+i.lineHorizontal+" "+i.dependencyHint+"'></div>").css({top:t.y,left:t.x,width:a,"transform-origin":"0% 0","-ms-transform-origin":"0% 0","-webkit-transform-origin":"0% 0",transform:"rotate("+s+"rad)","-ms-transform":"rotate("+s+"rad)","-webkit-transform":"rotate("+s+"rad)"}).appendTo(this.content)},_creteVmlDependencyDragHint:function(t,n){var i=e("<kvml:line class='"+R.styles.dependencyHint+"' style='position:absolute; top: 0px;' strokecolor='black' strokeweight='2px' from='"+t.x+"px,"+t.y+"px' to='"+n.x+"px,"+n.y+"px'></kvml:line>").appendTo(this.content);i[0].outerHTML=i[0].outerHTML},_removeDependencyDragHint:function(){this.content.find(x+R.styles.dependencyHint).remove()},_createTaskTooltip:function(t,n,i){var r=R.styles,o=this.options,a=this.content,s=this.content.offset(),l=e(n).parents("tr").first(),c=l.offset(),d=o.tooltip&&o.tooltip.template?kendo.template(o.tooltip.template):M,u=i-(s.left-a.scrollLeft()),h=c.top+l.outerHeight()-s.top+a.scrollTop(),p=this._taskTooltip=e('<div style="z-index: 100002;" class="'+r.tooltipWrapper+'" ><div class="'+r.taskContent+'"></div></div>');p.css({left:u,top:h}).appendTo(a).find(x+r.taskContent).append(d({styles:r,task:t,messages:o.messages.views})),p.outerHeight()<c.top-s.top&&p.css("top",c.top-s.top-p.outerHeight()+a.scrollTop()),p.outerWidth()+u-a.scrollLeft()>a.width()&&p.css("left",u-p.outerWidth())},_removeTaskTooltip:function(){this._taskTooltip&&this._taskTooltip.remove(),this._taskTooltip=null},_scrollTo:function(e){var t=e.offset().left,n=e.width(),i=t+n,r=e.closest("tr"),o=r.offset().top,a=r.height(),s=o+a,l=this.content,c=l.offset(),d=c.top,u=l.height(),h=d+u,p=c.left,f=l.width(),g=p+f,m=kendo.support.scrollbar();d>o?l.scrollTop(l.scrollTop()+(o-d)):s>h&&l.scrollTop(l.scrollTop()+(s+m-h)),p>t&&n>f&&g>i||i>g&&f>n?l.scrollLeft(l.scrollLeft()+(i+m-g)):(i>g&&n>f&&t>p||p>t&&f>n)&&l.scrollLeft(l.scrollLeft()+(t-p))},_timeSlots:function(){return this._slots&&this._slots.length?this._slots[this._slots.length-1]:[]},_headers:function(e){var t,n,i,r,o,a,c,d,u=[],h=R.styles;for(o=0,a=e.length;a>o;o++){for(t=e[o],n=[],c=0,d=t.length;d>c;c++)i=t[c],r=l(i.text),n.push(s("th",{colspan:i.span,className:h.header+(i.isNonWorking?" "+h.nonWorking:"")},[r]));u.push(s("tr",null,n))}return u},_hours:function(e,t){var n,i,r,o=[],a=this.options,s=a.workDayStart.getHours(),l=a.workDayEnd.getHours(),c=a.hourSpan;for(e=new Date(e),t=new Date(t);t>e;)n=new Date(e),r=n.getHours(),i=r>=s&&l>r,n.setHours(n.getHours()+c),r==n.getHours()&&n.setHours(n.getHours()+2*c),(!a.showWorkHours||i)&&o.push({start:e,end:n,isNonWorking:!i,span:1}),e=n;return o},_days:function(e,t){var n,i,r=[];for(e=new Date(e),t=new Date(t);t>e;)n=kendo.date.nextDay(e),i=this._isWorkDay(e),(!this.options.showWorkDays||i)&&r.push({start:e,end:n,isNonWorking:!i,span:1}),e=n;return r},_weeks:function(e,t){var n,i,r,o=[],a=this.calendarInfo().firstDay;for(e=new Date(e),t=new Date(t);t>e;)n=kendo.date.dayOfWeek(kendo.date.addDays(e,1),a,1),n>t&&(n=t),i=this._days(e,n),r=i.length,r>0&&o.push({start:i[0].start,end:i[r-1].end,span:r}),e=n;return o},_months:function(e,t){var n,i,r,o=[];for(e=new Date(e),t=new Date(t);t>e;)n=new Date(e),n.setMonth(n.getMonth()+1),i=this._days(e,n),r=i.length,r>0&&o.push({start:i[0].start,end:i[r-1].end,span:r}),e=n;return o},_years:function(e,t){var n,i=[];for(e=new Date(e),t=new Date(t);t>e;)n=new Date(e),n.setFullYear(n.getFullYear()+1),i.push({start:e,end:n,span:12}),e=n;return i},_slotHeaders:function(e,t){var n,i,r,o=[];for(i=0,r=e.length;r>i;i++)n=e[i],o.push({text:t(n),isNonWorking:!!n.isNonWorking,span:n.span});return o},_isWorkDay:function(e){var t,n,i=e.getDay(),r=this._workDays;for(t=0,n=r.length;n>t;t++)if(r[t]===i)return!0;return!1},calendarInfo:function(){return kendo.getCulture().calendars.standard},_renderCurrentTime:function(){var t,n=this._getCurrentTime(),i=this._offset(n),r=e("<div class='k-current-time'></div>");this.content&&this._timeSlots().length&&(this.content.find(".k-current-time").remove(),t=this._timeSlots()[this._slotIndex("start",n)],t.start>n||n>t.end||(r.css({left:i+"px",top:"0px",width:"1px",height:this._contentHeight+"px"}),this.content.append(r)))},_getCurrentTime:function(){return new Date},_currentTime:function(){var e=this.options.currentTimeMarker;e!==!1&&void 0!==e.updateInterval&&(this._renderCurrentTime(),this._currentTimeUpdateTimer=setInterval(u(this._renderCurrentTime,this),e.updateInterval))}});d(!0,R,{styles:z}),kendo.ui.GanttDayView=R.extend({name:"day",options:{timeHeaderTemplate:C,dayHeaderTemplate:T,resizeTooltipFormat:"h:mm tt ddd, MMM d"},range:function(e){this.start=kendo.date.getDate(e.start),this.end=kendo.date.getDate(e.end),(kendo.date.getMilliseconds(e.end)>0||this.end.getTime()===this.start.getTime())&&(this.end=kendo.date.addDays(this.end,1))},_createSlots:function(){var e,t,n,i,r=[],o=this._days(this.start,this.end),a=[];for(n=0,i=o.length;i>n;n++)e=o[n],t=this._hours(e.start,e.end),e.span=t.length,a.push.apply(a,t);return r.push(o),r.push(a),r},_layout:function(){var e=[],t=this.options;return e.push(this._slotHeaders(this._slots[0],kendo.template(t.dayHeaderTemplate))),e.push(this._slotHeaders(this._slots[1],kendo.template(t.timeHeaderTemplate))),e}}),kendo.ui.GanttWeekView=R.extend({name:"week",options:{dayHeaderTemplate:T,weekHeaderTemplate:S,resizeTooltipFormat:"h:mm tt ddd, MMM d"},range:function(e){var t=this.calendarInfo(),n=t.firstDay,i=e.end;n===i.getDay()&&i.setDate(i.getDate()+7),this.start=kendo.date.getDate(kendo.date.dayOfWeek(e.start,n,-1)),this.end=kendo.date.getDate(kendo.date.dayOfWeek(i,n,1))},_createSlots:function(){var e=[];return e.push(this._weeks(this.start,this.end)),e.push(this._days(this.start,this.end)),e},_layout:function(){var e=[],t=this.options;return e.push(this._slotHeaders(this._slots[0],kendo.template(t.weekHeaderTemplate))),e.push(this._slotHeaders(this._slots[1],kendo.template(t.dayHeaderTemplate))),e}}),kendo.ui.GanttMonthView=R.extend({name:"month",options:{weekHeaderTemplate:S,monthHeaderTemplate:D,resizeTooltipFormat:"dddd, MMM d, yyyy"},range:function(e){this.start=kendo.date.firstDayOfMonth(e.start),this.end=kendo.date.addDays(kendo.date.getDate(kendo.date.lastDayOfMonth(e.end)),1)},_createSlots:function(){var e=[];return e.push(this._months(this.start,this.end)),e.push(this._weeks(this.start,this.end)),e},_layout:function(){var e=[],t=this.options;return e.push(this._slotHeaders(this._slots[0],kendo.template(t.monthHeaderTemplate))),e.push(this._slotHeaders(this._slots[1],kendo.template(t.weekHeaderTemplate))),e}}),kendo.ui.GanttYearView=R.extend({name:"year",options:{yearHeaderTemplate:A,monthHeaderTemplate:D,resizeTooltipFormat:"dddd, MMM d, yyyy"},range:function(e){this.start=kendo.date.firstDayOfMonth(new Date(e.start.setMonth(0))),this.end=kendo.date.firstDayOfMonth(new Date(e.end.setMonth(12)))},_createSlots:function(){var t=[],n=this._months(this.start,this.end);return e(n).each(function(e,t){t.span=1}),t.push(this._years(this.start,this.end)),t.push(n),t},_layout:function(){var e=[],t=this.options;return e.push(this._slotHeaders(this._slots[0],kendo.template(t.yearHeaderTemplate))),e.push(this._slotHeaders(this._slots[1],kendo.template(t.monthHeaderTemplate))),e}}),r={wrapper:"k-timeline k-grid k-widget",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",gridContentWrap:"k-grid-content",tasksWrapper:"k-gantt-tables",dependenciesWrapper:"k-gantt-dependencies",task:"k-task",line:"k-line",taskResizeHandle:"k-resize-handle",taskResizeHandleWest:"k-resize-w",taskDragHandle:"k-task-draghandle",taskComplete:"k-task-complete",taskDelete:"k-task-delete",taskWrapActive:"k-task-wrap-active",taskWrap:"k-task-wrap",taskDot:"k-task-dot",taskDotStart:"k-task-start",taskDotEnd:"k-task-end",hovered:"k-state-hover",selected:"k-state-selected",origin:"k-origin"},o=kendo.ui.GanttTimeline=a.extend({init:function(e,t){a.fn.init.call(this,e,t),this.options.views&&this.options.views.length||(this.options.views=["day","week","month"]),this._wrapper(),this._domTrees(),this._views(),this._selectable(),this._draggable(),this._resizable(),this._percentResizeDraggable(),this._createDependencyDraggable(),this._attachEvents(),this._tooltip()},options:{name:"GanttTimeline",messages:{views:{day:"Day",week:"Week",month:"Month",year:"Year",start:"Start",end:"End"}},snap:!0,selectable:!0,editable:!0},destroy:function(){a.fn.destroy.call(this),this._currentTimeUpdateTimer&&clearInterval(this._currentTimeUpdateTimer),this._unbindView(this._selectedView),this._moveDraggable&&this._moveDraggable.destroy(),this._resizeDraggable&&this._resizeDraggable.destroy(),this._percentDraggable&&this._percentDraggable.destroy(),this._dependencyDraggable&&this._dependencyDraggable.destroy(),this.touch&&this.touch.destroy(),this._headerTree=null,this._taskTree=null,this._dependencyTree=null,this.wrapper.off(m),kendo.destroy(this.wrapper)},_wrapper:function(){var e=o.styles;this.wrapper=this.element.addClass(e.wrapper).append("<div class='"+e.gridHeader+"'><div class='"+e.gridHeaderWrap+"'></div></div>").append("<div class='"+e.gridContentWrap+"'><div class='"+e.tasksWrapper+"'></div><div class='"+e.dependenciesWrapper+"'></div></div>")},_domTrees:function(){var e=o.styles,t=kendo.dom.Tree,n=this.wrapper;this._headerTree=new t(n.find(x+e.gridHeaderWrap)[0]),this._taskTree=new t(n.find(x+e.tasksWrapper)[0]),this._dependencyTree=new t(n.find(x+e.dependenciesWrapper)[0])},_views:function(){var e,t,n,i,r,o,a,s=this.options.views;for(this.views={},o=0,a=s.length;a>o;o++)e=s[o],t=c(e),t&&e.selectable===!1||(n=t?"string"!=typeof e.type?e.title:e.type:e,i=F[n],i&&(t&&(e.type=i.type),i.title=this.options.messages.views[n]),e=d({title:n},i,t?e:{}),n&&(this.views[n]=e,(!r||e.selected)&&(r=n)));r&&(this._selectedViewName=r)},view:function(e){return e&&(this._selectView(e),this.trigger("navigate",{view:e,action:"changeView"})),this._selectedView},_selectView:function(e){e&&this.views[e]&&(this._selectedView&&this._unbindView(this._selectedView),this._selectedView=this._initializeView(e),this._selectedViewName=e)},_viewByIndex:function(e){var t,n=this.views;for(t in n){if(!e)return t;e--}},_initializeView:function(e){var n,i=this.views[e];if(i){if(n=i.type,"string"==typeof n&&(n=kendo.getter(i.type)(window)),!n)throw Error("There is no such view");i=new n(this.wrapper,t(d(!0,{headerTree:this._headerTree,taskTree:this._taskTree,dependencyTree:this._dependencyTree},i,this.options)))}return i},_unbindView:function(e){e&&e.destroy()},_range:function(e){var t,n,i={field:"start",dir:"asc"},r={field:"end",dir:"desc"};return e&&e.length?(t=new g(e).sort(i).toArray()[0].start||new Date,n=new g(e).sort(r).toArray()[0].end||new Date,{start:new Date(t),end:new Date(n)}):{start:new Date,end:new Date}},_render:function(e){var t=this.view(),n=this._range(e);this._tasks=e,t.range(n),t.renderLayout(),t.render(e)},_renderDependencies:function(e){this.view()._renderDependencies(e)},_taskByUid:function(e){var t,n,i=this._tasks,r=i.length;for(n=0;r>n;n++)if(t=i[n],t.uid===e)return t},_draggable:function(){var e,t,n,r,a=this,s=this.options.snap,l=o.styles,c=function(){a.view()._removeDragHint(),e&&e.css("opacity",1),e=null,t=null,a.dragInProgress=!1};this.options.editable&&(this._moveDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:x+l.task,holdToDrag:kendo.support.mobileOS,ignore:x+l.taskResizeHandle}),this._moveDraggable.bind("dragstart",function(i){var o=a.view();return e=i.currentTarget.parent(),t=a._taskByUid(i.currentTarget.attr("data-uid")),a.trigger("moveStart",{task:t})?void i.preventDefault():(n=t.start,r=o._timeByPosition(i.x.location,s)-n,o._createDragHint(e),e.css("opacity",.5),clearTimeout(a._tooltipTimeout),void(a.dragInProgress=!0))}).bind("drag",kendo.throttle(function(e){var i,o;a.dragInProgress&&(i=a.view(),o=new Date(i._timeByPosition(e.x.location,s)-r),a.trigger("move",{task:t,start:o})||(n=o,i._updateDragHint(n)))},15)).bind("dragend",function(){a.trigger("moveEnd",{task:t,start:n}),c()}).bind("dragcancel",function(){c()}).userEvents.bind("select",function(){i()}))},_resizable:function(){var e,t,n,r,a,s=this,l=this.options.snap,c=o.styles,d=function(){s.view()._removeResizeHint(),e=null,t=null,s.dragInProgress=!1};this.options.editable&&(this._resizeDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:x+c.taskResizeHandle,holdToDrag:!1}),this._resizeDraggable.bind("dragstart",function(i){return a=i.currentTarget.hasClass(c.taskResizeHandleWest),e=i.currentTarget.closest(x+c.task),t=s._taskByUid(e.attr("data-uid")),s.trigger("resizeStart",{task:t})?void i.preventDefault():(n=t.start,r=t.end,s.view()._createResizeHint(t),clearTimeout(s._tooltipTimeout),void(s.dragInProgress=!0))}).bind("drag",kendo.throttle(function(e){var i,o;s.dragInProgress&&(i=s.view(),o=i._timeByPosition(e.x.location,l,!a),a?n=r>o?o:r:r=o>n?o:n,s.trigger("resize",{task:t,start:n,end:r})||i._updateResizeHint(n,r,a))},15)).bind("dragend",function(){s.trigger("resizeEnd",{task:t,resizeStart:a,start:n,end:r}),d()}).bind("dragcancel",function(){d()}).userEvents.bind("select",function(){i()}))},_percentResizeDraggable:function(){var e,t,n,r,a,s,l,c,d,u=this,h=o.styles,p=function(){u.view()._removePercentCompleteTooltip(),t=null,e=null,u.dragInProgress=!1},f=function(e){t.find(x+h.taskComplete).width(e).end().siblings(x+h.taskDragHandle).css("left",e)};this.options.editable&&(this._percentDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:x+h.taskDragHandle,holdToDrag:!1}),this._percentDraggable.bind("dragstart",function(i){t=i.currentTarget.siblings(x+h.task),e=u._taskByUid(t.attr("data-uid")),l=e.percentComplete,n=t.offset(),r=this.element.offset(),a=t.find(x+h.taskComplete).width(),s=t.outerWidth(),clearTimeout(u._tooltipTimeout),u.dragInProgress=!0}).bind("drag",kendo.throttle(function(e){if(u.dragInProgress){var t=Math.max(0,Math.min(s,a+e.x.initialDelta));l=Math.round(t/s*100),f(t),c=n.top-r.top,d=n.left+t-r.left,u.view()._updatePercentCompleteTooltip(c,d,l)}},15)).bind("dragend",function(){u.trigger("percentResizeEnd",{task:e,percentComplete:l/100}),p()}).bind("dragcancel",function(){f(a),p()}).userEvents.bind("select",function(){i()}))},_createDependencyDraggable:function(){var t,n,r,a,s,l=this,c=e(),d=e(),u=h.msie&&9>h.version,p=o.styles,f=function(){t.css("display","").removeClass(p.hovered),t.parent().removeClass(p.origin),t=null,g(!1),d=e(),c=e(),l.view()._removeDependencyDragHint(),l.dragInProgress=!1},g=function(e){d.hasClass(p.origin)||(d.find(x+p.taskDot).css("display",e?"block":""),c.toggleClass(p.hovered,e))};this.options.editable&&(u&&document.namespaces&&document.namespaces.add("kvml","urn:schemas-microsoft-com:vml","#default#VML"),this._dependencyDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:x+p.taskDot,holdToDrag:!1}),this._dependencyDraggable.bind("dragstart",function(e){t=e.currentTarget.css("display","block").addClass(p.hovered),t.parent().addClass(p.origin);var i=t.offset();a=l.view().content,s=a.offset(),n=Math.round(i.left+a.scrollLeft()-s.left+t.outerHeight()/2),r=Math.round(i.top+a.scrollTop()-s.top+t.outerWidth()/2),clearTimeout(l._tooltipTimeout),l.dragInProgress=!0}).bind("drag",kendo.throttle(function(t){var i,o,h;l.dragInProgress&&(l.view()._removeDependencyDragHint(),i=e(kendo.elementUnderCursor(t)),o=t.x.location+a.scrollLeft()-s.left,h=t.y.location+a.scrollTop()-s.top,l.view()._updateDependencyDragHint({x:n,y:r},{x:o,y:h},u),g(!1),c=i.hasClass(p.taskDot)?i:e(),d=i.closest(x+p.taskWrap),g(!0))},15)).bind("dragend",function(){var e,n,i,r,o;c.length&&(e=t.hasClass(p.taskDotStart),n=c.hasClass(p.taskDotStart),i=e?n?3:2:n?1:0,r=l._taskByUid(t.siblings(x+p.task).attr("data-uid")),o=l._taskByUid(c.siblings(x+p.task).attr("data-uid")),r!==o&&l.trigger("dependencyDragEnd",{type:i,predecessor:r,successor:o})),f()}).bind("dragcancel",function(){f()}).userEvents.bind("select",function(){i()}))},_selectable:function(){var t=this,n=o.styles;this.options.selectable&&this.wrapper.on(v+m,x+n.task,function(n){n.stopPropagation(),n.ctrlKey?t.trigger("clear"):t.trigger("select",{uid:e(this).attr("data-uid")})}).on(v+m,x+n.tasksWrapper,function(){t.selectDependency().length>0?t.clearSelection():t.trigger("clear")}).on(v+m,x+n.line,function(e){e.stopPropagation(),t.selectDependency(this)})},select:function(e){var t=this.wrapper.find(e),n=o.styles;return t.length?(this.clearSelection(),t.addClass(n.selected),void(kendo.support.mobileOS&&t.parent().addClass(n.taskWrapActive))):this.wrapper.find(x+n.task+x+n.selected)},selectDependency:function(t){var n,i=this.wrapper.find(t),r=o.styles;return i.length?(this.clearSelection(),this.trigger("clear"),n=e(i).attr("data-uid"),void this.wrapper.find(x+r.line+"[data-uid='"+n+"']").addClass(r.selected)):this.wrapper.find(x+r.line+x+r.selected)},clearSelection:function(){var e=o.styles;this.wrapper.find(x+e.selected).removeClass(e.selected),kendo.support.mobileOS&&this.wrapper.find(x+e.taskWrapActive).removeClass(e.taskWrapActive)},_attachEvents:function(){var t=this,n=o.styles;this.options.editable&&(this._tabindex(),this.wrapper.on(v+m,x+n.taskDelete,function(i){t.trigger("removeTask",{uid:e(this).closest(x+n.task).attr("data-uid")}),i.stopPropagation(),i.preventDefault()}).on(k+m,function(e){var n;e.keyCode===f.DELETE&&(n=t.selectDependency(),n.length&&(t.trigger("removeDependency",{uid:n.attr("data-uid")}),t.clearSelection()))}),p?this.touch=this.wrapper.kendoTouch({filter:x+n.task,doubletap:function(n){t.trigger("editTask",{uid:e(n.touch.currentTarget).attr("data-uid")})}}).data("kendoTouch"):this.wrapper.on(_+m,x+n.task,function(n){t.trigger("editTask",{uid:e(this).attr("data-uid")}),n.stopPropagation(),n.preventDefault()}))},_tooltip:function(){var t,n=this,i=this.options.tooltip,r=o.styles,a=function(e){t=e.clientX};i&&i.visible===!1||this.wrapper.on(y+m,x+r.task,function(){var i=this,r=n._taskByUid(e(this).attr("data-uid"));n.dragInProgress||(n._tooltipTimeout=setTimeout(function(){n.view()._createTaskTooltip(r,i,t)},800),e(this).on(w,a))}).on(b+m,x+r.task,function(){clearTimeout(n._tooltipTimeout),n.view()._removeTaskTooltip(),e(this).off(w,a)})}}),d(!0,o,{styles:r})}(window.kendo.jQuery),function(e,t){function n(e){return"["+f.attr("uid")+(e?"='"+e+"']":"]")}function i(e){return delete e.name,delete e.prefix,delete e.remove,delete e.edit,delete e.add,delete e.navigate,e}function r(e){var t,n,i,r,o,a;if(e.filter("[name=end], [name=start]").length){for(t=e.attr("name"),n=f.widgetInstance(e,f.ui),i={},r=e;r!==window&&!o;)r=r.parent(),o=r.data("kendoEditable");return(a=o?o.options.model:null)?(i.start=a.start,i.end=a.end,i[t]=n?n.value():f.parseDate(e.value()),i.end>=i.start):!0}return!0}function o(t,n){var i=t.parents("["+f.attr("role")+'="gantt"]'),r=[],o=a(i);t.attr(M,0),n&&o.each(function(t,n){r[t]=e(n).scrollTop()});try{t[0].setActive()}catch(s){t[0].focus()}n&&o.each(function(t,n){e(n).scrollTop(r[t])})}function a(t){return e(t).parentsUntil("body").filter(function(e,t){var n=f.getComputedStyles(t,["overflow"]);return"visible"!=n.overflow}).add(window)}var s,l,c,d,u,h,p,f=window.kendo,g=f.support.browser,m=f.Observable,v=f.ui.Widget,_=f.data.DataSource,w=f.data.ObservableObject,y=f.data.ObservableArray,b=f.data.Query,k=e.isArray,x=e.inArray,C=f.isFunction,T=e.proxy,S=e.extend,D=e.isPlainObject,A=e.map,E=f.keys,I=".kendoGantt",P="p0",M="tabIndex",F="click",z="width",R="string",B={down:{origin:"bottom center",position:"top center"},up:{origin:"top center",position:"bottom center"}},H="aria-activedescendant",L="gantt_active_cell",N="action-option-focused",O=".",V="Are you sure you want to delete this task?",U="Are you sure you want to delete this dependency?",W='<button class="#=styles.button# #=className#" #if (action) {#data-action="#=action#"#}#><span class="#=iconClass#"></span>#=text#</button>',j='<a class="#=className#" #=attr# href="\\#">#=text#</a>',q=f.template('<ul class="#=styles.viewsWrapper#">#for(var view in views){#<li class="#=styles.viewButtonDefault# #=styles.viewButton#-#= view.toLowerCase() #" data-#=ns#name="#=view#"><a href="\\#" class="#=styles.link#">#=views[view].title#</a></li>#}#</ul>'),G=f.template('<div class="#=styles.popupWrapper#"><ul class="#=styles.popupList#" role="listbox">#for(var i = 0, l = actions.length; i < l; i++){#<li class="#=styles.item#" data-action="#=actions[i].data#" role="option">#=actions[i].text#</span>#}#</ul></div>'),$=function(t,n){var i={name:n.field},r=n.model.fields[n.field].validation;r&&D(r)&&r.message&&(i[f.attr("dateCompare-msg")]=r.message),e('<input type="text" required '+f.attr("type")+'="date" '+f.attr("role")+'="datetimepicker" '+f.attr("bind")+'="value:'+n.field+'" '+f.attr("validate")+"='true' />").attr(i).appendTo(t),e("<span "+f.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},Y=function(t,n){e('<a href="#" class="'+n.styles.button+'">'+n.messages.assingButton+"</a>").click(n.click).appendTo(t)},Q={wrapper:"k-widget k-gantt",listWrapper:"k-gantt-layout k-gantt-treelist",list:"k-gantt-treelist",timelineWrapper:"k-gantt-layout k-gantt-timeline",timeline:"k-gantt-timeline",splitBarWrapper:"k-splitbar k-state-default k-splitbar-horizontal k-splitbar-draggable-horizontal k-gantt-layout",splitBar:"k-splitbar",splitBarHover:"k-splitbar-horizontal-hover",popupWrapper:"k-list-container",popupList:"k-list k-reset",resizeHandle:"k-resize-handle",icon:"k-icon",item:"k-item",line:"k-line",buttonDelete:"k-gantt-delete",buttonCancel:"k-gantt-cancel",buttonSave:"k-gantt-update",primary:"k-primary",hovered:"k-state-hover",selected:"k-state-selected",focused:"k-state-focused",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",popup:{form:"k-popup-edit-form",editForm:"k-gantt-edit-form",formContainer:"k-edit-form-container",resourcesFormContainer:"k-resources-form-container",message:"k-popup-message",buttonsContainer:"k-edit-buttons k-state-default",button:"k-button",editField:"k-edit-field",editLabel:"k-edit-label",resourcesField:"k-gantt-resources"},toolbar:{headerWrapper:"k-floatwrap k-header k-gantt-toolbar",footerWrapper:"k-floatwrap k-header k-gantt-toolbar",toolbar:"k-gantt-toolbar",views:"k-gantt-views",viewsWrapper:"k-reset k-header k-gantt-views",actions:"k-gantt-actions",button:"k-button k-button-icontext",iconPlus:"k-icon k-i-plus",iconPdf:"k-icon k-i-pdf",viewButtonDefault:"k-state-default",viewButton:"k-view",link:"k-link",pdfButton:"k-gantt-pdf",appendButton:"k-gantt-create"}},K={append:{text:"Add Task",action:"add",className:Q.toolbar.appendButton,iconClass:Q.toolbar.iconPlus},pdf:{text:"Export to PDF",className:Q.toolbar.pdfButton,iconClass:Q.toolbar.iconPdf}},X=m.extend({init:function(e,t){m.fn.init.call(this),this.element=e,this.options=S(!0,{},this.options,t),this._popup()
},options:{direction:"down",navigatable:!1},_current:function(e){var t=p.styles,n=this.list.find(O+t.focused),i=n[e]();i.length&&(n.removeClass(t.focused).removeAttr("id"),i.addClass(t.focused).attr("id",N),this.list.find("ul").removeAttr(H).attr(H,N))},_popup:function(){var t=this,n=p.styles,i="li"+O+n.item,r=this.options.messages.actions,o=this.options.navigatable;this.list=e(G({styles:n,actions:[{data:"add",text:r.addChild},{data:"insert-before",text:r.insertBefore},{data:"insert-after",text:r.insertAfter}]})),this.element.append(this.list),this.popup=new f.ui.Popup(this.list,S({anchor:this.element,open:function(){t._adjustListWidth()},animation:this.options.animation},B[this.options.direction])),this.element.on(F+I,O+n.toolbar.appendButton,function(i){var r=e(this),a=r.attr(f.attr("action"));i.preventDefault(),a?t.trigger("command",{type:a}):(t.popup.open(),o&&t.list.find("li:first").addClass(n.focused).attr("id",N).end().find("ul").attr({TABINDEX:0,"aria-activedescendant":N}).focus())}),this.list.find(i).hover(function(){e(this).addClass(n.hovered)},function(){e(this).removeClass(n.hovered)}).end().on(F+I,i,function(){t.trigger("command",{type:e(this).attr(f.attr("action"))}),t.popup.close()}),o&&(this.popup.bind("close",function(){t.list.find(i).removeClass(n.focused).end().find("ul").attr(M,0),t.element.parents("["+f.attr("role")+'="gantt"]').find(O+n.gridContent+" > table:first").focus()}),this.list.find("ul").on("keydown"+I,function(e){var i=e.keyCode;switch(i){case E.UP:e.preventDefault(),t._current("prev");break;case E.DOWN:e.preventDefault(),t._current("next");break;case E.ENTER:t.list.find(O+n.focused).click();break;case E.ESC:e.preventDefault(),t.popup.close()}}))},_adjustListWidth:function(){var e,t,n=this.list,i=n[0].style.width,r=this.element;(n.data(z)||!i)&&(e=window.getComputedStyle?window.getComputedStyle(r[0],null):0,t=e?parseFloat(e.width):r.outerWidth(),e&&(g.mozilla||g.msie)&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),i="border-box"!==n.css("box-sizing")?t-(n.outerWidth()-n.width()):t,n.css({fontFamily:r.css("font-family"),width:i}).data(z,i))},destroy:function(){this.popup.destroy(),this.element.off(I),this.list.off(I),this.unbind()}}),Z=function(e,t){return function(n){var i,r;if(n=k(i)?{data:n}:n,i=n||{},r=i.data,i.data=r,!(i instanceof e)&&i instanceof _)throw Error("Incorrect DataSource type. Only "+t+" instances are supported");return i instanceof e?i:new e(i)}},J=f.data.Model.define({id:"id",fields:{id:{type:"number"},predecessorId:{type:"number"},successorId:{type:"number"},type:{type:"number"}}}),et=_.extend({init:function(e){_.fn.init.call(this,S(!0,{},{schema:{modelBase:J,model:J}},e))},successors:function(e){return this._dependencies("predecessorId",e)},predecessors:function(e){return this._dependencies("successorId",e)},dependencies:function(e){var t=this.predecessors(e),n=this.successors(e);return t.push.apply(t,n),t},_dependencies:function(e,t){var n=this.view(),i={field:e,operator:"eq",value:t};return n=new b(n).filter(i).toArray()}});et.create=Z(et,"GanttDependencyDataSource"),s=f.data.Model.define({duration:function(){var e=this.end,t=this.start;return e-t},isMilestone:function(){return 0===this.duration()},_offset:function(e){var t,n,i=["start","end"];for(n=0;i.length>n;n++)t=new Date(this.get(i[n]).getTime()+e),this.set(i[n],t)},id:"id",fields:{id:{type:"number"},parentId:{type:"number",defaultValue:null,validation:{required:!0}},orderId:{type:"number",validation:{required:!0}},title:{type:"string",defaultValue:""},start:{type:"date",validation:{required:!0,dateCompare:r,message:"Start date should be before or equal to the end date"}},end:{type:"date",validation:{required:!0,dateCompare:r,message:"End date should be after or equal to the start date"}},percentComplete:{type:"number",validation:{required:!0,min:0,max:1,step:.01}},summary:{type:"boolean"},expanded:{type:"boolean",defaultValue:!0}}}),l=_.extend({init:function(e){_.fn.init.call(this,S(!0,{},{schema:{modelBase:s,model:s}},e))},remove:function(e){var t=e.get("parentId"),n=this.taskAllChildren(e);return this._removeItems(n),e=_.fn.remove.call(this,e),this._childRemoved(t,e.get("orderId")),e},add:function(e){return e?(e=this._toGanttTask(e),this.insert(this.taskSiblings(e).length,e)):t},insert:function(e,n){return n?(n=this._toGanttTask(n),n.set("orderId",e),n=_.fn.insert.call(this,e,n),this._reorderSiblings(n,this.taskSiblings(n).length-1),this._resolveSummaryFields(this.taskParent(n)),n):t},taskChildren:function(e){var n,i=this.view(),r={field:"parentId",operator:"eq",value:null},o=this._sort||{field:"orderId",dir:"asc"};if(e){if(n=e.get("id"),n===t||null===n)return[];r.value=n}return i=new b(i).filter(r).sort(o).toArray()},taskAllChildren:function(e){var t=[],n=this,i=function(e){var r=n.taskChildren(e);t.push.apply(t,r),A(r,i)};return e?i(e):t=this.view(),t},taskSiblings:function(e){if(!e)return null;var t=this.taskParent(e);return this.taskChildren(t)},taskParent:function(e){return e&&null!==e.get("parentId")?this.get(e.parentId):null},taskLevel:function(e){for(var t=0,n=this.taskParent(e);null!==n;)t+=1,n=this.taskParent(n);return t},taskTree:function(e){var t,n,i,r,o=[],a=this.taskChildren(e);for(n=0,i=a.length;i>n;n++)t=a[n],o.push(t),t.get("expanded")&&(r=this.taskTree(t),o.push.apply(o,r));return o},update:function(e,n){var i,r,o=this,a=function(e,t){var n,i,r=o.taskAllChildren(e);for(n=0,i=r.length;i>n;n++)r[n]._offset(t)},s=function(e){var t=e.field,n=e.sender;switch(t){case"start":o._resolveSummaryStart(o.taskParent(n)),a(n,n.get(t).getTime()-i.getTime());break;case"end":o._resolveSummaryEnd(o.taskParent(n));break;case"percentComplete":o._resolveSummaryPercentComplete(o.taskParent(n));break;case"orderId":o._reorderSiblings(n,i)}};n.parentId!==t&&(i=e.get("parentId"),i!==n.parentId&&(e.set("parentId",n.parentId),o._childRemoved(i,e.get("orderId")),e.set("orderId",o.taskSiblings(e).length-1),o._resolveSummaryFields(o.taskParent(e))),delete n.parentId),e.bind("change",s);for(r in n)i=e.get(r),e.set(r,n[r]);e.unbind("change",s)},_resolveSummaryFields:function(e){e&&(this._updateSummary(e),this.taskChildren(e).length&&(this._resolveSummaryStart(e),this._resolveSummaryEnd(e),this._resolveSummaryPercentComplete(e)))},_resolveSummaryStart:function(e){var t=this,n=function(e){var n,i,r,o=t.taskChildren(e),a=o[0].start.getTime();for(i=1,r=o.length;r>i;i++)n=o[i].start.getTime(),a>n&&(a=n);return new Date(a)};this._updateSummaryRecursive(e,"start",n)},_resolveSummaryEnd:function(e){var t=this,n=function(e){var n,i,r,o=t.taskChildren(e),a=o[0].end.getTime();for(i=1,r=o.length;r>i;i++)n=o[i].end.getTime(),n>a&&(a=n);return new Date(a)};this._updateSummaryRecursive(e,"end",n)},_resolveSummaryPercentComplete:function(e){var t=this,n=function(e){var n=t.taskChildren(e),i=new b(n).aggregate([{field:"percentComplete",aggregate:"average"}]);return i.percentComplete.average};this._updateSummaryRecursive(e,"percentComplete",n)},_updateSummaryRecursive:function(e,t,n){var i,r;e&&(i=n(e),e.set(t,i),r=this.taskParent(e),r&&this._updateSummaryRecursive(r,t,n))},_childRemoved:function(e,t){var n,i,r=null===e?null:this.get(e),o=this.taskChildren(r);for(n=t,i=o.length;i>n;n++)o[n].set("orderId",n);this._resolveSummaryFields(r)},_reorderSiblings:function(e,t){var n,i=e.get("orderId"),r=i>t,o=r?t:i,a=r?i:t,s=r?o:o+1,l=this.taskSiblings(e);for(a=Math.min(a,l.length-1),n=o;a>=n;n++)l[n]!==e&&(l[n].set("orderId",s),s+=1)},_updateSummary:function(e){if(null!==e){var t=this.taskChildren(e).length;e.set("summary",t>0)}},_toGanttTask:function(e){if(!(e instanceof s)){var t=e;e=this._createNewModel(),e.accept(t)}return e}}),l.create=Z(l,"GanttDataSource"),S(!0,f.data,{GanttDataSource:l,GanttTask:s,GanttDependencyDataSource:et,GanttDependency:J}),c={desktop:{dateRange:$,resources:Y}},d=f.Observable.extend({init:function(e,t){f.Observable.fn.init.call(this),this.element=e,this.options=S(!0,{},this.options,t),this.createButton=this.options.createButton},fields:function(t,n){var i,r=this,o=this.options,a=o.messages.editor,s=o.resources,l=function(e){e.preventDefault(),s.editor(r.container.find(O+p.styles.popup.resourcesField),n)};return o.editable.template?i=e.map(n.fields,function(e,t){return{field:t}}):(i=[{field:"title",title:a.title},{field:"start",title:a.start,editor:t.dateRange},{field:"end",title:a.end,editor:t.dateRange},{field:"percentComplete",title:a.percentComplete,format:P}],n.get(s.field)&&i.push({field:s.field,title:a.resources,messages:a,editor:t.resources,click:l,styles:p.styles.popup})),i},_buildEditTemplate:function(e,t,n){var i,r,o,a,s=this.options.resources,l=this.options.editable.template,c=S({},f.Template,this.options.templateSettings),d=c.paramName,u=p.styles.popup,h="";if(l)typeof l===R&&(l=window.unescape(l)),h+=f.template(l,c)(e);else for(i=0,r=t.length;r>i;i++)o=t[i],h+='<div class="'+u.editLabel+'"><label for="'+o.field+'">'+(o.title||o.field||"")+"</label></div>",o.field===s.field&&(h+='<div class="'+u.resourcesField+'" style="display:none"></div>'),!e.editable||e.editable(o.field)?(n.push(o),h+="<div "+f.attr("container-for")+'="'+o.field+'" class="'+u.editField+'"></div>'):(a="#:",o.field?(o=f.expr(o.field,d),a+=o+"==null?'':"+o):a+="''",a+="#",a=f.template(a,c),h+='<div class="'+u.editField+'">'+a(e)+"</div>");return h}}),u=d.extend({destroy:function(){this.close(),this.unbind()},editTask:function(e){this.editable=this._createPopupEditor(e)},close:function(){var e=this,t=function(){e.editable&&(e.editable.destroy(),e.editable=null,e.container=null),e.popup&&(e.popup.destroy(),e.popup=null)};this.editable&&this.container.is(":visible")?this.container.data("kendoWindow").bind("deactivate",t).close():t()},showDialog:function(t){var n,i,r,o,a=t.buttons,s=p.styles.popup,l=f.format('<div class="{0}"><div class="{1}"><p class="{2}">{3}</p><div class="{4}">',s.form,s.formContainer,s.message,t.text,s.buttonsContainer);for(n=0,i=a.length;i>n;n++)l+=this.createButton(a[n]);l+="</div></div></div>",r=this.element,this.popup&&this.popup.destroy(),o=this.popup=e(l).appendTo(r).eq(0).on("click",O+s.button,function(t){t.preventDefault(),o.close();var n=e(t.currentTarget).index();a[n].click()}).kendoWindow({modal:!0,resizable:!1,draggable:!1,title:t.title,visible:!1,close:function(){this.destroy(),r.focus()}}).getKendoWindow(),o.center().open()},_createPopupEditor:function(t){var n,i,r=this,o={},a=this.options.messages,s=p.styles,l=s.popup,d=f.format('<div {0}="{1}" class="{2} {3}"><div class="{4}">',f.attr("uid"),t.uid,l.form,l.editForm,l.formContainer),u=this.fields(c.desktop,t),h=[];return d+=this._buildEditTemplate(t,u,h),d+='<div class="'+l.buttonsContainer+'">',d+=this.createButton({name:"update",text:a.save,className:p.styles.primary}),d+=this.createButton({name:"cancel",text:a.cancel}),d+=this.createButton({name:"delete",text:a.destroy}),d+="</div></div></div>",n=this.container=e(d).appendTo(this.element).eq(0).kendoWindow(S({modal:!0,resizable:!1,draggable:!0,title:a.editor.editorTitle,visible:!1,close:function(e){e.userTriggered&&r.trigger("cancel",{container:n,model:t})&&e.preventDefault()}},o)),i=n.kendoEditable({fields:h,model:t,clearContainer:!1,validateOnBlur:!0,target:r.options.target}).data("kendoEditable"),this.trigger("edit",{container:n,model:t})?r.trigger("cancel",{container:n,model:t}):(n.data("kendoWindow").center().open(),n.on(F+I,O+s.buttonCancel,function(e){e.preventDefault(),e.stopPropagation(),r.trigger("cancel",{container:n,model:t})}),n.on(F+I,O+s.buttonSave,function(e){var i,o,a,s,l;for(e.preventDefault(),e.stopPropagation(),i=r.fields(c.desktop,t),o={},s=0,l=i.length;l>s;s++)a=i[s].field,o[a]=t.get(a);r.trigger("save",{container:n,model:t,updateInfo:o})}),n.on(F+I,O+s.buttonDelete,function(e){e.preventDefault(),e.stopPropagation(),r.trigger("remove",{container:n,model:t})})),i}}),h=v.extend({init:function(e,t){v.fn.init.call(this,e,t),this.wrapper=this.element,this.model=this.options.model,this.resourcesField=this.options.resourcesField,this.createButton=this.options.createButton,this._initContainer(),this._attachHandlers()},events:["save"],open:function(){this.window.center().open(),this.grid.resize(!0)},close:function(){this.window.bind("deactivate",T(this.destroy,this)).close()},destroy:function(){this._dettachHandlers(),this.grid.destroy(),this.grid=null,this.window.destroy(),this.window=null,v.fn.destroy.call(this),f.destroy(this.wrapper),this.element=this.wrapper=null},_attachHandlers:function(){var t=p.styles,n=this.grid,i=this._cancelProxy=T(this._cancel,this);this.container.on(F+I,O+t.buttonCancel,this._cancelProxy),this._saveProxy=T(this._save,this),this.container.on(F+I,O+t.buttonSave,this._saveProxy),this.window.bind("close",function(e){e.userTriggered&&i(e)}),n.wrapper.on(F+I,"input[type='checkbox']",function(){var t=e(this),i=e(t).closest("tr"),r=n.dataSource.getByUid(i.attr(f.attr("uid"))),o=e(t).is(":checked")?1:"";r.set("value",o)})},_dettachHandlers:function(){this._cancelProxy=null,this._saveProxy=null,this.container.off(I),this.grid.wrapper.off()},_cancel:function(e){e.preventDefault(),this.close()},_save:function(e){e.preventDefault(),this._updateModel(),this.wrapper.is(O+p.styles.popup.resourcesField)||this.trigger("save",{container:this.wrapper,model:this.model}),this.close()},_initContainer:function(){var t=p.styles.popup,n=f.format('<div class="{0} {1}"><div class="{2} {3}"/></div>"',t.form,t.editForm,t.formContainer,t.resourcesFormContainer);n=e(n),this.container=n.find(O+t.resourcesFormContainer),this.window=n.kendoWindow({modal:!0,resizable:!1,draggable:!0,visible:!1,title:this.options.messages.resourcesEditorTitle}).data("kendoWindow"),this._resourceGrid(),this._createButtons()},_resourceGrid:function(){var t=this,n=this.options.messages,i=e('<div id="resources-grid"/>').appendTo(this.container);this.grid=new f.ui.Grid(i,{columns:[{field:"name",title:n.resourcesHeader,template:"<label><input type='checkbox' value='#=name#'# if (value > 0 && value !== null) {#checked='checked'# } #/>#=name#</labe>"},{field:"value",title:n.unitsHeader,template:function(e){var t=e.format,n=null!==e.value?e.value:"";return t?f.toString(n,t):n}}],height:280,sortable:!0,editable:!0,filterable:!0,dataSource:{data:t.options.data,schema:{model:{id:"id",fields:{id:{from:"id",type:"number"},name:{from:"name",type:"string",editable:!1},value:{from:"value",type:"number",defaultValue:""},format:{from:"format",type:"string"}}}}},save:function(e){var t=!!e.values.value;e.container.parent().find("input[type='checkbox']").prop("checked",t)}})},_createButtons:function(){var e,t,n=this.options.buttons,i='<div class="'+p.styles.popup.buttonsContainer+'">';for(e=0,t=n.length;t>e;e++)i+=this.createButton(n[e]);i+="</div>",this.container.append(i)},_updateModel:function(){var e,t,n,i=[],r=this.grid.dataSource.data();for(t=0,n=r.length;n>t;t++)e=r[t].get("value"),null!==e&&e>0&&i.push(r[t]);this.model[this.resourcesField]=i}}),p=v.extend({init:function(e,t){k(t)&&(t={dataSource:t}),v.fn.init.call(this,e,t),this._wrapper(),this._resources(),this._timeline(),this._toolbar(),this._footer(),this._adjustDimensions(),this._preventRefresh=!0,this.view(this.timeline._selectedViewName),this._preventRefresh=!1,this._dataSource(),this._assignments(),this._dropDowns(),this._list(),this._dependencies(),this._resizable(),this._scrollable(),this._dataBind(),this._attachEvents(),this._createEditor(),f.notify(this)},events:["dataBinding","dataBound","add","edit","remove","cancel","save","change","navigate","moveStart","move","moveEnd","resizeStart","resize","resizeEnd"],options:{name:"Gantt",autoBind:!0,navigatable:!1,selectable:!0,editable:!0,columns:[],views:[],dataSource:{},dependencies:{},resources:{},assignments:{},messages:{save:"Save",cancel:"Cancel",destroy:"Delete",deleteTaskWindowTitle:"Delete task",deleteDependencyWindowTitle:"Delete dependency",views:{day:"Day",week:"Week",month:"Month",year:"Year",start:"Start",end:"End"},actions:{append:"Add Task",addChild:"Add Child",insertBefore:"Add Above",insertAfter:"Add Below",pdf:"Export to PDF"},editor:{editorTitle:"Task",resourcesEditorTitle:"Resources",title:"Title",start:"Start",end:"End",percentComplete:"Complete",resources:"Resources",assingButton:"Assign",resourcesHeader:"Resources",unitsHeader:"Units"}},showWorkHours:!0,showWorkDays:!0,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,hourSpan:1,snap:!0,height:600,listWidth:"30%"},select:function(e){var n=this.list;return e?(n.select(e),t):n.select()},clearSelection:function(){this.list.clearSelection()},destroy:function(){v.fn.destroy.call(this),this.dataSource&&(this.dataSource.unbind("change",this._refreshHandler),this.dataSource.unbind("progress",this._progressHandler),this.dataSource.unbind("error",this._errorHandler)),this.dependencies&&(this.dependencies.unbind("change",this._dependencyRefreshHandler),this.dependencies.unbind("error",this._dependencyErrorHandler)),this.timeline&&(this.timeline.unbind(),this.timeline.destroy()),this.list&&(this.list.unbind(),this.list.destroy()),this.footerDropDown&&this.footerDropDown.destroy(),this.headerDropDown&&this.headerDropDown.destroy(),this._editor&&this._editor.destroy(),this._resizeDraggable&&this._resizeDraggable.destroy(),this.toolbar.off(I),e(window).off("resize"+I,this._resizeHandler),e(this.wrapper).off(I),this.toolbar=null,this.footer=null},_attachEvents:function(){this._resizeHandler=T(this.resize,this),e(window).on("resize"+I,this._resizeHandler)},_wrapper:function(){var e=p.styles,t=[e.icon,e.resizeHandle].join(" "),n=this.options,i=n.height,r=n.width;this.wrapper=this.element.addClass(e.wrapper).append("<div class='"+e.listWrapper+"'><div></div></div>").append("<div class='"+e.splitBarWrapper+"'><div class='"+t+"'></div></div>").append("<div class='"+e.timelineWrapper+"'><div></div></div>"),this.wrapper.find(O+e.list).width(n.listWidth),i&&this.wrapper.height(i),r&&this.wrapper.width(r)},_toolbar:function(){var t,n,i=this,r=p.styles,o=O+r.toolbar.views+" > li",a=O+r.toolbar.pdfButton,s=r.hovered,l=this.options.toolbar,c=e("<div class='"+r.toolbar.actions+"'>");C(l)||(l=typeof l===R?l:this._actions(l),l=T(f.template(l),this)),n=e(q({ns:f.ns,views:this.timeline.views,styles:r.toolbar})),c.append(l({})),t=e("<div class='"+r.toolbar.headerWrapper+"'>").append(c).append(n),this.wrapper.prepend(t),this.toolbar=t,t.on(F+I,o,function(t){t.preventDefault();var n=e(this).attr(f.attr("name"));i.trigger("navigate",{view:n})||i.view(n)}).on(F+I,a,function(){i.saveAsPDF()}),this.wrapper.find(O+r.toolbar.toolbar+" li").hover(function(){e(this).addClass(s)},function(){e(this).removeClass(s)})},_actions:function(){var e,t,n=this.options,i=n.toolbar,r="";if(!k(i)){if(!n.editable)return r;i=["append"]}for(e=0,t=i.length;t>e;e++)r+=this._createButton(i[e]);return r},_footer:function(){var t,n,i,r,o;this.options.editable&&(t=p.styles.toolbar,n=this.options.messages.actions,i=e(f.template(W)(S(!0,{styles:t},K.append,{text:n.append}))),r=e("<div class='"+t.actions+"'>").append(i),o=e("<div class='"+t.footerWrapper+"'>").append(r),this.wrapper.append(o),this.footer=o)},_createButton:function(e){var t=e.template||W,n=this.options.messages.actions,i=typeof e===R?e:e.name||e.text,r=K[i]?K[i].className:"k-gantt-"+(i||"").replace(/\s/g,""),o={iconClass:"",action:"",text:i,className:r,styles:p.styles.toolbar};if(!(i||D(e)&&e.template))throw Error("Custom commands should have name specified");return o=S(!0,o,K[i],{text:n[i]}),D(e)&&(e.className&&x(o.className,e.className.split(" "))<0&&(e.className+=" "+o.className),o=S(!0,o,e)),f.template(t)(o)},_adjustDimensions:function(){var e=this.element,t=p.styles,n=O+t.list,i=O+t.timeline,r=O+t.splitBar,o=this.toolbar.outerHeight(),a=this.footer?this.footer.outerHeight():0,s=e.height(),l=e.width(),c=e.find(r).outerWidth(),d=e.find(n).outerWidth();e.children([n,i,r].join(",")).height(s-(o+a)).end().children(i).width(l-(c+d))},_scrollTo:function(e){var t=this.timeline.view(),i=f.attr("uid"),r="string"==typeof e?e:e.closest("tr"+n()).attr(i),o=t.content.find(n(r));0!==o.length&&t._scrollTo(o)},_dropDowns:function(){var e=this,t=O+p.styles.toolbar.actions,n=this.options.messages.actions,i=this.dataSource,r=this.timeline,o=function(t){var n,o=t.type,a=i._createNewModel(),s=e.dataItem(e.select()),l=i.taskParent(s),c=r.view()._timeSlots()[0],d="add"===o?s:l;a.set("title","New task"),d?(a.set("parentId",d.get("id")),a.set("start",d.get("start")),a.set("end",d.get("end"))):(a.set("start",c.start),a.set("end",c.end)),"add"!==o&&(n=s.get("orderId"),n="insert-before"===o?n:n+1),e._createTask(a,n)};this.options.editable&&(this.footerDropDown=new X(this.footer.children(t).eq(0),{messages:{actions:n},direction:"up",animation:{open:{effects:"slideIn:up"}},navigatable:e.options.navigatable}),this.headerDropDown=new X(this.toolbar.children(t).eq(0),{messages:{actions:n},navigatable:e.options.navigatable}),this.footerDropDown.bind("command",o),this.headerDropDown.bind("command",o))},_list:function(){var e,t,n=this,i=n.options.navigatable,r=p.styles,a=this.wrapper.find(O+r.list),s=a.find("> div"),l=this.wrapper.find(O+r.toolbar.actions+" > button"),c={columns:this.options.columns||[],dataSource:this.dataSource,selectable:this.options.selectable,editable:this.options.editable,listWidth:a.outerWidth(),resourcesField:this.resources.field},d=c.columns,u=function(){i&&(n._current(n._cachedCurrent),o(n.list.content.find("table"),!0)),delete n._cachedCurrent};for(t=0;d.length>t;t++)e=d[t],e.field===this.resources.field&&"function"!=typeof e.editor&&(e.editor=T(this._createResourceEditor,this));this.list=new f.ui.GanttList(s,c),this.list.bind("render",function(){n._navigatable()},!0).bind("edit",function(e){n._cachedCurrent=e.cell,n.trigger("edit",{task:e.model,container:e.cell})&&e.preventDefault()}).bind("cancel",function(e){n.trigger("cancel",{task:e.model,container:e.cell})&&e.preventDefault(),u()}).bind("update",function(e){n._updateTask(e.task,e.updateInfo),u()}).bind("change",function(){n.trigger("change");var e=n.list.select();e.length?(l.removeAttr("data-action","add"),n.timeline.select("[data-uid='"+e.attr("data-uid")+"']")):(l.attr("data-action","add"),n.timeline.clearSelection())})},_timeline:function(){var e=this,t=p.styles,n=i(S(!0,{resourcesField:this.resources.field},this.options)),r=this.wrapper.find(O+t.timeline+" > div");this.timeline=new f.ui.GanttTimeline(r,n),this.timeline.bind("navigate",function(n){e.toolbar.find(O+t.toolbar.views+" > li").removeClass(t.selected).end().find(O+t.toolbar.viewButton+"-"+n.view.replace(/\./g,"\\.").toLowerCase()).addClass(t.selected),e.refresh()}).bind("moveStart",function(t){e.trigger("moveStart",{task:t.task})&&t.preventDefault()}).bind("move",function(t){var n=t.task,i=t.start,r=new Date(i.getTime()+n.duration());e.trigger("move",{task:n,start:i,end:r})&&t.preventDefault()}).bind("moveEnd",function(t){var n=t.task,i=t.start,r=new Date(i.getTime()+n.duration());e.trigger("moveEnd",{task:n,start:i,end:r})||e._updateTask(e.dataSource.getByUid(n.uid),{start:i,end:r})}).bind("resizeStart",function(t){e.trigger("resizeStart",{task:t.task})&&t.preventDefault()}).bind("resize",function(t){e.trigger("resize",{task:t.task,start:t.start,end:t.end})&&t.preventDefault()}).bind("resizeEnd",function(t){var n=t.task,i={};t.resizeStart?i.start=t.start:i.end=t.end,e.trigger("resizeEnd",{task:n,start:t.start,end:t.end})||e._updateTask(e.dataSource.getByUid(n.uid),i)}).bind("percentResizeEnd",function(t){e._updateTask(e.dataSource.getByUid(t.task.uid),{percentComplete:t.percentComplete})}).bind("dependencyDragEnd",function(t){var n=e.dependencies._createNewModel({type:t.type,predecessorId:t.predecessor.id,successorId:t.successor.id});e._createDependency(n)}).bind("select",function(t){e.select("[data-uid='"+t.uid+"']")}).bind("editTask",function(t){e.editTask(t.uid)}).bind("clear",function(){e.clearSelection()}).bind("removeTask",function(t){e.removeTask(e.dataSource.getByUid(t.uid))}).bind("removeDependency",function(t){e.removeDependency(e.dependencies.getByUid(t.uid))})},_dataSource:function(){var e=this.options,t=e.dataSource;t=k(t)?{data:t}:t,this.dataSource&&this._refreshHandler?this.dataSource.unbind("change",this._refreshHandler).unbind("progress",this._progressHandler).unbind("error",this._errorHandler):(this._refreshHandler=T(this.refresh,this),this._progressHandler=T(this._requestStart,this),this._errorHandler=T(this._error,this)),this.dataSource=f.data.GanttDataSource.create(t).bind("change",this._refreshHandler).bind("progress",this._progressHandler).bind("error",this._errorHandler)},_dependencies:function(){var e=this.options.dependencies||{},t=k(e)?{data:e}:e;this.dependencies&&this._dependencyRefreshHandler?this.dependencies.unbind("change",this._dependencyRefreshHandler).unbind("error",this._dependencyErrorHandler):(this._dependencyRefreshHandler=T(this.refreshDependencies,this),this._dependencyErrorHandler=T(this._error,this)),this.dependencies=f.data.GanttDependencyDataSource.create(t).bind("change",this._dependencyRefreshHandler).bind("error",this._dependencyErrorHandler)},_resources:function(){var e=this.options.resources,t=e.dataSource||{};this.resources={field:"resources",dataTextField:"name",dataColorField:"color",dataFormatField:"format"},S(this.resources,e),this.resources.dataSource=f.data.DataSource.create(t)},_assignments:function(){var e=this.options.assignments,t=e.dataSource||{};this.assignments?this.assignments.dataSource.unbind("change",this._assignmentsRefreshHandler):this._assignmentsRefreshHandler=T(this.refresh,this),this.assignments={dataTaskIdField:"taskId",dataResourceIdField:"resourceId",dataValueField:"value"},S(this.assignments,e),this.assignments.dataSource=f.data.DataSource.create(t),this.assignments.dataSource.bind("change",this._assignmentsRefreshHandler)},_createEditor:function(){var e=this,n=this._editor=new u(this.wrapper,S({},this.options,{target:this,resources:{field:this.resources.field,editor:T(this._createResourceEditor,this)},createButton:T(this._createPopupButton,this)}));n.bind("cancel",function(n){var i=e.dataSource.getByUid(n.model.uid);return e.trigger("cancel",{container:n.container,task:i})?(n.preventDefault(),t):(e.cancelTask(),t)}).bind("edit",function(t){var n=e.dataSource.getByUid(t.model.uid);e.trigger("edit",{container:t.container,task:n})&&t.preventDefault()}).bind("save",function(t){var n=e.dataSource.getByUid(t.model.uid);e.saveTask(n,t.updateInfo)}).bind("remove",function(t){e.removeTask(t.model.uid)})},_createResourceEditor:function(e,t){var n=this,i=t instanceof w?t:t.model,r=i.get("id"),o=this.options.messages,a=n.resources.field,s=this._resourceEditor=new h(e,{resourcesField:a,data:this._wrapResourceData(r),model:i,messages:S({},o.editor),buttons:[{name:"update",text:o.save,className:p.styles.primary},{name:"cancel",text:o.cancel}],createButton:T(this._createPopupButton,this),save:function(e){n._updateAssignments(e.model.get("id"),e.model.get(a))}});s.open()},_createPopupButton:function(e){var t=e.name||e.text,n={className:p.styles.popup.button+" k-gantt-"+(t||"").replace(/\s/g,""),text:t,attr:""};if(!(t||D(e)&&e.template))throw Error("Custom commands should have name specified");return D(e)&&(e.className&&(e.className+=" "+n.className),n=S(!0,n,e)),f.template(j)(n)},view:function(e){return this.timeline.view(e)},dataItem:function(e){var t,n;return e?(t=this.list,n=t.content.find(e),t._modelFromElement(n)):null},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.list._setDataSource(this.dataSource),this.options.autoBind&&e.fetch()},setDependenciesDataSource:function(e){this.options.dependencies=e,this._dependencies(),this.options.autoBind&&e.fetch()},items:function(){return this.wrapper.children(".k-task")},_updateAssignments:function(e,t){for(var n,i,r,o,a,s,l,c=this.assignments.dataSource,d=this.assignments.dataTaskIdField,u=this.assignments.dataResourceIdField,h=this.assignments.dataValueField,p=!1,f=new b(c.view()).filter({field:d,operator:"eq",value:e}).toArray();f.length;){for(n=f[0],o=0,a=t.length;a>o;o++)if(i=t[o],n.get(u)===i.get("id")){r=t[o].get("value"),n.set(h,r),t.splice(o,1),p=!0;break}p||c.remove(n),p=!1,f.shift()}for(s=0,l=t.length;l>s;s++)i=t[s],n=c._createNewModel(),n[d]=e,n[u]=i.get("id"),n[h]=i.get("value"),c.add(n);c.sync()},cancelTask:function(){var e=this._editor,t=e.container;t&&e.close()},editTask:function(e){var t,n="string"==typeof e?this.dataSource.getByUid(e):e;n&&(t=this.dataSource._createNewModel(n.toJSON()),t.uid=n.uid,this.cancelTask(),this._editTask(t))},_editTask:function(e){this._editor.editTask(e)},saveTask:function(e,t){var n=this._editor,i=n.container,r=n.editable;i&&r&&r.end()&&this._updateTask(e,t)},_updateTask:function(e,t){var n=this.resources.field;this.trigger("save",{task:e,values:t})||(this._preventRefresh=!0,this.dataSource.update(e,t),t[n]&&this._updateAssignments(e.get("id"),t[n]),this._syncDataSource())},removeTask:function(e){var t=this,n="string"==typeof e?this.dataSource.getByUid(e):e;n&&this._taskConfirm(function(e){e||t._removeTask(n)},n)},_createTask:function(e,n){if(!this.trigger("add",{task:e,dependency:null})){var i=this.dataSource;this._preventRefresh=!0,n===t?i.add(e):i.insert(n,e),this._scrollToUid=e.uid,this._syncDataSource()}},_createDependency:function(e){this.trigger("add",{task:null,dependency:e})||(this._preventDependencyRefresh=!0,this.dependencies.add(e),this._preventDependencyRefresh=!1,this.dependencies.sync())},removeDependency:function(e){var t=this,n="string"==typeof e?this.dependencies.getByUid(e):e;n&&this._dependencyConfirm(function(e){e||t._removeDependency(n)},n)},_removeTaskDependencies:function(e,t){this._preventDependencyRefresh=!0;for(var n=0,i=t.length;i>n;n++)this.dependencies.remove(t[n]);this._preventDependencyRefresh=!1,this.dependencies.sync()},_removeResourceAssignments:function(e){var t,n,i=this.assignments.dataSource,r=i.view(),o={field:this.assignments.dataTaskIdField,operator:"eq",value:e.get("id")};for(r=new b(r).filter(o).toArray(),this._preventRefresh=!0,t=0,n=r.length;n>t;t++)i.remove(r[t]);this._preventRefresh=!1,i.sync()},_removeTask:function(e){var t=this.dependencies.dependencies(e.id);this.trigger("remove",{task:e,dependencies:t})||(this._removeTaskDependencies(e,t),this._removeResourceAssignments(e),this._preventRefresh=!0,this.dataSource.remove(e)&&this._syncDataSource(),this._preventRefresh=!1)},_removeDependency:function(e){this.trigger("remove",{task:null,dependencies:[e]})||this.dependencies.remove(e)&&this.dependencies.sync()},_taskConfirm:function(e,t){this._confirm(e,{model:t,text:V,title:this.options.messages.deleteTaskWindowTitle})},_dependencyConfirm:function(e,t){this._confirm(e,{model:t,text:U,title:this.options.messages.deleteDependencyWindowTitle})},_confirm:function(e,t){var n,i,r=this.options.editable;r===!0||r.confirmation!==!1?(n=this.options.messages,i=[{name:"delete",text:n.destroy,className:p.styles.primary,click:function(){e()}},{name:"cancel",text:n.cancel,click:function(){e(!0)}}],this.showDialog(S(!0,{},t,{buttons:i}))):e()},showDialog:function(e){this._editor.showDialog(e)},refresh:function(){var e,t,i,r,o,a;this._preventRefresh||this.list.editable||(this._progress(!1),e=this.dataSource,t=e.taskTree(),i=this._scrollToUid,a=-1,this.current&&(o=this.current.closest("tr").attr(f.attr("uid")),a=this.current.index()),this.trigger("dataBinding")||(0!==this.resources.dataSource.data().length&&this._assignResources(t),this._editor&&this._editor.close(),this.clearSelection(),this.list._render(t),this.timeline._render(t),this.timeline._renderDependencies(this.dependencies.view()),i&&(this._scrollTo(i),this.select(n(i))),(i||o)&&a>=0&&(r=this.list.content.find("tr"+n(i||o)+" > td:eq("+a+")"),this._current(r)),this._scrollToUid=null,this.trigger("dataBound")))},refreshDependencies:function(){this._preventDependencyRefresh||this.trigger("dataBinding")||(this.timeline._renderDependencies(this.dependencies.view()),this.trigger("dataBound"))
},_assignResources:function(e){var t,n,i=this.resources,r=this.assignments,o=function(){var e=r.dataSource.view(),t={field:r.dataTaskIdField};return e=new b(e).group(t).toArray()},a=o(),s=function(e,t){var n,r,o=e.get("id");for(f.setter(i.field)(e,new y([])),n=0,r=a.length;r>n;n++)a[n].value===o&&t(e,a[n].items)},l=function(e,t){var n,o,a,s,l,c,d,u;for(n=0,o=t.length;o>n;n++)a=t[n],s=i.dataSource.get(a.get(r.dataResourceIdField)),l=a.get(r.dataValueField),c=a.get(r.dataResourceIdField),d=s.get(i.dataFormatField)||P,u=f.toString(l,d),e[i.field].push(new w({id:c,name:s.get(i.dataTextField),color:s.get(i.dataColorField),value:l,formatedValue:u}))};for(t=0,n=e.length;n>t;t++)s(e[t],l)},_wrapResourceData:function(e){var t,n,i,r=this,o=[],a=this.resources.dataSource.view(),s=this.assignments.dataSource.view(),l=new b(s).filter({field:r.assignments.dataTaskIdField,operator:"eq",value:e}).toArray(),c=function(e){var t=null;return new b(l).filter({field:r.assignments.dataResourceIdField,operator:"eq",value:e}).select(function(e){t+=e.get(r.assignments.dataValueField)}),t};for(n=0,i=a.length;i>n;n++)t=a[n],o.push({id:t.get("id"),name:t.get(r.resources.dataTextField),format:t.get(r.resources.dataFormatField)||P,value:c(t.id)});return o},_syncDataSource:function(){this._preventRefresh=!1,this._requestStart(),this.dataSource.sync()},_requestStart:function(){this._progress(!0)},_error:function(){this._progress(!1)},_progress:function(e){f.ui.progress(this.element,e)},_resizable:function(){var t,n,i,r=this.wrapper,o=p.styles,a=O+o.gridContent,s=r.find(O+o.list),l=r.find(O+o.timeline);this._resizeDraggable=r.find(O+o.splitBar).height(s.height()).hover(function(){e(this).addClass(o.splitBarHover)},function(){e(this).removeClass(o.splitBarHover)}).end().kendoResizable({orientation:"horizontal",handle:O+o.splitBar,start:function(){t=s.width(),n=l.width(),i=l.find(a).scrollLeft()},resize:function(e){var r=e.x.initialDelta;0>t+r||0>n-r||(s.width(t+r),l.width(n-r),l.find(a).scrollLeft(i+r))}}).data("kendoResizable")},_scrollable:function(){var t=p.styles,n=O+t.gridContent,i=O+t.gridHeaderWrap,r=this.timeline.element,o=this.list.element;r.find(n).on("scroll",function(){r.find(i).scrollLeft(this.scrollLeft),o.find(n).scrollTop(this.scrollTop)}),o.find(n).on("scroll",function(){o.find(i).scrollLeft(this.scrollLeft)}).on("DOMMouseScroll"+I+" mousewheel"+I,function(t){var i=r.find(n),o=i.scrollTop(),a=f.wheelDeltaY(t);a&&(t.preventDefault(),e(t.currentTarget).one("wheel"+I,!1),i.scrollTop(o+-a))})},_navigatable:function(){var i,r=this,a=this.options.navigatable,s=this.options.editable,l=this.list.header.find("table"),c=this.list.content.find("table"),d=p.styles,u=this.timeline.element.find(O+d.gridContent),h=l.add(c),g=n(),m={collapse:!1,expand:!0},v=function(e){var t=r.timeline.view()._timeSlots()[0].offsetWidth;u.scrollLeft(u.scrollLeft()+(e?-t:t))},_=function(e){var t=r.current.parent("tr"+n()),i=r.current.index(),a=t[e]();0!==r.select().length&&r.clearSelection(),0!==a.length?(r._current(a.children("td:eq("+i+")")),r._scrollTo(r.current)):r.current.is("td")&&"prev"==e?o(l):r.current.is("th")&&"next"==e&&o(c)},w=function(e){var t=r.current[e]();0!==t.length&&(r._current(t),i=r.current.index())},y=function(e){var t=r.dataItem(r.current);t.summary&&t.expanded!==e&&t.set("expanded",e)},b=function(){var e,t;r.options.editable&&!r.list.editable&&(e=r.select(),t=f.attr("uid"),e.length&&r.removeTask(e.attr(t)))};return e(this.wrapper).on("mousedown"+I,"tr"+g+", div"+g+":not("+O+d.line+")",function(t){var i,l=e(t.currentTarget),c=e(t.target).is(":button,a,:input,a>.k-icon,textarea,span.k-icon,span.k-link,.k-input,.k-multiselect-wrap");t.ctrlKey||(a&&(i=l.is("tr")?e(t.target).closest("td"):r.list.content.find("tr"+n(l.attr(f.attr("uid")))+" > td:first"),r._current(i)),!a&&!s||c||setTimeout(function(){o(r.list.content.find("table"),!0)},2))}),a!==!0?(c.on("keydown"+I,function(e){e.keyCode==E.DELETE&&b()}),t):(h.on("focus"+I,function(){var t=this===c.get(0)?"td":"th",n=(e(this),r.select()),o=r.current||e(n.length?n:this).find(t+":eq("+(i||0)+")");r._current(o)}).on("blur"+I,function(){r._current(),this==l&&e(this).attr(M,-1)}).on("keydown"+I,function(e){var t,n=e.keyCode;if(r.current)switch(t=r.current.is("td"),n){case E.RIGHT:e.preventDefault(),e.altKey?v():e.ctrlKey?y(m.expand):w("next");break;case E.LEFT:e.preventDefault(),e.altKey?v(!0):e.ctrlKey?y(m.collapse):w("prev");break;case E.UP:e.preventDefault(),_("prev");break;case E.DOWN:e.preventDefault(),_("next");break;case E.SPACEBAR:e.preventDefault(),t&&r.select(r.current.closest("tr"));break;case E.ENTER:e.preventDefault(),t?r.options.editable&&(r._cachedCurrent=r.current,r.list._startEditHandler(r.current),e.stopPropagation()):r.current.children("a.k-link").click();break;case E.ESC:e.stopPropagation();break;case E.DELETE:t&&b();break;default:n>=49&&57>=n&&r.view(r.timeline._viewByIndex(n-49))}}),t)},_current:function(t){var n,i=p.styles;this.current&&this.current.length&&this.current.removeClass(i.focused).removeAttr("id"),t&&t.length?(this.current=t.addClass(i.focused).attr("id",L),n=e(f._activeElement()),n.is("table")&&this.wrapper.find(n).length>0&&n.removeAttr(H).attr(H,L)):this.current=null},_dataBind:function(){var t,n=this;n.options.autoBind&&(this._preventRefresh=!0,this._preventDependencyRefresh=!0,t=e.map([this.dataSource,this.dependencies,this.resources.dataSource,this.assignments.dataSource],function(e){return e.fetch()}),e.when.apply(null,t).done(function(){n._preventRefresh=!1,n._preventDependencyRefresh=!1,n.refresh()}))},_resize:function(){this._adjustDimensions(),this.timeline.view()._adjustHeight(),this.list._adjustHeight()}}),f.PDFMixin&&f.PDFMixin.extend(p.prototype),f.ui.plugin(p),S(!0,p,{styles:Q})}(window.kendo.jQuery),function(e,t){function n(e){var t,n,i=[],r=e.className;for(t=0,n=e.level;n>t;t++)i.push(c("span",{className:r}));return i}var i,r,o,a=kendo.data,s=e.extend,l=kendo.dom,c=l.element,d=l.text,u=l.html,h=kendo.ui,p=h.DataBoundWidget,f=a.DataSource,g=a.ObservableArray,m=a.Query,v=a.Model,_=e.proxy,w=e.map,y=e.grep,b="string",k="change",x="error",C="progress",T=".",S=".kendoTreeList",D="click",A="mousedown",E="edit",I="save",P="expand",M="collapse",F="remove",z="dataBinding",R="dataBound",B="cancel",H="filterMenuInit",L={wrapper:"k-treelist k-grid k-widget",header:"k-header",button:"k-button",alt:"k-alt",editCell:"k-edit-cell",group:"k-treelist-group",gridToolbar:"k-grid-toolbar",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",gridContentWrap:"k-grid-content",gridFilter:"k-grid-filter",footerTemplate:"k-footer-template",loading:"k-loading",refresh:"k-i-refresh",retry:"k-request-retry",selected:"k-state-selected",status:"k-status",link:"k-link",withIcon:"k-with-icon",filterable:"k-filterable",icon:"k-icon",iconFilter:"k-filter",iconCollapse:"k-i-collapse",iconExpand:"k-i-expand",iconHidden:"k-i-none",iconPlaceHolder:"k-icon k-i-none",input:"k-input",dropPositions:"k-insert-top k-insert-bottom k-add k-insert-middle",dropTop:"k-insert-top",dropBottom:"k-insert-bottom",dropAdd:"k-add",dropMiddle:"k-insert-middle",dropDenied:"k-denied",dragStatus:"k-drag-status",dragClue:"k-drag-clue",dragClueText:"k-clue-text"},N={create:{imageClass:"k-add",className:"k-grid-add",methodName:"addRow"},createchild:{imageClass:"k-add",className:"k-grid-add",methodName:"addRow"},destroy:{imageClass:"k-delete",className:"k-grid-delete",methodName:"removeRow"},edit:{imageClass:"k-edit",className:"k-grid-edit",methodName:"editRow"},update:{imageClass:"k-update",className:"k-primary k-grid-update",methodName:"saveRow"},canceledit:{imageClass:"k-cancel",className:"k-grid-cancel",methodName:"_cancelEdit"},excel:{imageClass:"k-i-excel",className:"k-grid-excel",methodName:"saveAsExcel"},pdf:{imageClass:"k-i-pdf",className:"k-grid-pdf",methodName:"saveAsPDF"}},O=v.define({id:"id",fields:{id:{type:"number"},parentId:{type:"number",nullable:!0}},init:function(e){v.fn.init.call(this,e),this._loaded=!1},loaded:function(e){return e===t?this._loaded:(this._loaded=e,t)},shouldSerialize:function(e){return v.fn.shouldSerialize.call(this,e)&&"_loaded"!==e&&"_error"!=e&&"_edit"!=e}}),V=f.extend({init:function(e){f.fn.init.call(this,s(!0,{},{schema:{modelBase:O,model:O}},e))},_readData:function(e){var t,n,i=[],r=this.data();for(t=0,n=r.length;n>t;t++)i.push(r[t]);return i.concat(f.fn._readData.call(this,e))},_readAggregates:function(e){var t=s(this._aggregateResult,this.reader.aggregates(e));return""in t&&(t[this._defaultParentId()]=t[""],delete t[""]),t},remove:function(e){var t=this._subtree(this._childrenMap(this.data()),e.id);this._removeItems(t),f.fn.remove.call(this,e)},_filterCallback:function(e){var t,n,i=[],r=e.toArray(),o={};for(t=0;r.length>t;t++)for(n=r[t];n&&(o[n.id]=!0,!o[n.parentId]);)o[n.parentId]=!0,n=this.parentNode(n),n&&i.push(n);return new m(r.concat(i))},_subtree:function(e,t){var n,i,r=e[t]||[],o=this._defaultParentId();for(n=0,i=r.length;i>n;n++)r[n].id!==o&&(r=r.concat(this._subtree(e,r[n].id)));return r},_childrenMap:function(e){var t,n,i,r,o={};for(e=this._observeView(e),t=0;e.length>t;t++)n=e[t],i=n.id,r=n.parentId,o[i]=o[i]||[],o[r]=o[r]||[],o[r].push(n);return o},_calculateAggregates:function(e,t){var n,i,r,o,a,s;for(t=t||{},n={},a=t.filter,a&&(e=m.process(e,{filter:a,filterCallback:_(this._filterCallback,this)}).data),s=this._childrenMap(e),n[this._defaultParentId()]=new m(this._subtree(s,this._defaultParentId())).aggregate(t.aggregate),o=0;e.length>o;o++)i=e[o],r=this._subtree(s,i.id),n[i.id]=new m(r).aggregate(t.aggregate);return n},_queryProcess:function(e,t){var n,i,r,o,a,s,l;for(t=t||{},t.filterCallback=_(this._filterCallback,this),n=this._defaultParentId(),i=m.process(e,t),r=this._childrenMap(i.data),e=r[n]||[],a=0;e.length>a;a++)s=e[a],s.id!==n&&(l=r[s.id],o=!(!l||!l.length),s.loaded()||s.loaded(o),(s.loaded()||s.hasChildren!==!0)&&(s.hasChildren=o),o&&e.splice.apply(e,[a+1,0].concat(l)));return i.data=e,i},_queueRequest:function(e,t){t.call(this)},_modelLoaded:function(e){var t=this.get(e);t.loaded(!0),t.hasChildren=this.childNodes(t).length>0},_modelError:function(e,t){this.get(e)._error=t},read:function(e){return e&&e.id||(this._data=this._observe([])),f.fn.read.call(this,e)},load:function(e){var t="_query";return!e.loaded()&&e.hasChildren&&(t="read"),this[t]({id:e.id}).then(_(this._modelLoaded,this,e.id),_(this._modelError,this,e.id))},_byParentId:function(e,t){var n,i,r=[],o=this.view();if(e===t)return[];for(i=0;o.length>i;i++)n=o.at(i),n.parentId==e&&r.push(n);return r},_defaultParentId:function(){return this.reader.model.fn.defaults.parentId},childNodes:function(e){return this._byParentId(e.id,this._defaultParentId())},rootNodes:function(){return this._byParentId(this._defaultParentId())},parentNode:function(e){return this.get(e.parentId)},level:function(e){var t=-1;e instanceof O||(e=this.get(e));do e=this.parentNode(e),t++;while(e);return t},filter:function(e){var n=f.fn.filter;return e===t?n.call(this,e):(n.call(this,e),t)}});V.create=function(t){return e.isArray(t)?t={data:t}:t instanceof g&&(t={data:t.toJSON()}),t instanceof V?t:new V(t)},i=kendo.Observable.extend({init:function(e,t){kendo.Observable.fn.init.call(this),t=this.options=s(!0,{},this.options,t),this.element=e,this.bind(this.events,t),this.model=this.options.model,this.fields=this._fields(this.options.columns),this._initContainer(),this.createEditable()},events:[],_initContainer:function(){this.wrapper=this.element},createEditable:function(){var e=this.options;this.editable=new h.Editable(this.wrapper,{fields:this.fields,target:e.target,clearContainer:e.clearContainer,model:this.model})},_isEditable:function(e){return e.field&&this.model.editable(e.field)},_fields:function(e){var t,n,i,r=[];for(t=0,n=e.length;n>t;t++)i=e[t],this._isEditable(i)&&r.push({field:i.field,format:i.format,editor:i.editor});return r},end:function(){return this.editable.end()},close:function(){this.destroy()},destroy:function(){this.editable.destroy(),this.editable.element.find("["+kendo.attr("container-for")+"]").empty(),this.model=this.wrapper=this.element=this.columns=this.editable=null}}),r=i.extend({init:function(e,t){i.fn.init.call(this,e,t),this._attachHandlers(),this.open()},events:[B,I],options:{window:{modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1}},_initContainer:function(){var t=this.options,n=[];this.wrapper=e('<div class="k-popup-edit-form"/>').attr(kendo.attr("uid"),this.model.uid).append('<div class="k-edit-form-container"/>'),t.template?(this._appendTemplate(n),this.fields=[]):this._appendFields(n),this._appendButtons(n),new l.Tree(this.wrapper.children()[0]).render(n),this.wrapper.appendTo(t.appendTo),this.window=new h.Window(this.wrapper,t.window)},_appendTemplate:function(e){var t=this.options.template;typeof t===b&&(t=window.unescape(t)),t=kendo.template(t)(this.model),e.push(u(t))},_appendFields:function(e){var t,n,i,r=this.options.columns;for(t=0,n=r.length;n>t;t++)i=r[t],i.command||(e.push(u('<div class="k-edit-label"><label for="'+i.field+'">'+(i.title||i.field||"")+"</label></div>")),e.push(this._isEditable(i)?u("<div "+kendo.attr("container-for")+'="'+i.field+'" class="k-edit-field"></div>'):c("div",{"class":"k-edit-field"},[this.options.fieldRenderer(i,this.model)])))},_appendButtons:function(e){e.push(c("div",{"class":"k-edit-buttons k-state-default"},this.options.commandRenderer()))},_attachHandlers:function(){var e=this._cancelProxy=_(this._cancel,this);this.wrapper.on(D+S,".k-grid-cancel",this._cancelProxy),this._saveProxy=_(this._save,this),this.wrapper.on(D+S,".k-grid-update",this._saveProxy),this.window.bind("close",function(t){t.userTriggered&&e(t)})},_dettachHandlers:function(){this._cancelProxy=null,this._saveProxy=null,this.wrapper.off(S)},_cancel:function(e){this.trigger(B,e)},_save:function(){this.trigger(I)},open:function(){this.window.center().open()},close:function(){this.window.bind("deactivate",_(this.destroy,this)).close()},destroy:function(){this.window.destroy(),this.window=null,this._dettachHandlers(),i.fn.destroy.call(this)}}),o=p.extend({init:function(e,t){p.fn.init.call(this,e,t),this._dataSource(this.options.dataSource),this._columns(),this._layout(),this._sortable(),this._filterable(),this._selectable(),this._attachEvents(),this._toolbar(),this._scrollable(),this.options.autoBind&&this.dataSource.fetch(),this._adjustHeight(),kendo.notify(this)},_scrollable:function(){var e,t;this.options.scrollable&&(e=this.header.closest(".k-grid-header-wrap"),this.content.closest(".k-grid-content").bind("scroll"+S,function(){e.scrollLeft(this.scrollLeft)}),t=kendo.touchScroller(this.content.closest("div")),t&&t.movable&&(this._touchScroller=t))},_progress:function(){var e=this.options.messages;this.content.find("tr").length||this._showStatus(kendo.template("<span class='#= className #' /> #: messages.loading #")({className:L.icon+" "+L.loading,messages:e}))},_error:function(e){this.dataSource.rootNodes().length||this._render({error:e})},refresh:function(e){e=e||{},"itemchange"==e.action&&this.editor||this.trigger(z)||(this._angularItems("cleanup"),this._angularFooters("cleanup"),this._cancelEditor(),this._render(),this._adjustHeight(),this._angularItems("compile"),this._angularFooters("compile"),this.trigger(R))},_angularFooters:function(t){var n,i,r,o=this.dataSource.aggregates(),a=this.content.find("tr").filter(function(){return e(this).hasClass(L.footerTemplate)});for(n=0;a.length>n;n++)i=a.eq(n),r=o[i.attr("data-parentId")],this._angularFooter(t,i.find("td").get(),r)},_angularFooter:function(e,t,n){var i=this.columns;this.angular(e,function(){return{elements:t,data:w(i,function(e){return{column:e,aggregate:n&&n[e.field]}})}})},items:function(){return this.content.find("tr").filter(function(){return!e(this).hasClass(L.footerTemplate)})},_showStatus:function(t){var n=this.element.find(".k-status");n.length||(n=e("<div class='k-status' />").appendTo(this.element)),this._contentTree.render([]),this.content.closest(T+L.gridContent).hide(),n.html(t)},_hideStatus:function(){this.element.find(".k-status").remove(),this.content.closest(T+L.gridContent).show()},_adjustHeight:function(){var e,t=this.element,n=t.find(T+L.gridContentWrap),i=t.find(T+L.gridHeader),r=t.find(T+L.gridToolbar);t.height(this.options.height),e=function(e){var t,n;return e[0].style.height?!0:(t=e.height(),e.height("auto"),n=e.height(),e.height(""),t!=n)},e(t)&&n.height(t.height()-i.outerHeight()-r.outerHeight())},destroy:function(){p.fn.destroy.call(this);var e=this.dataSource;e.unbind(k,this._refreshHandler),e.unbind(x,this._errorHandler),e.unbind(C,this._progressHandler),this._destroyEditor(),this.element.off(S),this._touchScroller&&this._touchScroller.destroy(),this._refreshHandler=this._errorHandler=this._progressHandler=null,this.header=this.content=this.element=null,this._statusTree=this._headerTree=this._contentTree=null},options:{name:"TreeList",columns:[],autoBind:!0,scrollable:!0,selectable:!1,sortable:!1,toolbar:null,height:null,messages:{noRows:"No records to display",loading:"Loading...",requestFailed:"Request failed.",retry:"Retry",commands:{edit:"Edit",update:"Update",canceledit:"Cancel",create:"Add new record",createchild:"Add child record",destroy:"Delete",excel:"Export to Excel",pdf:"Export to PDF"}},excel:{hierarchy:!0},filterable:!1,editable:!1},events:[k,E,I,F,P,M,z,R,B,H],_toggle:function(e,n){var i=e.loaded();e._error&&(e.expanded=!1,e._error=t),(i||!e.expanded)&&(t===n&&(n=!e.expanded),e.expanded=n,i||this.dataSource.load(e).always(_(this.refresh,this)),this.refresh())},expand:function(e){this._toggle(this.dataItem(e),!0)},collapse:function(e){this._toggle(this.dataItem(e),!1)},_toggleChildren:function(t){var n=e(t.currentTarget),i=this.dataItem(n),r=i.expanded?M:P;this.trigger(r,{model:i})||this._toggle(i),t.preventDefault()},_attachEvents:function(){var e=T+L.iconCollapse+", ."+L.iconExpand+", ."+L.refresh,t=T+L.retry,n=this.dataSource;this.element.on(A+S,e,_(this._toggleChildren,this)).on(D+S,t,_(n.fetch,n)).on(D+S,".k-button[data-command]",_(this._commandClick,this))},_commandByName:function(e){var t,n,i,r=this.columns;if(e=e.toLowerCase(),N[e])return N[e];for(t=0;r.length>t;t++)if(i=r[t].command)for(n=0;i.length>n;n++)if(i[n].name.toLowerCase()==e)return i[n]},_commandClick:function(n){var i=e(n.currentTarget),r=i.attr("data-command"),o=this._commandByName(r),a=i.closest("tr");a=a.length?a:t,o&&(o.methodName?this[o.methodName](a):o.click&&o.click.call(this,n))},_columns:function(){var e,t=this.options.columns||[];this.columns=w(t,function(e){return e="string"==typeof e?{field:e}:e,s({encoded:!0},e)}),e=y(this.columns,function(e){return e.expandable}),this.columns.length&&!e.length&&(this.columns[0].expandable=!0),this._columnTemplates(),this._columnAttributes()},_columnTemplates:function(){var e,t,n,i=this.columns;for(e=0,t=i.length;t>e;e++)n=i[e],n.template&&(n.template=kendo.template(n.template)),n.headerTemplate&&(n.headerTemplate=kendo.template(n.headerTemplate)),n.footerTemplate&&(n.footerTemplate=kendo.template(n.footerTemplate))},_columnAttributes:function(){function e(e){var t,n,i;if(e&&e.style)for(t=e.style.split(";"),e.style={},n=0;t.length>n;n++)i=t[n].split(":"),e.style[i[0]]=i[1]}var t,n,i=this.columns;for(t=0,n=i.length;n>t;t++)e(i[t].attributes),e(i[t].headerAttributes)},_layout:function(){var e,t,n=this.element,i=this._colgroup(),r="";this.wrapper=n.addClass(L.wrapper),r="<div class='#= gridHeader #' style=\"padding-right: "+kendo.support.scrollbar()+"px;\"><div class='#= gridHeaderWrap #'><table role='grid'>"+i+"<thead role='rowgroup' /></table></div></div><div class='#= gridContentWrap #'><table role='treegrid' tabindex='0'>"+i+"<tbody /></table></div>",this.options.scrollable||(r="<table role='treegrid' tabindex='0'>"+i+"<thead class='#= gridHeader #' role='rowgroup' /><tbody /></table>"),this.options.toolbar&&(r="<div class='#= header # #= gridToolbar #' />"+r),n.append(kendo.template(r)(L)+"<div class='k-status' />"),this.toolbar=n.find(T+L.gridToolbar),e=this.header=n.find(T+L.gridHeader).find("thead").addBack().filter("thead"),this._headerTree=new l.Tree(this.header[0]),this._headerTree.render([c("tr",{role:"row"},this._ths())]),t=this.columns,this.angular("compile",function(){return{elements:e.find("th.k-header").get(),data:w(t,function(e){return{column:e}})}}),this.content=n.find(T+L.gridContentWrap).find("tbody"),this.content.length||(this.content=n.find("tbody")),this._contentTree=new l.Tree(this.content[0]),this._statusTree=new l.Tree(this.element.children(".k-status")[0])},_toolbar:function(){var t,n=this.options.toolbar,i=this.toolbar;n&&(e.isArray(n)?(t=this._buildCommands(n),new l.Tree(i[0]).render(t)):i.append(kendo.template(n)({})),this.angular("compile",function(){return{elements:i.get()}}))},_render:function(e){var t,n,i;e=e||{},t=this.options.messages,n=this.dataSource.rootNodes(),i=this.dataSource.aggregates(),this._absoluteIndex=0,e.error?this._showStatus(kendo.template("#: messages.requestFailed # <button class='#= buttonClass #'>#: messages.retry #</button>")({buttonClass:[L.button,L.retry].join(" "),messages:t})):n.length?(this._hideStatus(),this._contentTree.render(this._trs({aggregates:e.aggregates,data:n,visible:!0,level:0}))):this._showStatus(kendo.htmlEncode(t.noRows))},_ths:function(){var e,t,n,i,r,o,a,l=this.columns,h=[];for(o=0,a=l.length;a>o;o++)e=l[o],n=[],i=[L.header],t=e.headerTemplate?e.headerTemplate({}):e.title||e.field||"",n.push(e.sortable?c("a",{href:"#",className:L.link},[d(t)]):e.headerTemplate?u(t):d(t)),r={"data-field":e.field,"data-title":e.title,className:i.join(" "),role:"columnheader"},e.headerAttributes&&s(r,e.headerAttributes),h.push(c("th",r,n));return h},_colgroup:function(){var e,t,n,i=this.columns,r=[];for(t=0,n=i.length;n>t;t++)r.push("<col "),e=i[t].width,e&&0!==parseInt(e,10)&&(r.push("style='width:"),r.push("string"==typeof e?e:e+"px"),r.push("'")),r.push("/>");return"<colgroup>"+r.join("")+"</colgroup>"},_trs:function(e){var n,i,r,o,a,s,l,c,d=[],u=e.level,h=e.data,p=this.dataSource,f=p.aggregates()||{};for(s=0,l=h.length;l>s;s++)r=[],n=h[s],a=n.loaded()&&p.childNodes(n),o=a&&a.length,i={"data-uid":n.uid,role:"row"},o&&(i["aria-expanded"]=!!n.expanded),this._absoluteIndex%2!==0&&r.push(L.alt),e.visible?this._absoluteIndex++:i.style={display:"none"},o&&r.push(L.group),n._edit&&r.push("k-grid-edit-row"),i.className=r.join(" ")||t,d.push(this._tds({model:n,attr:i,level:u},_(this._td,this))),o&&(d=d.concat(this._trs({parentId:n.id,aggregates:f,visible:e.visible&&!!n.expanded,data:a,level:u+1})));return this._hasFooterTemplate()&&(c=e.parentId||null,i={className:L.footerTemplate,"data-parentId":c},e.visible||(i.style={display:"none"}),d.push(this._tds({model:f[c],attr:i,level:u},this._footerTd))),d},_footerTd:function(t){var i=[],r=t.column,o=t.column.footerTemplate||e.noop,a=t.model[r.field]||{},l={role:"gridcell"};return r.expandable&&(i=i.concat(n({level:t.level+1,className:L.iconPlaceHolder}))),r.attributes&&s(l,r.attributes),i.push(u(o(a)||"")),c("td",l,i)},_hasFooterTemplate:function(){return!!y(this.columns,function(e){return e.footerTemplate}).length},_tds:function(e,t){var n,i,r,o=[],a=this.columns;for(i=0,r=a.length;r>i;i++)n=a[i],o.push(t({model:e.model,column:n,level:e.level}));return c("tr",e.attr,o)},_td:function(e){var t,i=[],r=e.model,o=e.column,a={role:"gridcell"};return r._edit&&o.field&&r.editable(o.field)?a[kendo.attr("container-for")]=o.field:(o.expandable&&(i=n({level:e.level,className:L.iconPlaceHolder}),t=[L.icon],t.push(r.hasChildren?r.expanded?L.iconCollapse:L.iconExpand:L.iconHidden),r._error?t.push(L.refresh):!r.loaded()&&r.expanded&&t.push(L.loading),i.push(c("span",{className:t.join(" ")}))),o.attributes&&s(a,o.attributes),o.command?i=this._buildCommands(r._edit?["update","canceledit"]:o.command):i.push(this._cellContent(o,r))),c("td",a,i)},_cellContent:function(e,n){var i;return e.template?i=e.template(n):e.field&&(i=n.get(e.field),e.format&&(i=kendo.format(e.format,i))),t===i&&(i=""),e.template||!e.encoded?u(i):d(i)},_buildCommands:function(e){var t,n=[];for(t=0;e.length>t;t++)n.push(this._button(e[t]));return n},_button:function(e){var t=(e.name||e).toLowerCase(),n=this.options.messages.commands[t],i=[];return e=s({},N[t],{text:n},e),e.imageClass&&i.push(c("span",{className:["k-icon",e.imageClass].join(" ")})),c("button",{"data-command":t,className:["k-button k-button-icontext",e.className].join(" ")},i.concat([d(e.text||e.name)]))},_sortable:function(){var e,t,n,i,r,o=this.columns,a=this.header.find("th"),l=kendo.attr("field"),c=this.options.sortable;if(c)for(i=0,r=a.length;r>i;i++)e=o[i],e.sortable!==!1&&!e.command&&e.field&&(n=a.eq(i),t=n.data("kendoColumnSorter"),t&&t.destroy(),n.attr(l,e.field).kendoColumnSorter(s({},c,e.sortable,{dataSource:this.dataSource})))},_filterable:function(){var e,t,n,i,r,o,a=this.header.find("th"),l=this.options.filterable;if(l)for(o=_(function(e){this.trigger(H,{field:e.field,container:e.container})},this),e=0,t=a.length;t>e;e++)n=this.columns[e],i=a.eq(e),r=i.data("kendoFilterMenu"),r&&r.destroy(),n.command||n.filterable===!1||i.kendoFilterMenu(s(!0,{},l,n.filterable,{dataSource:this.dataSource,init:o}))},_change:function(){this.trigger(k)},_selectable:function(){var e,t=this.options.selectable;t&&(t=kendo.ui.Selectable.parseOptions(t),e=">tr:not(.k-footer-template)",t.cell&&(e+=">td"),this.selectable=new kendo.ui.Selectable(this.content,{filter:e,aria:!0,multiple:t.multiple,change:_(this._change,this)}))},select:function(e){var n=this.selectable;return t===e||n.options.multiple||(n.clear(),e=e.first()),n.value(e)},clearSelection:function(){var e=this.select();e.length&&(this.selectable.clear(),this.trigger(k))},_dataSource:function(e){var t=this.dataSource;t&&(t.unbind(k,this._refreshHandler),t.unbind(x,this._errorHandler),t.unbind(C,this._progressHandler)),this._refreshHandler=_(this.refresh,this),this._errorHandler=_(this._error,this),this._progressHandler=_(this._progress,this),t=this.dataSource=V.create(e),t.bind(k,this._refreshHandler),t.bind(x,this._errorHandler),t.bind(C,this._progressHandler)},setDataSource:function(e){this._dataSource(e),this._sortable(),this._filterable(),this._contentTree.render([]),this.options.autoBind&&this.dataSource.fetch()},dataItem:function(t){var n=e(t).closest("tr"),i=this.dataSource.getByUid(n.attr(kendo.attr("uid")));return i},editRow:function(e){var t;typeof e===b&&(e=this.content.find(e)),t=this.dataItem(e),t&&("popup"!=this._editMode()&&(t._edit=!0),this._cancelEditor(),this._render(),this._createEditor(t),this.trigger(E,{container:this.editor.element,model:t}))},_cancelEdit:function(e){e=s(e,{container:this.editor.wrapper,model:this.editor.model}),this.trigger(B,e)||this.cancelRow()},cancelRow:function(){this._cancelEditor(),this._render()},saveRow:function(){var e,t=this.editor;t&&(e={model:t.model,container:t.element},t.end()&&!this.trigger(I,e)&&this.dataSource.sync())},addRow:function(e){var n=this.editor,i=0,r={};if(!n||n.end())return e?(e instanceof O||(e=this.dataItem(e)),r.parentId=e.id,i=this.dataSource.indexOf(e)+1,e.set("expanded",!0),this.dataSource.load(e).then(_(this._insertAt,this,r,i)),t):(this._insertAt(r,i),t)},_insertAt:function(e,t){e=this.dataSource.insert(t,e);var n=this.content.find("["+kendo.attr("uid")+"="+e.uid+"]");this.editRow(n)},removeRow:function(e){var t=this.dataItem(e),n={model:t,row:e};t&&!this.trigger(F,n)&&(this.dataSource.remove(t),this.dataSource.sync())},_cancelEditor:function(){var e,t=this.editor;t&&(e=t.model,this._destroyEditor(),this.dataSource.cancelChanges(e),e._edit=!1)},_destroyEditor:function(){this.editor&&(this.editor.close(),this.editor=null)},_createEditor:function(e){var t=this.content.find("["+kendo.attr("uid")+"="+e.uid+"]"),n=this._editMode(),o={columns:this.columns,model:e,target:this,clearContainer:!1,template:this.options.editable.template};"inline"==n?this.editor=new i(t,o):(s(o,{window:this.options.editable.window,commandRenderer:_(function(){return this._buildCommands(["update","canceledit"])},this),fieldRenderer:this._cellContent,save:_(this.saveRow,this),cancel:_(this._cancelEdit,this),appendTo:this.wrapper}),this.editor=new r(t,o))},_editMode:function(){var e="inline",t=this.options.editable;return t!==!0&&(e="string"==typeof t?t:t.mode||e),e.toLowerCase()}}),kendo.ExcelMixin&&kendo.ExcelMixin.extend(o.prototype),kendo.PDFMixin&&kendo.PDFMixin.extend(o.prototype),s(!0,kendo.data,{TreeListDataSource:V,TreeListModel:O}),s(!0,kendo.ui,{TreeList:o}),h.plugin(o)}(window.kendo.jQuery),function(e){function t(e){for(var t,n=0,i=e.length;i>n;n++)if(2==e[n].type){t=!0;break}t&&e.splice(n+1,0,{caption:"KPIs",defaultHierarchy:"[KPIs]",name:"KPIs",uniqueName:"[KPIs]"})}function n(e){return{name:e.uniqueName,type:e.type}}function i(e){for(var t=0,n=e.length;n>t;t++)e[t].uniqueName=e[t].name,e[t].type="kpi";return e}function r(t){var n=e(t).closest(".k-pivot-setting");return n.length?n.data("kendoPivotSettingTarget"):null}function o(e,t,n){return{hierarchyUniqueName:e,uniqueName:t,caption:t,measure:t,name:t,type:n,kpi:!0}}function a(e){var t=e.name;return[o(t,e.value,"value"),o(t,e.goal,"goal"),o(t,e.status,"status"),o(t,e.trend,"trend")]}var s=window.kendo,l=s.ui,c=l.Widget,d=".kendoPivotConfigurator",u="mouseenter"+d+" mouseleave"+d,h=s.template('<p class="k-reset"><span class="k-icon #=icon#"></span>${name}</p><div class="k-list-container k-reset"/>'),p=c.extend({init:function(e,t){c.fn.init.call(this,e,t),this.element.addClass("k-widget k-fieldselector k-alt k-edit-form-container"),this._dataSource(),this._layout(),this.refresh(),s.notify(this)},events:[],options:{name:"PivotConfigurator",filterable:!1,sortable:!1,messages:{measures:"Drop Data Fields Here",columns:"Drop Column Fields Here",rows:"Drop Rows Fields Here",measuresLabel:"Measures",columnsLabel:"Columns",rowsLabel:"Rows",fieldsLabel:"Fields"}},_dataSource:function(){this.dataSource&&this._refreshHandler?this.dataSource.unbind("change",this._refreshHandler):this._refreshHandler=e.proxy(this.refresh,this),this.dataSource=s.data.PivotDataSource.create(this.options.dataSource),this.dataSource.bind("change",this._refreshHandler)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.measures&&this.measures.setDataSource(e),this.rows&&this.rows.setDataSource(e),this.columns&&this.columns.setDataSource(e),this.refresh()},_treeViewDataSource:function(){var n=this;return s.data.HierarchicalDataSource.create({schema:{model:{id:"uniqueName",hasChildren:function(e){return!("hierarchyUniqueName"in e||"aggregator"in e)}}},transport:{read:function(r){var o,s,l;e.isEmptyObject(r.data)?(o=n.dataSource.schemaDimensions(),o.done(function(e){n.dataSource.cubeBuilder||t(e),r.success(e)}).fail(r.error)):(s=n.treeView.dataSource.get(r.data.uniqueName),"[KPIs]"===s.uniqueName?(l=!0,o=n.dataSource.schemaKPIs(),o.done(function(e){r.success(i(e))}).fail(r.error)):"kpi"==s.type&&(l=!0,r.success(a(s))),l||(o=2==s.type?n.dataSource.schemaMeasures():s.dimensionUniqueName?n.dataSource.schemaLevels(r.data.uniqueName):n.dataSource.schemaHierarchies(r.data.uniqueName),o.done(r.success).fail(r.error)))}}})},_layout:function(){this.form=e('<div class="k-columns k-state-default k-floatwrap"/>').appendTo(this.element),this._fields(),this._targets()},_fields:function(){var t=e('<div class="k-state-default"><p class="k-reset"><span class="k-icon k-i-group"></span>'+this.options.messages.fieldsLabel+"</p></div>").appendTo(this.form),i='# if (item.type == 2 || item.uniqueName == "[KPIs]") { #<span class="k-icon k-i-#= (item.type == 2 ? "sum" : "kpi") #"></span># } else if (item.type && item.type !== "kpi") { #<span class="k-icon k-i-dimension"></span># } ##: item.caption || item.name #';this.treeView=e("<div/>").appendTo(t).kendoTreeView({template:i,dataTextField:"caption",dragAndDrop:!0,autoBind:!1,dataSource:this._treeViewDataSource(),dragstart:function(e){var t=this.dataItem(e.sourceNode);(t.hasChildren||t.aggregator||t.measure)&&2!=t.type&&"[KPIs]"!==t.uniqueName||e.preventDefault()
},drag:function(e){var t="k-denied",n=r(e.dropTarget);n&&n.validate(this.dataItem(e.sourceNode))&&(t="k-add"),e.setStatusClass(t)},drop:function(e){var t,i,o,s,l,c;if(e.preventDefault(),t=r(e.dropTarget),i=this.dataItem(e.sourceNode),t&&t.validate(i)){if(c=i.defaultHierarchy||i.uniqueName,"kpi"===i.type)for(l=a(i),s=l.length,c=[],o=0;s>o;o++)c.push(n(l[o]));else i.kpi&&(c=[n(i)]);t.add(c)}}}).data("kendoTreeView")},_createTarget:function(t,n){var i='<li class="k-item k-header" data-'+s.ns+'name="${data.name}">${data.name}',r=n.sortable,o="";return r&&(o+="#if (data.sortIcon) {#",o+='<span class="k-icon ${data.sortIcon} k-setting-sort"></span>',o+="#}#"),(n.filterable||r)&&(o+='<span class="k-icon k-i-arrowhead-s k-setting-fieldmenu"></span>'),o+='<span class="k-icon k-si-close k-setting-delete"></span>',i+='<span class="k-field-actions">'+o+"</span></li>",new s.ui.PivotSettingTarget(t,e.extend({dataSource:this.dataSource,hint:function(t){var n=e('<div class="k-fieldselector"><ul class="k-list k-reset"></ul></div>');return n.find(".k-list").append(t.clone()),n},template:i,emptyTemplate:'<li class="k-item k-empty">${data}</li>'},n))},_targets:function(){var t=e('<div class="k-state-default"/>').appendTo(this.form),n=e(h({name:this.options.messages.columnsLabel,icon:"k-i-vbars"})).appendTo(t),i=e('<ul class="k-pivot-configurator-settings k-list k-reset" />').appendTo(n.last()),r=e(h({name:this.options.messages.rowsLabel,icon:"k-i-hbars"})).appendTo(t),o=e('<ul class="k-pivot-configurator-settings k-list k-reset" />').appendTo(r.last()),a=e(h({name:this.options.messages.measuresLabel,icon:"k-i-sum"})).appendTo(t),s=e('<ul class="k-pivot-configurator-settings k-list k-reset" />').appendTo(a.last()),l=this.options;this.columns=this._createTarget(i,{filterable:l.filterable,sortable:l.sortable,connectWith:o,messages:{empty:l.messages.columns,fieldMenu:l.messages.fieldMenu}}),this.rows=this._createTarget(o,{filterable:l.filterable,setting:"rows",connectWith:i,messages:{empty:this.options.messages.rows,fieldMenu:this.options.messages.fieldMenu}}),this.measures=this._createTarget(s,{setting:"measures",messages:{empty:l.messages.measures}}),i.add(o).add(s).on(u,".k-item:not(.k-empty)",this._toggleHover)},_toggleHover:function(t){e(t.currentTarget).toggleClass("k-state-hover","mouseenter"===t.type)},_resize:function(){var e,t,n=this.element,i=this.options.height;i&&n.is(":visible")&&(n.height(i),t=n.children(".k-columns").children("div.k-state-default"),e=(n.outerHeight()-n.innerHeight())/2,i=i-(t.outerHeight(!0)-t.height())-e,t.height(i))},refresh:function(){var e=this.dataSource;(e.cubeBuilder||this._cube!==e.cube()||this._catalog!==e.catalog())&&this.treeView.dataSource.fetch(),this._catalog=this.dataSource.catalog(),this._cube=this.dataSource.cube(),this._resize()},destroy:function(){c.fn.destroy.call(this),this.dataSource.unbind("change",this._refreshHandler),this.form.find(".k-list").off(d),this.rows.destroy(),this.columns.destroy(),this.measures.destroy(),this.treeView.destroy(),this.element=null,this._refreshHandler=null}});l.plugin(p)}(window.kendo.jQuery),function(e,t,n){"use strict";function i(e){var t=k;try{return k=function(e){return e()},e()}finally{k=t}}function r(e,i,r,o){i[r]=t.copy(e.$eval(o)),i[r]===n&&o.match(/^\w*$/)&&C.warn(r+" attribute resolved to undefined. Maybe you meant to use a string literal like: '"+o+"'?")}function o(i,o,s,l,f,g){function m(){var n,g,m,w,y,b,k,x,C;return s.kRebind&&(n=e(e(o)[0].cloneNode(!0))),g=l.replace(/^kendo/,""),m=t.extend({},s.defaultOptions,i.$eval(s.kOptions||s.options)),(w=e(o)[l])?(y=w.widget.prototype.options,b=w.widget.prototype.events,e.each(s,function(e,t){var n,o,a,s;"source"!==e&&"kDataSource"!==e&&(n="data"+e.charAt(0).toUpperCase()+e.slice(1),0===e.indexOf("on")&&(o=e.replace(/^on./,function(e){return e.charAt(2).toLowerCase()}),b.indexOf(o)>-1&&(m[o]=t)),y.hasOwnProperty(n)?r(i,m,n,t):y.hasOwnProperty(e)&&!A[e]?r(i,m,e,t):D[e]||(a=e.match(/^k(On)?([A-Z].*)/),a&&(s=a[2].charAt(0).toLowerCase()+a[2].slice(1),a[1]&&"kOnLabel"!=e?m[s]=t:("kOnLabel"==e&&(s="onLabel"),r(i,m,s,t)))))}),k=s.kDataSource||s.source,k&&(m.dataSource=S(i,o,g,k)),m.$angular=[i],o.is("select")&&!function(t){if(t.length>0){var n=e(t[0]);!/\S/.test(n.text())&&/^\?/.test(n.val())&&n.remove()}}(o[0].options),x=w.call(o,T=m).data(l),a(x,i,s,l,f),i.$emit("kendoWidgetCreated",x),C=u(i,x),s.kRebind&&p(x,i,o,n,s.kRebind,C),s.kNgModel&&d(x,i,s.kNgModel),v&&c(x,i,o,v,_),x&&h(x,o),x):(window.console.error("Could not find: "+l),null)}var v,_,w,y,b=s.kNgDelay,x=i.$eval(b);return g=g||[],v=g[0],_=g[1],b&&!x?(w=i.$root||i,y=function(){var e=i.$watch(b,function(t,n){t!==n&&(e(),o.removeAttr(s.$attr.kNgDelay),b=null,k(m))})},/^\$(digest|apply)$/.test(w.$$phase)?y():i.$apply(y),n):m()}function a(e,t,n,i,r){if(n[r]){var o=b(n[r]).assign;if(!o)throw Error(r+" attribute used but expression in it is not assignable: "+n[i]);o(t,e)}}function s(e){return/checkbox|radio/i.test(e.attr("type"))?e.prop("checked"):e.val()}function l(e){return E.test(e[0].tagName)}function c(e,t,i,r,o){var a,c,d,u;e.value&&(a=l(i)?function(){return s(i)}:function(){return e.value()},r.$render=function(){var t=r.$viewValue;t===n&&(t=r.$modelValue),setTimeout(function(){e&&e.value(t)},0)},c=!1,l(i)&&i.on("change",function(){c=!0}),d=function(e){return function(){var n;c||(c=!1,e&&o&&(n=o.$pristine),r.$setViewValue(a()),e&&(r.$setPristine(),n&&o.$setPristine()),m(t))}},e.first("change",d(!1)),e.first("dataBound",d(!0)),u=a(),u!=r.$viewValue&&(r.$isEmpty(r.$viewValue)?null!=u&&""!==u&&u!=r.$viewValue&&r.$setViewValue(u):e.value(r.$viewValue)),r.$setPristine())}function d(e,t,i){var r,o,a;return"function"!=typeof e.value?(C.warn("k-ng-model specified on a widget that does not have the value() method: "+e.options.name),n):(r=b(i),o=r.assign,a=!1,e.$angular_setLogicValue(r(t)),t.$apply(function(){var r=function(t,i){t===n&&(t=null),a||t!==i&&e.$angular_setLogicValue(t)};kendo.ui.MultiSelect&&e instanceof kendo.ui.MultiSelect?t.$watchCollection(i,r):t.$watch(i,r)}),e.first("change",function(){a=!0,t.$apply(function(){o(t,e.$angular_getLogicValue())}),a=!1}),n)}function u(e,t){var n=e.$on("$destroy",function(){n(),t&&(t.element&&(t=g(t.element),t&&t.destroy()),t=null)});return n}function h(t,n){function i(){a.disconnect()}function r(){a.observe(e(n)[0],{attributes:!0})}var o,a;window.MutationObserver&&t.wrapper&&(o=[].slice.call(e(n)[0].classList),a=new MutationObserver(function(n){i(),t&&(n.forEach(function(n){var i,r=e(t.wrapper)[0];switch(n.attributeName){case"class":i=[].slice.call(n.target.classList),i.forEach(function(e){o.indexOf(e)<0&&(r.classList.add(e),kendo.ui.ComboBox&&t instanceof kendo.ui.ComboBox&&t.input[0].classList.add(e))}),o.forEach(function(e){i.indexOf(e)<0&&(r.classList.remove(e),kendo.ui.ComboBox&&t instanceof kendo.ui.ComboBox&&t.input[0].classList.remove(e))}),o=i;break;case"disabled":"function"==typeof t.enable&&t.enable(!e(n.target).attr("disabled"));break;case"readonly":"function"==typeof t.readonly&&t.readonly(!!e(n.target).attr("readonly"))}}),r())}),r(),t.first("destroy",i))}function p(t,n,i,r,o,a){var s=n.$watch(o,function(o,l){var c,d,u;o!==l&&(s(),c=e(t.wrapper)[0],d=e(t.element)[0],u=i.injector().get("$compile"),t.destroy(),a&&a(),t=null,c&&d&&(c.parentNode.replaceChild(d,c),e(i).replaceWith(r)),u(r)(n))},!0);m(n)}function f(e,n){function i(e,t){w.directive(e,["directiveFactory",function(n){return n.create(t,e)}])}var r,o,a,s,l=n?"Mobile":"";l+=e.fn.options.name,r=l,o="kendo"+l.charAt(0)+l.substr(1).toLowerCase(),l="kendo"+l,a=l.replace(/([A-Z])/g,"-$1"),-1==P.indexOf(l.replace("kendo",""))&&(s=l===o?[l]:[l,o],t.forEach(s,function(e){w.directive(e,function(){return{restrict:"E",replace:!0,template:function(e){var t=I[r]||"div";return"<"+t+" "+a+">"+e.html()+"</"+t+">"}}})})),M.indexOf(l.replace("kendo",""))>-1||(i(l,l),o!=l&&i(o,l))}function g(t){return t=e(t),kendo.widgetInstance(t,kendo.ui)||kendo.widgetInstance(t,kendo.mobile.ui)||kendo.widgetInstance(t,kendo.dataviz.ui)}function m(e,t){var n=e.$root||e,i=/^\$(digest|apply)$/.test(n.$$phase);t?i?t():n.$apply(t):i||n.$digest()}function v(t,n){t.$destroy(),n&&e(n).removeData("$scope").removeData("$isolateScope").removeData("$isolateScopeNoTemplate").removeClass("ng-scope")}function _(n,i,r){var o,a,s;if(e.isArray(n))return t.forEach(n,function(e){_(e,i,r)});if("string"==typeof n){for(o=n.split("."),a=kendo;a&&o.length>0;)a=a[o.shift()];if(!a)return F.push([n,i,r]),!1;n=a.prototype}return s=n[i],n[i]=function(){var e=this,t=arguments;return r.apply({self:e,next:function(){return s.apply(e,arguments.length>0?arguments:t)}},t)},!0}var w,y,b,k,x,C,T,S,D,A,E,I,P,M,F,z;t&&(w=t.module("kendo.directives",[]),y=t.injector(["ng"]),b=y.get("$parse"),k=y.get("$timeout"),C=y.get("$log"),S=function(){var e={TreeList:"TreeListDataSource",TreeView:"HierarchicalDataSource",Scheduler:"SchedulerDataSource",PanelBar:"$PLAIN",Menu:"$PLAIN",ContextMenu:"$PLAIN"},t=function(e,t){return"$PLAIN"==t?e:kendo.data[t].create(e)};return function(n,i,r,o){var a=e[r]||"DataSource",s=t(n.$eval(o),a);return n.$watch(o,function(e,n){var r,o;e!==n&&(r=t(e,a),o=g(i),o&&"function"==typeof o.setDataSource&&o.setDataSource(r))}),s}}(),D={kDataSource:!0,kOptions:!0,kRebind:!0,kNgModel:!0,kNgDelay:!0},A={name:!0,title:!0,style:!0},E=/^(input|select|textarea)$/i,w.factory("directiveFactory",["$compile",function(t){var n,i=0,r=!1;return x=t,n=function(t,n){return{restrict:"AC",require:["?ngModel","^?form"],scope:!1,controller:["$scope","$attrs","$element",function(e,t){this.template=function(e,n){t[e]=kendo.stringify(n)}}],link:function(a,s,l,c){var d=e(s),u=t.replace(/([A-Z])/g,"-$1"),h="hidden"!==d.css("visibility");d.attr(u,d.attr("data-"+u)),d[0].removeAttribute("data-"+u),h&&d.css("visibility","hidden"),++i,k(function(){h&&d.css("visibility","");var u=o(a,s,l,t,n,c);u&&(--i,0===i&&(a.$emit("kendoRendered"),r||(r=!0,e("form").each(function(){var t=e(this).controller("form");t&&t.$setPristine()}))))})}}},{create:n}}]),I={Editor:"textarea",NumericTextBox:"input",DatePicker:"input",DateTimePicker:"input",TimePicker:"input",AutoComplete:"input",ColorPicker:"input",MaskedTextBox:"input",MultiSelect:"input",Upload:"input",Validator:"form",Button:"button",MobileButton:"a",MobileBackButton:"a",MobileDetailButton:"a",ListView:"ul",MobileListView:"ul",TreeView:"ul",Menu:"ul",ContextMenu:"ul",ActionSheet:"ul"},P=["MobileView","MobileLayout","MobileSplitView","MobilePane","MobileModalView"],M=["MobileApplication","MobileView","MobileModalView","MobileLayout","MobileActionSheet","MobileDrawer","MobileSplitView","MobilePane","MobileScrollView","MobilePopOver"],t.forEach(["MobileNavBar","MobileButton","MobileBackButton","MobileDetailButton","MobileTabStrip","MobileScrollView"],function(e){M.push(e),e="kendo"+e,w.directive(e,function(){return{restrict:"A",link:function(t,n,i){o(t,n,i,e,e)}}})}),function(){function e(e){return function(n){t.forEach(n,function(t){t.fn&&t.fn.options&&t.fn.options.name&&/^[A-Z]/.test(t.fn.options.name)&&f(t,e)})}}t.forEach([kendo.ui,kendo.dataviz&&kendo.dataviz.ui],e(!1)),t.forEach([kendo.mobile&&kendo.mobile.ui],e(!0))}(),F=[],_(kendo.ui,"plugin",function(t,n,i){this.next(),F=e.grep(F,function(e){return!_.apply(null,e)}),f(t,"Mobile"==i)}),_(["ui.Widget","mobile.ui.Widget"],"angular",function(r,o){var a,s=this.self;return"init"==r?(!o&&T&&(o=T),T=null,o&&o.$angular&&(s.$angular_scope=o.$angular[0],s.$angular_init(s.element,o)),n):(a=s.$angular_scope,a&&i(function(){var i,l,c=o(),d=c.elements,u=c.data;if(d.length>0)switch(r){case"cleanup":t.forEach(d,function(e){var n=t.element(e).scope();n&&n!==a&&n.$$kendoScope&&v(n,e)});break;case"compile":i=s.element.injector(),l=i?i.get("$compile"):x,t.forEach(d,function(i,r){var o,s;c.scopeFrom?o=t.element(c.scopeFrom).scope():(s=u&&u[r],s!==n&&(o=e.extend(a.$new(),s),o.$$kendoScope=!0)),l(i)(o||a)}),m(a)}}),n)}),_("ui.Widget","$angular_getLogicValue",function(){return this.self.value()}),_("ui.Widget","$angular_setLogicValue",function(e){this.self.value(e)}),_("ui.Select","$angular_getLogicValue",function(){var e=this.self.dataItem();return e?this.self.options.valuePrimitive?e[this.self.options.dataValueField]:e.toJSON():null}),_("ui.Select","$angular_setLogicValue",function(e){var t=this.self,n=t.options,i=n.dataValueField;i&&!n.valuePrimitive&&(e=null!=e?e[n.dataValueField||n.dataTextField]:null),t.value(e)}),_("ui.MultiSelect","$angular_getLogicValue",function(){var t=this.self.dataItems().slice(0),n=this.self.options.dataValueField;return n&&this.self.options.valuePrimitive&&(t=e.map(t,function(e){return e[n]})),t}),_("ui.MultiSelect","$angular_setLogicValue",function(t){null==t&&(t=[]);var n=this.self,i=n.options.dataValueField;i&&!n.options.valuePrimitive&&(t=e.map(t,function(e){return e[i]})),n.value(t)}),_("ui.AutoComplete","$angular_getLogicValue",function(){var e,t,n,i,r,o=this.self.options,a=this.self.value().split(o.separator),s=o.valuePrimitive,l=this.self.dataSource.data(),c=[];for(e=0,t=l.length;t>e;e++)for(n=l[e],i=o.dataTextField?n[o.dataTextField]:n,r=0;a.length>r;r++)if(i===a[r]){c.push(s?i:n.toJSON());break}return c}),_("ui.AutoComplete","$angular_setLogicValue",function(t){null==t&&(t=[]);var n=this.self,i=n.options.dataTextField;i&&!n.options.valuePrimitive&&(t=e.map(t,function(e){return e[i]})),n.value(t)}),_("ui.Widget","$angular_init",function(t,n){var i,r,o,a,s=this.self;if(n&&!e.isArray(n))for(i=s.$angular_scope,r=s.events.length;--r>=0;)o=s.events[r],a=n[o],a&&"string"==typeof a&&(n[o]=s.$angular_makeEventHandler(o,i,a))}),_("ui.Widget","$angular_makeEventHandler",function(e,t,n){return n=b(n),function(e){m(t,function(){n(t,{kendoEvent:e})})}}),_(["ui.Grid","ui.ListView","ui.TreeView"],"$angular_makeEventHandler",function(e,n,i){return"change"!=e?this.next():(i=b(i),function(e){var r,o,a,s,l,c,d,u,h,p=e.sender,f=p.options,g={kendoEvent:e};for(t.isString(f.selectable)&&(r=-1!==f.selectable.indexOf("cell"),o=-1!==f.selectable.indexOf("multiple")),a=g.selected=this.select(),s=g.data=[],l=g.columns=[],d=0;a.length>d;d++)u=r?a[d].parentNode:a[d],h=p.dataItem(u),r?(t.element.inArray(h,s)<0&&s.push(h),c=t.element(a[d]).index(),t.element.inArray(c,l)<0&&l.push(c)):s.push(h);o||(g.dataItem=g.data=s[0],g.selected=a[0]),m(n,function(){i(n,g)})})}),_("ui.Grid","$angular_init",function(i,r){if(this.next(),r.columns){var o=e.extend({},kendo.Template,r.templateSettings);t.forEach(r.columns,function(e){!e.field||e.template||e.format||e.values||e.encoded!==n&&!e.encoded||(e.template="<span ng-bind='"+kendo.expr(e.field,"dataItem")+"'>#: "+kendo.expr(e.field,o.paramName)+"#</span>")})}}),_("mobile.ui.ButtonGroup","value",function(e){var t=this.self;return null!=e&&(t.select(t.element.children("li.km-button").eq(e)),t.trigger("change"),t.trigger("select",{index:t.selectedIndex})),t.selectedIndex}),_("mobile.ui.ButtonGroup","_select",function(){this.next(),this.self.trigger("change")}),w.directive("kendoMobileApplication",function(){return{terminal:!0,link:function(e,t,n){o(e,t,n,"kendoMobileApplication","kendoMobileApplication")}}}).directive("kendoMobileView",function(){return{scope:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=o(e,t,n,"kendoMobileView","kendoMobileView")},post:function(e,t,n){n._instance._layout(),n._instance._scroller()}}}}).directive("kendoMobileDrawer",function(){return{scope:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=o(e,t,n,"kendoMobileDrawer","kendoMobileDrawer")},post:function(e,t,n){n._instance._layout(),n._instance._scroller()}}}}).directive("kendoMobileModalView",function(){return{scope:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=o(e,t,n,"kendoMobileModalView","kendoMobileModalView")},post:function(e,t,n){n._instance._layout(),n._instance._scroller()}}}}).directive("kendoMobileSplitView",function(){return{terminal:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=o(e,t,n,"kendoMobileSplitView","kendoMobileSplitView")},post:function(e,t,n){n._instance._layout()}}}}).directive("kendoMobilePane",function(){return{terminal:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,o(e,t,n,"kendoMobilePane","kendoMobilePane")}}}}).directive("kendoMobileLayout",function(){return{link:{pre:function(e,t,n){o(e,t,n,"kendoMobileLayout","kendoMobileLayout")}}}}).directive("kendoMobileActionSheet",function(){return{restrict:"A",link:function(t,n,i){n.find("a[k-action]").each(function(){e(this).attr("data-"+kendo.ns+"action",e(this).attr("k-action"))}),o(t,n,i,"kendoMobileActionSheet","kendoMobileActionSheet")}}}).directive("kendoMobilePopOver",function(){return{terminal:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,o(e,t,n,"kendoMobilePopOver","kendoMobilePopOver")}}}}).directive("kendoViewTitle",function(){return{restrict:"E",replace:!0,template:function(e){return"<span data-"+kendo.ns+"role='view-title'>"+e.html()+"</span>"}}}).directive("kendoMobileHeader",function(){return{restrict:"E",link:function(e,t){t.addClass("km-header").attr("data-role","header")}}}).directive("kendoMobileFooter",function(){return{restrict:"E",link:function(e,t){t.addClass("km-footer").attr("data-role","footer")}}}).directive("kendoMobileScrollViewPage",function(){return{restrict:"E",replace:!0,template:function(e){return"<div data-"+kendo.ns+"role='page'>"+e.html()+"</div>"}}}),t.forEach(["align","icon","rel","transition","actionsheetContext"],function(e){var t="k"+e.slice(0,1).toUpperCase()+e.slice(1);w.directive(t,function(){return{restrict:"A",priority:2,link:function(n,i,r){i.attr(kendo.attr(kendo.toHyphens(e)),n.$eval(r[t]))}}})}),z={TreeMap:["Template"],MobileListView:["HeaderTemplate","Template"],MobileScrollView:["EmptyTemplate","Template"],Grid:["AltRowTemplate","DetailTemplate","RowTemplate"],ListView:["EditTemplate","Template","AltTemplate"],Pager:["SelectTemplate","LinkTemplate"],PivotGrid:["ColumnHeaderTemplate","DataCellTemplate","RowHeaderTemplate"],Scheduler:["AllDayEventTemplate","DateHeaderTemplate","EventTemplate","MajorTimeHeaderTemplate","MinorTimeHeaderTemplate"],TreeView:["Template"],Validator:["ErrorTemplate"]},function(){var e={};t.forEach(z,function(n,i){t.forEach(n,function(t){e[t]||(e[t]=[]),e[t].push("?^^kendo"+i)})}),t.forEach(e,function(e,t){var n="k"+t,i=kendo.toHyphens(n);w.directive(n,function(){return{restrict:"A",require:e,terminal:!0,compile:function(t,r){if(""===r[n]){t.removeAttr(i);var o=t[0].outerHTML;return function(r,a,s,l){for(var c;!c&&l.length;)c=l.shift();c?(c.template(n,o),t.remove()):C.warn(i+" without a matching parent widget found. It can be one of the following: "+e.join(", "))}}}}})})}())}(window.kendo.jQuery,window.angular),function(e,t){function n(e,t){var n={top:0,right:0,bottom:0,left:0};return t=t||0,"number"==typeof e?n[Rt]=n[zt]=n[ct]=n[Tt]=e:(n[Rt]=e[Rt]||t,n[zt]=e[zt]||t,n[ct]=e[ct]||t,n[Tt]=e[Tt]||t),n}function i(e,t){var n=e.tickX,i=e.tickY,r=e.position,o=new X.Path({stroke:{width:t.width,color:t.color}});return e.vertical?o.moveTo(n,r).lineTo(n+t.size,r):o.moveTo(r,i).lineTo(r,i+t.size),k(o),o}function r(e,t){var n=e.lineStart,i=e.lineEnd,r=e.position,o=new X.Path({stroke:{width:t.width,color:t.color,dashType:t.dashType}});return e.vertical?o.moveTo(n,r).lineTo(i,r):o.moveTo(r,n).lineTo(r,i),k(o),o}function o(e,t){var n,i,r,o=u(t-e,vt-1);if(0===o){if(0===t)return.1;o=ot.abs(t)}return n=ot.pow(10,ot.floor(ot.log(o)/ot.log(10))),i=u(o/n,vt),r=1,r=1.904762>i?.2:4.761904>i?.5:9.523809>i?1:2,u(n*r,vt)}function a(e,t,n,i,r){var o=r*wt;return new Ut(n+(e-n)*ot.cos(o)+(t-i)*ot.sin(o),i-(e-n)*ot.sin(o)+(t-i)*ot.cos(o))}function s(t,n){if(t.x1==n.x1&&t.y1==n.y1&&t.x2==n.x2&&t.y2==n.y2)return n;var i=ot.min(t.x1,n.x1),r=ot.max(t.x1,n.x1),o=ot.min(t.x2,n.x2),a=ot.max(t.x2,n.x2),s=ot.min(t.y1,n.y1),l=ot.max(t.y1,n.y1),c=ot.min(t.y2,n.y2),d=ot.max(t.y2,n.y2),u=[];return u[0]=C(r,s,o,l),u[1]=C(i,l,r,c),u[2]=C(o,l,a,c),u[3]=C(r,c,o,d),t.x1==i&&t.y1==s||n.x1==i&&n.y1==s?(u[4]=C(i,s,r,l),u[5]=C(o,c,a,d)):(u[4]=C(o,s,a,l),u[5]=C(i,c,r,d)),e.grep(u,function(e){return e.height()>0&&e.width()>0})[0]}function l(e,t){return-1!=it(e,t)}function c(e,t){return u(ot.ceil(e/t)*t,vt)}function d(e,t){return u(ot.floor(e/t)*t,vt)}function u(e,t){var n=ot.pow(10,t||0);return ot.round(e*n)/n}function h(e,t){return ot.log(e)/ot.log(t)}function p(e,t,n){var i=u(ot.abs(e%t),vt),r=t*(1-n);return 0===i||i>r}function f(e,t,n){return u(e+(t-e)*n,ut)}function g(e,t){return e-t}function m(e,t){return e.match(yt)?W.format.apply(this,arguments):W.toString(t,e)}function v(e,t){return 0>-e.x*t.y+e.y*t.x}function _(e,t){return e&&t?e.getTime()-t.getTime():0}function w(e){var t=e.originalEvent,n=0;return t.wheelDelta&&(n=-t.wheelDelta/120,n=n>0?ot.ceil(n):ot.floor(n)),t.detail&&(n=u(t.detail/3)),n}function y(e){if(!e||!e.indexOf||e.indexOf("&")<0)return e;var t=y._element;return t.innerHTML=e,t.textContent||t.innerText}function b(e,t){return e>=t.min&&t.max>=e}function k(e){if(!W.support.vml)for(var t=0;e.segments.length>t;t++)e.segments[t].anchor().round(0).translate(.5,.5);return e}function x(e){var t,n,i=e.stops,r=e.innerRadius/e.radius*100,o=i.length,a=[];for(t=0;o>t;t++)n=at({},i[t]),n.offset=(n.offset*(100-r)+r)/100,a.push(n);return a}var C,T,S,D,A,E,I,P,M,F,z,R,B,H,L,N,O,V,U,W=window.kendo,j=W.util,q=j.append,G=j.defined,$=j.last,Y=j.valueOrDefault,Q=W.dataviz,K=Q.geometry,X=Q.drawing,Z=X.util.measureText,J=K.Matrix,et=W.Class,tt=W.template,nt=e.noop,it=e.inArray,rt=e.trim,ot=Math,at=W.deepExtend,st="axisLabelClick",lt="#000",ct="bottom",dt="center",ut=3,ht="clip",pt="circle",ft="cross",gt="12px sans-serif",mt=400,vt=6,_t=600,wt=ot.PI/180,yt=/\{\d+:?/,bt="height",kt=1e5,xt=600,Ct="inside",Tt="left",St="linear",Dt=Number.MAX_VALUE,At=-Number.MAX_VALUE,Et="none",It="noteClick",Pt="noteHover",Mt="outside",Ft="radial",zt="right",Rt="top",Bt="triangle",Ht="width",Lt="#fff",Nt="x",Ot="y",Vt=.2,Ut=function(e,n){var i=this;return i instanceof Ut?(i.x=e||0,i.y=n||0,t):new Ut(e,n)};Ut.fn=Ut.prototype={clone:function(){var e=this;return new Ut(e.x,e.y)},equals:function(e){return e&&e.x===this.x&&e.y===this.y},rotate:function(e,t){var n=this,i=t*wt,r=ot.cos(i),o=ot.sin(i),a=e.x,s=e.y,l=n.x,c=n.y;return n.x=u(a+(l-a)*r+(c-s)*o,ut),n.y=u(s+(c-s)*r-(l-a)*o,ut),n},multiply:function(e){var t=this;return t.x*=e,t.y*=e,t},distanceTo:function(e){var t=this.x-e.x,n=this.y-e.y;return ot.sqrt(t*t+n*n)}},Ut.onCircle=function(e,t,n){return t*=wt,new Ut(e.x-n*ot.cos(t),e.y-n*ot.sin(t))},C=function(e,n,i,r){var o=this;return o instanceof C?(o.x1=e||0,o.x2=i||0,o.y1=n||0,o.y2=r||0,t):new C(e,n,i,r)},C.fn=C.prototype={width:function(){return this.x2-this.x1},height:function(){return this.y2-this.y1},translate:function(e,t){var n=this;return n.x1+=e,n.x2+=e,n.y1+=t,n.y2+=t,n},move:function(e,t){var n=this,i=n.height(),r=n.width();return G(e)&&(n.x1=e,n.x2=n.x1+r),G(t)&&(n.y1=t,n.y2=n.y1+i),n},wrap:function(e){var t=this;return t.x1=ot.min(t.x1,e.x1),t.y1=ot.min(t.y1,e.y1),t.x2=ot.max(t.x2,e.x2),t.y2=ot.max(t.y2,e.y2),t},wrapPoint:function(e){return this.wrap(new C(e.x,e.y,e.x,e.y)),this},snapTo:function(e,t){var n=this;return t!=Nt&&t||(n.x1=e.x1,n.x2=e.x2),t!=Ot&&t||(n.y1=e.y1,n.y2=e.y2),n},alignTo:function(e,t){var n,i,r=this,o=r.height(),a=r.width(),s=t==Rt||t==ct?Ot:Nt,l=s==Ot?o:a;return t===dt?(n=e.center(),i=r.center(),r.x1+=n.x-i.x,r.y1+=n.y-i.y):r[s+1]=t===Rt||t===Tt?e[s+1]-l:e[s+2],r.x2=r.x1+a,r.y2=r.y1+o,r},shrink:function(e,t){var n=this;return n.x2-=e,n.y2-=t,n},expand:function(e,t){return this.shrink(-e,-t),this},pad:function(e){var t=this,i=n(e);return t.x1-=i.left,t.x2+=i.right,t.y1-=i.top,t.y2+=i.bottom,t},unpad:function(e){var t=this,i=n(e);return i.left=-i.left,i.top=-i.top,i.right=-i.right,i.bottom=-i.bottom,t.pad(i)},clone:function(){var e=this;return new C(e.x1,e.y1,e.x2,e.y2)},center:function(){var e=this;return new Ut(e.x1+e.width()/2,e.y1+e.height()/2)},containsPoint:function(e){var t=this;return e.x>=t.x1&&t.x2>=e.x&&e.y>=t.y1&&t.y2>=e.y},points:function(){var e=this;return[new Ut(e.x1,e.y1),new Ut(e.x2,e.y1),new Ut(e.x2,e.y2),new Ut(e.x1,e.y2)]},getHash:function(){var e=this;return[e.x1,e.y1,e.x2,e.y2].join(",")},overlaps:function(e){return!(this.y1>e.y2||e.y1>this.y2||this.x1>e.x2||e.x1>this.x2)},rotate:function(e){var t=this,n=t.width(),i=t.height(),r=t.center(),o=r.x,s=r.y,l=a(0,0,o,s,e),c=a(n,0,o,s,e),d=a(n,i,o,s,e),u=a(0,i,o,s,e);return n=ot.max(l.x,c.x,d.x,u.x)-ot.min(l.x,c.x,d.x,u.x),i=ot.max(l.y,c.y,d.y,u.y)-ot.min(l.y,c.y,d.y,u.y),t.x2=t.x1+n,t.y2=t.y1+i,t},toRect:function(){return new K.Rect([this.x1,this.y1],[this.width(),this.height()])}},T=et.extend({init:function(e,t,n,i,r){var o=this;o.c=e,o.ir=t,o.r=n,o.startAngle=i,o.angle=r},clone:function(){var e=this;return new T(e.c,e.ir,e.r,e.startAngle,e.angle)},middle:function(){return this.startAngle+this.angle/2},radius:function(e,t){var n=this;return t?n.ir=e:n.r=e,n},point:function(e,t){var n=this,i=e*wt,r=ot.cos(i),o=ot.sin(i),a=t?n.ir:n.r,s=u(n.c.x-r*a,ut),l=u(n.c.y-o*a,ut);return new Ut(s,l)},adjacentBox:function(e,t,n){var i=this.clone().expand(e),r=i.middle(),o=i.point(r),a=t/2,s=n/2,l=o.x-a,c=o.y-s,d=ot.sin(r*wt),u=ot.cos(r*wt);return ot.abs(d)<.9&&(l+=a*-u/ot.abs(u)),ot.abs(u)<.9&&(c+=s*-d/ot.abs(d)),new C(l,c,l+t,c+n)},containsPoint:function(e){var t=this,n=t.c,i=t.ir,r=t.r,o=t.startAngle,a=t.startAngle+t.angle,s=e.x-n.x,l=e.y-n.y,c=new Ut(s,l),d=t.point(o),h=new Ut(d.x-n.x,d.y-n.y),p=t.point(a),f=new Ut(p.x-n.x,p.y-n.y),g=u(s*s+l*l,ut);return(h.equals(c)||v(h,c))&&!v(f,c)&&g>=i*i&&r*r>=g},getBBox:function(){var e,t,n,i=this,r=new C(Dt,Dt,At,At),o=u(i.startAngle%360),a=u((o+i.angle)%360),s=i.ir,l=[0,90,180,270,o,a].sort(g),c=it(o,l),d=it(a,l);for(e=o==a?l:d>c?l.slice(c,d+1):[].concat(l.slice(0,d+1),l.slice(c,l.length)),t=0;e.length>t;t++)n=i.point(e[t]),r.wrapPoint(n),r.wrapPoint(n,s);return s||r.wrapPoint(i.c),r},expand:function(e){return this.r+=e,this}}),S=T.extend({init:function(e,t,n,i){T.fn.init.call(this,e,0,t,n,i)},expand:function(e){return T.fn.expand.call(this,e)},clone:function(){var e=this;return new S(e.c,e.r,e.startAngle,e.angle)},radius:function(e){return T.fn.radius.call(this,e)},point:function(e){return T.fn.point.call(this,e)}}),D=function(){},D.fn=D.prototype={createRing:function(e,t){var n,i=e.startAngle+180,r=e.angle+i,o=new K.Point(e.c.x,e.c.y),a=ot.max(e.r,0),s=ot.max(e.ir,0),l=new K.Arc(o,{startAngle:i,endAngle:r,radiusX:a,radiusY:a}),c=X.Path.fromArc(l,t).close();return s?(l.radiusX=l.radiusY=s,n=l.pointAt(r),c.lineTo(n.x,n.y),c.arc(r,i,s,s,!0)):c.lineTo(o.x,o.y),c}},D.current=new D,A=et.extend({init:function(e){var t=this;t.children=[],t.options=at({},t.options,e)},reflow:function(e){var t,n,i,r=this,o=r.children;for(n=0;o.length>n;n++)i=o[n],i.reflow(e),t=t?t.wrap(i.box):i.box.clone();r.box=t||e},destroy:function(){{var e,t=this,n=t.children;t.getRoot()}for(this.animation&&this.animation.destroy(),e=0;n.length>e;e++)n[e].destroy()},getRoot:function(){var e=this.parent;return e?e.getRoot():null},translateChildren:function(e,t){var n,i=this,r=i.children,o=r.length;for(n=0;o>n;n++)r[n].box.translate(e,t)},append:function(){q(this.children,arguments);for(var e=0;arguments.length>e;e++)arguments[e].parent=this},renderVisual:function(){var e,t;if(this.options.visible!==!1){for(this.createVisual(),this.visual&&(this.visual.chartElement=this,this.parent&&this.parent.appendVisual(this.visual)),e=this.children,t=0;e.length>t;t++)e[t].renderVisual();this.createAnimation(),this.renderComplete()}},createVisual:function(){this.visual=new Q.drawing.Group({zIndex:this.options.zIndex,visible:Y(this.options.visible,!0)})},createAnimation:function(){this.visual&&(this.animation=X.Animation.create(this.visual,this.options.animation))},appendVisual:function(e){e.chartElement||(e.chartElement=this),e.options.noclip?this.clipRoot().visual.append(e):G(e.options.zIndex)?this.stackRoot().stackVisual(e):this.visual?this.visual.append(e):this.parent.appendVisual(e)},clipRoot:function(){return this.parent?this.parent.clipRoot():this},stackRoot:function(){return this.parent?this.parent.stackRoot():this},stackVisual:function(e){var t,n,i,r=e.options.zIndex||0,o=this.visual.children;for(t=0;o.length>t&&(n=o[t],i=Y(n.options.zIndex,0),!(i>r));t++);this.visual.insertAt(e,t)},traverse:function(e){var t,n,i=this.children;for(t=0;i.length>t;t++)n=i[t],e(n),n.traverse&&n.traverse(e)},closest:function(e){for(var n=this,i=!1;n&&!i;)i=e(n),i||(n=n.parent);return i?n:t},renderComplete:e.noop,toggleHighlight:function(e){var t=this._highlight,n=this.options.highlight;!this.createHighlight||n&&n.visible===!1||(t||(t=this._highlight=this.createHighlight({fill:{color:Lt,opacity:.2},stroke:{color:Lt,width:1,opacity:.2}}),this.appendVisual(t)),t.visible(e))},createGradientOverlay:function(e,t,n){var i=new X.Path(at({stroke:{color:Et},fill:this.createGradient(n),closed:e.options.closed},t));return i.segments.elements(e.segments.elements()),i},createGradient:function(e){return this.parent?this.parent.createGradient(e):t}}),E=A.extend({init:function(e){var t=this;t.gradients={},A.fn.init.call(t,e)},options:{width:_t,height:mt,background:Lt,border:{color:lt,width:0},margin:n(5),zIndex:-2},reflow:function(){var e,t=this,n=t.options,i=t.children,r=new C(0,0,n.width,n.height);for(t.box=r.unpad(n.margin),e=0;i.length>e;e++)i[e].reflow(r),r=s(r,i[e].box)},createVisual:function(){this.visual=new X.Group,this.createBackground()},createBackground:function(){var e=this.options,t=e.border||{},n=this.box.clone().pad(e.margin).unpad(t.width),i=X.Path.fromRect(n.toRect(),{stroke:{color:t.width?t.color:"",width:t.width,dashType:t.dashType},fill:{color:e.background,opacity:e.opacity},zIndex:-10});this.visual.append(i)},getRoot:function(){return this},createGradient:function(e){var t,n,i=this.gradients,r=j.objectKey(e),o=Q.Gradients[e.gradient];return i[r]?t=i[r]:(n=at({},o,e),"linear"==o.type?t=new X.LinearGradient(n):(e.innerRadius&&(n.stops=x(n)),t=new X.RadialGradient(n),t.supportVML=o.supportVML!==!1),i[r]=t),t}}),I=A.extend({options:{align:Tt,vAlign:Rt,margin:{},padding:{},border:{color:lt,width:0},background:"",shrinkToFit:!1,width:0,height:0,visible:!0},reflow:function(e){function t(){s.align(e,Nt,l.align),s.align(e,Ot,l.vAlign),s.paddingBox=i.clone().unpad(p).unpad(g)}var i,r,o,a,s=this,l=s.options,c=l.width,d=l.height,u=c&&d,h=l.shrinkToFit,p=n(l.margin),f=n(l.padding),g=l.border.width,m=s.children;for(r=e.clone(),u&&(r.x2=r.x1+c,r.y2=r.y1+d),h&&r.unpad(p).unpad(g).unpad(f),A.fn.reflow.call(s,r),i=u?s.box=C(0,0,c,d):s.box,h&&u?(t(),r=s.contentBox=s.paddingBox.clone().unpad(f)):(r=s.contentBox=i.clone(),i.pad(f).pad(g).pad(p),t()),s.translateChildren(i.x1-r.x1+p.left+g+f.left,i.y1-r.y1+p.top+g+f.top),o=0;m.length>o;o++)a=m[o],a.reflow(a.box)},align:function(e,t,n){var i=this,r=i.box,o=t+1,a=t+2,s=t===Nt?Ht:bt,c=r[s]();l(n,[Tt,Rt])?(r[o]=e[o],r[a]=r[o]+c):l(n,[zt,ct])?(r[a]=e[a],r[o]=r[a]-c):n==dt&&(r[o]=e[o]+(e[s]()-c)/2,r[a]=r[o]+c)},hasBox:function(){var e=this.options;return e.border.width||e.background},createVisual:function(){A.fn.createVisual.call(this);var e=this.options;e.visible&&this.hasBox()&&this.visual.append(X.Path.fromRect(this.paddingBox.toRect(),this.visualStyle()))},visualStyle:function(){var e=this,t=e.options,n=t.border||{};return{stroke:{width:n.width,color:n.color,opacity:Y(n.opacity,t.opacity),dashType:n.dashType},fill:{color:t.background,opacity:t.opacity},cursor:t.cursor}}}),P=A.extend({init:function(e,t){var n=this;A.fn.init.call(n,t),n.content=e,n.reflow(C())},options:{font:gt,color:lt,align:Tt,vAlign:""},reflow:function(e){var t,n=this,i=n.options;t=i.size=Z(n.content,{font:i.font}),n.baseline=t.baseline,n.box=C(e.x1,e.y1,e.x1+t.width,e.y1+t.height)},createVisual:function(){var e=this.options;this.visual=new X.Text(this.content,this.box.toRect().topLeft(),{font:e.font,fill:{color:e.color,opacity:e.opacity},cursor:e.cursor})}}),M=A.extend({init:function(e){A.fn.init.call(this,e),this._initDirection()},_initDirection:function(){var e=this.options;
e.vertical?(this.groupAxis=Nt,this.elementAxis=Ot,this.groupSizeField=Ht,this.elementSizeField=bt,this.groupSpacing=e.spacing,this.elementSpacing=e.vSpacing):(this.groupAxis=Ot,this.elementAxis=Nt,this.groupSizeField=bt,this.elementSizeField=Ht,this.groupSpacing=e.vSpacing,this.elementSpacing=e.spacing)},options:{vertical:!0,wrap:!0,vSpacing:0,spacing:0},reflow:function(e){this.box=e.clone(),this.reflowChildren()},reflowChildren:function(){var e,t,n,i,r,o,a,s,l,c,d=this,u=d.box,h=d.elementAxis,p=d.groupAxis,f=d.elementSizeField,g=d.groupSizeField,m=d.groupOptions(),v=m.groups,_=v.length,w=u[p+1]+d.alignStart(m.groupsSize,u[g]()),y=w;if(_){for(a=0;_>a;a++){for(n=v[a],i=n.groupElements,r=i.length,e=u[h+1],o=0;r>o;o++)s=i[o],c=d.elementSize(s),t=y+d.alignStart(c[g],n.groupSize),l=C(),l[p+1]=t,l[p+2]=t+c[g],l[h+1]=e,l[h+2]=e+c[f],s.reflow(l),e+=c[f]+d.elementSpacing;y+=n.groupSize+d.groupSpacing}u[p+1]=w,u[p+2]=w+m.groupsSize,u[h+2]=u[h+1]+m.maxGroupElementsSize}},alignStart:function(e,t){var n=0,i=this.options.align;return i==zt||i==ct?n=t-e:i==dt&&(n=(t-e)/2),n},groupOptions:function(){var e,t,n=this,i=n.box,r=n.children,o=r.length,a=this.elementSizeField,s=this.groupSizeField,l=this.elementSpacing,c=this.groupSpacing,d=u(i[a]()),h=0,p=0,f=0,g=0,m=[],v=[],_=0;for(h=0;o>h;h++)t=r[h],t.box||t.reflow(i),e=this.elementSize(t),n.options.wrap&&u(f+l+e[a])>d&&(m.push({groupElements:v,groupSize:p,groupElementsSize:f}),_=ot.max(_,f),g+=c+p,p=0,f=0,v=[]),p=ot.max(p,e[s]),f>0&&(f+=l),f+=e[a],v.push(t);return m.push({groupElements:v,groupSize:p,groupElementsSize:f}),_=ot.max(_,f),g+=p,{groups:m,groupsSize:g,maxGroupElementsSize:_}},elementSize:function(e){return{width:e.box.width(),height:e.box.height()}},createVisual:nt}),F=I.extend({ROWS_SPLIT_REGEX:/\n|\\n/m,init:function(e,t){var n=this;n.content=e,I.fn.init.call(n,t),n._initContainer(),n.reflow(C())},_initContainer:function(){{var e,t,n=this,i=n.options,r=(n.content+"").split(n.ROWS_SPLIT_REGEX),o=new M({vertical:!0,align:i.align,wrap:!1}),a=at({},i,{opacity:1,animation:null});n.hasBox()}for(n.container=o,n.append(o),t=0;r.length>t;t++)e=new P(rt(r[t]),a),o.append(e)},reflow:function(e){var t,n,i=this,r=i.options,o=r.align,a=r.rotation;i.container.options.align=o,I.fn.reflow.call(i,e),a&&(t=r.margin,n=i.box.unpad(t),i.normalBox=n.clone(),n.rotate(a),n.pad(t),i.align(e,Nt,o),i.align(e,Ot,r.vAlign))},createVisual:function(){var e,t=this.options;t.visible&&(this.visual=new Q.drawing.Group({transform:this.rotationTransform(),zIndex:t.zIndex,noclip:t.noclip}),this.hasBox()&&(e=X.Path.fromRect(this.paddingBox.toRect(),this.visualStyle()),this.visual.append(e)))},rotationTransform:function(){var e,t,n,i,r=this.options.rotation;return r?(e=this.normalBox.center(),t=e.x,n=e.y,i=this.box.center(),K.transform().translate(i.x-t,i.y-n).rotate(r,[t,n])):null},rotationMatrix:function(){var e=this,t=e.options,n=e.normalBox,i=n.center(),r=i.x,o=i.y,a=e.box.center(),s=a.x-r,l=a.y-o,c=J.translate(s,l).times(J.rotate(t.rotation,r,o));return c}}),z=A.extend({init:function(e){var t=this;A.fn.init.call(t,e),e=t.options,t.append(new F(e.text,at({},e,{vAlign:e.position})))},options:{color:lt,position:Rt,align:dt,margin:n(5),padding:n(5)},reflow:function(e){var t=this;A.fn.reflow.call(t,e),t.box.snapTo(e,Nt)}}),z.buildTitle=function(e,t,n){var i;return"string"==typeof e&&(e={text:e}),e=at({visible:!0},n,e),e&&e.visible&&e.text&&(i=new z(e),t.append(i)),i},R=F.extend({init:function(e,t,n,i,r){var o=this;o.text=t,o.value=e,o.index=n,o.dataItem=i,F.fn.init.call(o,t,r)},click:function(t,n){var i=this;t.trigger(st,{element:e(n.target),value:i.value,text:i.text,index:i.index,dataItem:i.dataItem,axis:i.parent.options})}}),B=A.extend({init:function(e){var t=this;A.fn.init.call(t,e),t.options.visible||(t.options=at({},t.options,{labels:{visible:!1},line:{visible:!1},margin:0,majorTickSize:0,minorTickSize:0})),t.options.minorTicks=at({},{color:t.options.line.color,width:t.options.line.width,visible:t.options.minorTickType!=Et},t.options.minorTicks,{size:t.options.minorTickSize,align:t.options.minorTickType}),t.options.majorTicks=at({},{color:t.options.line.color,width:t.options.line.width,visible:t.options.majorTickType!=Et},t.options.majorTicks,{size:t.options.majorTickSize,align:t.options.majorTickType}),t.createLabels(),t.createTitle(),t.createNotes()},options:{labels:{visible:!0,rotation:0,mirror:!1,step:1,skip:0},line:{width:1,color:lt,visible:!0},title:{visible:!0,position:dt},majorTicks:{align:Mt,size:4,skip:0,step:1},minorTicks:{align:Mt,size:3,skip:0,step:1},axisCrossingValue:0,majorTickType:Mt,minorTickType:Et,majorGridLines:{skip:0,step:1},minorGridLines:{visible:!1,width:1,color:lt,skip:0,step:1},margin:5,visible:!0,reverse:!1,justified:!0,notes:{label:{text:""}},_alignLines:!0},createLabels:function(){var e,t,n,i=this,r=i.options,o=r.vertical?zt:dt,a=at({},r.labels,{align:o,zIndex:r.zIndex}),s=a.step;if(i.labels=[],a.visible)for(e=i.labelsCount(),n=a.skip;e>n;n+=s)t=i.createAxisLabel(n,a),t&&(i.append(t),i.labels.push(t))},lineBox:function(){var e=this,t=e.options,n=e.box,i=t.vertical,r=e.labels,o=i?bt:Ht,a=t.justified,s=t.labels.mirror,l=s?n.x1:n.x2,c=s?n.y2:n.y1,d=0,u=t.line.width;return a&&r.length>1&&(d=r[0].box[o]()/2,u=$(r).box[o]()/2),i?C(l,n.y1+d,l,n.y2-u):C(n.x1+d,c,n.x2-u,c)},createTitle:function(){var e,t=this,n=t.options,i=at({rotation:n.vertical?-90:0,text:"",zIndex:1},n.title);i.visible&&i.text&&(e=new F(i.text,i),t.append(e),t.title=e)},createNotes:function(){var e,t,n,i=this,r=i.options,o=r.notes,a=o.data||[];for(i.notes=[],e=0;a.length>e;e++)t=at({},o,a[e]),t.value=i.parseNoteValue(t.value),n=new H(t.value,t.label.text,null,null,null,t),n.options.visible&&(G(n.options.position)?r.vertical&&!l(n.options.position,[Tt,zt])?n.options.position=r.reverse?Tt:zt:r.vertical||l(n.options.position,[Rt,ct])||(n.options.position=r.reverse?ct:Rt):n.options.position=r.vertical?r.reverse?Tt:zt:r.reverse?ct:Rt,i.append(n),i.notes.push(n))},parseNoteValue:function(e){return e},renderVisual:function(){A.fn.renderVisual.call(this),this.createPlotBands()},createVisual:function(){A.fn.createVisual.call(this),this.createBackground(),this.createLine()},gridLinesVisual:function(){var e=this._gridLines;return e||(e=this._gridLines=new X.Group({zIndex:-2}),this.appendVisual(this._gridLines)),e},createTicks:function(e){function t(t,n,r){var s,c=t.length;if(n.visible)for(s=n.skip;c>s;s+=n.step)G(r)&&s%r===0||(l.tickX=a?o.x2:o.x2-n.size,l.tickY=a?o.y1-n.size:o.y1,l.position=t[s],e.append(i(l,n)))}var n=this,r=n.options,o=n.lineBox(),a=r.labels.mirror,s=r.majorTicks.visible?r.majorUnit:0,l={vertical:r.vertical};t(n.getMajorTickPositions(),r.majorTicks),t(n.getMinorTickPositions(),r.minorTicks,s/r.minorUnit)},createLine:function(){var e,t,n=this,i=n.options,r=i.line,o=n.lineBox();r.width>0&&r.visible&&(e=new X.Path({stroke:{width:r.width,color:r.color,dashType:r.dashType}}),e.moveTo(o.x1,o.y1).lineTo(o.x2,o.y2),i._alignLines&&k(e),t=this._lineGroup=new X.Group,t.append(e),this.visual.append(t),this.createTicks(t))},getActualTickSize:function(){var e=this,t=e.options,n=0;return t.majorTicks.visible&&t.minorTicks.visible?n=ot.max(t.majorTicks.size,t.minorTicks.size):t.majorTicks.visible?n=t.majorTicks.size:t.minorTicks.visible&&(n=t.minorTicks.size),n},createBackground:function(){var e=this,t=e.options,n=t.background,i=e.box;n&&(e._backgroundPath=X.Path.fromRect(i.toRect(),{fill:{color:n},stroke:null}),this.visual.append(e._backgroundPath))},createPlotBands:function(){var t,n,i,r,o,a,s=this,l=s.options,c=l.plotBands||[],d=l.vertical,u=s.plotArea;0!==c.length&&(o=this._plotbandGroup=new X.Group({zIndex:-1}),a=this.range(),e.each(c,function(e,l){var c,h,p;i=Y(l.from,At),r=Y(l.to,Dt),c=[],(b(i,a)||b(r,a))&&(d?(t=u.axisX.lineBox(),n=s.getSlot(l.from,l.to,!0)):(t=s.getSlot(l.from,l.to,!0),n=u.axisY.lineBox()),h=new K.Rect([t.x1,n.y1],[t.width(),n.height()]),p=X.Path.fromRect(h,{fill:{color:l.color,opacity:l.opacity},stroke:null}),o.append(p))}),s.appendVisual(o))},createGridLines:function(e){function t(e,t,i){var o,s=e.length;if(t.visible)for(o=t.skip;s>o;o+=t.step)n=u(e[o]),l(n,g)||o%i===0||a&&p===n||(f.position=n,m.append(r(f,t)),g.push(n))}var n,i=this,o=i.options,a=e.options.line.visible,s=o.majorGridLines,c=s.visible?o.majorUnit:0,d=o.vertical,h=e.lineBox(),p=h[d?"y1":"x1"],f={lineStart:h[d?"x1":"y1"],lineEnd:h[d?"x2":"y2"],vertical:d},g=[],m=this.gridLinesVisual();return t(i.getMajorTickPositions(),o.majorGridLines),t(i.getMinorTickPositions(),o.minorGridLines,c/o.minorUnit),m.children},reflow:function(e){var t,n,i=this,r=i.options,o=r.vertical,a=i.labels,s=a.length,l=i.getActualTickSize()+r.margin,c=0,d=0,u=i.title;for(n=0;s>n;n++)t=a[n],c=ot.max(c,t.box.height()),d=ot.max(d,t.box.width());u&&(o?d+=u.box.width():c+=u.box.height()),i.box=o?C(e.x1,e.y1,e.x1+d+l,e.y2):C(e.x1,e.y1,e.x2,e.y1+c+l),i.arrangeTitle(),i.arrangeLabels(),i.arrangeNotes()},arrangeLabels:function(){var e,t,n,i,r,o,a,s,l,c,d,u=this,h=u.options,p=u.labels,f=!h.justified,g=h.vertical,m=u.lineBox(),v=h.labels.mirror,_=u.getMajorTickPositions(),w=u.getActualTickSize()+h.margin;for(n=0;p.length>n;n++)i=p[n],r=i.index,o=g?i.box.height():i.box.width(),a=_[r]-o/2,g?(f&&(s=_[r],l=_[r+1],c=s+(l-s)/2,a=c-o/2),d=m.x2,v?d+=w:d-=w+i.box.width(),e=i.box.move(d,a)):(f?(s=_[r],l=_[r+1]):(s=a,l=a+o),t=m.y1,v?t-=w+i.box.height():t+=w,e=C(s,t,l,t+i.box.height())),i.reflow(e)},arrangeTitle:function(){var e=this,t=e.options,n=t.labels.mirror,i=t.vertical,r=e.title;r&&(i?(r.options.align=n?zt:Tt,r.options.vAlign=r.options.position):(r.options.align=r.options.position,r.options.vAlign=n?Rt:ct),r.reflow(e.box))},arrangeNotes:function(){var e,t,n,i,r=this;for(e=0;r.notes.length>e;e++)t=r.notes[e],i=t.options.value,G(i)?(r.shouldRenderNote(i)?t.show():t.hide(),n=r.getSlot(i)):t.hide(),t.reflow(n||r.lineBox())},alignTo:function(e){var t=this,n=e.lineBox(),i=t.options.vertical,r=i?Ot:Nt;t.box.snapTo(n,r),i?t.box.shrink(0,t.lineBox().height()-n.height()):t.box.shrink(t.lineBox().width()-n.width(),0),t.box[r+1]-=t.lineBox()[r+1]-n[r+1],t.box[r+2]-=t.lineBox()[r+2]-n[r+2]},axisLabelText:function(e,t,n){var i,r=e;return n.template?(i=tt(n.template),r=i({value:e,dataItem:t,format:n.format,culture:n.culture})):n.format&&(r=n.format.match(yt)?W.format(n.format,e):W.toString(e,n.format,n.culture)),r}}),H=I.extend({init:function(e,t,n,i,r,o){var a=this;I.fn.init.call(a,o),a.value=e,a.text=t,a.dataItem=n,a.category=i,a.series=r,a.render()},options:{icon:{visible:!0,type:pt},label:{position:Ct,visible:!0,align:dt,vAlign:dt},line:{visible:!0},visible:!0,position:Rt,zIndex:2},hide:function(){this.options.visible=!1},show:function(){this.options.visible=!0},render:function(){var e,t,n,i,r=this,o=r.options,a=o.label,s=r.text,l=o.icon,c=l.size,d=C();o.visible&&(G(a)&&a.visible&&(a.template?(i=tt(a.template),s=i({dataItem:r.dataItem,category:r.category,value:r.value,text:s,series:r.series})):a.format&&(s=m(a.format,s)),r.label=new F(s,at({},a)),r.append(r.label),a.position===Ct&&(l.type===pt?c=ot.max(r.label.box.width(),r.label.box.height()):(t=r.label.box.width(),n=r.label.box.height()),d.wrap(r.label.box))),l.width=t||c,l.height=n||c,e=new L(at({},l)),r.marker=e,r.append(e),e.reflow(C()),r.wrapperBox=d.wrap(e.box))},reflow:function(e){var t,n,i,r=this,o=r.options,a=e.center(),s=r.wrapperBox,c=o.line.length,d=o.position,u=r.label,h=r.marker;o.visible&&(l(d,[Tt,zt])?d===Tt?(i=s.alignTo(e,d).translate(-c,e.center().y-s.center().y),o.line.visible&&(t=[ot.floor(e.x1),a.y],r.linePoints=[t,[ot.floor(i.x2),a.y]],n=i.clone().wrapPoint(t))):(i=s.alignTo(e,d).translate(c,e.center().y-s.center().y),o.line.visible&&(t=[ot.floor(e.x2),a.y],r.linePoints=[t,[ot.floor(i.x1),a.y]],n=i.clone().wrapPoint(t))):d===ct?(i=s.alignTo(e,d).translate(e.center().x-s.center().x,c),o.line.visible&&(t=[ot.floor(a.x),ot.floor(e.y2)],r.linePoints=[t,[ot.floor(a.x),ot.floor(i.y1)]],n=i.clone().wrapPoint(t))):(i=s.alignTo(e,d).translate(e.center().x-s.center().x,-c),o.line.visible&&(t=[ot.floor(a.x),ot.floor(e.y1)],r.linePoints=[t,[ot.floor(a.x),ot.floor(i.y2)]],n=i.clone().wrapPoint(t))),h&&h.reflow(i),u&&(u.reflow(i),h&&(o.label.position===Mt&&u.box.alignTo(h.box,d),u.reflow(u.box))),r.contentBox=i,r.box=n||i)},createVisual:function(){I.fn.createVisual.call(this),this.options.visible&&this.createLine()},createLine:function(){var e=this.options.line,t=X.Path.fromPoints(this.linePoints,{stroke:{color:e.color,width:e.width,dashType:e.dashType}});this.visual.append(t)},click:function(e,t){var n=this.eventArgs(t);e.trigger(It,n)||t.preventDefault()},hover:function(e,t){var n=this.eventArgs(t);e.trigger(Pt,n)||t.preventDefault()},leave:function(e){e._unsetActivePoint()},eventArgs:function(t){var n=this,i=n.options;return{element:e(t.target),text:G(i.label)?i.label.text:"",dataItem:n.dataItem,series:n.series,value:n.value,category:n.category}}}),L=I.extend({options:{type:pt,align:dt,vAlign:dt},getElement:function(){var e,t,n=this,i=n.options,r=i.type,o=i.rotation,a=n.paddingBox,s=a.center(),l=a.width()/2;if(i.visible&&n.hasBox())return t=n.visualStyle(),r===pt?e=new X.Circle(new K.Circle([u(a.x1+l,ut),u(a.y1+a.height()/2,ut)],l),t):r===Bt?e=X.Path.fromPoints([[a.x1+l,a.y1],[a.x1,a.y2],[a.x2,a.y2]],t).close():r===ft?(e=new X.MultiPath(t),e.moveTo(a.x1,a.y1).lineTo(a.x2,a.y2),e.moveTo(a.x1,a.y2).lineTo(a.x2,a.y1)):e=X.Path.fromRect(a.toRect(),t),o&&e.transform(K.transform().rotate(-o,[s.x,s.y])),e.options.zIndex=this.options.zIndex,e},createVisual:function(){this.visual=this.getElement()}}),N=B.extend({init:function(e,t,n){var i=this,r=i.initDefaults(e,t,n);B.fn.init.call(i,r)},startValue:function(){return 0},options:{type:"numeric",min:0,max:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:lt},zIndex:1},initDefaults:function(e,t,n){var i,r=this,a=n.narrowRange,s=r.autoAxisMin(e,t,a),l=r.autoAxisMax(e,t,a),u=o(s,l),h={majorUnit:u};return n.roundToMajorUnit!==!1&&(0>s&&p(s,u,1/3)&&(s-=u),l>0&&p(l,u,1/3)&&(l+=u)),h.min=d(s,u),h.max=c(l,u),n&&(i=G(n.min)||G(n.max),i&&n.min===n.max&&(n.min>0?n.min=0:n.max=1),n.majorUnit?(h.min=d(h.min,n.majorUnit),h.max=c(h.max,n.majorUnit)):i&&(n=at(h,n),h.majorUnit=o(n.min,n.max))),h.minorUnit=(n.majorUnit||h.majorUnit)/5,at(h,n)},range:function(){var e=this.options;return{min:e.min,max:e.max}},autoAxisMax:function(e,t,n){var i,r;if(!e&&!t)return 1;if(0>=e&&0>=t){if(t=e==t?0:t,r=ot.abs((t-e)/t),!n&&r>Vt)return 0;i=ot.min(0,t-(e-t)/2)}else e=e==t?0:e,i=t;return i},autoAxisMin:function(e,t,n){var i,r;if(!e&&!t)return 0;if(e>=0&&t>=0){if(e=e==t?0:e,r=(t-e)/t,!n&&r>Vt)return 0;i=ot.max(0,e-(t-e)/2)}else t=e==t?0:t,i=e;return i},getDivisions:function(e){if(0===e)return 1;var t=this.options,n=t.max-t.min;return ot.floor(u(n/e,ut))+1},getTickPositions:function(e,t){var n,i=this,r=i.options,o=r.vertical,a=r.reverse,s=i.lineBox(),l=o?s.height():s.width(),c=r.max-r.min,d=l/c,h=e*d,p=0,f=i.getDivisions(e),g=(o?-1:1)*(a?-1:1),m=1===g?1:2,v=s[(o?Ot:Nt)+m],_=[];for(t&&(p=t/e),n=0;f>n;n++)n%p!==0&&_.push(u(v,ut)),v+=h*g;return _},getMajorTickPositions:function(){var e=this;return e.getTickPositions(e.options.majorUnit)},getMinorTickPositions:function(){var e=this;return e.getTickPositions(e.options.minorUnit)},getSlot:function(e,t,n){var i,r,o=this,a=o.options,s=a.reverse,l=a.vertical,c=l?Ot:Nt,d=o.lineBox(),u=d[c+(s?2:1)],h=l?d.height():d.width(),p=s?-1:1,f=p*(h/(a.max-a.min)),g=new C(d.x1,d.y1,d.x1,d.y1);return G(e)||(e=t||0),G(t)||(t=e||0),n&&(e=ot.max(ot.min(e,a.max),a.min),t=ot.max(ot.min(t,a.max),a.min)),l?(i=a.max-ot.max(e,t),r=a.max-ot.min(e,t)):(i=ot.min(e,t)-a.min,r=ot.max(e,t)-a.min),g[c+1]=ot.max(ot.min(u+f*(s?r:i),kt),-kt),g[c+2]=ot.max(ot.min(u+f*(s?i:r),kt),-kt),g},getValue:function(e){var t,n=this,i=n.options,r=i.reverse,o=i.vertical,a=1*i.max,s=1*i.min,l=o?Ot:Nt,c=n.lineBox(),d=c[l+(r?2:1)],h=o?c.height():c.width(),p=r?-1:1,f=p*(e[l]-d),g=(a-s)/h,m=f*g;return 0>f||f>h?null:(t=o?a-m:s+m,u(t,vt))},translateRange:function(e){var t=this,n=t.options,i=t.lineBox(),r=n.vertical,o=n.reverse,a=r?i.height():i.width(),s=n.max-n.min,l=a/s,c=u(e/l,vt);return!r&&!o||r&&o||(c=-c),{min:n.min+c,max:n.max+c}},scaleRange:function(e){var t=this,n=t.options,i=-e*n.majorUnit;return{min:n.min-i,max:n.max+i}},labelsCount:function(){return this.getDivisions(this.options.majorUnit)},createAxisLabel:function(e,t){var n=this,i=n.options,r=u(i.min+e*i.majorUnit,vt),o=n.axisLabelText(r,null,t);return new R(r,o,e,null,t)},shouldRenderNote:function(e){var t=this.range();return e>=t.min&&t.max>=e}}),O=B.extend({init:function(e,t,n){this.options=this._initOptions(e,t,n),B.fn.init.call(this,n)},startValue:function(){return this.options.min},options:{type:"log",majorUnit:10,minorUnit:1,axisCrossingValue:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:lt},zIndex:1},getSlot:function(e,n,i){var r,o,a=this,s=a.options,l=s.reverse,c=s.vertical,d=c?Ot:Nt,u=a.lineBox(),p=u[d+(l?2:1)],f=c?u.height():u.width(),g=l?-1:1,m=s.majorUnit,v=a.logMin,_=a.logMax,w=g*(f/(_-v)),y=new C(u.x1,u.y1,u.x1,u.y1);return G(e)||(e=n||1),G(n)||(n=e||1),0>=e||0>=n?t:(i&&(e=ot.max(ot.min(e,s.max),s.min),n=ot.max(ot.min(n,s.max),s.min)),e=h(e,m),n=h(n,m),c?(r=_-ot.max(e,n),o=_-ot.min(e,n)):(r=ot.min(e,n)-v,o=ot.max(e,n)-v),y[d+1]=p+w*(l?o:r),y[d+2]=p+w*(l?r:o),y)},getValue:function(e){var t,n=this,i=n.options,r=i.reverse,o=i.vertical,a=n.lineBox(),s=i.majorUnit,l=n.logMin,c=n.logMax,d=o===r?1:-1,h=1===d?1:2,p=o?a.height():a.width(),f=(c-l)/p,g=o?Ot:Nt,m=a[g+h],v=d*(e[g]-m),_=v*f;return 0>v||v>p?null:(t=l+_,u(ot.pow(s,t),vt))},range:function(){var e=this.options;return{min:e.min,max:e.max}},scaleRange:function(e){var t=this,n=t.options,i=n.majorUnit,r=-e;return{min:ot.pow(i,t.logMin-r),max:ot.pow(i,t.logMax+r)}},translateRange:function(e){var t=this,n=t.options,i=n.majorUnit,r=t.lineBox(),o=n.vertical,a=n.reverse,s=o?r.height():r.width(),l=s/(t.logMax-t.logMin),c=u(e/l,vt);return!o&&!a||o&&a||(c=-c),{min:ot.pow(i,t.logMin+c),max:ot.pow(i,t.logMax+c)}},labelsCount:function(){var e=this,t=ot.floor(e.logMax),n=ot.floor(t-e.logMin)+1;return n},getMajorTickPositions:function(){var e=this,t=[];return e.traverseMajorTicksPositions(function(e){t.push(e)},{step:1,skip:0}),t},createTicks:function(e){function t(t,n){d.tickX=s?a.x2:a.x2-n.size,d.tickY=s?a.y1-n.size:a.y1,d.position=t,e.append(i(d,n))}var n=this,r=[],o=n.options,a=n.lineBox(),s=o.labels.mirror,l=o.majorTicks,c=o.minorTicks,d={vertical:o.vertical};return l.visible&&n.traverseMajorTicksPositions(t,l),c.visible&&n.traverseMinorTicksPositions(t,c),r},createGridLines:function(e){function t(e,t){l(e,u)||(d.position=e,h.append(r(d,t)),u.push(e))}var n=this,i=n.options,o=i.majorGridLines,a=i.minorGridLines,s=i.vertical,c=e.lineBox(),d={lineStart:c[s?"x1":"y1"],lineEnd:c[s?"x2":"y2"],vertical:s},u=[],h=this.gridLinesVisual();return o.visible&&n.traverseMajorTicksPositions(t,o),a.visible&&n.traverseMinorTicksPositions(t,a),h.children},traverseMajorTicksPositions:function(e,t){var n,i,r=this,o=r._lineOptions(),a=o.lineStart,s=o.step,l=r.logMin,c=r.logMax;for(n=ot.ceil(l)+t.skip;c>=n;n+=t.step)i=u(a+s*(n-l),vt),e(i,t)},traverseMinorTicksPositions:function(e,t){var n,i,r,o,a,s=this,l=s.options,c=s._lineOptions(),d=c.lineStart,p=c.step,f=l.majorUnit,g=s.logMin,m=s.logMax,v=ot.floor(g),_=l.max,w=l.min,y=l.minorUnit;for(n=v;m>n;n++)for(o=s._minorIntervalOptions(n),a=t.skip;y>a&&(i=o.value+a*o.minorStep,!(i>_));a+=t.step)i>=w&&(r=u(d+p*(h(i,f)-g),vt),e(r,t))},createAxisLabel:function(e,t){var n=this,i=n.options,r=ot.ceil(n.logMin+e),o=Math.pow(i.majorUnit,r),a=n.axisLabelText(o,null,t);return new R(o,a,e,null,t)},shouldRenderNote:function(e){var t=this.range();return e>=t.min&&t.max>=e},_throwNegativeValuesError:function(){throw Error("Non positive values cannot be used for a logarithmic axis")},_initOptions:function(e,t,n){var i,r=this,o=at({},r.options,{min:e,max:t},n),a=o.min,s=o.max,l=o.majorUnit;return 0>=o.axisCrossingValue&&r._throwNegativeValuesError(),G(n.max)?0>=n.max&&r._throwNegativeValuesError():(i=u(h(s,l),vt)%1,s=0>=s?l:0!==i&&(.3>i||i>.9)?ot.pow(l,h(s,l)+.2):ot.pow(l,ot.ceil(h(s,l)))),G(n.min)?0>=n.min&&r._throwNegativeValuesError():0>=a?a=1>=s?ot.pow(l,-2):1:n.narrowRange||(a=ot.pow(l,ot.floor(h(a,l)))),r.logMin=u(h(a,l),vt),r.logMax=u(h(s,l),vt),o.max=s,o.min=a,o.minorUnit=n.minorUnit||u(l-1,vt),o},_minorIntervalOptions:function(e){var t=this.options.majorUnit,n=ot.pow(t,e),i=ot.pow(t,e+1),r=i-n,o=r/this.options.minorUnit;return{value:n,minorStep:o}},_lineOptions:function(){var e=this,t=e.options,n=t.reverse,i=t.vertical,r=i?Ot:Nt,o=e.lineBox(),a=i===n?1:-1,s=1===a?1:2,l=i?o.height():o.width(),c=a*(l/(e.logMax-e.logMin)),d=o[r+s];return{step:c,lineStart:d,lineBox:o}}}),Q.Gradients={glass:{type:St,rotation:0,stops:[{offset:0,color:Lt,opacity:0},{offset:.25,color:Lt,opacity:.3},{offset:1,color:Lt,opacity:0}]},sharpBevel:{type:Ft,stops:[{offset:0,color:Lt,opacity:.55},{offset:.65,color:Lt,opacity:0},{offset:.95,color:Lt,opacity:.25}]},roundedBevel:{type:Ft,stops:[{offset:.33,color:Lt,opacity:.06},{offset:.83,color:Lt,opacity:.2},{offset:.95,color:Lt,opacity:0}]},roundedGlass:{type:Ft,supportVML:!1,stops:[{offset:0,color:Lt,opacity:0},{offset:.5,color:Lt,opacity:.3},{offset:.99,color:Lt,opacity:0}]},sharpGlass:{type:Ft,supportVML:!1,stops:[{offset:0,color:Lt,opacity:.2},{offset:.15,color:Lt,opacity:.15},{offset:.17,color:Lt,opacity:.35},{offset:.85,color:Lt,opacity:.05},{offset:.87,color:Lt,opacity:.15},{offset:.99,color:Lt,opacity:0}]}},V={extend:function(e,t){if(!e.exportVisual)throw Error("Mixin target has no exportVisual method defined.");e.exportSVG=this.exportSVG,e.exportImage=this.exportImage,e.exportPDF=this.exportPDF,t||(e.svg=this.svg,e.imageDataURL=this.imageDataURL)},exportSVG:function(e){return X.exportSVG(this.exportVisual(),e)},exportImage:function(e){return X.exportImage(this.exportVisual(),e)},exportPDF:function(e){return X.exportPDF(this.exportVisual(),e)},svg:function(){if(X.svg.Surface)return X.svg._exportGroup(this.exportVisual());throw Error("SVG Export failed. Unable to export instantiate kendo.drawing.svg.Surface")},imageDataURL:function(){var t,n,i;if(!W.support.canvas)return null;if(X.canvas.Surface)return t=e("<div />").css({display:"none",width:this.element.width(),height:this.element.height()}).appendTo(document.body),n=new X.canvas.Surface(t),n.draw(this.exportVisual()),i=n._rootElement.toDataURL(),n.destroy(),t.remove(),i;throw Error("Image Export failed. Unable to export instantiate kendo.drawing.canvas.Surface")}},U=function(e){this.closed=e},U.prototype=U.fn={WEIGHT:.333,EXTREMUM_ALLOWED_DEVIATION:.01,process:function(e){var t,n,i,r,o,a,s,l,c,d,u=this,h=u.closed,p=e.slice(0),f=p.length,g=[];if(f>2&&(u.removeDuplicates(0,p),f=p.length),2>f||2==f&&p[0].equals(p[1]))return g;for(t=p[0],n=p[1],i=p[2],g.push(new X.Segment(t));t.equals(p[f-1]);)h=!0,p.pop(),f--;if(2==f)return s=u.tangent(t,n,Nt,Ot),$(g).controlOut(u.firstControlPoint(s,t,n,Nt,Ot)),g.push(new X.Segment(n,u.secondControlPoint(s,t,n,Nt,Ot))),g;for(h?(t=p[f-1],n=p[0],i=p[1],r=u.controlPoints(t,n,i),o=r[1],a=r[0]):(s=u.tangent(t,n,Nt,Ot),o=u.firstControlPoint(s,t,n,Nt,Ot)),l=o,c=0;f-3>=c;c++)u.removeDuplicates(c,p),f=p.length,f>=c+3&&(t=p[c],n=p[c+1],i=p[c+2],r=u.controlPoints(t,n,i),$(g).controlOut(l),l=r[1],d=r[0],g.push(new X.Segment(n,d)));return h?(t=p[f-2],n=p[f-1],i=p[0],r=u.controlPoints(t,n,i),$(g).controlOut(l),g.push(new X.Segment(n,r[0])),$(g).controlOut(r[1]),g.push(new X.Segment(i,a))):(s=u.tangent(n,i,Nt,Ot),$(g).controlOut(l),g.push(new X.Segment(i,u.secondControlPoint(s,n,i,Nt,Ot)))),g},removeDuplicates:function(e,t){for(;t[e].equals(t[e+1])||t[e+1].equals(t[e+2]);)t.splice(e+1,1)},invertAxis:function(e,t,n){var i,r,o=this,a=!1;return e.x===t.x?a=!0:t.x===n.x?(n.y>t.y&&t.y>=e.y||t.y>n.y&&e.y>=t.y)&&(a=!0):(i=o.lineFunction(e,t),r=o.calculateFunction(i,n.x),t.y>=e.y&&r>=n.y||e.y>=t.y&&n.y>=r||(a=!0)),a},isLine:function(e,t,n){var i=this,r=i.lineFunction(e,t),o=i.calculateFunction(r,n.x);return e.x==t.x&&t.x==n.x||u(o,1)===u(n.y,1)},lineFunction:function(e,t){var n=(t.y-e.y)/(t.x-e.x),i=e.y-n*e.x;return[i,n]},controlPoints:function(e,t,n){var i,r,o,a,s,l,c=this,d=Nt,u=Ot,h=!1,p=!1,f=c.EXTREMUM_ALLOWED_DEVIATION;return c.isLine(e,t,n)?i=c.tangent(e,t,Nt,Ot):(r={x:c.isMonotonicByField(e,t,n,Nt),y:c.isMonotonicByField(e,t,n,Ot)},r.x&&r.y?(i=c.tangent(e,n,Nt,Ot),h=!0):(c.invertAxis(e,t,n)&&(d=Ot,u=Nt),r[d]?i=0:(s=e[u]>n[u]&&t[u]>=e[u]||n[u]>e[u]&&e[u]>=t[u]?c.sign((n[u]-e[u])*(t[d]-e[d])):-c.sign((n[d]-e[d])*(t[u]-e[u])),i=f*s,p=!0))),a=c.secondControlPoint(i,e,t,d,u),p&&(l=d,d=u,u=l),o=c.firstControlPoint(i,t,n,d,u),h&&(c.restrictControlPoint(e,t,a,i),c.restrictControlPoint(t,n,o,i)),[a,o]},sign:function(e){return 0>=e?-1:1},restrictControlPoint:function(e,t,n,i){t.y>e.y?n.y>t.y?(n.x=e.x+(t.y-e.y)/i,n.y=t.y):e.y>n.y&&(n.x=t.x-(t.y-e.y)/i,n.y=e.y):t.y>n.y?(n.x=e.x-(e.y-t.y)/i,n.y=t.y):n.y>e.y&&(n.x=t.x+(e.y-t.y)/i,n.y=e.y)},tangent:function(e,t,n,i){var r,o=t[n]-e[n],a=t[i]-e[i];return r=0===o?0:a/o},isMonotonicByField:function(e,t,n,i){return n[i]>t[i]&&t[i]>e[i]||t[i]>n[i]&&e[i]>t[i]},firstControlPoint:function(e,t,n,i,r){var o=this,a=t[i],s=n[i],l=(s-a)*o.WEIGHT;return o.point(a+l,t[r]+l*e,i,r)},secondControlPoint:function(e,t,n,i,r){var o=this,a=t[i],s=n[i],l=(s-a)*o.WEIGHT;return o.point(s-l,n[r]-l*e,i,r)},point:function(e,t,n,i){var r=new K.Point;return r[n]=e,r[i]=t,r},calculateFunction:function(e,t){var n,i=0,r=e.length;for(n=0;r>n;n++)i+=Math.pow(t,n)*e[n];return i}},y._element=document.createElement("span"),at(W.dataviz,{AXIS_LABEL_CLICK:st,COORD_PRECISION:ut,DEFAULT_PRECISION:vt,DEFAULT_WIDTH:_t,DEFAULT_HEIGHT:mt,DEFAULT_FONT:gt,INITIAL_ANIMATION_DURATION:xt,NOTE_CLICK:It,NOTE_HOVER:Pt,CLIP:ht,Axis:B,AxisLabel:R,Box2D:C,BoxElement:I,ChartElement:A,CurveProcessor:U,ExportMixin:V,FloatElement:M,LogarithmicAxis:O,Note:H,NumericAxis:N,Point2D:Ut,Ring:T,RootElement:E,Sector:S,ShapeBuilder:D,ShapeElement:L,Text:P,TextBox:F,Title:z,alignPathToPixel:k,autoFormat:m,autoMajorUnit:o,boxDiff:s,dateComparer:_,decodeEntities:y,getSpacing:n,inArray:l,interpolateValue:f,mwDelta:w,rotatePoint:a,round:u,ceil:c,floor:d})}(window.kendo.jQuery),function(){var e=window.kendo,t=e.dataviz.ui,n=e.deepExtend,i=1.5,r=.4,o="#000",a="Arial,Helvetica,sans-serif",s="11px "+a,l="12px "+a,c="16px "+a,d="#fff",u={title:{font:c},legend:{labels:{font:l}},seriesDefaults:{visible:!0,labels:{font:s},donut:{margin:1},line:{width:2},vericalLine:{width:2},scatterLine:{width:1},area:{opacity:.4,markers:{visible:!1,size:6},highlight:{markers:{border:{color:"#fff",opacity:1,width:1}}},line:{opacity:1,width:0}},verticalArea:{opacity:.4,markers:{visible:!1,size:6},line:{opacity:1,width:0}},radarLine:{width:2,markers:{visible:!1}},radarArea:{opacity:.5,markers:{visible:!1,size:6},line:{opacity:1,width:0}},candlestick:{line:{width:1,color:o},border:{width:1,_brightness:.8},gap:1,spacing:.3,downColor:d,highlight:{line:{width:2},border:{width:2,opacity:1}}},ohlc:{line:{width:1},gap:1,spacing:.3,highlight:{line:{width:3,opacity:1}}},bubble:{opacity:.6,border:{width:0},labels:{background:"transparent"}},bar:{gap:i,spacing:r},column:{gap:i,spacing:r},rangeColumn:{gap:i,spacing:r},rangeBar:{gap:i,spacing:r},waterfall:{gap:.5,spacing:r,line:{width:1,color:o}},horizontalWaterfall:{gap:.5,spacing:r,line:{width:1,color:o}},bullet:{gap:i,spacing:r,target:{color:"#ff0000"}},verticalBullet:{gap:i,spacing:r,target:{color:"#ff0000"}},boxPlot:{outliersField:"",meanField:"",whiskers:{width:1,color:o},mean:{width:1,color:o},median:{width:1,color:o},border:{width:1,_brightness:.8},gap:1,spacing:.3,downColor:d,highlight:{whiskers:{width:2},border:{width:2,opacity:1}}},funnel:{labels:{color:"",background:""}},notes:{icon:{size:7,border:{width:1}},label:{padding:3,font:l},line:{length:10,width:1},visible:!0}},categoryAxis:{majorGridLines:{visible:!0}},axisDefaults:{labels:{font:l},title:{font:c,margin:5},crosshair:{tooltip:{font:l}},notes:{icon:{size:7,border:{width:1}},label:{padding:3,font:l},line:{length:10,width:1},visible:!0}},tooltip:{font:l},navigator:{pane:{height:90,margin:{top:10}}}},h={scale:{labels:{font:l}}},p={shapeDefaults:{hover:{opacity:.2},stroke:{width:0}},editable:{resize:{handles:{width:7,height:7}}},selectable:{stroke:{width:1,dashType:"dot"}},connectionDefaults:{stroke:{width:2},selection:{handles:{width:8,height:8}},editable:{tools:["edit","delete"]}}},f=t.themes,g=t.registerTheme=function(e,t){var i,r={};r.chart=n({},u,t.chart),r.gauge=n({},h,t.gauge),r.diagram=n({},p,t.diagram),r.treeMap=n({},t.treeMap),i=r.chart.seriesDefaults,i.verticalLine=n({},i.line),i.verticalArea=n({},i.area),i.polarArea=n({},i.radarArea),i.polarLine=n({},i.radarLine),f[e]=r};g("black",{chart:{title:{color:d},legend:{labels:{color:d},inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}},seriesDefaults:{labels:{color:d},errorBars:{color:d},notes:{icon:{background:"#3b3b3b",border:{color:"#8e8e8e"}},label:{color:d},line:{color:"#8e8e8e"}},pie:{overlay:{gradient:"sharpBevel"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#3d3d3d"}},scatter:{markers:{background:"#3d3d3d"}},scatterLine:{markers:{background:"#3d3d3d"}},waterfall:{line:{color:"#8e8e8e"}},horizontalWaterfall:{line:{color:"#8e8e8e"}},candlestick:{downColor:"#555",line:{color:d},border:{_brightness:1.5,opacity:1},highlight:{border:{color:d,opacity:.2}}},ohlc:{line:{color:d}}},chartArea:{background:"#3d3d3d"},seriesColors:["#0081da","#3aafff","#99c900","#ffeb3d","#b20753","#ff4195"],axisDefaults:{line:{color:"#8e8e8e"},labels:{color:d},majorGridLines:{color:"#545454"},minorGridLines:{color:"#454545"},title:{color:d},crosshair:{color:"#8e8e8e"},notes:{icon:{background:"#3b3b3b",border:{color:"#8e8e8e"}},label:{color:d},line:{color:"#8e8e8e"}}}},gauge:{pointer:{color:"#0070e4"},scale:{rangePlaceholderColor:"#1d1d1d",labels:{color:d},minorTicks:{color:d},majorTicks:{color:d},line:{color:d}}},diagram:{shapeDefaults:{fill:{color:"#0066cc"},connectorDefaults:{fill:{color:d},stroke:{color:"#384049"},hover:{fill:{color:"#3d3d3d"},stroke:{color:"#efefef"}}},content:{color:d}},editable:{resize:{handles:{fill:{color:"#3d3d3d"},stroke:{color:d},hover:{fill:{color:d},stroke:{color:d}}}},rotate:{thumb:{stroke:{color:d},fill:{color:d}}}},selectable:{stroke:{color:d}},connectionDefaults:{stroke:{color:d},content:{color:d},selection:{handles:{fill:{color:"#3d3d3d"},stroke:{color:"#efefef"}}}}},treeMap:{colors:[["#0081da","#314b5c"],["#3aafff","#3c5464"],["#99c900","#4f5931"],["#ffeb3d","#64603d"],["#b20753","#543241"],["#ff4195","#643e4f"]]}}),g("blueopal",{chart:{title:{color:"#293135"},legend:{labels:{color:"#293135"},inactiveItems:{labels:{color:"#27A5BA"},markers:{color:"#27A5BA"}}},seriesDefaults:{labels:{color:o,background:d,opacity:.5},errorBars:{color:"#293135"},candlestick:{downColor:"#c4d0d5",line:{color:"#9aabb2"}},waterfall:{line:{color:"#9aabb2"}},horizontalWaterfall:{line:{color:"#9aabb2"}},notes:{icon:{background:"transparent",border:{color:"#9aabb2"}},label:{color:"#293135"},line:{color:"#9aabb2"}}},seriesColors:["#0069a5","#0098ee","#7bd2f6","#ffb800","#ff8517","#e34a00"],axisDefaults:{line:{color:"#9aabb2"},labels:{color:"#293135"},majorGridLines:{color:"#c4d0d5"},minorGridLines:{color:"#edf1f2"},title:{color:"#293135"},crosshair:{color:"#9aabb2"},notes:{icon:{background:"transparent",border:{color:"#9aabb2"}},label:{color:"#293135"},line:{color:"#9aabb2"}}}},gauge:{pointer:{color:"#005c83"},scale:{rangePlaceholderColor:"#daecf4",labels:{color:"#293135"},minorTicks:{color:"#293135"},majorTicks:{color:"#293135"},line:{color:"#293135"}}},diagram:{shapeDefaults:{fill:{color:"#7ec6e3"},connectorDefaults:{fill:{color:"#003f59"},stroke:{color:d},hover:{fill:{color:d},stroke:{color:"#003f59"}}},content:{color:"#293135"}},editable:{resize:{handles:{fill:{color:d},stroke:{color:"#003f59"},hover:{fill:{color:"#003f59"},stroke:{color:"#003f59"}}}},rotate:{thumb:{stroke:{color:"#003f59"},fill:{color:"#003f59"}}}},selectable:{stroke:{color:"#003f59"}},connectionDefaults:{stroke:{color:"#003f59"},content:{color:"#293135"},selection:{handles:{fill:{color:"#3d3d3d"},stroke:{color:"#efefef"}}}}},treeMap:{colors:[["#0069a5","#bad7e7"],["#0098ee","#b9e0f5"],["#7bd2f6","#ceeaf6"],["#ffb800","#e6e3c4"],["#ff8517","#e4d8c8"],["#e34a00","#ddccc2"]]}}),g("highcontrast",{chart:{title:{color:"#ffffff"},legend:{labels:{color:"#ffffff"},inactiveItems:{labels:{color:"#66465B"},markers:{color:"#66465B"}}},seriesDefaults:{labels:{color:"#ffffff"},errorBars:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#ffffff"}},label:{color:"#ffffff"},line:{color:"#ffffff"}},pie:{overlay:{gradient:"sharpGlass"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#2c232b"}},scatter:{markers:{background:"#2c232b"}},scatterLine:{markers:{background:"#2c232b"}},area:{opacity:.5},waterfall:{line:{color:"#ffffff"}},horizontalWaterfall:{line:{color:"#ffffff"}},candlestick:{downColor:"#664e62",line:{color:"#ffffff"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:"#ffffff",opacity:1}}},ohlc:{line:{color:"#ffffff"}}},chartArea:{background:"#2c232b"},seriesColors:["#a7008f","#ffb800","#3aafff","#99c900","#b20753","#ff4195"],axisDefaults:{line:{color:"#ffffff"},labels:{color:"#ffffff"},majorGridLines:{color:"#664e62"},minorGridLines:{color:"#4f394b"},title:{color:"#ffffff"},crosshair:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#ffffff"}},label:{color:"#ffffff"},line:{color:"#ffffff"}}}},gauge:{pointer:{color:"#a7008f"},scale:{rangePlaceholderColor:"#2c232b",labels:{color:"#ffffff"},minorTicks:{color:"#2c232b"},majorTicks:{color:"#664e62"},line:{color:"#ffffff"}}},diagram:{shapeDefaults:{fill:{color:"#a7018f"},connectorDefaults:{fill:{color:d},stroke:{color:"#2c232b"},hover:{fill:{color:"#2c232b"},stroke:{color:d}}},content:{color:d}},editable:{resize:{handles:{fill:{color:"#2c232b"},stroke:{color:d},hover:{fill:{color:d},stroke:{color:d}}}},rotate:{thumb:{stroke:{color:d},fill:{color:d}}}},selectable:{stroke:{color:d}},connectionDefaults:{stroke:{color:d},content:{color:d},selection:{handles:{fill:{color:"#2c232b"},stroke:{color:d}}}}},treeMap:{colors:[["#a7008f","#451c3f"],["#ffb800","#564122"],["#3aafff","#2f3f55"],["#99c900","#424422"],["#b20753","#471d33"],["#ff4195","#562940"]]}}),g("default",{chart:{title:{color:"#8e8e8e"},legend:{labels:{color:"#232323"},inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}},seriesDefaults:{labels:{color:o,background:d,opacity:.5},errorBars:{color:"#232323"},candlestick:{downColor:"#dedede",line:{color:"#8d8d8d"}},waterfall:{line:{color:"#8e8e8e"}},horizontalWaterfall:{line:{color:"#8e8e8e"}},notes:{icon:{background:"transparent",border:{color:"#8e8e8e"}},label:{color:"#232323"},line:{color:"#8e8e8e"}}},seriesColors:["#ff6800","#a0a700","#ff8d00","#678900","#ffb53c","#396000"],axisDefaults:{line:{color:"#8e8e8e"},labels:{color:"#232323"},minorGridLines:{color:"#f0f0f0"},majorGridLines:{color:"#dfdfdf"},title:{color:"#232323"},crosshair:{color:"#8e8e8e"},notes:{icon:{background:"transparent",border:{color:"#8e8e8e"}},label:{color:"#232323"},line:{color:"#8e8e8e"}}}},gauge:{pointer:{color:"#ea7001"},scale:{rangePlaceholderColor:"#dedede",labels:{color:"#2e2e2e"},minorTicks:{color:"#2e2e2e"},majorTicks:{color:"#2e2e2e"},line:{color:"#2e2e2e"}}},diagram:{shapeDefaults:{fill:{color:"#e15613"},connectorDefaults:{fill:{color:"#282828"},stroke:{color:d},hover:{fill:{color:d},stroke:{color:"#282828"}}},content:{color:"#2e2e2e"}},editable:{resize:{handles:{fill:{color:d},stroke:{color:"#282828"},hover:{fill:{color:"#282828"},stroke:{color:"#282828"}}}},rotate:{thumb:{stroke:{color:"#282828"},fill:{color:"#282828"}}}},selectable:{stroke:{color:"#a7018f"}},connectionDefaults:{stroke:{color:"#282828"},content:{color:"#2e2e2e"},selection:{handles:{fill:{color:d},stroke:{color:"#282828"}}}}},treeMap:{colors:[["#ff6800","#edcfba"],["#a0a700","#dadcba"],["#ff8d00","#edd7ba"],["#678900","#cfd6ba"],["#ffb53c","#eddfc6"],["#396000","#c6ceba"]]}}),g("silver",{chart:{title:{color:"#4e5968"},legend:{labels:{color:"#4e5968"},inactiveItems:{labels:{color:"#B1BCC8"},markers:{color:"#B1BCC8"}}},seriesDefaults:{labels:{color:"#293135",background:"#eaeaec",opacity:.5},errorBars:{color:"#4e5968"},notes:{icon:{background:"transparent",border:{color:"#4e5968"}},label:{color:"#4e5968"},line:{color:"#4e5968"}},line:{markers:{background:"#eaeaec"}},scatter:{markers:{background:"#eaeaec"}},scatterLine:{markers:{background:"#eaeaec"}},pie:{connectors:{color:"#A6B1C0"}},donut:{connectors:{color:"#A6B1C0"}},waterfall:{line:{color:"#a6b1c0"}},horizontalWaterfall:{line:{color:"#a6b1c0"}},candlestick:{downColor:"#a6afbe"}},chartArea:{background:"#eaeaec"},seriesColors:["#007bc3","#76b800","#ffae00","#ef4c00","#a419b7","#430B62"],axisDefaults:{line:{color:"#a6b1c0"},labels:{color:"#4e5968"},majorGridLines:{color:"#dcdcdf"},minorGridLines:{color:"#eeeeef"},title:{color:"#4e5968"},crosshair:{color:"#a6b1c0"},notes:{icon:{background:"transparent",border:{color:"#4e5968"}},label:{color:"#4e5968"},line:{color:"#4e5968"}}}},gauge:{pointer:{color:"#0879c0"},scale:{rangePlaceholderColor:"#f3f3f4",labels:{color:"#515967"},minorTicks:{color:"#515967"},majorTicks:{color:"#515967"},line:{color:"#515967"}}},diagram:{shapeDefaults:{fill:{color:"#1c82c2"},connectorDefaults:{fill:{color:"#515967"},stroke:{color:d},hover:{fill:{color:d},stroke:{color:"#282828"}}},content:{color:"#515967"}},editable:{resize:{handles:{fill:{color:d},stroke:{color:"#515967"},hover:{fill:{color:"#515967"},stroke:{color:"#515967"}}}},rotate:{thumb:{stroke:{color:"#515967"},fill:{color:"#515967"}}}},selectable:{stroke:{color:"#515967"}},connectionDefaults:{stroke:{color:"#515967"},content:{color:"#515967"},selection:{handles:{fill:{color:d},stroke:{color:"#515967"}}}}},treeMap:{colors:[["#007bc3","#c2dbea"],["#76b800","#dae7c3"],["#ffae00","#f5e5c3"],["#ef4c00","#f2d2c3"],["#a419b7","#e3c7e8"],["#430b62","#d0c5d7"]]}}),g("metro",{chart:{title:{color:"#777777"},legend:{labels:{color:"#777777"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{color:o},errorBars:{color:"#777777"},notes:{icon:{background:"transparent",border:{color:"#777777"}},label:{color:"#777777"},line:{color:"#777777"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},waterfall:{line:{color:"#c7c7c7"}},horizontalWaterfall:{line:{color:"#c7c7c7"}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:["#8ebc00","#309b46","#25a0da","#ff6900","#e61e26","#d8e404","#16aba9","#7e51a1","#313131","#ed1691"],axisDefaults:{line:{color:"#c7c7c7"},labels:{color:"#777777"},minorGridLines:{color:"#c7c7c7"},majorGridLines:{color:"#c7c7c7"},title:{color:"#777777"},crosshair:{color:"#c7c7c7"},notes:{icon:{background:"transparent",border:{color:"#777777"}},label:{color:"#777777"},line:{color:"#777777"}}}},gauge:{pointer:{color:"#8ebc00"},scale:{rangePlaceholderColor:"#e6e6e6",labels:{color:"#777"},minorTicks:{color:"#777"},majorTicks:{color:"#777"},line:{color:"#777"}}},diagram:{shapeDefaults:{fill:{color:"#8ebc00"},connectorDefaults:{fill:{color:o},stroke:{color:d},hover:{fill:{color:d},stroke:{color:o}}},content:{color:"#777"}},editable:{resize:{handles:{fill:{color:d},stroke:{color:"#787878"},hover:{fill:{color:"#787878"},stroke:{color:"#787878"}}}},rotate:{thumb:{stroke:{color:"#787878"},fill:{color:"#787878"}}}},selectable:{stroke:{color:"#515967"}},connectionDefaults:{stroke:{color:"#787878"},content:{color:"#777"},selection:{handles:{fill:{color:d},stroke:{color:"#787878"}}}}},treeMap:{colors:[["#8ebc00","#e8f2cc"],["#309b46","#d6ebda"],["#25a0da","#d3ecf8"],["#ff6900","#ffe1cc"],["#e61e26","#fad2d4"],["#d8e404","#f7facd"],["#16aba9","#d0eeee"],["#7e51a1","#e5dcec"],["#313131","#d6d6d6"],["#ed1691","#fbd0e9"]]}}),g("metroblack",{chart:{title:{color:"#ffffff"},legend:{labels:{color:"#ffffff"},inactiveItems:{labels:{color:"#797979"},markers:{color:"#797979"}}},seriesDefaults:{border:{_brightness:1},labels:{color:"#ffffff"},errorBars:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#cecece"}},label:{color:"#ffffff"},line:{color:"#cecece"}},line:{markers:{background:"#0e0e0e"}},bubble:{opacity:.6},scatter:{markers:{background:"#0e0e0e"}},scatterLine:{markers:{background:"#0e0e0e"}},candlestick:{downColor:"#828282",line:{color:"#ffffff"}},waterfall:{line:{color:"#cecece"}},horizontalWaterfall:{line:{color:"#cecece"}},overlay:{gradient:"none"}},chartArea:{background:"#0e0e0e"},seriesColors:["#00aba9","#309b46","#8ebc00","#ff6900","#e61e26","#d8e404","#25a0da","#7e51a1","#313131","#ed1691"],axisDefaults:{line:{color:"#cecece"},labels:{color:"#ffffff"},minorGridLines:{color:"#2d2d2d"},majorGridLines:{color:"#333333"},title:{color:"#ffffff"},crosshair:{color:"#cecece"},notes:{icon:{background:"transparent",border:{color:"#cecece"}},label:{color:"#ffffff"},line:{color:"#cecece"}}}},gauge:{pointer:{color:"#00aba9"},scale:{rangePlaceholderColor:"#2d2d2d",labels:{color:"#ffffff"},minorTicks:{color:"#333333"},majorTicks:{color:"#cecece"},line:{color:"#cecece"}}},diagram:{shapeDefaults:{fill:{color:"#00aba9"},connectorDefaults:{fill:{color:d},stroke:{color:"#0e0e0e"},hover:{fill:{color:"#0e0e0e"},stroke:{color:d}}},content:{color:d}},editable:{resize:{handles:{fill:{color:"#0e0e0e"},stroke:{color:"#787878"},hover:{fill:{color:"#787878"},stroke:{color:"#787878"}}}},rotate:{thumb:{stroke:{color:d},fill:{color:d}}}},selectable:{stroke:{color:"#787878"}},connectionDefaults:{stroke:{color:d},content:{color:d},selection:{handles:{fill:{color:"#0e0e0e"},stroke:{color:d}}}}},treeMap:{colors:[["#00aba9","#0b2d2d"],["#309b46","#152a19"],["#8ebc00","#28310b"],["#ff6900","#3e200b"],["#e61e26","#391113"],["#d8e404","#36390c"],["#25a0da","#132b37"],["#7e51a1","#241b2b"],["#313131","#151515"],["#ed1691","#3b1028"]]}}),g("moonlight",{chart:{title:{color:"#ffffff"},legend:{labels:{color:"#ffffff"},inactiveItems:{labels:{color:"#A1A7AB"},markers:{color:"#A1A7AB"}}},seriesDefaults:{labels:{color:"#ffffff"},errorBars:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#8c909e"}},label:{color:"#ffffff"},line:{color:"#8c909e"}},pie:{overlay:{gradient:"sharpBevel"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#212a33"}},bubble:{opacity:.6},scatter:{markers:{background:"#212a33"}},scatterLine:{markers:{background:"#212a33"}},area:{opacity:.3},candlestick:{downColor:"#757d87",line:{color:"#ea9d06"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:d,opacity:.2}}},waterfall:{line:{color:"#8c909e"}},horizontalWaterfall:{line:{color:"#8c909e"}},ohlc:{line:{color:"#ea9d06"}}},chartArea:{background:"#212a33"},seriesColors:["#ffca08","#ff710f","#ed2e24","#ff9f03","#e13c02","#a00201"],axisDefaults:{line:{color:"#8c909e"},minorTicks:{color:"#8c909e"},majorTicks:{color:"#8c909e"},labels:{color:"#ffffff"},majorGridLines:{color:"#3e424d"},minorGridLines:{color:"#2f3640"},title:{color:"#ffffff"},crosshair:{color:"#8c909e"},notes:{icon:{background:"transparent",border:{color:"#8c909e"}},label:{color:"#ffffff"},line:{color:"#8c909e"}}}},gauge:{pointer:{color:"#f4af03"},scale:{rangePlaceholderColor:"#2f3640",labels:{color:d},minorTicks:{color:"#8c909e"},majorTicks:{color:"#8c909e"},line:{color:"#8c909e"}}},diagram:{shapeDefaults:{fill:{color:"#f3ae03"},connectorDefaults:{fill:{color:d},stroke:{color:"#414550"},hover:{fill:{color:"#414550"},stroke:{color:d}}},content:{color:d}},editable:{resize:{handles:{fill:{color:"#414550"},stroke:{color:d},hover:{fill:{color:d},stroke:{color:d}}}},rotate:{thumb:{stroke:{color:d},fill:{color:d}}}},selectable:{stroke:{color:d}},connectionDefaults:{stroke:{color:d},content:{color:d},selection:{handles:{fill:{color:"#414550"},stroke:{color:d}}}}},treeMap:{colors:[["#ffca08","#4e4b2b"],["#ff710f","#4e392d"],["#ed2e24","#4b2c31"],["#ff9f03","#4e422a"],["#e13c02","#482e2a"],["#a00201","#3b232a"]]}}),g("uniform",{chart:{title:{color:"#686868"},legend:{labels:{color:"#686868"},inactiveItems:{labels:{color:"#B6B6B6"},markers:{color:"#B6B6B6"}}},seriesDefaults:{labels:{color:"#686868"},errorBars:{color:"#686868"},notes:{icon:{background:"transparent",border:{color:"#9e9e9e"}},label:{color:"#686868"},line:{color:"#9e9e9e"}},pie:{overlay:{gradient:"sharpBevel"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#ffffff"}},bubble:{opacity:.6},scatter:{markers:{background:"#ffffff"}},scatterLine:{markers:{background:"#ffffff"}},area:{opacity:.3},candlestick:{downColor:"#cccccc",line:{color:"#cccccc"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:"#cccccc",opacity:.2}}},waterfall:{line:{color:"#9e9e9e"}},horizontalWaterfall:{line:{color:"#9e9e9e"}},ohlc:{line:{color:"#cccccc"}}},chartArea:{background:"#ffffff"},seriesColors:["#527aa3","#6f91b3","#8ca7c2","#a8bdd1","#c5d3e0","#e2e9f0"],axisDefaults:{line:{color:"#9e9e9e"},minorTicks:{color:"#aaaaaa"},majorTicks:{color:"#888888"},labels:{color:"#686868"},majorGridLines:{color:"#dadada"},minorGridLines:{color:"#e7e7e7"},title:{color:"#686868"},crosshair:{color:"#9e9e9e"},notes:{icon:{background:"transparent",border:{color:"#9e9e9e"}},label:{color:"#686868"},line:{color:"#9e9e9e"}}}},gauge:{pointer:{color:"#527aa3"},scale:{rangePlaceholderColor:"#e7e7e7",labels:{color:"#686868"},minorTicks:{color:"#aaaaaa"},majorTicks:{color:"#888888"},line:{color:"#9e9e9e"}}},diagram:{shapeDefaults:{fill:{color:"#d1d1d1"},connectorDefaults:{fill:{color:"#686868"},stroke:{color:d},hover:{fill:{color:d},stroke:{color:"#686868"}}},content:{color:"#686868"}},editable:{resize:{handles:{fill:{color:d},stroke:{color:"#686868"},hover:{fill:{color:"#686868"},stroke:{color:"#686868"}}}},rotate:{thumb:{stroke:{color:"#686868"},fill:{color:"#686868"}}}},selectable:{stroke:{color:"#686868"}},connectionDefaults:{stroke:{color:"#686868"},content:{color:"#686868"},selection:{handles:{fill:{color:d},stroke:{color:"#686868"}}}}},treeMap:{colors:[["#527aa3","#d0d8e1"],["#6f91b3","#d6dde4"],["#8ca7c2","#dce1e7"],["#a8bdd1","#e2e6ea"],["#c5d3e0","#e7eaed"],["#e2e9f0","#edeff0"]]}}),g("bootstrap",{chart:{title:{color:"#333333"},legend:{labels:{color:"#333333"},inactiveItems:{labels:{color:"#999999"},markers:{color:"#9A9A9A"}}},seriesDefaults:{labels:{color:"#333333"},overlay:{gradient:"none"},errorBars:{color:"#343434"},notes:{icon:{background:"#000000",border:{color:"#000000"}},label:{color:"#333333"},line:{color:"#000000"}},pie:{overlay:{gradient:"none"}},donut:{overlay:{gradient:"none"}},line:{markers:{background:"#ffffff"}},bubble:{opacity:.6},scatter:{markers:{background:"#ffffff"}},scatterLine:{markers:{background:"#ffffff"}},area:{opacity:.8},candlestick:{downColor:"#d0d0d0",line:{color:"#333333"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:"#b8b8b8",opacity:.2}}},waterfall:{line:{color:"#cccccc"}},horizontalWaterfall:{line:{color:"#cccccc"}},ohlc:{line:{color:"#333333"}}},chartArea:{background:"#ffffff"},seriesColors:["#428bca","#5bc0de","#5cb85c","#f2b661","#e67d4a","#da3b36"],axisDefaults:{line:{color:"#cccccc"},minorTicks:{color:"#ebebeb"},majorTicks:{color:"#cccccc"},labels:{color:"#333333"},majorGridLines:{color:"#cccccc"},minorGridLines:{color:"#ebebeb"},title:{color:"#333333"},crosshair:{color:"#000000"},notes:{icon:{background:"#000000",border:{color:"#000000"}},label:{color:"#ffffff"},line:{color:"#000000"}}}},gauge:{pointer:{color:"#428bca"},scale:{rangePlaceholderColor:"#cccccc",labels:{color:"#333333"},minorTicks:{color:"#ebebeb"},majorTicks:{color:"#cccccc"},line:{color:"#cccccc"}}},diagram:{shapeDefaults:{fill:{color:"#428bca"},connectorDefaults:{fill:{color:"#333333"},stroke:{color:d},hover:{fill:{color:d},stroke:{color:"#333333"}}},content:{color:"#333333"}},editable:{resize:{handles:{fill:{color:d},stroke:{color:"#333333"},hover:{fill:{color:"#333333"},stroke:{color:"#333333"}}}},rotate:{thumb:{stroke:{color:"#333333"},fill:{color:"#333333"}}}},selectable:{stroke:{color:"#333333"}},connectionDefaults:{stroke:{color:"#c4c4c4"},content:{color:"#333333"},selection:{handles:{fill:{color:d},stroke:{color:"#333333"}},stroke:{color:"#333333"}}}},treeMap:{colors:[["#428bca","#d1e0ec"],["#5bc0de","#d6eaf0"],["#5cb85c","#d6e9d6"],["#5cb85c","#f4e8d7"],["#e67d4a","#f2ddd3"],["#da3b36","#f0d0cf"]]}}),g("flat",{chart:{title:{color:"#4c5356"},legend:{labels:{color:"#4c5356"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{color:"#4c5356"},errorBars:{color:"#4c5356"},notes:{icon:{background:"transparent",border:{color:"#cdcdcd"}},label:{color:"#4c5356"},line:{color:"#cdcdcd"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},area:{opacity:.9},waterfall:{line:{color:"#cdcdcd"}},horizontalWaterfall:{line:{color:"#cdcdcd"}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:["#10c4b2","#ff7663","#ffb74f","#a2df53","#1c9ec4","#ff63a5","#1cc47b"],axisDefaults:{line:{color:"#cdcdcd"},labels:{color:"#4c5356"},minorGridLines:{color:"#cdcdcd"},majorGridLines:{color:"#cdcdcd"},title:{color:"#4c5356"},crosshair:{color:"#cdcdcd"},notes:{icon:{background:"transparent",border:{color:"#cdcdcd"}},label:{color:"#4c5356"},line:{color:"#cdcdcd"}}}},gauge:{pointer:{color:"#10c4b2"},scale:{rangePlaceholderColor:"#cdcdcd",labels:{color:"#4c5356"},minorTicks:{color:"#4c5356"},majorTicks:{color:"#4c5356"},line:{color:"#4c5356"}}},diagram:{shapeDefaults:{fill:{color:"#10c4b2"},connectorDefaults:{fill:{color:"#363940"},stroke:{color:d},hover:{fill:{color:d},stroke:{color:"#363940"}}},content:{color:"#4c5356"}},editable:{resize:{handles:{fill:{color:d},stroke:{color:"#363940"},hover:{fill:{color:"#363940"},stroke:{color:"#363940"}}}},rotate:{thumb:{stroke:{color:"#363940"},fill:{color:"#363940"}}}},selectable:{stroke:{color:"#363940"}},connectionDefaults:{stroke:{color:"#cdcdcd"},content:{color:"#4c5356"},selection:{handles:{fill:{color:d},stroke:{color:"#363940"}},stroke:{color:"#363940"}}}},treeMap:{colors:[["#10c4b2","#cff3f0"],["#ff7663","#ffe4e0"],["#ffb74f","#fff1dc"],["#a2df53","#ecf9dd"],["#1c9ec4","#d2ecf3"],["#ff63a5","#ffe0ed"],["#1cc47b","#d2f3e5"]]}}),g("material",{chart:{title:{color:"#444444"},legend:{labels:{color:"#444444"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{color:"#444444"},errorBars:{color:"#444444"},notes:{icon:{background:"transparent",border:{color:"#e5e5e5"}},label:{color:"#444444"},line:{color:"#e5e5e5"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},area:{opacity:.9},waterfall:{line:{color:"#e5e5e5"}},horizontalWaterfall:{line:{color:"#e5e5e5"}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#ff9800","#ff5722"],axisDefaults:{line:{color:"#e5e5e5"},labels:{color:"#444444"},minorGridLines:{color:"#e5e5e5"},majorGridLines:{color:"#e5e5e5"},title:{color:"#444444"},crosshair:{color:"#7f7f7f"},notes:{icon:{background:"transparent",border:{color:"#e5e5e5"}},label:{color:"#444444"},line:{color:"#e5e5e5"}}}},gauge:{pointer:{color:"#3f51b5"},scale:{rangePlaceholderColor:"#e5e5e5",labels:{color:"#444444"},minorTicks:{color:"#444444"},majorTicks:{color:"#444444"},line:{color:"#444444"}}},diagram:{shapeDefaults:{fill:{color:"#3f51b5"},connectorDefaults:{fill:{color:"#7f7f7f"},stroke:{color:d},hover:{fill:{color:d},stroke:{color:"#7f7f7f"}}},content:{color:"#444444"}},editable:{resize:{handles:{fill:{color:d},stroke:{color:"#444444"},hover:{fill:{color:"#444444"},stroke:{color:"#444444"}}}},rotate:{thumb:{stroke:{color:"#444444"},fill:{color:"#444444"}}}},selectable:{stroke:{color:"#444444"}},connectionDefaults:{stroke:{color:"#7f7f7f"},content:{color:"#444444"},selection:{handles:{fill:{color:d},stroke:{color:"#444444"}},stroke:{color:"#444444"}}}},treeMap:{colors:[["#3f51b5","#cff3f0"],["#03a9f4","#e5f6fe"],["#4caf50","#edf7ed"],["#f9ce1d","#fefae8"],["#ff9800","#fff4e5"],["#ff5722","#ffeee8"]]}}),g("materialblack",{chart:{title:{color:"#fff"},legend:{labels:{color:"#fff"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{color:"#fff"},errorBars:{color:"#fff"},notes:{icon:{background:"transparent",border:{color:"#e5e5e5"}},label:{color:"#fff"},line:{color:"#e5e5e5"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},area:{opacity:.9},waterfall:{line:{color:"#4d4d4d"}},horizontalWaterfall:{line:{color:"#4d4d4d"}},overlay:{gradient:"none"},border:{_brightness:1}},chartArea:{background:"#1c1c1c"},seriesColors:["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#ff9800","#ff5722"],axisDefaults:{line:{color:"#4d4d4d"},labels:{color:"#fff"},minorGridLines:{color:"#4d4d4d"},majorGridLines:{color:"#4d4d4d"},title:{color:"#fff"},crosshair:{color:"#7f7f7f"},notes:{icon:{background:"transparent",border:{color:"#4d4d4d"}},label:{color:"#fff"},line:{color:"#4d4d4d"}}}},gauge:{pointer:{color:"#3f51b5"},scale:{rangePlaceholderColor:"#4d4d4d",labels:{color:"#fff"},minorTicks:{color:"#fff"},majorTicks:{color:"#fff"},line:{color:"#fff"}}},diagram:{shapeDefaults:{fill:{color:"#3f51b5"},connectorDefaults:{fill:{color:"#7f7f7f"},stroke:{color:d},hover:{fill:{color:d},stroke:{color:"#7f7f7f"}}},content:{color:"#fff"}},editable:{resize:{handles:{fill:{color:d},stroke:{color:"#fff"},hover:{fill:{color:"#fff"},stroke:{color:"#fff"}}}},rotate:{thumb:{stroke:{color:"#fff"},fill:{color:"#fff"}}}},selectable:{stroke:{color:"#fff"}},connectionDefaults:{stroke:{color:"#7f7f7f"},content:{color:"#fff"},selection:{handles:{fill:{color:d},stroke:{color:"#fff"}},stroke:{color:"#fff"}}}},treeMap:{colors:[["#3f51b5","#cff3f0"],["#03a9f4","#e5f6fe"],["#4caf50","#edf7ed"],["#f9ce1d","#fefae8"],["#ff9800","#fff4e5"],["#ff5722","#ffeee8"]]}})
}(window.kendo.jQuery),function(e,t){function n(){this._defaults={}}function i(e,t,n,i){var r,o,a=(i.x-n.x)*(e.y-n.y)-(i.y-n.y)*(e.x-n.x),s=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y);return 0!==s&&(o=a/s,r=new On(e.x+o*(t.x-e.x),e.y+o*(t.y-e.y))),r}function r(e,t){var n,i,r,a=e.series,s=a.length,l=e.seriesDefaults,c=Cn({},e.seriesDefaults),d=t?Cn({},t.seriesDefaults):{},u=Cn({},d);for(o(c),o(u),n=0;s>n;n++)i=a[n].type||e.seriesDefaults.type,r=Cn({data:[]},u,d[i],{tooltip:e.tooltip},c,l[i]),a[n]._defaults=r,a[n]=Cn({},r,a[n])}function o(e){delete e.bar,delete e.column,delete e.rangeColumn,delete e.line,delete e.verticalLine,delete e.pie,delete e.donut,delete e.area,delete e.verticalArea,delete e.scatter,delete e.scatterLine,delete e.bubble,delete e.candlestick,delete e.ohlc,delete e.boxPlot,delete e.bullet,delete e.verticalBullet,delete e.polarArea,delete e.polarLine,delete e.radarArea,delete e.radarLine,delete e.waterfall}function a(e){var t,n,i,r,o=e.series,a=e.seriesColors||[];for(t=0;o.length>t;t++)n=o[t],i=a[t%a.length],n.color=n.color||i,r=n._defaults,r&&(r.color=r.color||i)}function s(e){var t;hn([Ii,Fo,Oo,Vo],function(){t=this+"Axes",e[t]&&(e[this+"Axis"]=e[t],delete e[t])})}function l(t,n){var i=(n||{}).axisDefaults||{};hn([Ii,Fo,Oo,Vo],function(){var n=this+"Axis",r=[].concat(t[n]),o=t.axisDefaults||{};r=e.map(r,function(e){var t=(e||{}).color,r=Cn({},i,i[n],o,o[n],{line:{color:t},labels:{color:t},title:{color:t}},e);return delete r[n],r}),t[n]=r.length>1?r:r[0]})}function c(e){var t,n=e.length,i=0;for(t=0;n>t;t++)i=gn.max(i,e[t].data.length);return i}function d(e){return e*e}function u(e,t){if(null===t)return t;var n=Tn(e,!0);return n(t)}function h(e,t){if(null===t)return t;var n="_date_"+e,i=t[n];return i||(i=p(Tn(e,!0)(t)),t[n]=i),i}function p(e){var t,n;if(e instanceof Date)t=e;else if(typeof e===mo)t=wn.parseDate(e)||new Date(e);else if(e)if(pn(e))for(t=[],n=0;e.length>n;n++)t.push(p(e[n]));else t=new Date(e);return t}function f(e){return pn(e)?fn(e,f):e?p(e).getTime():t}function g(e,t,n,i){var r,o=e;return e&&(e=p(e),r=e.getHours(),n===Uo?(o=new Date(e.getFullYear()+t,0,1),wn.date.adjustDST(o,0)):n===Pr?(o=new Date(e.getFullYear(),e.getMonth()+t,1),wn.date.adjustDST(o,r)):n===Lo?(o=g(m(e,i),7*t,Wi),wn.date.adjustDST(o,r)):n===Wi?(o=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),wn.date.adjustDST(o,r)):n===pr?(o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours()+t),t>0&&T(e,o)&&(o=g(e,t+1,n,i))):n===Ir?(o=new Date(e.getTime()+t*wo),o.getSeconds()>0&&o.setSeconds(0)):n===ro&&(o=new Date(e.getTime()+t*_o)),o.getMilliseconds()>0&&o.setMilliseconds(0)),o}function m(e,t){var n=e.getDay(),i=0;if(!isNaN(n))for(t=t||0;n!==t;)0===n?n=6:n--,i++;return y(e,-i*bo)}function v(e,t,n){return e=p(e),g(e,0,t,n)}function _(e,t,n){return e=p(e),e&&v(e,t,n).getTime()===e.getTime()?e:g(e,1,t,n)}function w(e,t){var n=e.getTime()-t,i=e.getTimezoneOffset()-t.getTimezoneOffset();return n-i*wo}function y(e,t){var n=e.getTimezoneOffset(),i=new Date(e.getTime()+t),r=i.getTimezoneOffset()-n;return new Date(i.getTime()+r*wo)}function b(e,t,n){var i;return i=n===Uo?t.getFullYear()-e.getFullYear():n===Pr?12*b(e,t,Uo)+t.getMonth()-e.getMonth():gn.floor(n===Wi?w(t,e)/bo:(t-e)/To[n])}function k(e){return 1===e.length?e[0]:e}function x(e){var t,n,i,r=e.length;if(r>0)for(n=0;r>n;n++)i=e[n].box,t?t.wrap(i):t=i.clone();return t||Pn()}function C(e,t){return e&&t?e.toLowerCase()===t.toLowerCase():e===t}function T(e,t){return e&&t?f(e)===f(t):e===t}function S(e,t){null!==t&&e.push(t)}function D(e,t){for(var n,i,r=0,o=t.length-1;o>=r;)if(n=gn.floor((r+o)/2),i=t[n],e>i)r=n+1;else{if(!(i>e)){for(;T(t[n-1],e);)n--;return n}o=n-1}return e>=t[n]?n:n-1}function A(e){return"number"==typeof e&&!isNaN(e)}function E(e){var t,n,i=e.length,r=0;for(t=0;i>t;t++)n=e[t],A(n)&&r++;return r}function I(e){return E(e)===e.length}function P(e){var t,n,i,r={};for(t=0;e.length>t;t++)n=e[t],i=n.options.name,i&&(r[i]=n.range());return r}function M(e,t,n,i){var r,o,a,s,l,c=!1;if(n=n||{},a=n.excluded=n.excluded||[],s=n.defaults=n.defaults||{},l=n.depth=n.depth||0,!(l>Sr)){for(r in e)!Xn(r,n.excluded)&&e.hasOwnProperty(r)&&(o=e[r],Sn(o)?(c=!0,i||(e[r]=di(o(t),s[r]))):typeof o===Wr&&(n.defaults=s[r],n.depth++,c=M(o,t,n,i)||c,n.depth--));return c}}function F(e,n){var i,r,o,a=[],s=e.groupNameTemplate,l=n.length;for(ii(s)?(wn.logToConsole("'groupNameTemplate' is obsolete and will be removed in future versions. Specify the group name template as 'series.name'"),s&&(i=Dn(s))):(i=Dn(e.name||""),0===i._slotCount&&(i=Dn(ii(e.name)?"#= group.value #: #= series.name #":"#= group.value #"))),r=0;l>r;r++)o=Cn({},e),Sn(o.color)||(o.color=t),o._groupIx=r,a.push(o),i&&(o.name=i({series:o,group:n[r]}));return a}function z(e,t){var n,i,r=[];for(t=[].concat(t),n=0;e.length>n;n++)i=e[n],Xn(i.type,t)&&r.push(i);return r}function R(t,n){if(t instanceof Date){for(var i=0,r=n.length;r>i;i++)if(T(n[i],t))return i;return-1}return e.inArray(t,n)}function B(e,t){t=t||Qn;for(var n=1,i=e.length;i>n;n++)if(t(e[n],e[n-1])<0){e.sort(t);break}return e}function H(e,t){var n,i=B(e,t),r=i.length,o=r>0?[i[0]]:[];for(t=t||Qn,n=1;r>n;n++)0!==t(i[n],ri(o))&&o.push(i[n]);return o}function L(e,t){var n=e.type,i=t instanceof Date;return!n&&i||C(n,Ui)}function N(e){var t,n,i,r,o=[],a=e.length;for(t=0;a>t;t++)for(n=e[t],r=n.length,i=0;r>i;i++)o[i]=o[i]||[],o[i].push(n[i]);return o}function O(e,t){if(e.indexOf(".")>-1)for(var n,i=e.split("."),r="";i.length>1;)r+=i.shift(),n=wn.getter(r)(t)||{},wn.setter(r)(t,n),r+="."}function V(e){var t,n,i,r=e.data,o=0;for(t=0;r.length>t;t++)n=q.current.bindPoint(e,t),i=n.valueFields.value,typeof i===mo&&(i=parseFloat(i)),A(i)&&n.fields.visible!==!1&&(o+=gn.abs(i));return o}function U(e){var t=e.overlay;return t&&t.gradient&&"none"!=t.gradient}function W(){return this}var j,q,G,$,Y,Q,K,X,Z,J,et,tt,nt,it,rt,ot,at,st,lt,ct,dt,ut,ht,pt,ft,gt,mt,vt,_t,wt,yt,bt,kt,xt,Ct,Tt,St,Dt,At,Et,It,Pt,Mt,Ft,zt,Rt,Bt,Ht,Lt,Nt,Ot,Vt,Ut,Wt,jt,qt,Gt,$t,Yt,Qt,Kt,Xt,Zt,Jt,en,tn,nn,rn,on,an,sn,ln,cn,dn,un,hn=e.each,pn=e.isArray,fn=e.map,gn=Math,mn=e.noop,vn=e.extend,_n=e.proxy,wn=window.kendo,yn=wn.Class,bn=wn.Observable,kn=wn.data.DataSource,xn=wn.ui.Widget,Cn=wn.deepExtend,Tn=wn.getter,Sn=wn.isFunction,Dn=wn.template,An=wn.dataviz,En=An.Axis,In=An.AxisLabel,Pn=An.Box2D,Mn=An.BoxElement,Fn=An.ChartElement,zn=wn.drawing.Color,Rn=An.CurveProcessor,Bn=An.FloatElement,Hn=An.Note,Ln=An.LogarithmicAxis,Nn=An.NumericAxis,On=An.Point2D,Vn=An.RootElement,Un=An.Ring,Wn=An.ShapeElement,jn=An.ShapeBuilder,qn=An.TextBox,Gn=An.Title,$n=An.alignPathToPixel,Yn=An.autoFormat,Qn=An.dateComparer,Kn=An.getSpacing,Xn=An.inArray,Zn=An.interpolateValue,Jn=An.mwDelta,ei=An.round,ti=wn.util,ni=ti.append,ii=ti.defined,ri=ti.last,oi=ti.limitValue,ai=ti.sparseArrayLimits,si=ti.sparseArrayMin,li=ti.sparseArrayMax,ci=ti.renderTemplate,di=ti.valueOrDefault,ui=An.geometry,hi=An.drawing,pi=".kendoChart",fi="above",gi="area",mi="auto",vi="fit",_i=An.AXIS_LABEL_CLICK,wi="bar",yi=6,bi=.8,ki="below",xi="#000",Ci="both",Ti="bottom",Si="boxPlot",Di="bubble",Ai="bullet",Ei="candlestick",Ii="category",Pi="center",Mi="change",Fi="circle",zi="contextmenu"+pi,Ri="color",Bi="column",Hi=An.COORD_PRECISION,Li="cross",Ni="k-",Oi="custom",Vi="dataBound",Ui="date",Wi="days",ji=An.DEFAULT_FONT,qi=An.DEFAULT_HEIGHT,Gi=An.DEFAULT_PRECISION,$i=An.DEFAULT_WIDTH,Yi=4,Qi="donut",Ki=50,Xi="drag",Zi="dragEnd",Ji="dragStart",er="errorLow",tr="errorHigh",nr="xErrorLow",ir="xErrorHigh",rr="yErrorLow",or="yErrorHigh",ar="fadeIn",sr="first",lr="from",cr="funnel",dr="glass",ur="horizontal",hr="horizontalWaterfall",pr="hours",fr=An.INITIAL_ANIMATION_DURATION,gr="insideBase",mr="insideEnd",vr="interpolate",_r="left",wr="legendItemClick",yr="legendItemHover",br="line",kr=8,xr="linear",Cr="log",Tr="max",Sr=5,Dr=Number.MAX_VALUE,Ar="min",Er=-Number.MAX_VALUE,Ir="minutes",Pr="months",Mr="mouseleave"+pi,Fr="mousemove.tracking",zr="mouseover"+pi,Rr="mouseout"+pi,Br="mousemove"+pi,Hr=20,Lr=150,Nr="DOMMouseScroll"+pi+" mousewheel"+pi,Or=An.NOTE_CLICK,Vr=An.NOTE_HOVER,Ur="noteText",Wr="object",jr="ohlc",qr="outsideEnd",Gr="pie",$r=70,Yr="plotAreaClick",Qr="pointer",Kr="rangeBar",Xr="rangeColumn",Zr="render",Jr="right",eo="roundedBevel",to="roundedGlass",no="scatter",io="scatterLine",ro="seconds",oo="selectStart",ao="select",so="selectEnd",lo="seriesClick",co="seriesHover",uo=.001,ho="step",po="smooth",fo="stderr",go="stddev",mo="string",vo="summary",_o=1e3,wo=60*_o,yo=60*wo,bo=24*yo,ko=7*bo,xo=31*bo,Co=365*bo,To={years:Co,months:xo,weeks:ko,days:bo,hours:yo,minutes:wo,seconds:_o},So="to",Do="top",Ao=150,Eo=5,Io=100,Po=100,Mo="chart-tooltip-inverse",Fo="value",zo="verticalArea",Ro="verticalBullet",Bo="verticalLine",Ho="waterfall",Lo="weeks",No="#fff",Oo="x",Vo="y",Uo="years",Wo="zero",jo=3,qo="zoomStart",Go="zoom",$o="zoomEnd",Yo=[ro,Ir,pr,Wi,Lo,Pr,Uo],Qo=[wi,Bi,jr,Ei,Si,Ai,Xr,Kr,Ho,hr],Ko={seconds:"HH:mm:ss",minutes:"HH:mm",hours:"HH:mm",days:"M/d",weeks:"M/d",months:"MMM 'yy",years:"yyyy"},Xo=xn.extend({init:function(e,n){var i,r,o=this;wn.destroy(e),xn.fn.init.call(o,e),o.element.addClass(Ni+this.options.name.toLowerCase()).css("position","relative"),n&&(r=n.dataSource,n.dataSource=t),i=Cn({},o.options,n),o._originalOptions=Cn({},i),o._initTheme(i),o._initSurface(),o.bind(o.events,o.options),o.wrapper=o.element,n&&(n.dataSource=r),o._initDataSource(n),wn.notify(o,An.ui)},_initTheme:function(n){var i,r=this,o=An.ui.themes||{},l=n.theme,c=o[l]||o[l.toLowerCase()],d=l&&c?c.chart:{},u=[],h=n.series||[];for(i=0;h.length>i;i++)u.push(e.extend({},h[i]));n.series=u,s(n),r._applyDefaults(n,d),null===n.seriesColors&&(n.seriesColors=t),r.options=Cn({},d,n),a(r.options)},_initDataSource:function(e){var t=this,n=(e||{}).dataSource;t._dataChangeHandler=_n(t._onDataChanged,t),t.dataSource=kn.create(n).bind(Mi,t._dataChangeHandler),t._bindCategories(),n&&(t._hasDataSource=!0),t._redraw(),t._attachEvents(),n&&t.options.autoBind&&t.dataSource.fetch()},setDataSource:function(e){var t=this;t.dataSource.unbind(Mi,t._dataChangeHandler),t.dataSource=e=kn.create(e),t._hasDataSource=!0,t._hasData=!1,e.bind(Mi,t._dataChangeHandler),t.options.autoBind&&e.fetch()},events:[Vi,lo,co,_i,wr,yr,Yr,Ji,Xi,Zi,qo,Go,$o,oo,ao,so,Or,Vr,Zr],items:function(){return e()},options:{name:"Chart",renderAs:"",theme:"default",chartArea:{},legend:{visible:!0,labels:{}},categoryAxis:{},autoBind:!0,seriesDefaults:{type:Bi,data:[],highlight:{visible:!0},labels:{},negativeValues:{visible:!1}},series:[],seriesColors:null,tooltip:{visible:!1},transitions:!0,valueAxis:{},plotArea:{},title:{},xAxis:{},yAxis:{},panes:[{}]},refresh:function(){var e=this;e._applyDefaults(e.options),a(e.options),e._bindSeries(),e._bindCategories(),e.trigger(Vi),e._redraw()},getSize:function(){return wn.dimensions(this.element)},_resize:function(){var e=this.options.transitions;this.options.transitions=!1,this._redraw(),this.options.transitions=e},redraw:function(e){var t,n,i=this;i._applyDefaults(i.options),a(i.options),e?(n=i._model._plotArea,t=n.findPane(e),n.redraw(t)):i._redraw()},_initSurface:function(){var e,t=this.surface,n=this._surfaceWrap();t&&t.options.type===this.options.renderAs?this.surface.clear():(t&&t.destroy(),this.surface=hi.Surface.create(n,{type:this.options.renderAs})),e=this.options.chartArea,e.width&&n.css("width",e.width),e.height&&n.css("height",e.height)},_surfaceWrap:function(){return this.element},_redraw:function(){var e,t=this,n=t._getModel();t._destroyView(),t._model=n,t._plotArea=n._plotArea,n.renderVisual(),this.options.transitions!==!1&&n.traverse(function(e){e.animation&&e.animation.setup()}),t._initSurface(),t.surface.draw(n.visual),this.options.transitions!==!1&&n.traverse(function(e){e.animation&&e.animation.play()}),t._tooltip=t._createTooltip(),t._highlight=new nn(e),t._setupSelection(),t._hasDataSource&&!t._hasData&&t.options.autoBind||t.trigger(Zr)},exportVisual:function(){var e=this._getModel();return e.renderVisual(),e.visual},_sharedTooltip:function(){var e=this,t=e.options;return e._plotArea instanceof Qt&&t.tooltip.shared},_createTooltip:function(){var e,t=this,n=t.options,i=t.element;return e=t._sharedTooltip()?new an(i,t._plotArea,n.tooltip):new on(i,n.tooltip)},_applyDefaults:function(e,t){l(e,t),r(e,t)},_getModel:function(){var e,t=this,n=t.options,i=new Vn(t._modelOptions());return i.chart=t,Gn.buildTitle(n.title,i),e=i._plotArea=t._createPlotArea(),n.legend.visible&&i.append(new Y(e.options.legend)),i.append(e),i.reflow(),i},_modelOptions:function(){var e=this,t=e.options,n=e.element,i=gn.floor(n.height()),r=gn.floor(n.width());return e._size=null,Cn({width:r||$i,height:i||qi,transitions:t.transitions},t.chartArea)},_createPlotArea:function(e){var t=this,n=t.options;return j.current.create(e?[]:n.series,n)},_setupSelection:function(){var e,t,n,i,r,o,a=this,s=a._plotArea,l=s.axes,c=a._selections=[];for(a._selectStartHandler||(a._selectStartHandler=_n(a._selectStart,a),a._selectHandler=_n(a._select,a),a._selectEndHandler=_n(a._selectEnd,a)),t=0;l.length>t;t++)n=l[t],o=n.options,n instanceof Q&&o.select&&!o.vertical&&(i=0,r=o.categories.length-1,n instanceof K&&(i=o.categories[i],r=o.categories[r]),o.justified||(n instanceof K?r=g(r,1,o.baseUnit,o.weekStartDay):r++),e=new dn(a,n,Cn({min:i,max:r},o.select)),e.bind(oo,a._selectStartHandler),e.bind(ao,a._selectHandler),e.bind(so,a._selectEndHandler),c.push(e))},_selectStart:function(e){return this.trigger(oo,e)},_select:function(e){return this.trigger(ao,e)},_selectEnd:function(e){return this.trigger(so,e)},_attachEvents:function(){var e=this,t=e.element;t.on(zi,_n(e._click,e)),t.on(zr,_n(e._mouseover,e)),t.on(Rr,_n(e._mouseout,e)),t.on(Nr,_n(e._mousewheel,e)),t.on(Mr,_n(e._mouseleave,e)),e._mousemove=wn.throttle(_n(e._mousemove,e),Hr),e._shouldAttachMouseMove()&&t.on(Br,e._mousemove),wn.UserEvents&&(e._userEvents=new wn.UserEvents(t,{global:!0,filter:":not(.k-selector)",multiTouch:!1,tap:_n(e._tap,e),start:_n(e._start,e),move:_n(e._move,e),end:_n(e._end,e)}))},_mouseout:function(e){var t=this,n=t._getChartElement(e);n&&n.leave&&n.leave(t,e)},_start:function(e){var t=this,n=t._events;ii(n[Ji]||n[Xi]||n[Zi])&&t._startNavigation(e,Ji)},_move:function(e){var t,n,i,r,o,a,s=this,l=s._navState,c={};if(l){for(e.preventDefault(),t=l.axes,n=0;t.length>n;n++)i=t[n],r=i.options.name,r&&(o=i.options.vertical?e.y:e.x,a=o.startLocation-o.location,0!==a&&(c[i.options.name]=i.translateRange(a)));l.axisRanges=c,s.trigger(Xi,{axisRanges:c,originalEvent:e})}},_end:function(e){this._endNavigation(e,Zi)},_mousewheel:function(e){var t,n,i,r,o,a,s=this,l=e.originalEvent,c=Jn(e),d=s._navState,u={};if(d||(t=s._startNavigation(l,qo),t||(d=s._navState)),d){for(n=d.totalDelta||c,d.totalDelta=n+c,i=s._navState.axes,r=0;i.length>r;r++)o=i[r],a=o.options.name,a&&(u[a]=o.scaleRange(-n));s.trigger(Go,{delta:c,axisRanges:u,originalEvent:e}),s._mwTimeout&&clearTimeout(s._mwTimeout),s._mwTimeout=setTimeout(function(){s._endNavigation(e,$o)},Lr)}},_startNavigation:function(e,t){var n,i,r,o=this,a=o._eventCoordinates(e),s=o._model._plotArea,l=s.findPointPane(a),c=s.axes.slice(0),d=!1;if(l){for(n=0;c.length>n;n++)if(i=c[n],i.box.containsPoint(a)){d=!0;break}!d&&s.backgroundBox().containsPoint(a)&&(r=o.trigger(t,{axisRanges:P(c),originalEvent:e}),r?o._userEvents.cancel():(o._suppressHover=!0,o._unsetActivePoint(),o._navState={pane:l,axes:c}))}},_endNavigation:function(e,t){var n=this;n._navState&&(n.trigger(t,{axisRanges:n._navState.axisRanges,originalEvent:e}),n._suppressHover=!1,n._navState=null)},_getChartElement:function(e,n){var i,r=this.surface.eventTarget(e);if(r){for(;r&&!i;)i=r.chartElement,r=r.parent;return i?(i.aliasFor&&(i=i.aliasFor(e,this._eventCoordinates(e))),n&&(i=i.closest(n)),i):t}},_eventCoordinates:function(e){var t=this,n=ii((e.x||{}).client),i=n?e.x.client:e.clientX,r=n?e.y.client:e.clientY;return t._toModelCoordinates(i,r)},_toModelCoordinates:function(t,n){var i=this.element,r=i.offset(),o=parseInt(i.css("paddingLeft"),10),a=parseInt(i.css("paddingTop"),10),s=e(window);return new On(t-r.left-o+s.scrollLeft(),n-r.top-a+s.scrollTop())},_tap:function(e){var t=this,n=t._getChartElement(e);t._activePoint===n?t._click(e):(t._startHover(e)||t._unsetActivePoint(),t._click(e))},_click:function(e){for(var t=this,n=t._getChartElement(e);n;)n.click&&n.click(t,e),n=n.parent},_startHover:function(e){var n,i=this,r=i._getChartElement(e),o=i._tooltip,a=i._highlight,s=i.options.tooltip;if(!i._suppressHover&&a&&!a.isHighlighted(r)&&!i._sharedTooltip())return n=i._getChartElement(e,function(e){return e.hover}),n&&!n.hover(i,e)?(i._activePoint=n,s=Cn({},s,n.options.tooltip),s.visible&&o.show(n),a.show(n),!0):t},_mouseover:function(t){var n=this;n._startHover(t)&&e(document).on(Fr,_n(n._mouseMoveTracking,n))},_mouseMoveTracking:function(t){var n,i,r=this,o=r.options,a=r._tooltip,s=r._highlight,l=r._eventCoordinates(t),c=r._activePoint;r._plotArea.box.containsPoint(l)?c&&c.tooltipTracking&&c.series&&c.parent.getNearestPoint&&(i=c.parent.getNearestPoint(l.x,l.y,c.seriesIx),i&&i!=c&&(i.hover(r,t),r._activePoint=i,n=Cn({},o.tooltip,c.options.tooltip),n.visible&&a.show(i),s.show(i))):(e(document).off(Fr),r._unsetActivePoint())},_mousemove:function(e){var t=this._eventCoordinates(e);this._trackCrosshairs(t),this._sharedTooltip()&&this._trackSharedTooltip(t,e)},_trackCrosshairs:function(e){var t,n,i=this._plotArea.crosshairs;for(t=0;i.length>t;t++)n=i[t],n.box.containsPoint(e)?n.showAt(e):n.hide()},_trackSharedTooltip:function(t,n){var i,r,o,a,s=this,l=s.options,c=s._plotArea,d=c.categoryAxis,u=s._tooltip,h=l.tooltip,p=s._highlight;c.box.containsPoint(t)&&(i=d.pointCategoryIndex(t),i!==s._tooltipCategoryIx&&(r=c.pointsByCategoryIndex(i),o=e.map(r,function(e){return e.eventArgs(n)}),a=o[0]||{},a.categoryPoints=o,r.length>0&&!this.trigger(co,a)?(h.visible&&u.showAt(r,t),p.show(r)):u.hide(),s._tooltipCategoryIx=i))},_mouseleave:function(t){var n,i=this,r=i._plotArea,o=r.crosshairs,a=i._tooltip,s=i._highlight,l=t.relatedTarget;if(!l||!e(l).closest(a.element).length){for(i._mousemove.cancel(),n=0;o.length>n;n++)o[n].hide();s.hide(),setTimeout(_n(a.hide,a),Po),i._tooltipCategoryIx=null}},_unsetActivePoint:function(){var e=this,t=e._tooltip,n=e._highlight;e._activePoint=null,t&&t.hide(),n&&n.hide()},_onDataChanged:function(){var e,t,n=this,i=n.options,r=n._sourceSeries||i.series,o=r.length,s=n.dataSource.view(),l=(n.dataSource.group()||[]).length>0,c=[];for(e=0;o>e;e++)t=r[e],n._isBindable(t)&&l?ni(c,F(t,s)):c.push(t||[]);n._sourceSeries=r,i.series=c,a(n.options),n._bindSeries(),n._bindCategories(),n._hasData=!0,n._deferRedraw()},_deferRedraw:function(){var e=this;wn.support.vml?(e._clearRedrawTimeout(),e._redrawTimeout=setTimeout(function(){e.surface&&(e.trigger(Vi),e._redraw())},0)):(e.trigger(Vi),e._redraw())},_clearRedrawTimeout:function(){this._redrawTimeout&&(clearInterval(this._redrawTimeout),this._redrawTimeout=null)},_bindSeries:function(){var e,t,n,i,r=this,o=r.dataSource.view(),a=r.options.series,s=a.length;for(e=0;s>e;e++)t=a[e],r._isBindable(t)&&(n=t._groupIx,i=ii(n)?(o[n]||{}).items:o,t.autoBind!==!1&&(t.data=i))},_bindCategories:function(){var e,t,n=this,i=n.dataSource.view()||[],r=(n.dataSource.group()||[]).length>0,o=i,a=n.options,s=[].concat(a.categoryAxis);for(r&&i.length&&(o=i[0].items),e=0;s.length>e;e++)t=s[e],t.autoBind!==!1&&n._bindCategoryAxis(t,o,e)},_bindCategoryAxis:function(e,t,n){var i,r,o,a=(t||[]).length;if(e.field)for(e.categories=[],i=0;a>i;i++)o=t[i],r=u(e.field,o),0===i?(e.categories=[r],e.dataItems=[o]):(e.categories.push(r),e.dataItems.push(o));else this._bindCategoryAxisFromSeries(e,n)},_bindCategoryAxisFromSeries:function(e,t){var n,i,r,o,a,s,l,c,d,p,f,g=this,m=[],v=g.options.series,_=v.length,w={};for(i=0;_>i;i++)if(r=v[i],o=r.categoryAxis===e.name||!r.categoryAxis&&0===t,a=r.data,l=a.length,r.categoryField&&o&&l>0)for(f=L(e,u(r.categoryField,a[0])),p=f?h:u,s=0;l>s;s++)c=a[s],d=p(r.categoryField,c),(f||!w[d])&&(m.push([d,c]),f||(w[d]=!0));m.length>0&&(f&&(m=H(m,function(e,t){return Qn(e[0],t[0])})),n=N(m),e.categories=n[0],e.dataItems=n[1])},_isBindable:function(e){var t,n,i=q.current.valueFields(e),r=!0;for(n=0;i.length>n;n++)if(t=i[n],t===Fo?t="field":t+="Field",!ii(e[t])){r=!1;break}return r},_legendItemClick:function(e,t){var n,i,r,o=this,a=o._plotArea,s=(a.srcSeries||a.series)[e],l=(o._sourceSeries||[])[e]||s;Xn(s.type,[Gr,Qi,cr])?(r=l.data[t],i=ii(r.visible)?!r.visible:!1,r.visible=i):(i=!l.visible,l.visible=i,s.visible=i),o.options.transitions&&(o.options.transitions=!1,n=!0),o.redraw(),n&&(o.options.transitions=!0)},_legendItemHover:function(e,t){var n,i,r=this,o=r._plotArea,a=r._highlight,s=(o.srcSeries||o.series)[e];n=Xn(s.type,[Gr,Qi,cr])?t:e,i=o.pointsBySeriesIndex(n),a.show(i)},_shouldAttachMouseMove:function(){var e=this;return e._plotArea.crosshairs.length||e._tooltip&&e._sharedTooltip()},setOptions:function(n){var i=this,r=n.dataSource;n.dataSource=t,i._originalOptions=Cn(i._originalOptions,n),i.options=Cn({},i._originalOptions),i._sourceSeries=null,e(document).off(Br),xn.fn._setEvents.call(i,n),i._initTheme(i.options),r&&i.setDataSource(r),i._shouldAttachMouseMove()&&i.element.on(Br,i._mousemove),i._hasDataSource?i.refresh():i.redraw()},destroy:function(){var t=this,n=t.dataSource;t.element.off(pi),n.unbind(Mi,t._dataChangeHandler),e(document).off(Fr),t._userEvents&&t._userEvents.destroy(),t._destroyView(),t.surface.destroy(),t.surface=null,t._clearRedrawTimeout(),xn.fn.destroy.call(t)},_destroyView:function(){var e=this,t=e._model,n=e._selections;if(t&&(t.destroy(),e._model=null),n)for(;n.length>0;)n.shift().destroy();e._unsetActivePoint(),e._tooltip&&e._tooltip.destroy(),e._highlight&&e._highlight.destroy()}});An.ExportMixin.extend(Xo.fn),wn.PDFMixin&&wn.PDFMixin.extend(Xo.fn),j=yn.extend({init:function(){this._registry=[]},register:function(e,t){this._registry.push({type:e,seriesTypes:t})},create:function(e,t){var n,i,r,o=this._registry,a=o[0];for(n=0;o.length>n;n++)if(i=o[n],r=z(e,i.seriesTypes),r.length>0){a=i;break}return new a.type(r,t)}}),j.current=new j,q=yn.extend({init:function(){this._valueFields={},this._otherFields={},this._nullValue={},this._undefinedValue={}},register:function(e,n,i){var r,o,a=this;for(n=n||[Fo],r=0;e.length>r;r++)o=e[r],a._valueFields[o]=n,a._otherFields[o]=i,a._nullValue[o]=a._makeValue(n,null),a._undefinedValue[o]=a._makeValue(n,t)},canonicalFields:function(e){return this.valueFields(e).concat(this.otherFields(e))},valueFields:function(e){return this._valueFields[e.type]||[Fo]},otherFields:function(e){return this._otherFields[e.type]||[Fo]},bindPoint:function(e,t){var n,i,r,o,a,s=this,l=e.data,c=l[t],d={valueFields:{value:c}},u=s.valueFields(e),h=s._otherFields[e.type];return null===c?a=s._nullValue[e.type]:ii(c)?pn(c)?(i=c.slice(u.length),a=s._bindFromArray(c,u),n=s._bindFromArray(i,h)):typeof c===Wr&&(r=s.sourceFields(e,u),o=s.sourceFields(e,h),a=s._bindFromObject(c,u,r),n=s._bindFromObject(c,h,o)):a=s._undefinedValue[e.type],ii(a)&&(1===u.length?d.valueFields.value=a[u[0]]:d.valueFields=a),d.fields=n||{},d},_makeValue:function(e,t){var n,i,r={},o=e.length;for(n=0;o>n;n++)i=e[n],r[i]=t;return r},_bindFromArray:function(e,t){var n,i,r={};if(t)for(i=gn.min(t.length,e.length),n=0;i>n;n++)r[t[n]]=e[n];return r},_bindFromObject:function(e,t,n){var i,r,o,a,s={};if(t)for(r=t.length,n=n||t,i=0;r>i;i++)o=t[i],a=n[i],s[o]=u(a,e);return s},sourceFields:function(e,t){var n,i,r,o,a;if(t)for(i=t.length,o=[],n=0;i>n;n++)r=t[n],a=r===Fo?"field":r+"Field",o.push(e[a]||r);return o}}),q.current=new q,G=Fn.extend({init:function(e,t){var n=this;Fn.fn.init.call(n,t),this.textBox=new qn(e,n.options),n.append(this.textBox)},options:{position:qr,margin:Kn(3),padding:Kn(4),color:xi,background:"",border:{width:1,color:""},aboveAxis:!0,vertical:!1,animation:{type:ar,delay:fr},zIndex:2},createVisual:function(){this.textBox.options.noclip=this.options.noclip},reflow:function(e){var t=this,n=t.options,i=n.vertical,r=n.aboveAxis,o=t.children[0],a=o.box,s=o.options.padding;o.options.align=i?Pi:_r,o.options.vAlign=i?Do:Pi,n.position==mr?i?(o.options.vAlign=Do,!r&&a.height()<e.height()&&(o.options.vAlign=Ti)):o.options.align=r?Jr:_r:n.position==Pi?(o.options.vAlign=Pi,o.options.align=Pi):n.position==gr?i?o.options.vAlign=r?Ti:Do:o.options.align=r?_r:Jr:n.position==qr&&(i?e=r?new Pn(e.x1,e.y1-a.height(),e.x2,e.y1):new Pn(e.x1,e.y2,e.x2,e.y2+a.height()):(o.options.align=Pi,e=r?new Pn(e.x2+a.width(),e.y1,e.x2,e.y2):new Pn(e.x1-a.width(),e.y1,e.x1,e.y2))),n.rotation||(i?s.left=s.right=(e.width()-o.contentBox.width())/2:s.top=s.bottom=(e.height()-o.contentBox.height())/2),o.reflow(e)},alignToClipBox:function(e){var t,n=this,i=n.options.vertical,r=i?Vo:Oo,o=r+"1",a=r+"2",s=n.children[0],l=n.parent.box;(e[o]>l[o]||l[a]>e[a])&&(t=s.paddingBox.clone(),t[o]=gn.max(l[o],e[o]),t[a]=gn.min(l[a],e[a]),this.reflow(t))}}),$=Mn.extend({init:function(e){var t=this;Mn.fn.init.call(t,e),t.createContainer(),t.createMarker(),t.createLabel()},createContainer:function(){var e=this;e.container=new Bn({vertical:!1,wrap:!1,align:Pi}),e.append(e.container)},createMarker:function(){var e=this,t=e.options,n=t.markerColor,i=t.markers,r=Cn({},i,{background:n,border:{color:n}});e.container.append(new Wn(r))},createLabel:function(){var e=this,t=e.options,n=Cn({},t.labels);e.container.append(new qn(t.text,n))},renderComplete:function(){var e,t;Fn.fn.renderComplete.call(this),e=this.options.cursor||{},t=this._itemOverlay=hi.Path.fromRect(this.container.box.toRect(),{fill:{color:No,opacity:0},stroke:null,cursor:e.style}),this.appendVisual(t)},click:function(e,t){var n=this.eventArgs(t);e.trigger(wr,n)||(t.preventDefault(),e._legendItemClick(n.seriesIndex,n.pointIndex))},hover:function(e,t){var n=this.eventArgs(t);return e.trigger(yr,n)||(t.preventDefault(),e._legendItemHover(n.seriesIndex,n.pointIndex)),!0},leave:function(e){e._unsetActivePoint()},eventArgs:function(t){var n=this.options;return{element:e(t.target),text:n.text,series:n.series,seriesIndex:n.series.index,pointIndex:n.pointIndex}},createVisual:mn}),Y=Fn.extend({init:function(e){var t=this;Fn.fn.init.call(t,e),Xn(t.options.position,[Do,Jr,Ti,_r,Oi])||(t.options.position=Jr),t.createContainer(),t.createItems()},options:{position:Jr,items:[],labels:{margin:{left:6}},offsetX:0,offsetY:0,margin:Kn(5),padding:Kn(5),border:{color:xi,width:0},item:{cursor:{style:Qr}},spacing:6,background:"",zIndex:1,markers:{border:{width:1},width:7,height:7,type:"rect",align:_r,vAlign:Pi}},createContainer:function(){var e=this,t=e.options,n=t.position,i=n,r=Pi;n==Oi?i=_r:Xn(n,[Do,Ti])&&(i=Pi,r=n),e.container=new Mn({margin:t.margin,padding:t.padding,background:t.background,border:t.border,vAlign:r,align:i,zIndex:t.zIndex,shrinkToFit:!0}),e.append(e.container)},createItems:function(){var e,t,n,i=this,r=i.options,o=r.items,a=o.length,s=i.isVertical();for(e=new Bn({vertical:s,spacing:r.spacing}),r.reverse&&(o=o.slice(0).reverse()),t=0;a>t;t++)n=o[t],e.append(new $(Cn({},{markers:r.markers,labels:r.labels},r.item,n)));i.container.append(e)},isVertical:function(){var e=this,t=e.options,n=t.position,i=Xn(n,[_r,Jr])||n==Oi&&t.orientation!=ur;return i},hasItems:function(){return this.container.children[0].children.length>0},reflow:function(e){var n=this,i=n.options,r=n.container,o=n.isVertical(),a=e.clone();return n.hasItems()?(o&&(a.y1=0),i.position===Oi?(n.containerCustomReflow(a),n.box=e.clone()):(r.reflow(a),n.containerReflow(e)),t):(n.box=e.clone(),t)},containerReflow:function(e){var t=this,n=t.options,i=n.position==Do||n.position==Ti?Oo:Vo,r=t.container.box,o=r.clone();(n.offsetX||n.offsetY)&&(r.translate(n.offsetX,n.offsetY),t.container.reflow(r)),o[i+1]=e[i+1],o[i+2]=e[i+2],t.box=o},containerCustomReflow:function(e){var t=this,n=t.options,i=n.offsetX,r=n.offsetY,o=t.container,a=n.width,s=n.height,l=t.isVertical(),c=e.clone();l&&s?c.y2=c.y1+s:!l&&a&&(c.x2=c.x1+a),o.reflow(c),c=o.box,o.reflow(Pn(i,r,i+c.width(),r+c.height()))},renderVisual:function(){this.hasItems()&&Fn.fn.renderVisual.call(this)}}),Q=En.extend({init:function(e){var t=this;En.fn.init.call(t,e),e=t.options,e.categories=e.categories.slice(0),t._ticks={}},options:{type:Ii,categories:[],vertical:!1,majorGridLines:{visible:!1,width:1,color:xi},labels:{zIndex:1},justified:!1},range:function(){return{min:0,max:this.options.categories.length}},getTickPositions:function(e){var t,n=this,i=n.options,r=i.vertical,o=i.justified,a=n.lineBox(),s=r?a.height():a.width(),l=e-(o?1:0),c=s/l,d=r?Vo:Oo,u=a[d+1],h=[];for(t=0;e>t;t++)h.push(ei(u,Hi)),u+=c;return o||h.push(a[d+2]),i.reverse?h.reverse():h},getMajorTickPositions:function(){return this.getTicks().majorTicks},getMinorTickPositions:function(){return this.getTicks().minorTicks},getTicks:function(){var e,t=this,n=t._ticks,i=t.options,r=i.categories.length,o=i.reverse,a=i.justified,s=t.lineBox();return e=s.getHash()+r+o+a,n._hash!==e&&(n._hash=e,n.majorTicks=t.getTickPositions(r),n.minorTicks=t.getTickPositions(2*r)),n},getSlot:function(e,t){var n,i,r,o=this,a=o.options,s=o.getTicks().majorTicks,l=a.reverse,c=a.justified,d=a.vertical?Vo:Oo,u=o.lineBox(),h=u[d+(l?2:1)],p=u[d+(l?1:2)],f=u.clone(),g=gn.max(1,s.length-(c?0:1)),m=!ii(t);return e=di(e,0),t=di(t,e),e=oi(e,0,g),t=oi(t-1,e,g),t=gn.max(e,t),n=0===e?h:s[e]||p,i=c?n:s[t],r=t-e,(r>0||e===t)&&(i=s[t+1]||p),m&&c&&(e===g?n=i:i=n),f[d+1]=l?i:n,f[d+2]=l?n:i,f},pointCategoryIndex:function(e){var t,n,i,r,o=this,a=o.options,s=a.reverse,l=a.vertical,c=l?Vo:Oo,d=o.lineBox(),u=d[c+1],h=d[c+2],p=e[c],f=o.getMajorTickPositions(),g=Dr;if(u>p||p>h)return null;for(i=0;f.length>i;i++)if(t=f[i],n=f[i+1],ii(n)||(n=s?u:h),s&&(t=n,n=f[i]),a.justified){if(p===n){r=gn.max(0,l?f.length-i-1:i+1);break}gn.abs(p-t)<g&&(g=p-t,r=i)}else if(p>=t&&n>=p){r=i;break}return r},getCategory:function(e){var t=this.pointCategoryIndex(e);return null===t?null:this.options.categories[t]},categoryIndex:function(e){return R(e,this.options.categories)},translateRange:function(e){var t=this,n=t.options,i=t.lineBox(),r=n.vertical?i.height():i.width(),o=n.categories.length,a=r/o,s=ei(e/a,Gi);return{min:s,max:o+s}},scaleRange:function(e){var t=this,n=t.options,i=n.categories.length,r=e*i;return{min:-r,max:i+r}},labelsCount:function(){return this.options.categories.length},createAxisLabel:function(e,t){var n=this,i=n.options,r=i.dataItems?i.dataItems[e]:null,o=di(i.categories[e],""),a=n.axisLabelText(o,r,t);return new In(o,a,e,r,t)},shouldRenderNote:function(e){var t=this.options.categories;return t.length&&t.length>e&&e>=0}}),K=Q.extend({init:function(e){var t,n,i=this;e=e||{},e=Cn({roundToBaseUnit:!0},e,{categories:p(e.categories),min:p(e.min),max:p(e.max)}),e.categories&&e.categories.length>0?(t=(e.baseUnit||"").toLowerCase(),n=t!==vi&&!Xn(t,Yo),n&&(e.baseUnit=i.defaultBaseUnit(e)),(t===vi||e.baseUnitStep===mi)&&i.autoBaseUnit(e),i.groupCategories(e)):e.baseUnit=e.baseUnit||Wi,Q.fn.init.call(i,e)},options:{type:Ui,labels:{dateFormats:Ko},autoBaseUnitSteps:{seconds:[1,2,5,15,30],minutes:[1,2,5,15,30],hours:[1,2,3],days:[1,2,3],weeks:[1,2],months:[1,2,3,6],years:[1,2,3,5,10,25,50]},maxDateGroups:10},shouldRenderNote:function(e){var t=this,n=t.range(),i=t.options.categories||[];return Qn(e,n.min)>=0&&Qn(e,n.max)<=0&&i.length},parseNoteValue:function(e){return p(e)},translateRange:function(e){var t,n,i=this,r=i.options,o=r.baseUnit,a=r.weekStartDay,s=i.lineBox(),l=r.vertical?s.height():s.width(),c=i.range(),d=l/(c.max-c.min),u=ei(e/d,Gi);return c.min&&c.max&&(t=y(r.min||c.min,u),n=y(r.max||c.max,u),c={min:g(t,0,o,a),max:g(n,0,o,a)}),c},scaleRange:function(e){var t,n=this,i=gn.abs(e),r=n.range(),o=r.min,a=r.max;if(r.min&&r.max){for(;i--;)r=w(o,a),t=gn.round(.1*r),0>e?(o=y(o,t),a=y(a,-t)):(o=y(o,-t),a=y(a,t));r={min:o,max:a}}return r},defaultBaseUnit:function(e){var t,n,i,r,o,a=e.categories,s=ii(a)?a.length:0,l=Dr;for(t=0;s>t;t++)n=a[t],n&&r&&(i=w(n,r),i>0&&(l=gn.min(l,i),o=l>=Co?Uo:l>=xo-3*bo?Pr:l>=ko?Lo:l>=bo?Wi:l>=yo?pr:l>=wo?Ir:ro)),r=n;return o||Wi},_categoryRange:function(e){var t=e._range;
return t||(t=e._range=ai(e)),t},range:function(e){var t,n,i,r,o,a,s,l,c;return e=e||this.options,t=e.categories,n=e.baseUnit===vi,i=n?Yo[0]:e.baseUnit,r=e.baseUnitStep||1,o=f(e.min),a=f(e.max),s=this._categoryRange(t),l=f(s.min),c=f(s.max),e.roundToBaseUnit?{min:g(o||l,0,i,e.weekStartDay),max:g(a||c,r,i,e.weekStartDay)}:{min:p(o||l),max:p(a||this._srcMaxDate||c)}},autoBaseUnit:function(e){for(var t,n,i,r=this,o=r.range(Cn({},e,{baseUnitStep:1})),a=e.baseUnit===vi,s=0,l=a?Yo[s++]:e.baseUnit,c=o.max-o.min,d=c/To[l],u=d,h=e.maxDateGroups||r.options.maxDateGroups,p=Cn({},r.options.autoBaseUnitSteps,e.autoBaseUnitSteps);!n||d>h;)if(t=t||p[l].slice(0),i=t.shift())n=i,d=u/n;else{if(l===ri(Yo)){n=gn.ceil(u/h);break}if(!a){d>h&&(n=gn.ceil(u/h));break}l=Yo[s++]||ri(Yo),u=c/To[l],t=null}e.baseUnitStep=n,e.baseUnit=l},_timeScale:function(){var e,t,n,i=this,r=i.range(),o=i.options,a=i.lineBox(),s=o.vertical,l=s?a.height():a.width();return o.justified&&o._collapse!==!1?(t=this._categoryRange(o.categories),n=f(t.max),e=p(n)-r.min):e=r.max-r.min,l/e},getTickPositions:function(e){var t,n,i,r,o,a,s,l,c,d,u,h,p,f,g,m=this,v=m.options,_=v.categories,w=[];if(v.roundToBaseUnit||0===_.length)w=Q.fn.getTickPositions.call(m,e);else{for(t=v.vertical,n=v.reverse,i=m.lineBox(),r=_[0].getTime(),o=di(v._collapse,v.justified),a=_.length-(o?1:0),s=m._timeScale(),l=(t?-1:1)*(n?-1:1),c=1===l?1:2,d=1===l?2:1,u=i[(t?Vo:Oo)+c],h=i[(t?Vo:Oo)+d],p=u,f=0;a>f;f++)g=_[f]-r,p=u+g*s*l,w.push(ei(p,Hi));ri(w)!==h&&w.push(h)}return w},groupCategories:function(e){var t,n,i=this,r=e.categories,o=p(li(r)),a=e.baseUnit,s=e.baseUnitStep||1,l=i.range(e),c=l.max,d=[];for(t=l.min;c>t&&(d.push(t),n=g(t,s,a,e.weekStartDay),!(n>o)||e.max);t=n);e.roundToBaseUnit||T(ri(d),c)||(n>c&&e._collapse!==!1?this._srcMaxDate=c:d.push(c)),e.srcCategories=r,e.categories=d},createAxisLabel:function(e,n){var i,r,o=this.options,a=o.dataItems?o.dataItems[e]:null,s=o.categories[e],l=o.baseUnit,c=!0,d=n.dateFormats[l];return o.justified?(i=v(s,l,o.weekStartDay),c=T(i,s)):o.roundToBaseUnit||(c=!T(this.range().max,s)),c&&(n.format=n.format||d,r=this.axisLabelText(s,a,n))?new In(s,r,e,a,n):t},categoryIndex:function(e,t){var n,i,r=this,o=r.options,a=o.categories;return e=p(e),t=t||r.range(),n=o.roundToBaseUnit&&T(t.max,e),e&&(e>t.max||n)?a.length:!e||t.min>e?-1:i=D(e,a)},getSlot:function(e,t){var n=this;return typeof e===Wr&&(e=n.categoryIndex(e)),typeof t===Wr&&(t=n.categoryIndex(t)),Q.fn.getSlot.call(n,e,t)}}),X=En.extend({init:function(e,t,n){var i=this;n=n||{},Cn(n,{min:p(n.min),max:p(n.max),axisCrossingValue:p(n.axisCrossingValues||n.axisCrossingValue)}),n=i.applyDefaults(p(e),p(t),n),En.fn.init.call(i,n)},options:{type:Ui,majorGridLines:{visible:!0,width:1,color:xi},labels:{dateFormats:Ko}},applyDefaults:function(e,n,i){var r=this,o=i.min||e,a=i.max||n,s=i.baseUnit||r.timeUnits(a-o),l=To[s],c=v(f(o)-1,s)||p(a),d=_(f(a)+1,s),u=i.majorUnit?i.majorUnit:t,h=u||An.ceil(An.autoMajorUnit(c.getTime(),d.getTime()),l)/l,m=b(c,d,s),w=An.ceil(m,h),y=w-m,k=gn.floor(y/2),x=y-k;return i.baseUnit||delete i.baseUnit,i.baseUnit=i.baseUnit||s,i.min=i.min||g(c,-k,s),i.max=i.max||g(d,x,s),i.minorUnit=i.minorUnit||h/5,i.majorUnit=h,i},range:function(){var e=this.options;return{min:e.min,max:e.max}},getDivisions:function(e){var t=this.options;return gn.floor(b(t.min,t.max,t.baseUnit)/e+1)},getTickPositions:function(e){var t,n,i,r=this.options,o=r.vertical,a=r.reverse,s=this.lineBox(),l=(o?-1:1)*(a?-1:1),c=1===l?1:2,d=s[(o?Vo:Oo)+c],u=this.getDivisions(e),h=r.max-r.min,p=o?s.height():s.width(),f=p/h,m=[d];for(t=1;u>t;t++)n=g(r.min,t*r.majorUnit,r.baseUnit),i=d+(n-r.min)*f*l,m.push(ei(i,Hi));return m},getMajorTickPositions:function(){var e=this;return e.getTickPositions(e.options.majorUnit)},getMinorTickPositions:function(){var e=this;return e.getTickPositions(e.options.minorUnit)},getSlot:function(e,t,n){return Nn.fn.getSlot.call(this,p(e),p(t),n)},getValue:function(e){var t=Nn.fn.getValue.call(this,e);return null!==t?p(t):null},labelsCount:function(){return this.getDivisions(this.options.majorUnit)},createAxisLabel:function(e,t){var n,i,r=this.options,o=e*r.majorUnit,a=r.min;return o>0&&(a=g(a,o,r.baseUnit)),n=t.dateFormats[r.baseUnit],t.format=t.format||n,i=this.axisLabelText(a,null,t),new In(a,i,e,null,t)},timeUnits:function(e){var t=pr;return e>=Co?t=Uo:e>=xo?t=Pr:e>=ko?t=Lo:e>=bo&&(t=Wi),t},translateRange:function(e){var t=this,n=t.options,i=n.baseUnit,r=n.weekStartDay,o=t.lineBox(),a=n.vertical?o.height():o.width(),s=t.range(),l=a/(s.max-s.min),c=ei(e/l,Gi),d=y(n.min,c),u=y(n.max,c);return{min:g(d,0,i,r),max:g(u,0,i,r)}},scaleRange:function(e){for(var t,n,i=this,r=i.options,o=gn.abs(e),a=r.min,s=r.max;o--;)t=w(a,s),n=gn.round(.1*t),0>e?(a=y(a,n),s=y(s,-n)):(a=y(a,-n),s=y(s,n));return{min:a,max:s}},shouldRenderNote:function(e){var t=this.range();return Qn(e,t.min)>=0&&Qn(e,t.max)<=0}}),Z={extend:function(e){e.createVisual=this.createVisual,e.appendVisual=this.appendVisual},createVisual:mn,appendVisual:function(e){this.parent.appendVisual(e)}},J=Fn.extend({options:{vertical:!1,gap:0,spacing:0},reflow:function(e){var t,n,i=this,r=i.options,o=r.vertical,a=o?Vo:Oo,s=i.children,l=r.gap,c=r.spacing,d=s.length,u=d+l+c*(d-1),h=(o?e.height():e.width())/u,p=e[a+1]+h*(l/2);for(n=0;d>n;n++)t=(s[n].box||e).clone(),t[a+1]=p,t[a+2]=p+h,s[n].reflow(t),d-1>n&&(p+=h*c),p+=h}}),Z.extend(J.fn),et=Fn.extend({options:{vertical:!0},reflow:function(e){var t,n,i,r=this.options,o=r.vertical,a=o?Oo:Vo,s=this.children,l=this.box=new Pn,c=s.length;for(t=0;c>t;t++)n=s[t],n.visible!==!1&&(i=n.box.clone(),i.snapTo(e,a),0===t&&(l=this.box=i.clone()),n.reflow(i),l.wrap(i))}}),Z.extend(et.fn),tt={click:function(e,t){return e.trigger(lo,this.eventArgs(t))},hover:function(e,t){return e.trigger(co,this.eventArgs(t))},eventArgs:function(t){return{value:this.value,percentage:this.percentage,category:this.category,series:this.series,dataItem:this.dataItem,runningTotal:this.runningTotal,total:this.total,element:e(t.target),originalEvent:t,point:this}}},nt={createNote:function(){var e=this,t=e.options.notes,n=e.noteText||t.label.text;t.visible!==!1&&ii(n)&&null!==n&&(e.note=new Hn(e.value,n,e.dataItem,e.category,e.series,e.options.notes),e.append(e.note))}},it=Fn.extend({init:function(e,t){var n=this;Fn.fn.init.call(n),n.options=t,n.color=t.color||No,n.aboveAxis=di(n.options.aboveAxis,!0),n.value=e},defaults:{border:{width:1},vertical:!0,overlay:{gradient:dr},labels:{visible:!1,format:"{0}"},opacity:1,notes:{label:{}}},render:function(){this._rendered||(this._rendered=!0,this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))},createLabel:function(){var e,t,n=this.options,i=n.labels;i.visible&&(i.template?(t=Dn(i.template),e=t({dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total,series:this.series})):e=this.formatValue(i.format),this.label=new G(e,Cn({vertical:n.vertical},n.labels)),this.append(this.label))},formatValue:function(e){return this.owner.formatPointValue(this,e)},reflow:function(e){var t,n,i,r;if(this.render(),t=this,n=t.options,i=t.label,t.box=e,i&&(i.options.aboveAxis=t.aboveAxis,i.reflow(e)),t.note&&t.note.reflow(e),t.errorBars)for(r=0;t.errorBars.length>r;r++)t.errorBars[r].reflow(e)},createVisual:function(){var e=this.box;this.visible!==!1&&(Fn.fn.createVisual.call(this),e.width()>0&&e.height()>0&&this.createRect())},createRect:function(){var e=this.options,n=e.border,i=ii(n.opacity)?n.opacity:e.opacity,r=hi.Path.fromRect(this.box.toRect(),{fill:{color:this.color,opacity:e.opacity},stroke:{color:this.getBorderColor(),width:n.width,opacity:i,dashType:n.dashType}}),o=e.vertical?this.box.width():this.box.height();o>yi&&$n(r),this.visual.append(r),U(e)&&this.visual.append(this.createGradientOverlay(r,{baseColor:this.color},Cn({end:e.vertical?t:[0,1]},e.overlay)))},createHighlight:function(e){var t=hi.Path.fromRect(this.box.toRect(),e);return $n(t)},getBorderColor:function(){var e=this,t=e.options,n=e.color,i=t.border,r=i.color,o=i._brightness||bi;return ii(r)||(r=new zn(n).brightness(o).toHex()),r},tooltipAnchor:function(e,t){var n,i,r,o,a=this,s=a.options,l=a.box,c=s.vertical,d=a.aboveAxis,u=a.owner.pane.clipBox()||l;return c?(n=l.x2+Eo,i=d?gn.max(l.y1,u.y1):gn.min(l.y2,u.y2)-t):(r=gn.max(l.x1,u.x1),o=gn.min(l.x2,u.x2),s.isStacked?(n=d?o-e:r,i=l.y1-t-Eo):(n=d?o+Eo:r-e-Eo,i=l.y1)),new On(n,i)}}),Cn(it.fn,tt),Cn(it.fn,nt),rt=hi.Animation.extend({options:{duration:fr},setup:function(){var e,t,n,i=this.element,r=this.options,o=i.bbox();o?(e=this.origin=r.origin,t=r.vertical?Vo:Oo,n=this.fromScale=new ui.Point(1,1),n[t]=uo,i.transform(ui.transform().scale(n.x,n.y))):this.abort()},step:function(e){var t=Zn(this.fromScale.x,1,e),n=Zn(this.fromScale.y,1,e);this.element.transform(ui.transform().scale(t,n,this.origin))},abort:function(){hi.Animation.fn.abort.call(this),this.element.transform(null)}}),hi.AnimationFactory.current.register(wi,rt),ot={extend:function(e){if(e.createVisual!==mn)throw Error("Refusing to override existing createVisual");e.appendVisual=this.appendVisual,e.createVisual=this.createVisual,e._setAnimationOptions=this._setAnimationOptions,Cn(e.options,{animation:{type:wi}})},createVisual:function(){this._setAnimationOptions(),Fn.fn.createVisual.call(this)},appendVisual:function(e){ii(e.options.zIndex)&&(e.chartElement.options.animation=this.options.animation),Fn.fn.appendVisual.call(this,e)},_setAnimationOptions:function(){var e=this.options,t=this.categoryAxis.getSlot(0);e.animation=e.animation||{},e.animation.origin=new ui.Point(t.x1,t.y1),e.animation.vertical=!this.options.invertAxes}},at=hi.Animation.extend({options:{duration:200,easing:xr},setup:function(){this.fadeTo=this.element.opacity(),this.element.opacity(0)},step:function(e){this.element.opacity(e*this.fadeTo)}}),hi.AnimationFactory.current.register(ar,at),st=function(e,t,n){var i=this;i.initGlobalRanges(e,t,n)},st.prototype=st.fn={percentRegex:/percent(?:\w*)\((\d+)\)/,standardDeviationRegex:RegExp("^"+go+"(?:\\((\\d+(?:\\.\\d+)?)\\))?$"),initGlobalRanges:function(e,t,n){var i,r,o,a,s,l=this,c=t.data,d=l.standardDeviationRegex.exec(e);d?(l.valueGetter=l.createValueGetter(t,n),i=l.getAverage(c),r=l.getStandardDeviation(c,i,!1),o=d[1]?parseFloat(d[1]):1,a={low:i.value-r*o,high:i.value+r*o},l.globalRange=function(){return a}):e.indexOf&&e.indexOf(fo)>=0&&(l.valueGetter=l.createValueGetter(t,n),s=l.getStandardError(c,l.getAverage(c)),l.globalRange=function(e){return{low:e-s,high:e+s}})},createValueGetter:function(e,t){var n,i,r,o=e.data,a=q.current,s=a.valueFields(e),l=ii(o[0])?o[0]:{};return pn(l)?(n=t?R(t,s):0,r=Tn("["+n+"]")):A(l)?r=Tn():typeof l===Wr&&(i=a.sourceFields(e,s),r=Tn(i[R(t,s)])),r},getErrorRange:function(e,t){var n,i,r,o,a=this;if(ii(t)){if(a.globalRange)return a.globalRange(e);if(pn(t))n=e-t[0],i=e+t[1];else if(A(r=parseFloat(t)))n=e-r,i=e+r;else{if(!(r=a.percentRegex.exec(t)))throw Error("Invalid ErrorBar value: "+t);o=e*(parseFloat(r[1])/100),n=e-gn.abs(o),i=e+gn.abs(o)}return{low:n,high:i}}},getStandardError:function(e,t){return this.getStandardDeviation(e,t,!0)/gn.sqrt(t.count)},getStandardDeviation:function(e,t,n){var i,r,o=0,a=e.length,s=n?t.count-1:t.count;for(r=0;a>r;r++)i=this.valueGetter(e[r]),A(i)&&(o+=gn.pow(i-t.value,2));return gn.sqrt(o/s)},getAverage:function(e){var t,n,i=0,r=0,o=e.length;for(n=0;o>n;n++)t=this.valueGetter(e[n]),A(t)&&(i+=t,r++);return{value:i/r,count:r}}},lt=Fn.extend({init:function(e,t){var n=this;Fn.fn.init.call(n,t),n.plotArea=e,n.categoryAxis=e.seriesCategoryAxis(t.series[0]),n.valueAxisRanges={},n.points=[],n.categoryPoints=[],n.seriesPoints=[],n.seriesOptions=[],n._evalSeries=[],n.render()},options:{series:[],invertAxes:!1,isStacked:!1,clip:!0},render:function(){var e=this;e.traverseDataPoints(_n(e.addValue,e))},pointOptions:function(e,t){var n,i=this.seriesOptions[t];return i||(n=this.pointType().fn.defaults,this.seriesOptions[t]=i=Cn({},n,{vertical:!this.options.invertAxes},e)),i},plotValue:function(e){var t,n,i,r,o,a,s;if(!e)return 0;if(this.options.isStacked100&&A(e.value)){for(t=e.categoryIx,n=this.categoryPoints[t],i=0,r=0;n.length>r;r++)if(o=n[r]){if(a=e.series.stack,s=o.series.stack,a&&s&&a.group!==s.group)continue;A(o.value)&&(i+=gn.abs(o.value))}if(i>0)return e.value/i}return e.value},plotRange:function(e,t){var n,i,r,o,a,s,l,c,d,u,h,p,f=e.categoryIx,g=this.categoryPoints[f];if(this.options.isStacked){for(t=t||0,n=this.plotValue(e),i=n>0,r=t,o=!1,a=0;g.length>a&&(s=g[a],e!==s);a++){if(l=e.series.stack,c=s.series.stack,l&&c){if(typeof l===mo&&l!==c)continue;if(l.group&&l.group!==c.group)continue}d=this.plotValue(s),(d>0&&i||0>d&&!i)&&(r+=d,n+=d,o=!0)}return o&&(r-=t),[r,n]}return u=e.series,h=this.seriesValueAxis(u),p=this.categoryAxisCrossingValue(h),[p,e.value||p]},stackLimits:function(e,t){var n,i,r,o,a,s=Dr,l=Er;for(n=0;this.categoryPoints.length>n;n++)for(i=this.categoryPoints[n],r=0;i.length>r;r++)o=i[r],o&&(o.series.stack===t||o.series.axis===e)&&(a=this.plotRange(o,0)[1],ii(a)&&(l=gn.max(l,a),s=gn.min(s,a)));return{min:s,max:l}},updateStackRange:function(){var e,t,n,i,r,o,a=this,s=a.options.series,l=a.options.isStacked,c={};if(l)for(t=0;s.length>t;t++)n=s[t],i=n.axis,r=i+n.stack,e=c[r],e||(e=a.stackLimits(i,n.stack),o=a.errorTotals,o&&(o.negative.length&&(e.min=gn.min(e.min,si(o.negative))),o.positive.length&&(e.max=gn.max(e.max,li(o.positive)))),c[r]=e),a.valueAxisRanges[i]=e},addErrorBar:function(e,t,n){var i,r=this,o=e.value,a=e.series,s=e.seriesIx,l=e.options.errorBars,c=t.fields[er],d=t.fields[tr];A(c)&&A(d)?i={low:c,high:d}:l&&ii(l.value)&&(r.seriesErrorRanges=r.seriesErrorRanges||[],r.seriesErrorRanges[s]=r.seriesErrorRanges[s]||new st(l.value,a,Fo),i=r.seriesErrorRanges[s].getErrorRange(o,l.value)),i&&(e.low=i.low,e.high=i.high,r.addPointErrorBar(e,n))},addPointErrorBar:function(e,t){var n,i,r,o=this,a=e.series,s=e.low,l=e.high,c=!o.options.invertAxes,d=e.options.errorBars;o.options.isStacked?(i=o.stackedErrorRange(e,t),s=i.low,l=i.high):(r={categoryIx:t,series:a},o.updateRange({value:s},r),o.updateRange({value:l},r)),n=new mt(s,l,c,o,a,d),e.errorBars=[n],e.append(n)},stackedErrorRange:function(e,t){var n=this,i=n.plotRange(e,0)[1]-e.value,r=e.low+i,o=e.high+i;return n.errorTotals=n.errorTotals||{positive:[],negative:[]},0>r&&(n.errorTotals.negative[t]=gn.min(n.errorTotals.negative[t]||0,r)),o>0&&(n.errorTotals.positive[t]=gn.max(n.errorTotals.positive[t]||0,o)),{low:r,high:o}},addValue:function(t,n){var i,r,o=this,a=n.categoryIx,s=n.series,l=n.seriesIx,c=o.categoryPoints[a];c||(o.categoryPoints[a]=c=[]),i=o.seriesPoints[l],i||(o.seriesPoints[l]=i=[]),r=o.createPoint(t,n),r&&(e.extend(r,n),r.owner=o,r.dataItem=s.data[a],r.noteText=t.fields.noteText,o.addErrorBar(r,t,a)),o.points.push(r),i.push(r),c.push(r),o.updateRange(t.valueFields,n)},evalPointOptions:function(e,t,n,i,r,o){var a={defaults:r._defaults,excluded:["data","aggregate","_events","tooltip","template"]},s=this._evalSeries[o];return ii(s)||(this._evalSeries[o]=s=M(e,{},a,!0)),s&&(e=Cn({},e),M(e,{value:t,category:n,index:i,series:r,dataItem:r.data[i]},a)),e},updateRange:function(e,t){var n=this,i=t.series.axis,r=e.value,o=n.valueAxisRanges[i];isFinite(r)&&null!==r&&(o=n.valueAxisRanges[i]=o||{min:Dr,max:Er},o.min=gn.min(o.min,r),o.max=gn.max(o.max,r))},seriesValueAxis:function(e){var t=this.plotArea,n=e.axis,i=n?t.namedValueAxes[n]:t.valueAxis;if(!i)throw Error("Unable to locate value axis with name "+n);return i},reflow:function(e){var t,n,i,r=this,o=0,a=r.categorySlots=[],s=r.points,l=r.categoryAxis;r.traverseDataPoints(function(e,c){var d,u,h,p,f=c.categoryIx,g=c.series;t=r.pointValue(e),n=r.seriesValueAxis(g),i=s[o++],d=a[f],d||(a[f]=d=r.categorySlot(l,f,n)),i&&(u=r.plotRange(i,n.startValue()),h=n.getSlot(u[0],u[1],!r.options.clip),h?(p=r.pointSlot(d,h),i.aboveAxis=r.aboveAxis(i,n),r.options.isStacked100&&(i.percentage=r.plotValue(i)),r.reflowPoint(i,p)):i.visible=!1)}),r.reflowCategories(a),r.box=e},aboveAxis:function(e,t){var n=this.categoryAxisCrossingValue(t),i=e.value;return t.options.reverse?n>i:i>=n},categoryAxisCrossingValue:function(e){var t=this.categoryAxis,n=e.options,i=[].concat(n.axisCrossingValues||n.axisCrossingValue);return i[t.axisIndex||0]||0},reflowPoint:function(e,t){e.reflow(t)},reflowCategories:function(){},pointSlot:function(e,t){var n=this,i=n.options,r=i.invertAxes,o=r?t:e,a=r?e:t;return new Pn(o.x1,a.y1,o.x2,a.y2)},categorySlot:function(e,t){return e.getSlot(t)},traverseDataPoints:function(e){var t,n,i,r,o,a=this,s=a.options,l=s.series,d=a.categoryAxis.options.categories||[],u=c(l),h=l.length;for(t=0;u>t;t++)for(n=0;h>n;n++)o=l[n],r=d[t],i=this._bindPoint(o,n,t),e(i,{category:r,categoryIx:t,series:o,seriesIx:n})},_bindPoint:function(e,t,n){var i,r;return this._bindCache||(this._bindCache=[]),i=this._bindCache[t],i||(i=this._bindCache[t]=[]),r=i[n],r||(r=i[n]=q.current.bindPoint(e,n)),r},formatPointValue:function(e,t){return null===e.value?"":Yn(t,e.value)},pointValue:function(e){return e.valueFields.value},createVisual:mn}),ct=lt.extend({render:function(){var e=this;lt.fn.render.apply(e),e.updateStackRange()},pointType:function(){return it},clusterType:function(){return J},stackType:function(){return et},stackLimits:function(e,t){var n=lt.fn.stackLimits.call(this,e,t);return n.min=gn.min(0,n.min),n.max=gn.max(0,n.max),n},createPoint:function(e,t){var n,i,r,o,a=this,s=t.categoryIx,l=t.category,c=t.series,d=t.seriesIx,u=a.pointValue(e),h=a.options,p=a.children,f=a.options.isStacked,g=a.pointType(),m=a.clusterType(),v=this.pointOptions(c,d),_=v.labels;return f&&_.position==qr&&(_.position=mr),v.isStacked=f,r=e.fields.color||c.color,0>u&&v.negativeColor&&(r=v.negativeColor),v=a.evalPointOptions(v,u,l,s,c,d),wn.isFunction(c.color)&&(r=v.color),n=new g(u,v),n.color=r,i=p[s],i||(i=new m({vertical:h.invertAxes,gap:h.gap,spacing:h.spacing}),a.append(i)),f?(o=a.getStackWrap(c,i),o.append(n)):i.append(n),n},getStackWrap:function(e,t){var n,i,r,o=e.stack,a=o?o.group||o:o,s=t.children;if(typeof a===mo){for(i=0;s.length>i;i++)if(s[i]._stackGroup===a){n=s[i];break}}else n=s[0];return n||(r=this.stackType(),n=new r({vertical:!this.options.invertAxes}),n._stackGroup=a,t.append(n)),n},categorySlot:function(e,t,n){var i,r,o=this,a=o.options,s=e.getSlot(t),l=n.startValue();return a.isStacked&&(r=n.getSlot(l,l,!0),i=a.invertAxes?Oo:Vo,s[i+1]=s[i+2]=r[i+1]),s},reflowCategories:function(e){var t,n=this,i=n.children,r=i.length;for(t=0;r>t;t++)i[t].reflow(e[t])}}),ot.extend(ct.fn),dt=it.extend({defaults:{labels:{format:"{0} - {1}"},tooltip:{format:"{1}"}},createLabel:function(){var e=this.options.labels,t=Cn({},e,e.from),n=Cn({},e,e.to);t.visible&&(this.labelFrom=this._createLabel(t),this.append(this.labelFrom)),n.visible&&(this.labelTo=this._createLabel(n),this.append(this.labelTo))},_createLabel:function(e){var t,n;return e.template?(n=Dn(e.template),t=n({dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total,series:this.series})):t=this.formatValue(e.format),new G(t,Cn({vertical:this.options.vertical},e))},reflow:function(e){this.render();var t=this,n=t.labelFrom,i=t.labelTo;t.box=e,n&&(n.options.aboveAxis=t.value.from>t.value.to,n.reflow(e)),i&&(i.options.aboveAxis=t.value.to>t.value.from,i.reflow(e)),t.note&&t.note.reflow(e)}}),ut=ct.extend({pointType:function(){return dt},pointValue:function(e){return e.valueFields},formatPointValue:function(e,t){return null===e.value.from&&null===e.value.to?"":Yn(t,e.value.from,e.value.to)},plotLimits:lt.fn.plotLimits,plotRange:function(e){return e?[e.value.from,e.value.to]:0},updateRange:function(e,t){var n=this,i=t.series.axis,r=e.from,o=e.to,a=n.valueAxisRanges[i];null!==e&&A(r)&&A(o)&&(a=n.valueAxisRanges[i]=a||{min:Dr,max:Er},a.min=gn.min(a.min,r),a.max=gn.max(a.max,r),a.min=gn.min(a.min,o),a.max=gn.max(a.max,o))},aboveAxis:function(e){var t=e.value;return t.to>t.from}}),ht=lt.extend({init:function(e,t){var n=this;n.wrapData(t),lt.fn.init.call(n,e,t)},wrapData:function(e){var t,n,i,r=e.series;for(t=0;r.length>t;t++)i=r[t],n=i.data,n&&!pn(n[0])&&typeof n[0]!=Wr&&(i.data=[n])},reflowCategories:function(e){var t,n=this,i=n.children,r=i.length;for(t=0;r>t;t++)i[t].reflow(e[t])},plotRange:function(e){var t=e.series,n=this.seriesValueAxis(t),i=this.categoryAxisCrossingValue(n);return[i,e.value.current||i]},createPoint:function(e,t){var n,i,r=this,o=t.categoryIx,a=t.category,s=t.series,l=t.seriesIx,c=e.valueFields,d=r.options,u=r.children,h=Cn({vertical:!d.invertAxes,overlay:s.overlay,categoryIx:o,invertAxes:d.invertAxes},s);return h=r.evalPointOptions(h,c,a,o,s,l),n=new pt(c,h),i=u[o],i||(i=new J({vertical:d.invertAxes,gap:d.gap,spacing:d.spacing}),r.append(i)),i.append(n),n},updateRange:function(e,t){var n=this,i=t.series.axis,r=e.current,o=e.target,a=n.valueAxisRanges[i];ii(r)&&!isNaN(r)&&ii(o&&!isNaN(o))&&(a=n.valueAxisRanges[i]=a||{min:Dr,max:Er},a.min=gn.min.apply(gn,[a.min,r,o]),a.max=gn.max.apply(gn,[a.max,r,o]))},formatPointValue:function(e,t){return Yn(t,e.value.current,e.value.target)},pointValue:function(e){return e.valueFields.current},aboveAxis:function(e){var t=e.value.current;return t>0}}),ot.extend(ht.fn),pt=Fn.extend({init:function(e,t){var n=this;Fn.fn.init.call(n,t),n.value=e,n.aboveAxis=n.options.aboveAxis},options:{color:No,border:{width:1},vertical:!1,opacity:1,target:{shape:"",border:{width:0,color:"green"},line:{width:2}},tooltip:{format:"Current: {0}</br>Target: {1}"}},render:function(){var e=this,t=e.options;e._rendered||(e._rendered=!0,ii(e.value.target)&&(e.target=new ft({type:t.target.shape,background:t.target.color||t.color,opacity:t.opacity,zIndex:t.zIndex,border:t.target.border,vAlign:Do,align:Jr}),e.append(e.target)),e.createNote())},reflow:function(e){this.render();var t,n=this,i=n.options,r=n.owner,o=n.target,a=i.invertAxes,s=r.seriesValueAxis(n.options),l=r.categorySlot(r.categoryAxis,i.categoryIx,s),c=s.getSlot(n.value.target),d=a?c:l,u=a?l:c;o&&(t=new Pn(d.x1,u.y1,d.x2,u.y2),o.options.height=a?t.height():i.target.line.width,o.options.width=a?i.target.line.width:t.width(),o.reflow(t)),n.note&&n.note.reflow(e),n.box=e},createVisual:function(){var e,t;Fn.fn.createVisual.call(this),e=this.options,t=hi.Path.fromRect(this.box.toRect(),{fill:{color:e.color,opacity:e.opacity},stroke:null}),e.border.width>0&&t.options.set("stroke",{color:e.border.color||e.color,width:e.border.width,dashType:e.border.dashType,opacity:di(e.border.opacity,e.opacity)}),$n(t),this.visual.append(t)},createAnimation:function(){var e=this.options;Cn(e,{animation:{aboveAxis:this.aboveAxis,vertical:e.vertical}}),Fn.fn.createAnimation.call(this)},tooltipAnchor:function(e,t){var n,i,r,o,a=this,s=a.options,l=a.box,c=s.vertical,d=a.aboveAxis,u=a.owner.pane.clipBox()||l;return c?(n=l.x2+Eo,i=d?gn.max(l.y1,u.y1):gn.min(l.y2,u.y2)-t):(r=gn.max(l.x1,u.x1),o=gn.min(l.x2,u.x2),s.isStacked?(n=d?o-e:r,i=l.y1-t-Eo):(n=d?o+Eo:r-e-Eo,i=l.y1)),new On(n,i)},createHighlight:function(e){return hi.Path.fromRect(this.box.toRect(),e)},formatValue:function(e){var t=this;return t.owner.formatPointValue(t,e)}}),Cn(pt.fn,tt),Cn(pt.fn,nt),ft=Wn.extend(),Cn(ft.fn,tt),gt=Fn.extend({init:function(e,t,n,i,r,o){var a=this;a.low=e,a.high=t,a.isVertical=n,a.chart=i,a.series=r,Fn.fn.init.call(a,o)},options:{animation:{type:ar,delay:fr},endCaps:!0,line:{width:1},zIndex:1},getAxis:function(){},reflow:function(e){var t,n=this,i=n.options.endCaps,r=n.isVertical,o=n.getAxis(),a=o.getSlot(n.low,n.high),s=e.center(),l=n.getCapsWidth(e,r),c=r?s.x:s.y,d=c-l,u=c+l;r?(t=[On(s.x,a.y1),On(s.x,a.y2)],i&&t.push(On(d,a.y1),On(u,a.y1),On(d,a.y2),On(u,a.y2))):(t=[On(a.x1,s.y),On(a.x2,s.y)],i&&t.push(On(a.x1,d),On(a.x1,u),On(a.x2,d),On(a.x2,u))),n.linePoints=t},getCapsWidth:function(e,t){var n=t?e.width():e.height(),i=gn.min(gn.floor(n/2),Yi)||Yi;return i},createVisual:function(){var e,t,n=this,i=n.options,r={stroke:{color:i.color,width:i.line.width,dashType:i.line.dashType}},o=n.linePoints;for(Fn.fn.createVisual.call(this),e=0;o.length>e;e+=2)t=new hi.Path(r).moveTo(o[e].x,o[e].y).lineTo(o[e+1].x,o[e+1].y),this.visual.append(t)}}),mt=gt.extend({getAxis:function(){var e=this,t=e.chart,n=e.series,i=t.seriesValueAxis(n);return i}}),vt=gt.extend({getAxis:function(){var e=this,t=e.chart,n=e.series,i=t.seriesAxes(n),r=e.isVertical?i.y:i.x;return r}}),_t=Fn.extend({init:function(e,t){var n=this;Fn.fn.init.call(n),n.value=e,n.options=t,n.aboveAxis=di(n.options.aboveAxis,!0),n.tooltipTracking=!0},defaults:{vertical:!0,markers:{visible:!0,background:No,size:kr,type:Fi,border:{width:2},opacity:1},labels:{visible:!1,position:fi,margin:Kn(3),padding:Kn(4),animation:{type:ar,delay:fr}},notes:{label:{}},highlight:{markers:{border:{}}}},render:function(){var e,t=this,n=t.options,i=n.markers,r=n.labels,o=t.value;t._rendered||(t._rendered=!0,i.visible&&i.size&&(t.marker=t.createMarker(),t.append(t.marker)),r.visible&&(r.template?(e=Dn(r.template),o=e({dataItem:t.dataItem,category:t.category,value:t.value,percentage:t.percentage,series:t.series})):r.format&&(o=t.formatValue(r.format)),t.label=new qn(o,Cn({align:Pi,vAlign:Pi,margin:{left:5,right:5},zIndex:this.series.zIndex},r)),t.append(t.label)),t.createNote(),t.errorBar&&t.append(t.errorBar))},markerBorder:function(){var e=this.options.markers,t=e.background,n=Cn({color:this.color},e.border);return ii(n.color)||(n.color=new zn(t).brightness(bi).toHex()),n},createVisual:mn,createMarker:function(){var e=this.options.markers,t=new Wn({type:e.type,width:e.size,height:e.size,rotation:e.rotation,background:e.background,border:this.markerBorder(),opacity:e.opacity,zIndex:this.series.zIndex,animation:e.animation});return t},markerBox:function(){return this.marker||(this.marker=this.createMarker(),this.marker.reflow(this._childBox)),this.marker.box},reflow:function(e){var t,n,i,r,o=this,a=o.options,s=a.vertical,l=o.aboveAxis;if(o.render(),o.box=e,t=e.clone(),s?l?t.y1-=t.height():t.y2+=t.height():l?t.x1+=t.width():t.x2-=t.width(),o._childBox=t,o.marker&&o.marker.reflow(t),o.reflowLabel(t),o.errorBars)for(i=0;o.errorBars.length>i;i++)o.errorBars[i].reflow(t);o.note&&(r=o.markerBox(),o.marker||(n=r.center(),r=Pn(n.x,n.y,n.x,n.y)),o.note.reflow(r))},reflowLabel:function(e){var t=this,n=t.options,i=t.label,r=n.labels.position;i&&(r=r===fi?Do:r,r=r===ki?Ti:r,i.reflow(e),i.box.alignTo(t.markerBox(),r),i.reflow(i.box))},createHighlight:function(){var e=this.options.highlight,t=e.markers,n=this.markerBorder().color,i=this.options.markers,r=new Wn({type:i.type,width:i.size,height:i.size,rotation:i.rotation,background:t.color||n,border:{color:t.border.color,width:t.border.width,opacity:di(t.border.opacity,1)},opacity:di(t.opacity,1)});return r.reflow(this._childBox),r.getElement()},tooltipAnchor:function(e,n){var i=this,r=i.markerBox(),o=i.aboveAxis,a=r.x2+Eo,s=o?r.y1-n:r.y2,l=i.owner.pane.clipBox(),c=!l||l.overlaps(r);return c?On(a,s):t},formatValue:function(e){var t=this;return t.owner.formatPointValue(t,e)}}),Cn(_t.fn,tt),Cn(_t.fn,nt),wt=_t.extend({init:function(e,t){var n=this;_t.fn.init.call(n,e,t),n.category=e.category},defaults:{labels:{position:Pi},highlight:{opacity:1,border:{width:1,opacity:1}}},createHighlight:function(){var e=this.options.highlight,t=e.border,n=this.options.markers,i=this.box.center(),r=n.size/2-t.width/2,o=new hi.Circle(new ui.Circle([i.x,i.y],r),{stroke:{color:t.color||new zn(n.background).brightness(bi).toHex(),width:t.width,opacity:t.opacity},fill:{color:n.background,opacity:e.opacity}});return o}}),yt=Fn.extend({init:function(e,t,n){var i=this;Fn.fn.init.call(i),i.linePoints=e,i.series=t,i.seriesIx=n},options:{closed:!1},points:function(e){var t,n,i=this,r=i.linePoints.concat(e||[]),o=[];for(t=0,n=r.length;n>t;t++)r[t].visible!==!1&&o.push(r[t]._childBox.toRect().center());return o},createVisual:function(){var e,t=this.options,n=this.series,i=n._defaults,r=n.color;Sn(r)&&i&&(r=i.color),e=hi.Path.fromPoints(this.points(),{stroke:{color:r,width:n.width,opacity:n.opacity,dashType:n.dashType},zIndex:n.zIndex}),t.closed&&e.close(),this.visual=e},aliasFor:function(e,t){var n=this,i=n.seriesIx;return n.parent.getNearestPoint(t.x,t.y,i)}}),bt={renderSegments:function(){var e,t,n,i,r,o,a,s,l=this,c=l.options,d=c.series,u=l.seriesPoints,h=u.length;for(this._segments=[],t=0;h>t;t++){for(e=d[t],n=l.sortPoints(u[t]),a=n.length,i=[],o=0;a>o;o++)r=n[o],r?i.push(r):l.seriesMissingValues(e)!==vr&&(i.length>1&&(s=l.createSegment(i,e,t,s),this._addSegment(s)),i=[]);i.length>1&&(s=l.createSegment(i,e,t,s),this._addSegment(s))}},_addSegment:function(e){this._segments.push(e),this.children.unshift(e),e.parent=this},sortPoints:function(e){return e},seriesMissingValues:function(e){var t=e.missingValues,n=!t&&this.options.isStacked;return n?Wo:t||vr},getNearestPoint:function(e,t,n){var i,r,o,a,s,l=new On(e,t),c=this.seriesPoints[n],d=Dr;for(r=0;c.length>r;r++)o=c[r],o&&ii(o.value)&&null!==o.value&&o.visible!==!1&&(a=o.box,s=a.center().distanceTo(l),d>s&&(i=o,d=s));return i}},kt=lt.extend({render:function(){var e=this;lt.fn.render.apply(e),e.updateStackRange(),e.renderSegments()},pointType:function(){return _t},createPoint:function(e,t){var n,i,r,o=this,a=t.categoryIx,s=t.category,l=t.series,c=t.seriesIx,d=e.valueFields.value,u=o.seriesMissingValues(l);if(!ii(d)||null===d){if(u!==Wo)return null;d=0}return i=this.pointOptions(l,c),i=o.evalPointOptions(i,d,s,a,l,c),r=e.fields.color||l.color,wn.isFunction(l.color)&&(r=i.color),n=new _t(d,i),n.color=r,o.append(n),n},plotRange:function(e){var t,n,i,r,o=this.plotValue(e);if(this.options.isStacked)for(t=e.categoryIx,n=this.categoryPoints[t],i=0;n.length>i&&(r=n[i],e!==r);i++)o+=this.plotValue(r);return[o,o]},createSegment:function(e,t,n){var i,r=t.style;return new(i=r===ho?xt:r===po?Ct:yt)(e,t,n)}}),Cn(kt.fn,bt),xt=yt.extend({points:function(e){var t,n=this;return t=n.calculateStepPoints(n.linePoints),e&&e.length&&(t=t.concat(n.calculateStepPoints(e).reverse())),t},calculateStepPoints:function(e){var t,n,i,r,o,a=this,s=a.parent,l=s.plotArea,c=l.seriesCategoryAxis(a.series),d=s.seriesMissingValues(a.series)===vr,u=e.length,h=c.options.reverse,p=c.options.vertical,f=h?2:1,g=h?1:2,m=[];for(i=1;u>i;i++)t=e[i-1],n=e[i],r=t.markerBox().center(),o=n.markerBox().center(),c.options.justified?(m.push(new ui.Point(r.x,r.y)),m.push(p?new ui.Point(r.x,o.y):new ui.Point(o.x,r.y)),m.push(new ui.Point(o.x,o.y))):p?(m.push(new ui.Point(r.x,t.box[Vo+f])),m.push(new ui.Point(r.x,t.box[Vo+g])),d&&m.push(new ui.Point(r.x,n.box[Vo+f])),m.push(new ui.Point(o.x,n.box[Vo+f])),m.push(new ui.Point(o.x,n.box[Vo+g]))):(m.push(new ui.Point(t.box[Oo+f],r.y)),m.push(new ui.Point(t.box[Oo+g],r.y)),d&&m.push(new ui.Point(n.box[Oo+f],r.y)),m.push(new ui.Point(n.box[Oo+f],o.y)),m.push(new ui.Point(n.box[Oo+g],o.y)));return m||[]}}),Ct=yt.extend({createVisual:function(){var e,t,n,i=this.series,r=i._defaults,o=i.color;Sn(o)&&r&&(o=r.color),e=new Rn(this.options.closed),t=e.process(this.points()),n=new hi.Path({stroke:{color:o,width:i.width,opacity:i.opacity,dashType:i.dashType},zIndex:i.zIndex}),n.segments.push.apply(n.segments,t),this.visual=n}}),Tt={points:function(){var e,t,n=this,i=n.parent,r=i.plotArea,o=i.options.invertAxes,a=i.seriesValueAxis(n.series),s=a.lineBox(),l=r.seriesCategoryAxis(n.series),c=l.lineBox(),d=o?c.x1:c.y1,u=n.stackPoints,h=n._linePoints(u),p=o?Oo:Vo;return d=oi(d,s[p+1],s[p+2]),!n.stackPoints&&h.length>1&&(e=h[0],t=ri(h),o?(h.unshift(new ui.Point(d,e.y)),h.push(new ui.Point(d,t.y))):(h.unshift(new ui.Point(e.x,d)),h.push(new ui.Point(t.x,d)))),h},createVisual:function(){var e=this.series,t=e._defaults,n=e.color;Sn(n)&&t&&(n=t.color),this.visual=new hi.Group({zIndex:e.zIndex}),this.createArea(n),this.createLine(n)},createLine:function(e){var t,n=this.series,i=Cn({color:e,opacity:n.opacity},n.line);i.visible!==!1&&i.width>0&&(t=hi.Path.fromPoints(this._linePoints(),{stroke:{color:i.color,width:i.width,opacity:i.opacity,dashType:i.dashType,lineCap:"butt"}}),this.visual.append(t))
},createArea:function(e){var t=this.series,n=hi.Path.fromPoints(this.points(),{fill:{color:e,opacity:t.opacity},stroke:null});this.visual.append(n)}},St=yt.extend({init:function(e,t,n,i){var r=this;r.stackPoints=t,yt.fn.init.call(r,e,n,i)},_linePoints:yt.fn.points}),Cn(St.fn,Tt),Dt=kt.extend({createSegment:function(e,t,n,i){var r,o,a=this,s=a.options,l=s.isStacked,c=(t.line||{}).style;return l&&n>0&&i&&(r=i.linePoints,c!==ho&&(r=r.slice(0).reverse())),c===po?new At(e,i,l,t,n):new(o=c===ho?Et:St)(e,r,t,n)},seriesMissingValues:function(e){return e.missingValues||Wo}}),At=St.extend({init:function(e,t,n,i,r){var o=this;o.prevSegment=t,o.isStacked=n,yt.fn.init.call(o,e,i,r)},strokeSegments:function(){var e,t,n=this._strokeSegments;return n||(e=new Rn(this.options.closed),t=yt.fn.points.call(this),n=this._strokeSegments=e.process(t)),n},createVisual:function(){var e=this.series,t=e._defaults,n=e.color;Sn(n)&&t&&(n=t.color),this.visual=new hi.Group({zIndex:e.zIndex}),this.createFill({fill:{color:n,opacity:e.opacity},stroke:null}),this.createStroke({stroke:Cn({color:n,opacity:e.opacity,lineCap:"butt"},e.line)})},createFill:function(t){var n,i,r,o,a,s=this.strokeSegments(),l=s.slice(0),c=this.prevSegment;this.isStacked&&c&&(n=c.strokeSegments(),i=ri(n).anchor(),l.push(new hi.Segment(i,i,ri(s).anchor())),r=e.map(n,function(e){return new hi.Segment(e.anchor(),e.controlOut(),e.controlIn())}).reverse(),ni(l,r),o=l[0].anchor(),l.push(new hi.Segment(o,o,ri(r).anchor()))),a=new hi.Path(t),a.segments.push.apply(a.segments,l),this.closeFill(a),this.visual.append(a)},closeFill:function(e){var t=this,n=t.parent,i=t.prevSegment,r=n.plotArea,o=n.options.invertAxes,a=n.seriesValueAxis(t.series),s=a.lineBox(),l=r.seriesCategoryAxis(t.series),c=l.lineBox(),d=o?c.x1:c.y1,u=o?Oo:Vo,h=t.strokeSegments(),p=h[0].anchor(),f=ri(h).anchor();d=oi(d,s[u+1],s[u+2]),n.options.isStacked&&i||!(h.length>1)||(o?e.lineTo(d,f.y).lineTo(d,p.y):e.lineTo(f.x,d).lineTo(p.x,d))},createStroke:function(e){if(e.stroke.width>0){var t=new hi.Path(e);t.segments.push.apply(t.segments,this.strokeSegments()),this.visual.append(t)}}}),Et=xt.extend({init:function(e,t,n,i){var r=this;r.stackPoints=t,xt.fn.init.call(r,e,n,i)},_linePoints:xt.fn.points}),Cn(Et.fn,Tt),It=Fn.extend({init:function(e,t){var n=this;Fn.fn.init.call(n,t),n.plotArea=e,n.xAxisRanges={},n.yAxisRanges={},n.points=[],n.seriesPoints=[],n.seriesOptions=[],n._evalSeries=[],n.render()},options:{series:[],tooltip:{format:"{0}, {1}"},labels:{format:"{0}, {1}"},clip:!0},render:function(){var e=this;e.traverseDataPoints(_n(e.addValue,e))},addErrorBar:function(e,t,n){var i,r=this,o=e.value[t],a=t+"Value",s=t+"ErrorLow",l=t+"ErrorHigh",c=n.seriesIx,d=n.series,u=e.options.errorBars,h=n[s],p=n[l];A(o)&&(A(h)&&A(p)&&(i={low:h,high:p}),u&&ii(u[a])&&(r.seriesErrorRanges=r.seriesErrorRanges||{x:[],y:[]},r.seriesErrorRanges[t][c]=r.seriesErrorRanges[t][c]||new st(u[a],d,t),i=r.seriesErrorRanges[t][c].getErrorRange(o,u[a])),i&&r.addPointErrorBar(i,e,t))},addPointErrorBar:function(e,t,n){var i,r=this,o=e.low,a=e.high,s=t.series,l=n===Vo,c=t.options.errorBars,d={};t[n+"Low"]=o,t[n+"High"]=a,t.errorBars=t.errorBars||[],i=new vt(o,a,l,r,s,c),t.errorBars.push(i),t.append(i),d[n]=o,r.updateRange(d,s),d[n]=a,r.updateRange(d,s)},addValue:function(e,t){var n,i=this,r=e.x,o=e.y,a=t.seriesIx,s=i.seriesPoints[a];i.updateRange(e,t.series),ii(r)&&null!==r&&ii(o)&&null!==o&&(n=i.createPoint(e,t),n&&(vn(n,t),i.addErrorBar(n,Oo,t),i.addErrorBar(n,Vo,t))),i.points.push(n),s.push(n)},updateRange:function(e,t){var n=this,i=e.x,r=e.y,o=t.xAxis,a=t.yAxis,s=n.xAxisRanges[o],l=n.yAxisRanges[a];ii(i)&&null!==i&&(s=n.xAxisRanges[o]=s||{min:Dr,max:Er},typeof i===mo&&(i=p(i)),s.min=gn.min(s.min,i),s.max=gn.max(s.max,i)),ii(r)&&null!==r&&(l=n.yAxisRanges[a]=l||{min:Dr,max:Er},typeof r===mo&&(r=p(r)),l.min=gn.min(l.min,r),l.max=gn.max(l.max,r))},evalPointOptions:function(e,t,n){var i=n.series,r=n.seriesIx,o={defaults:i._defaults,excluded:["data","tooltip","tempate"]},a=this._evalSeries[r];return ii(a)||(this._evalSeries[r]=a=M(e,{},o,!0)),a&&(e=Cn({},e),M(e,{value:t,series:i,dataItem:n.dataItem},o)),e},pointType:function(){return _t},pointOptions:function(e,t){var n,i=this.seriesOptions[t];return i||(n=this.pointType().fn.defaults,this.seriesOptions[t]=i=Cn({},n,{markers:{opacity:e.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},e)),i},createPoint:function(e,t){var n,i=this,r=t.series,o=this.pointOptions(r,t.seriesIx),a=t.color||r.color;return o=i.evalPointOptions(o,e,t),wn.isFunction(r.color)&&(a=o.color),n=new _t(e,o),n.color=a,i.append(n),n},seriesAxes:function(e){var t=this.plotArea,n=e.xAxis,i=n?t.namedXAxes[n]:t.axisX,r=e.yAxis,o=r?t.namedYAxes[r]:t.axisY;if(!i)throw Error("Unable to locate X axis with name "+n);if(!o)throw Error("Unable to locate Y axis with name "+r);return{x:i,y:o}},reflow:function(e){var t,n,i=this,r=i.points,o=0,a=!i.options.clip;i.traverseDataPoints(function(e,s){t=r[o++],n=i.seriesAxes(s.series);var l,c=n.x.getSlot(e.x,e.x,a),d=n.y.getSlot(e.y,e.y,a);t&&(c&&d?(l=i.pointSlot(c,d),t.reflow(l)):t.visible=!1)}),i.box=e},pointSlot:function(e,t){return new Pn(e.x1,t.y1,e.x2,t.y2)},traverseDataPoints:function(e){var t,n,i,r,o,a,s,l=this,c=l.options,d=c.series,u=l.seriesPoints;for(n=0;d.length>n;n++)for(i=d[n],r=u[n],r||(u[n]=[]),t=0;i.data.length>t;t++)o=this._bindPoint(i,n,t),a=o.valueFields,s=o.fields,e(a,Cn({pointIx:t,series:i,seriesIx:n,dataItem:i.data[t],owner:l},s))},_bindPoint:lt.fn._bindPoint,formatPointValue:function(e,t){var n=e.value;return Yn(t,n.x,n.y)},createVisual:mn}),Pt=It.extend({render:function(){var e=this;It.fn.render.call(e),e.renderSegments()},createSegment:function(e,t,n){var i,r=t.style;return new(i=r===po?Ct:yt)(e,t,n)}}),Cn(Pt.fn,bt),Mt=It.extend({options:{tooltip:{format:"{3}"},labels:{format:"{3}"}},addValue:function(e,t){(null!==e.size&&e.size>=0||t.series.negativeValues.visible)&&It.fn.addValue.call(this,e,t)},reflow:function(e){var t=this;t.updateBubblesSize(e),It.fn.reflow.call(t,e)},pointType:function(){return wt},createPoint:function(e,t){var n,i,r=this,o=t.series,a=o.data.length,s=t.pointIx*(fr/a),l={delay:s,duration:fr-s,type:Di},c=t.color||o.color;return 0>e.size&&o.negativeValues.visible&&(c=di(o.negativeValues.color,c)),i=Cn({labels:{animation:{delay:s,duration:fr-s}}},this.pointOptions(o,t.seriesIx),{markers:{type:Fi,border:o.border,opacity:o.opacity,animation:l}}),i=r.evalPointOptions(i,e,t),wn.isFunction(o.color)&&(c=i.color),i.markers.background=c,n=new wt(e,i),n.color=c,r.append(n),n},updateBubblesSize:function(e){var t,n,i,r,o,a,s,l,c,d,u,h,p,f,g,m,v=this,_=v.options,w=_.series,y=gn.min(e.width(),e.height());for(t=0;w.length>t;t++)for(i=w[t],r=v.seriesPoints[t],o=v.maxSize(r),a=i.minSize||gn.max(.02*y,10),s=i.maxSize||.2*y,l=a/2,c=s/2,d=gn.PI*l*l,u=gn.PI*c*c,h=u-d,p=h/o,n=0;r.length>n;n++)f=r[n],g=gn.abs(f.value.size)*p,m=gn.sqrt((d+g)/gn.PI),Cn(f.options,{markers:{size:2*m,zIndex:c-m},labels:{zIndex:c-m+1}})},maxSize:function(e){var t,n,i=e.length,r=0;for(t=0;i>t;t++)n=e[t].value.size,r=gn.max(r,gn.abs(n));return r},formatPointValue:function(e,t){var n=e.value;return Yn(t,n.x,n.y,n.size,e.category)}}),Ft=Fn.extend({init:function(e,t){Fn.fn.init.call(this,t),this.value=e},options:{border:{_brightness:.8},line:{width:2},overlay:{gradient:dr},tooltip:{format:"<table style='text-align: left;'><th colspan='2'>{4:d}</th><tr><td>Open:</td><td>{0:C}</td></tr><tr><td>High:</td><td>{1:C}</td></tr><tr><td>Low:</td><td>{2:C}</td></tr><tr><td>Close:</td><td>{3:C}</td></tr></table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}}},reflow:function(e){var t,n,i,r=this,o=r.options,a=r.owner,s=r.value,l=a.seriesValueAxis(o),c=[];n=l.getSlot(s.open,s.close),i=l.getSlot(s.low,s.high),n.x1=i.x1=e.x1,n.x2=i.x2=e.x2,r.realBody=n,t=i.center().x,c.push([[t,i.y1],[t,n.y1]]),c.push([[t,n.y2],[t,i.y2]]),r.lines=c,r.box=i.clone().wrap(n),r._rendered||(r._rendered=!0,r.createNote()),r.reflowNote()},reflowNote:function(){var e=this;e.note&&e.note.reflow(e.box)},createVisual:function(){Fn.fn.createVisual.call(this),this.visual.append(this.mainVisual(this.options)),this.createOverlay()},mainVisual:function(e){var t=new hi.Group;return this.createBody(t,e),this.createLines(t,e),t},createBody:function(e,t){var n=hi.Path.fromRect(this.realBody.toRect(),{fill:{color:this.color,opacity:t.opacity},stroke:null});t.border.width>0&&n.options.set("stroke",{color:this.getBorderColor(),width:t.border.width,dashType:t.border.dashType,opacity:di(t.border.opacity,t.opacity)}),$n(n),e.append(n),U(t)&&e.append(this.createGradientOverlay(n,{baseColor:this.color},Cn({},t.overlay)))},createLines:function(e,t){this.drawLines(e,t,this.lines,t.line)},drawLines:function(e,t,n,i){var r,o,a={stroke:{color:i.color||this.color,opacity:di(i.opacity,t.opacity),width:i.width,dashType:i.dashType,lineCap:"butt"}};for(r=0;n.length>r;r++)o=hi.Path.fromPoints(n[r],a),$n(o),e.append(o)},getBorderColor:function(){var e=this,t=e.options,n=t.border,i=n.color;return ii(i)||(i=new zn(e.color).brightness(n._brightness).toHex()),i},createOverlay:function(){var e=hi.Path.fromRect(this.box.toRect(),{fill:{color:No,opacity:0},stroke:null});this.visual.append(e)},createHighlight:function(){var e,t=this.options.highlight,n=this.color;return this.color=t.color||this.color,e=this.mainVisual(Cn({},this.options,{line:{color:this.getBorderColor()}},t)),this.color=n,e},tooltipAnchor:function(){var e=this,t=e.box,n=e.owner.pane.clipBox()||t;return new On(t.x2+Eo,gn.max(t.y1,n.y1)+Eo)},formatValue:function(e){var t=this;return t.owner.formatPointValue(t,e)}}),Cn(Ft.fn,tt),Cn(Ft.fn,nt),zt=lt.extend({options:{},reflowCategories:function(e){var t,n=this,i=n.children,r=i.length;for(t=0;r>t;t++)i[t].reflow(e[t])},addValue:function(e,t){var n,i,r=this,o=t.categoryIx,a=t.category,s=t.series,l=t.seriesIx,c=r.options,d=e.valueFields,u=r.children,h=r.splitValue(d),p=I(h),f=r.categoryPoints[o],g=s.data[o];f||(r.categoryPoints[o]=f=[]),p&&(n=r.createPoint(e,t)),i=u[o],i||(i=new J({vertical:c.invertAxes,gap:c.gap,spacing:c.spacing}),r.append(i)),n&&(r.updateRange(d,t),i.append(n),n.categoryIx=o,n.category=a,n.series=s,n.seriesIx=l,n.owner=r,n.dataItem=g,n.noteText=e.fields.noteText),r.points.push(n),f.push(n)},pointType:function(){return Ft},createPoint:function(e,t){var n,i=this,r=t.categoryIx,o=t.category,a=t.series,s=t.seriesIx,l=e.valueFields,c=Cn({},a),d=i.pointType(),u=e.fields.color||a.color;return c=i.evalPointOptions(c,l,o,r,a,s),a.type==Ei&&l.open>l.close&&(u=e.fields.downColor||a.downColor||a.color),wn.isFunction(a.color)&&(u=c.color),n=new d(l,c),n.color=u,n},splitValue:function(e){return[e.low,e.open,e.close,e.high]},updateRange:function(e,t){var n=this,i=t.series.axis,r=n.valueAxisRanges[i],o=n.splitValue(e);r=n.valueAxisRanges[i]=r||{min:Dr,max:Er},r=n.valueAxisRanges[i]={min:gn.min.apply(gn,o.concat([r.min])),max:gn.max.apply(gn,o.concat([r.max]))}},formatPointValue:function(e,t){var n=e.value;return Yn(t,n.open,n.high,n.low,n.close,e.category)}}),Rt=Ft.extend({reflow:function(e){var t,n,i,r,o=this,a=o.options,s=o.owner,l=o.value,c=s.seriesValueAxis(a),d=[],u=[],h=[];r=c.getSlot(l.low,l.high),n=c.getSlot(l.open,l.open),i=c.getSlot(l.close,l.close),n.x1=i.x1=r.x1=e.x1,n.x2=i.x2=r.x2=e.x2,t=r.center().x,d.push([n.x1,n.y1]),d.push([t,n.y1]),u.push([t,i.y1]),u.push([i.x2,i.y1]),h.push([t,r.y1]),h.push([t,r.y2]),o.lines=[d,u,h],o.box=r.clone().wrap(n.clone().wrap(i)),o.reflowNote()},createBody:e.noop}),Bt=zt.extend({pointType:function(){return Rt}}),Ht=zt.extend({addValue:function(e,t){var n,i,r=this,o=t.categoryIx,a=t.category,s=t.series,l=t.seriesIx,c=r.options,d=r.children,u=e.valueFields,h=r.splitValue(u),p=I(h),f=r.categoryPoints[o],g=s.data[o];f||(r.categoryPoints[o]=f=[]),p&&(n=r.createPoint(e,t)),i=d[o],i||(i=new J({vertical:c.invertAxes,gap:c.gap,spacing:c.spacing}),r.append(i)),n&&(r.updateRange(u,t),i.append(n),n.categoryIx=o,n.category=a,n.series=s,n.seriesIx=l,n.owner=r,n.dataItem=g),r.points.push(n),f.push(n)},pointType:function(){return Lt},splitValue:function(e){return[e.lower,e.q1,e.median,e.q3,e.upper]},updateRange:function(e,t){var n=this,i=t.series.axis,r=n.valueAxisRanges[i],o=n.splitValue(e).concat(n.filterOutliers(e.outliers));ii(e.mean)&&(o=o.concat(e.mean)),r=n.valueAxisRanges[i]=r||{min:Dr,max:Er},r=n.valueAxisRanges[i]={min:gn.min.apply(gn,o.concat([r.min])),max:gn.max.apply(gn,o.concat([r.max]))}},formatPointValue:function(e,t){var n=e.value;return Yn(t,n.lower,n.q1,n.median,n.q3,n.upper,n.mean,e.category)},filterOutliers:function(e){var t,n,i=(e||[]).length,r=[];for(t=0;i>t;t++)n=e[t],ii(n)&&S(r,n);return r}}),Lt=Ft.extend({init:function(e,t){var n=this;Fn.fn.init.call(n,t),n.value=e,n.createNote()},options:{border:{_brightness:.8},line:{width:2},mean:{width:2,dashType:"dash"},overlay:{gradient:dr},tooltip:{format:"<table style='text-align: left;'><th colspan='2'>{6:d}</th><tr><td>Lower:</td><td>{0:C}</td></tr><tr><td>Q1:</td><td>{1:C}</td></tr><tr><td>Median:</td><td>{2:C}</td></tr><tr><td>Mean:</td><td>{5:C}</td></tr><tr><td>Q3:</td><td>{3:C}</td></tr><tr><td>Upper:</td><td>{4:C}</td></tr></table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},outliers:{visible:!0,size:kr,type:Li,background:No,border:{width:2,opacity:1},opacity:0},extremes:{visible:!0,size:kr,type:Fi,background:No,border:{width:2,opacity:1},opacity:0}},reflow:function(e){var t,n,i,r,o,a=this,s=a.options,l=a.owner,c=a.value,d=l.seriesValueAxis(s);i=d.getSlot(c.q1,c.q3),a.boxSlot=i,n=d.getSlot(c.lower,c.upper),r=d.getSlot(c.median),i.x1=n.x1=e.x1,i.x2=n.x2=e.x2,a.realBody=i,c.mean&&(o=d.getSlot(c.mean),a.meanPoints=[[[e.x1,o.y1],[e.x2,o.y1]]]),t=n.center().x,a.whiskerPoints=[[[t-5,n.y1],[t+5,n.y1],[t,n.y1],[t,i.y1]],[[t-5,n.y2],[t+5,n.y2],[t,n.y2],[t,i.y2]]],a.medianPoints=[[[e.x1,r.y1],[e.x2,r.y1]]],a.box=n.clone().wrap(i),a.reflowNote()},renderOutliers:function(e){var t,n,i,r,o=this,a=e.markers||{},s=o.value,l=s.outliers||[],c=(o.owner.seriesValueAxis(e),3*gn.abs(s.q3-s.q1)),d=[];for(r=0;l.length>r;r++)i=l[r],a=s.q3+c>i&&i>s.q1-c?e.outliers:e.extremes,t=Cn({},a.border),ii(t.color)||(t.color=ii(o.color)?o.color:new zn(a.background).brightness(bi).toHex()),n=new Wn({type:a.type,width:a.size,height:a.size,rotation:a.rotation,background:a.background,border:t,opacity:a.opacity}),n.value=i,d.push(n);return this.reflowOutliers(d),d},reflowOutliers:function(e){var t,n,i,r=this.owner.seriesValueAxis(this.options),o=this.box.center().x;for(t=0;e.length>t;t++)n=e[t].value,i=r.getSlot(n).move(o),this.box=this.box.wrap(i),e[t].reflow(i)},mainVisual:function(e){var t,n,i=Ft.fn.mainVisual.call(this,e),r=this.renderOutliers(e);for(t=0;r.length>t;t++)n=r[t].getElement(),n&&i.append(n);return i},createLines:function(e,t){this.drawLines(e,t,this.whiskerPoints,t.line),this.drawLines(e,t,this.medianPoints,t.median),this.drawLines(e,t,this.meanPoints,t.mean)},getBorderColor:function(){return this.color?this.color:Ft.getBorderColor.call(this)}}),Cn(Lt.fn,tt),Nt=Fn.extend({init:function(e,t,n){var i=this;i.value=e,i.sector=t,Fn.fn.init.call(i,n)},options:{color:No,overlay:{gradient:eo},border:{width:.5},labels:{visible:!1,distance:35,font:ji,margin:Kn(.5),align:Fi,zIndex:1,position:qr},animation:{type:Gr},highlight:{visible:!0,border:{width:1}},visible:!0},render:function(){var e,t=this,n=t.options,i=n.labels,r=t.value;t._rendered||t.visible===!1||(t._rendered=!0,i.template?(e=Dn(i.template),r=e({dataItem:t.dataItem,category:t.category,value:t.value,series:t.series,percentage:t.percentage})):i.format&&(r=Yn(i.format,r)),i.visible&&r&&(t.label=new qn(r,Cn({},i,{align:Pi,vAlign:"",animation:{type:ar,delay:t.animationDelay}})),t.append(t.label)))},reflow:function(e){var t=this;t.render(),t.box=e,t.reflowLabel()},reflowLabel:function(){var e,t,n,i,r=this,o=r.sector.clone(),a=r.options,s=r.label,l=a.labels,c=l.distance,d=o.middle();s&&(i=s.box.height(),n=s.box.width(),l.position==Pi?(o.r=gn.abs((o.r-i)/2)+i,e=o.point(d),s.reflow(Pn(e.x,e.y-i/2,e.x,e.y))):l.position==mr?(o.r=o.r-i/2,e=o.point(d),s.reflow(Pn(e.x,e.y-i/2,e.x,e.y))):(e=o.clone().expand(c).point(d),e.x>=o.c.x?(t=e.x+n,s.orientation=Jr):(t=e.x-n,s.orientation=_r),s.reflow(Pn(t,e.y-i,e.x,e.y))))},createVisual:function(){var e,t=this,n=t.sector,i=t.options,r=i.border||{},o=r.width>0?{stroke:{color:r.color,width:r.width,opacity:r.opacity,dashType:r.dashType}}:{},a=i.color,s={color:a,opacity:i.opacity};Fn.fn.createVisual.call(this),t.value&&(e=t.createSegment(n,Cn({fill:s,stroke:{opacity:i.opacity},zIndex:i.zIndex},o)),this.visual.append(e),U(i)&&this.visual.append(this.createGradientOverlay(e,{baseColor:a,fallbackFill:s},Cn({center:[n.c.x,n.c.y],innerRadius:n.ir,radius:n.r,userSpace:!0},i.overlay))))},createSegment:function(e,t){return t.singleSegment?new hi.Circle(new ui.Circle(new ui.Point(e.c.x,e.c.y),e.r),t):jn.current.createRing(e,t)},createAnimation:function(){var e=this.options,t=this.sector.c;Cn(e,{animation:{center:[t.x,t.y],delay:this.animationDelay}}),Fn.fn.createAnimation.call(this)},createHighlight:function(e){var t=this,n=t.options.highlight||{},i=n.border||{};return t.createSegment(t.sector,Cn({},e,{fill:{color:n.color,opacity:n.opacity},stroke:{opacity:i.opacity,width:i.width,color:i.color}}))},tooltipAnchor:function(e,t){var n=this,i=n.sector.adjacentBox(Eo,e,t);return new On(i.x1,i.y1)},formatValue:function(e){var t=this;return t.owner.formatPointValue(t,e)}}),Cn(Nt.fn,tt),Ot={createLegendItem:function(e,t,n){var i,r,o,a,s,l=this,c=l.options.legend||{},d=c.labels||{},u=c.inactiveItems||{},h=u.labels||{};n&&n.visibleInLegend!==!1&&(s=n.visible!==!1,i=n.category||"",r=s?d.template:h.template||d.template,r&&(i=Dn(r)({text:i,series:n.series,dataItem:n.dataItem,percentage:n.percentage,value:e})),s?(a={},o=t.color):(a={color:h.color,font:h.font},o=(u.markers||{}).color),i&&l.legendItems.push({pointIndex:n.index,text:i,series:n.series,markerColor:o,labels:a}))}},Vt=Fn.extend({init:function(e,t){var n=this;Fn.fn.init.call(n,t),n.plotArea=e,n.points=[],n.legendItems=[],n.render()},options:{startAngle:90,connectors:{width:1,color:"#939393",padding:4},inactiveItems:{markers:{},labels:{}}},render:function(){var e=this;e.traverseDataPoints(_n(e.addValue,e))},traverseDataPoints:function(e){var t,n,i,r,o,a,s,l,c,d,u,h,p,f=this,g=f.options,m=f.plotArea.options.seriesColors||[],v=m.length,_=g.series,w=_.length,y=0;for(r=0;w>r;r++){for(t=_[r],a=t.data,u=V(t),s=360/u,h=ii(t.startAngle)?t.startAngle:g.startAngle,r!=w-1&&t.labels.position==qr&&(t.labels.position=Pi),p=0;a.length>p;p++)n=q.current.bindPoint(t,p),l=n.valueFields.value,c=gn.abs(l),i=n.fields,o=ei(c*s,Gi),d=1!=a.length&&!!i.explode,Sn(t.color)||(t.color=i.color||m[p%v]),e(l,new Un(null,0,0,h,o),{owner:f,category:i.category||"",index:y,series:t,seriesIx:r,dataItem:a[p],percentage:c/u,explode:d,visibleInLegend:i.visibleInLegend,visible:i.visible,zIndex:w-r,animationDelay:f.animationDelay(p,r,w)}),n.fields.visible!==!1&&(h+=o),y++;y=0}},evalSegmentOptions:function(e,t,n){var i=n.series;M(e,{value:t,series:i,dataItem:n.dataItem,category:n.category,percentage:n.percentage},{defaults:i._defaults,excluded:["data","template"]})},addValue:function(e,t,n){var i,r=this,o=Cn({},n.series,{index:n.index});r.evalSegmentOptions(o,e,n),r.createLegendItem(e,o,n),n.visible!==!1&&(i=new Nt(e,t,o),vn(i,n),r.append(i),r.points.push(i))},reflow:function(e){var t,n,i,r,o,a,s,l,c=this,d=c.options,u=e.clone(),h=5,p=gn.min(u.width(),u.height()),f=p/2,g=p-.85*p,m=di(d.padding,g),v=Pn(u.x1,u.y1,u.x1+p,u.y1+p),_=v.center(),w=c.seriesConfigs||[],y=u.center(),b=c.points,k=b.length,x=d.series.length,C=[],T=[];for(m=m>f-h?f-h:m,v.translate(y.x-_.x,y.y-_.y),a=f-m,l=On(a+v.x1+m,a+v.y1+m),s=0;k>s;s++)r=b[s],o=r.sector,o.r=a,o.c=l,n=r.seriesIx,w.length&&(t=w[n],o.ir=t.ir,o.r=t.r),n==x-1&&r.explode&&(o.c=o.clone().radius(.15*o.r).point(o.middle())),r.reflow(v),i=r.label,i&&i.options.position===qr&&n==x-1&&(i.orientation===Jr?T.push(i):C.push(i));C.length>0&&(C.sort(c.labelComparator(!0)),c.leftLabelsReflow(C)),T.length>0&&(T.sort(c.labelComparator(!1)),c.rightLabelsReflow(T)),c.box=v},leftLabelsReflow:function(e){var t=this,n=t.distanceBetweenLabels(e);t.distributeLabels(n,e)},rightLabelsReflow:function(e){var t=this,n=t.distanceBetweenLabels(e);t.distributeLabels(n,e)},distanceBetweenLabels:function(e){var t,n,i,r=this,o=r.points,a=o[o.length-1],s=a.sector,l=e[0].box,c=e.length-1,d=s.r+a.options.labels.distance,u=[];for(n=ei(l.y1-(s.c.y-d-l.height()-l.height()/2)),u.push(n),i=0;c>i;i++)l=e[i].box,t=e[i+1].box,n=ei(t.y1-l.y2),u.push(n);return n=ei(s.c.y+d-e[c].box.y2-e[c].box.height()/2),u.push(n),u},distributeLabels:function(e,t){var n,i,r,o,a=this,s=e.length;for(o=0;s>o;o++)for(i=r=o,n=-e[o];n>0&&(i>=0||s>r);)n=a._takeDistance(e,o,--i,n),n=a._takeDistance(e,o,++r,n);a.reflowLabels(e,t)},_takeDistance:function(e,t,n,i){if(e[n]>0){var r=gn.min(e[n],i);i-=r,e[n]-=r,e[t]+=r}return i},reflowLabels:function(e,t){var n,i,r,o,a=this,s=a.points,l=s[s.length-1],c=l.sector,d=t.length,u=l.options.labels,h=u.distance,p=c.c.y-(c.r+h)-t[0].box.height();for(e[0]+=2,o=0;d>o;o++)n=t[o],p+=e[o],r=n.box,i=a.hAlignLabel(r.x2,c.clone().expand(h),p,p+r.height(),n.orientation==Jr),n.orientation==Jr?(u.align!==Fi&&(i=c.r+c.c.x+h),n.reflow(Pn(i+r.width(),p,i,p))):(u.align!==Fi&&(i=c.c.x-c.r-h),n.reflow(Pn(i-r.width(),p,i,p))),p+=r.height()},createVisual:function(){var e,t,n,r,o,a,s,l,c,d,u,h,p,f,g=this,m=g.options,v=m.connectors,_=g.points,w=_.length,y=4;for(Fn.fn.createVisual.call(this),this._connectorLines=[],s=0;w>s;s++)r=_[s],t=r.sector,n=t.middle(),a=r.label,o={seriesId:r.seriesIx},a&&(e=new hi.Path({stroke:{color:v.color,width:v.width},animation:{type:ar,delay:r.animationDelay}}),a.options.position===qr&&0!==r.value&&(l=a.box,c=t.c,d=t.point(n),u=On(l.x1,l.center().y),d=t.clone().expand(v.padding).point(n),e.moveTo(d.x,d.y),a.orientation==Jr?(p=On(l.x1-v.padding,l.center().y),f=i(c,d,u,p),u=On(p.x-y,p.y),f=f||u,f.x=gn.min(f.x,u.x),g.pointInCircle(f,t.c,t.r+y)||t.c.x>f.x?(h=t.c.x+t.r+y,r.options.labels.align!==Bi?u.x>h?e.lineTo(h,d.y):e.lineTo(d.x+2*y,d.y):e.lineTo(h,d.y),e.lineTo(u.x,p.y)):(f.y=p.y,e.lineTo(f.x,f.y))):(p=On(l.x2+v.padding,l.center().y),f=i(c,d,u,p),u=On(p.x+y,p.y),f=f||u,f.x=gn.max(f.x,u.x),g.pointInCircle(f,t.c,t.r+y)||f.x>t.c.x?(h=t.c.x-t.r-y,r.options.labels.align!==Bi?h>u.x?e.lineTo(h,d.y):e.lineTo(d.x-2*y,d.y):e.lineTo(h,d.y),e.lineTo(u.x,p.y)):(f.y=p.y,e.lineTo(f.x,f.y))),e.lineTo(p.x,p.y),this._connectorLines.push(e),this.visual.append(e)))},labelComparator:function(e){return e=e?-1:1,function(t,n){return t=(t.parent.sector.middle()+270)%360,n=(n.parent.sector.middle()+270)%360,(t-n)*e}},hAlignLabel:function(e,t,n,i,r){var o=t.c.x,a=t.c.y,s=t.r,l=gn.min(gn.abs(a-n),gn.abs(a-i));return l>s?e:o+gn.sqrt(s*s-l*l)*(r?1:-1)},pointInCircle:function(e,t,n){return d(t.x-e.x)+d(t.y-e.y)<d(n)},formatPointValue:function(e,t){return Yn(t,e.value)},animationDelay:function(e){return e*$r}}),Cn(Vt.fn,Ot),Ut=Nt.extend({options:{overlay:{gradient:to},labels:{position:Pi},animation:{type:Gr}},reflowLabel:function(){var e,t,n=this,i=n.sector.clone(),r=n.options,o=n.label,a=r.labels,s=i.middle();o&&(t=o.box.height(),a.position==Pi?(i.r-=(i.r-i.ir)/2,e=i.point(s),o.reflow(new Pn(e.x,e.y-t/2,e.x,e.y))):Nt.fn.reflowLabel.call(n))},createSegment:function(e,t){return jn.current.createRing(e,t)}}),Cn(Ut.fn,tt),Wt=Vt.extend({options:{startAngle:90,connectors:{width:1,color:"#939393",padding:4}},addValue:function(e,t,n){var i,r=this,o=Cn({},n.series,{index:n.index});r.evalSegmentOptions(o,e,n),r.createLegendItem(e,o,n),e&&n.visible!==!1&&(i=new Ut(e,t,o),vn(i,n),r.append(i),r.points.push(i))},reflow:function(e){var t,n,i,r,o,a,s=this,l=s.options,c=e.clone(),d=5,u=gn.min(c.width(),c.height()),h=u/2,p=u-.85*u,f=di(l.padding,p),g=l.series,m=g.length,v=0,_=0,w=0,y=0;for(s.seriesConfigs=[],f=f>h-d?h-d:f,i=h-f,o=0;m>o;o++)t=g[o],0===o&&ii(t.holeSize)&&(n=t.holeSize,i-=t.holeSize),ii(t.size)?i-=t.size:v++,ii(t.margin)&&o!=m-1&&(i-=t.margin);for(ii(n)||(y=(h-f)/(m+.75),n=.75*y,i-=n),w=n,o=0;m>o;o++)t=g[o],r=di(t.size,i/v),w+=_,a=w+r,s.seriesConfigs.push({ir:w,r:a}),_=t.margin||0,w=a;Vt.fn.reflow.call(s,e)},animationDelay:function(e,t,n){return e*Ki+fr*(t+1)/(n+1)}}),jt=ct.extend({render:function(){ct.fn.render.call(this),this.createSegments()},traverseDataPoints:function(e){var t,n,i,r,o,a,s,l,d,u,h=this.options.series,p=this.categoryAxis.options.categories||[],f=c(h),g=!this.options.invertAxes;for(t=0;h.length>t;t++)for(n=h[t],i=0,r=0,o=0;f>o;o++)a=q.current.bindPoint(n,o),s=a.valueFields.value,l=a.fields.summary,d=i,l?"total"===l.toLowerCase()?(a.valueFields.value=i,d=0,u=i):(a.valueFields.value=r,u=d-r,r=0):A(s)&&(r+=s,i+=s,u=i),e(a,{category:p[o],categoryIx:o,series:n,seriesIx:t,total:i,runningTotal:r,from:d,to:u,isVertical:g})},updateRange:function(e,t){ct.fn.updateRange.call(this,{value:t.to},t)},aboveAxis:function(e){return e.value>=0},plotRange:function(e){return[e.from,e.to]},createSegments:function(){var e,t,n,i,r,o,a,s=this.options.series,l=this.seriesPoints,c=this.segments=[];for(e=0;s.length>e;e++)if(t=s[e],n=l[e])for(r=0;n.length>r;r++)o=n[r],o&&i&&(a=new qt(i,o,t),c.push(a),this.append(a)),i=o}}),qt=Fn.extend({init:function(e,t,n){var i=this;Fn.fn.init.call(i),i.from=e,i.to=t,i.series=n},options:{animation:{type:ar,delay:fr}},linePoints:function(){var e,t,n=[],i=this.from,r=i.box,o=this.to.box;return i.isVertical?(e=i.aboveAxis?r.y1:r.y2,n.push([r.x1,e],[o.x2,e])):(t=i.aboveAxis?r.x2:r.x1,n.push([t,r.y1],[t,o.y2])),n},createVisual:function(){var e,t,n;Fn.fn.createVisual.call(this),e=this.options,t=this.series.line||{},n=hi.Path.fromPoints(this.linePoints(),{stroke:{color:t.color,width:t.width,opacity:t.opacity,dashType:t.dashType}}),$n(n),this.visual.append(n)}}),Gt=Mn.extend({init:function(e){var t=this;Mn.fn.init.call(t,e),e=t.options,t.id=wn.guid(),t.createTitle(),t.content=new Fn,t.chartContainer=new $t({},t),t.append(t.content),t.axes=[],t.charts=[]},options:{zIndex:-1,shrinkToFit:!0,title:{align:_r},visible:!0},createTitle:function(){var e=this,t=e.options.title;typeof t===Wr&&(t=Cn({},t,{align:t.position,position:Do})),e.title=Gn.buildTitle(t,e,Gt.fn.options.title)},appendAxis:function(e){var t=this;t.content.append(e),t.axes.push(e),e.pane=t},appendChart:function(e){var t=this;t.chartContainer.parent!==t.content&&t.content.append(t.chartContainer),t.charts.push(e),t.chartContainer.append(e),e.pane=t},empty:function(){var e,t=this,n=t.parent;if(n){for(e=0;t.axes.length>e;e++)n.removeAxis(t.axes[e]);for(e=0;t.charts.length>e;e++)n.removeChart(t.charts[e])}t.axes=[],t.charts=[],t.content.destroy(),t.content.children=[],t.chartContainer.children=[]},reflow:function(e){var t,n=this;ri(n.children)===n.content&&(t=n.children.pop()),Mn.fn.reflow.call(n,e),t&&n.children.push(t),n.title&&(n.contentBox.y1+=n.title.box.height())},renderComplete:function(){this.options.visible&&this.createGridLines()},stackRoot:W,createGridLines:function(){var e,t,n,i,r,o,a=this,s=a.axes,l=s.concat(a.parent.axes),c=[],d=[];for(t=0;s.length>t;t++)for(i=s[t],r=i.options.vertical,e=r?c:d,n=0;l.length>n;n++)0===e.length&&(o=l[n],r!==o.options.vertical&&ni(e,i.createGridLines(o)))},refresh:function(){this.visual.clear(),this.content.parent=null,this.content.createGradient=e.proxy(this.createGradient,this),this.content.renderVisual(),this.content.parent=this,this.visual.append(this.content.visual),this.renderComplete()},clipBox:function(){return this.chartContainer.clipBox}}),$t=Fn.extend({init:function(e,t){var n=this;Fn.fn.init.call(n,e),n.pane=t},shouldClip:function(){var e,t=this,n=t.children,i=n.length;for(e=0;i>e;e++)if(n[e].options.clip===!0)return!0;return!1},_clipBox:function(){var e,t,n,i,r=this,o=r.pane,a=o.axes,s=a.length,l=o.box.clone();for(t=0;s>t;t++)i=a[t],e=i.options.vertical?Vo:Oo,n=i.lineBox(),l[e+1]=n[e+1],l[e+2]=n[e+2];return l},createVisual:function(){var e,t,n;this.visual=new hi.Group({zIndex:0}),this.shouldClip()&&(e=this.clipBox=this._clipBox(),t=e.toRect(),n=hi.Path.fromRect(t),this.visual.clip(n),this.unclipLabels())},stackRoot:W,unclipLabels:function(){var e,t,n,i,r,o=this,a=o.children,s=o.clipBox;for(n=0;a.length>n;n++)for(e=a[n].points||{},r=e.length,i=0;r>i;i++)t=e[i],t&&t.label&&t.label.options.visible&&t.box.overlaps(s)&&(t.label.alignToClipBox&&t.label.alignToClipBox(s),t.label.options.noclip=!0)},destroy:function(){Fn.fn.destroy.call(this),delete this.parent}}),Yt=Fn.extend({init:function(e,t){var n=this;Fn.fn.init.call(n,t),n.series=e,n.initSeries(),n.charts=[],n.options.legend.items=[],n.axes=[],n.crosshairs=[],n.createPanes(),n.render(),n.createCrosshairs()},options:{series:[],plotArea:{margin:{}},background:"",border:{color:xi,width:0},legend:{inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}}},initSeries:function(){var e,t,n=this.series;for(e=0;n.length>e;e++)t=n[e],t.index=e},createPanes:function(){var e,t,n=this,i=[],r=n.options.panes||[],o=gn.max(r.length,1);for(e=0;o>e;e++)t=new Gt(r[e]),t.paneIndex=e,i.push(t),n.append(t);n.panes=i},createCrosshairs:function(e){var t,n,i,r,o,a=this;for(e=e||a.panes,t=0;e.length>t;t++)for(i=e[t],n=0;i.axes.length>n;n++)r=i.axes[n],r.options.crosshair&&r.options.crosshair.visible&&(o=new sn(r,r.options.crosshair),a.crosshairs.push(o),i.content.append(o))},removeCrosshairs:function(e){var t,n,i=this,r=i.crosshairs,o=e.axes;for(t=r.length-1;t>=0;t--)for(n=0;o.length>n;n++)if(r[t].axis===o[n]){r.splice(t,1);break}},findPane:function(e){var t,n,i=this,r=i.panes;for(t=0;r.length>t;t++)if(r[t].options.name===e){n=r[t];break}return n||r[0]},findPointPane:function(e){var t,n,i=this,r=i.panes;for(t=0;r.length>t;t++)if(r[t].box.containsPoint(e)){n=r[t];break}return n},appendAxis:function(e){var t=this,n=t.findPane(e.options.pane);n.appendAxis(e),t.axes.push(e),e.plotArea=t},removeAxis:function(e){var t,n,i=this,r=[];for(t=0;i.axes.length>t;t++)n=i.axes[t],e!==n?r.push(n):n.destroy();i.axes=r},appendChart:function(e,t){var n=this;n.charts.push(e),t?t.appendChart(e):n.append(e)},removeChart:function(e){var t,n,i=this,r=[];for(t=0;i.charts.length>t;t++)n=i.charts[t],n!==e?r.push(n):n.destroy();i.charts=r},addToLegend:function(e){var t,n,i,r,o,a,s,l,c,d=e.length,u=[],h=this.options.legend,p=h.labels||{},f=h.inactiveItems||{},g=f.labels||{};for(t=0;d>t;t++)n=e[t],l=n.visible!==!1,n.visibleInLegend!==!1&&(i=n.name||"",c=l?p.template:g.template||p.template,c&&(i=Dn(c)({text:i,series:n})),r=n.color,s=n._defaults,Sn(r)&&s&&(r=s.color),l?(o={},a=r):(o={color:g.color,font:g.font},a=f.markers.color),i&&u.push({text:i,labels:o,markerColor:a,series:n,active:l}));ni(h.items,u)},groupAxes:function(e){var t,n,i,r,o=[],a=[];for(i=0;e.length>i;i++)for(t=e[i].axes,r=0;t.length>r;r++)n=t[r],n.options.vertical?a.push(n):o.push(n);return{x:o,y:a,any:o.concat(a)}},groupSeriesByPane:function(){var e,t,n,i=this,r=i.series,o={};for(e=0;r.length>e;e++)n=r[e],t=i.seriesPaneName(n),o[t]?o[t].push(n):o[t]=[n];return o},filterVisibleSeries:function(e){var t,n,i=[];for(t=0;e.length>t;t++)n=e[t],n.visible!==!1&&i.push(n);return i},reflow:function(e){var t=this,n=t.options.plotArea,i=t.panes,r=Kn(n.margin);t.box=e.clone().unpad(r),t.reflowPanes(),t.reflowAxes(i),t.reflowCharts(i)},redraw:function(e){var t,n=this;for(e=[].concat(e),this.initSeries(),t=0;e.length>t;t++)n.removeCrosshairs(e[t]),e[t].empty();for(n.render(e),n.reflowAxes(n.panes),n.reflowCharts(e),n.createCrosshairs(e),t=0;e.length>t;t++)e[t].refresh()},axisCrossingValues:function(e,t){var n,i=e.options,r=[].concat(i.axisCrossingValues||i.axisCrossingValue),o=t.length-r.length,a=r[0]||0;for(n=0;o>n;n++)r.push(a);return r},alignAxisTo:function(e,t,n,i){var r=e.getSlot(n,n,!0),o=e.options.reverse?2:1,a=t.getSlot(i,i,!0),s=t.options.reverse?2:1,l=e.box.translate(a[Oo+s]-r[Oo+o],a[Vo+s]-r[Vo+o]);e.pane!==t.pane&&l.translate(0,e.pane.box.y1-t.pane.box.y1),e.reflow(l)},alignAxes:function(e,t){var n,i,r,o,a=this,s=e[0],l=t[0],c=a.axisCrossingValues(s,t),d=a.axisCrossingValues(l,e),u={},h={},p={},f={};
for(o=0;t.length>o;o++)r=t[o],n=r.pane,i=n.id,a.alignAxisTo(r,s,d[o],c[o]),r.options._overlap||(ei(r.lineBox().x1)===ei(s.lineBox().x1)&&(u[i]&&r.reflow(r.box.alignTo(u[i].box,_r).translate(-r.options.margin,0)),u[i]=r),ei(r.lineBox().x2)===ei(s.lineBox().x2)&&(r._mirrored||(r.options.labels.mirror=!r.options.labels.mirror,r._mirrored=!0),a.alignAxisTo(r,s,d[o],c[o]),h[i]&&r.reflow(r.box.alignTo(h[i].box,Jr).translate(r.options.margin,0)),h[i]=r),0!==o&&l.pane===r.pane&&r.alignTo(l));for(o=0;e.length>o;o++)r=e[o],n=r.pane,i=n.id,a.alignAxisTo(r,l,c[o],d[o]),r.options._overlap||(ei(r.lineBox().y1)===ei(l.lineBox().y1)&&(r._mirrored||(r.options.labels.mirror=!r.options.labels.mirror,r._mirrored=!0),a.alignAxisTo(r,l,c[o],d[o]),p[i]&&r.reflow(r.box.alignTo(p[i].box,Do).translate(0,-r.options.margin)),p[i]=r),ei(r.lineBox().y2,Hi)===ei(l.lineBox().y2,Hi)&&(f[i]&&r.reflow(r.box.alignTo(f[i].box,Ti).translate(0,r.options.margin)),f[i]=r),0!==o&&r.alignTo(s))},shrinkAxisWidth:function(e){var t,n,i,r=this,o=r.groupAxes(e).any,a=x(o),s=0;for(t=0;e.length>t;t++)n=e[t],n.axes.length>0&&(s=gn.max(s,a.width()-n.contentBox.width()));for(t=0;o.length>t;t++)i=o[t],i.options.vertical||i.reflow(i.box.shrink(s,0))},shrinkAxisHeight:function(e){var t,n,i,r,o,a;for(t=0;e.length>t;t++)for(n=e[t],i=n.axes,r=gn.max(0,x(i).height()-n.contentBox.height()),o=0;i.length>o;o++)a=i[o],a.options.vertical&&a.reflow(a.box.shrink(0,r))},fitAxes:function(e){var t,n,i,r,o,a,s,l,c=this,d=c.groupAxes(e).any,u=0;for(s=0;e.length>s;s++)if(o=e[s],t=o.axes,n=o.contentBox,t.length>0)for(i=x(t),u=gn.max(u,n.x1-i.x1),r=gn.max(n.y1-i.y1,n.y2-i.y2),l=0;t.length>l;l++)a=t[l],a.reflow(a.box.translate(0,r));for(s=0;d.length>s;s++)a=d[s],a.reflow(a.box.translate(u,0))},reflowAxes:function(e){var t,n=this,i=n.groupAxes(e);for(t=0;e.length>t;t++)n.reflowPaneAxes(e[t]);i.x.length>0&&i.y.length>0&&(n.alignAxes(i.x,i.y),n.shrinkAxisWidth(e),n.alignAxes(i.x,i.y),n.shrinkAxisHeight(e),n.alignAxes(i.x,i.y),n.fitAxes(e))},reflowPaneAxes:function(e){var t,n=e.axes,i=n.length;if(i>0)for(t=0;i>t;t++)n[t].reflow(e.contentBox)},reflowCharts:function(e){var t,n,i=this,r=i.charts,o=r.length,a=i.box;for(n=0;o>n;n++)t=r[n].pane,(!t||Xn(t,e))&&r[n].reflow(a)},reflowPanes:function(){var e,t,n,i,r,o=this,a=o.box,s=o.panes,l=s.length,c=a.height(),d=l,u=0,h=a.y1;for(e=0;l>e;e++)t=s[e],i=t.options.height,t.options.width=a.width(),t.options.height?(i.indexOf&&i.indexOf("%")&&(r=parseInt(i,10)/100,t.options.height=r*a.height()),t.reflow(a.clone()),c-=t.options.height):u++;for(e=0;l>e;e++)t=s[e],t.options.height||(t.options.height=c/u);for(e=0;l>e;e++)t=s[e],n=a.clone().move(a.x1,h),t.reflow(n),d--,h+=t.options.height},backgroundBox:function(){var e,t,n,i,r,o,a=this,s=a.axes,l=s.length;for(n=0;l>n;n++)for(r=s[n],i=0;l>i;i++)o=s[i],r.options.vertical!==o.options.vertical&&(e=r.lineBox().clone().wrap(o.lineBox()),t=t?t.wrap(e):e);return t||a.box},createVisual:function(){var e,t,n,i;Fn.fn.createVisual.call(this),e=this.backgroundBox(),t=this.options.plotArea,n=t.border||{},i=this._bgVisual=hi.Path.fromRect(e.toRect(),{fill:{color:t.background,opacity:t.opacity},stroke:{color:n.width?n.color:"",width:n.width,dashType:n.dashType},zIndex:-1}),this.appendVisual(i)},pointsByCategoryIndex:function(e){var t,n,i,r,o,a=this.charts,s=[];if(null!==e)for(t=0;a.length>t;t++)if(o=a[t],"_navigator"!==o.pane.options.name&&(i=a[t].categoryPoints[e],i&&i.length))for(n=0;i.length>n;n++)r=i[n],r&&ii(r.value)&&null!==r.value&&s.push(r);return s},pointsBySeriesIndex:function(e){var t,n,i,r,o,a=this.charts,s=[];for(i=0;a.length>i;i++)for(o=a[i],t=o.points,r=0;t.length>r;r++)n=t[r],n&&n.options.index===e&&s.push(n);return s},paneByPoint:function(e){var t,n,i=this,r=i.panes;for(n=0;r.length>n;n++)if(t=r[n],t.box.containsPoint(e))return t}}),Qt=Yt.extend({init:function(e,t){var n,i,r=this;if(r.namedCategoryAxes={},r.namedValueAxes={},r.valueAxisRangeTracker=new Kt,e.length>0)for(r.invertAxes=Xn(e[0].type,[wi,Ai,Bo,zo,Kr,hr]),n=0;e.length>n;n++)if(i=e[n].stack,i&&"100%"===i.type){r.stack100=!0;break}Yt.fn.init.call(r,e,t)},options:{categoryAxis:{categories:[]},valueAxis:{}},render:function(e){var t=this;e=e||t.panes,t.createCategoryAxes(e),t.aggregateCategories(e),t.createCharts(e),t.createValueAxes(e)},removeAxis:function(e){var t=this,n=e.options.name;Yt.fn.removeAxis.call(t,e),e instanceof Q?delete t.namedCategoryAxes[n]:(t.valueAxisRangeTracker.reset(n),delete t.namedValueAxes[n]),e===t.categoryAxis&&delete t.categoryAxis,e===t.valueAxis&&delete t.valueAxis},createCharts:function(e){var t,n,i,r,o=this,a=o.groupSeriesByPane();for(t=0;e.length>t;t++)n=e[t],i=a[n.options.name||"default"]||[],o.addToLegend(i),r=o.filterVisibleSeries(i),r&&(o.createAreaChart(z(r,[gi,zo]),n),o.createBarChart(z(r,[Bi,wi]),n),o.createRangeBarChart(z(r,[Xr,Kr]),n),o.createBulletChart(z(r,[Ai,Ro]),n),o.createCandlestickChart(z(r,Ei),n),o.createBoxPlotChart(z(r,Si),n),o.createOHLCChart(z(r,jr),n),o.createWaterfallChart(z(r,[Ho,hr]),n),o.createLineChart(z(r,[br,Bo]),n))},aggregateCategories:function(e){var t,n,i,r,o,a=this,s=a.srcSeries||a.series,l=[];for(t=0;s.length>t;t++)n=s[t],i=a.seriesCategoryAxis(n),r=a.findPane(i.options.pane),o=C(i.options.type,Ui),(o||n.categoryField)&&Xn(r,e)&&(n=a.aggregateSeries(n,i)),l.push(n);a.srcSeries=s,a.series=l},aggregateSeries:function(e,t){var i,r,o,a,s,l=t.options,c=C(t.options.type,Ui),d=l.categories,p=l.srcCategories||d,f=e.data,g=[],m=t.range(),v=Cn({},e),_=Cn({},e),w=u;for(v.data=a=[],c&&(w=h),i=0;f.length>i;i++)r=e.categoryField?w(e.categoryField,f[i]):p[i],o=t.categoryIndex(r,m),o>-1&&(g[o]=g[o]||[],g[o].push(i));for(s=new un(_,q.current,n.current),i=0;d.length>i;i++)a[i]=s.aggregatePoints(g[i],d[i]);return v},appendChart:function(e,t){for(var n=this,i=e.options.series,r=n.seriesCategoryAxis(i[0]),o=r.options.categories,a=gn.max(0,c(i)-o.length);a--;)o.push("");n.valueAxisRangeTracker.update(e.valueAxisRanges),Yt.fn.appendChart.call(n,e,t)},seriesPaneName:function(t){var n=this,i=n.options,r=t.axis,o=[].concat(i.valueAxis),a=e.grep(o,function(e){return e.name===r})[0],s=i.panes||[{}],l=(s[0]||{}).name||"default",c=(a||{}).pane||l;return c},seriesCategoryAxis:function(e){var t=this,n=e.categoryAxis,i=n?t.namedCategoryAxes[n]:t.categoryAxis;if(!i)throw Error("Unable to locate category axis with name "+n);return i},stackableChartOptions:function(e,t){var n,i=e.stack,r=i&&"100%"===i.type;return ii(t.options.clip)?n=t.options.clip:r&&(n=!1),{isStacked:i,isStacked100:r,clip:n}},createBarChart:function(e,t){if(0!==e.length){var n=this,i=e[0],r=new ct(n,vn({series:e,invertAxes:n.invertAxes,gap:i.gap,spacing:i.spacing},n.stackableChartOptions(i,t)));n.appendChart(r,t)}},createRangeBarChart:function(e,t){if(0!==e.length){var n=this,i=e[0],r=new ut(n,{series:e,invertAxes:n.invertAxes,gap:i.gap,spacing:i.spacing});n.appendChart(r,t)}},createBulletChart:function(e,t){if(0!==e.length){var n=this,i=e[0],r=new ht(n,{series:e,invertAxes:n.invertAxes,gap:i.gap,spacing:i.spacing,clip:t.options.clip});n.appendChart(r,t)}},createLineChart:function(e,t){if(0!==e.length){var n=this,i=e[0],r=new kt(n,vn({invertAxes:n.invertAxes,series:e},n.stackableChartOptions(i,t)));n.appendChart(r,t)}},createAreaChart:function(e,t){if(0!==e.length){var n=this,i=e[0],r=new Dt(n,vn({invertAxes:n.invertAxes,series:e},n.stackableChartOptions(i,t)));n.appendChart(r,t)}},createOHLCChart:function(e,t){if(0!==e.length){var n=this,i=e[0],r=new Bt(n,{invertAxes:n.invertAxes,gap:i.gap,series:e,spacing:i.spacing,clip:t.options.clip});n.appendChart(r,t)}},createCandlestickChart:function(e,t){if(0!==e.length){var n=this,i=e[0],r=new zt(n,{invertAxes:n.invertAxes,gap:i.gap,series:e,spacing:i.spacing,clip:t.options.clip});n.appendChart(r,t)}},createBoxPlotChart:function(e,t){if(0!==e.length){var n=this,i=e[0],r=new Ht(n,{invertAxes:n.invertAxes,gap:i.gap,series:e,spacing:i.spacing,clip:t.options.clip});n.appendChart(r,t)}},createWaterfallChart:function(e,t){if(0!==e.length){var n=this,i=e[0],r=new jt(n,{series:e,invertAxes:n.invertAxes,gap:i.gap,spacing:i.spacing});n.appendChart(r,t)}},axisRequiresRounding:function(e,t){var n,i,r=this,o=z(r.series,Qo);for(n=0;o.length>n;n++)if(i=o[n].categoryAxis||"",i===e||!i&&0===t)return!0},createCategoryAxes:function(e){var t,n,i,r,o,a,s,l,c=this,d=c.invertAxes,u=[].concat(c.options.categoryAxis),h=[];for(t=0;u.length>t;t++)if(n=u[t],i=c.findPane(n.pane),Xn(i,e)){if(a=n.name,r=n.categories||[],o=n.type||"",n=Cn({vertical:d,axisCrossingValue:d?Dr:0},n),ii(n.justified)||(n.justified=c.isJustified()),c.axisRequiresRounding(a,t)&&(n.justified=!1,n.roundToBaseUnit=!0),s=L(n,r[0])?new K(n):new Q(n),a){if(c.namedCategoryAxes[a])throw Error("Category axis with name "+a+" is already defined");c.namedCategoryAxes[a]=s}s.axisIndex=t,h.push(s),c.appendAxis(s)}l=c.categoryAxis||h[0],c.categoryAxis=l,d?c.axisY=l:c.axisX=l},isJustified:function(){var e,t,n=this,i=n.series;for(e=0;i.length>e;e++)if(t=i[e],!Xn(t.type,[gi,zo]))return!1;return!0},createValueAxes:function(e){var t,n,i,r,o,a,s,l,c,d=this,u=d.valueAxisRangeTracker,h=u.query(),p=[].concat(d.options.valueAxis),f=d.invertAxes,g={vertical:!f},m=[];for(d.stack100&&(g.roundToMajorUnit=!1,g.labels={format:"P0"}),c=0;p.length>c;c++)if(t=p[c],n=d.findPane(t.pane),Xn(n,e)){if(l=t.name,s=C(t.type,Cr)?{min:.1,max:1}:{min:0,max:1},o=u.query(l)||h||s,0===c&&o&&h&&(o.min=gn.min(o.min,h.min),o.max=gn.max(o.max,h.max)),a=C(t.type,Cr)?Ln:Nn,i=new a(o.min,o.max,Cn({},g,t)),l){if(d.namedValueAxes[l])throw Error("Value axis with name "+l+" is already defined");d.namedValueAxes[l]=i}i.axisIndex=c,m.push(i),d.appendAxis(i)}r=d.valueAxis||m[0],d.valueAxis=r,f?d.axisX=r:d.axisY=r},click:function(t,n){var i,r,o,a=this,s=t._eventCoordinates(n),l=new On(s.x,s.y),c=a.pointPane(l),d=[],u=[];if(c){for(i=c.axes,r=0;i.length>r;r++)o=i[r],o.getValue?S(u,o.getValue(l)):S(d,o.getCategory(l));0===d.length&&S(d,a.categoryAxis.getCategory(l)),d.length>0&&u.length>0&&t.trigger(Yr,{element:e(n.target),originalEvent:n,category:k(d),value:k(u)})}},pointPane:function(e){var t,n,i=this,r=i.panes;for(n=0;r.length>n;n++)if(t=r[n],t.contentBox.containsPoint(e))return t}}),Kt=yn.extend({init:function(){var e=this;e.axisRanges={}},update:function(e){var t,n,i,r=this,o=r.axisRanges;for(i in e)t=o[i],n=e[i],o[i]=t=t||{min:Dr,max:Er},t.min=gn.min(t.min,n.min),t.max=gn.max(t.max,n.max)},reset:function(e){this.axisRanges[e]=t},query:function(e){return this.axisRanges[e]}}),Xt=Yt.extend({init:function(e,t){var n=this;n.namedXAxes={},n.namedYAxes={},n.xAxisRangeTracker=new Kt,n.yAxisRangeTracker=new Kt,Yt.fn.init.call(n,e,t)},options:{xAxis:{},yAxis:{}},render:function(e){var t,n,i,r,o=this,a=o.groupSeriesByPane();for(e=e||o.panes,t=0;e.length>t;t++)n=e[t],i=a[n.options.name||"default"]||[],o.addToLegend(i),r=o.filterVisibleSeries(i),r&&(o.createScatterChart(z(r,no),n),o.createScatterLineChart(z(r,io),n),o.createBubbleChart(z(r,Di),n));o.createAxes(e)},appendChart:function(e,t){var n=this;n.xAxisRangeTracker.update(e.xAxisRanges),n.yAxisRangeTracker.update(e.yAxisRanges),Yt.fn.appendChart.call(n,e,t)},removeAxis:function(e){var t=this,n=e.options.name;Yt.fn.removeAxis.call(t,e),e.options.vertical?(t.yAxisRangeTracker.reset(n),delete t.namedYAxes[n]):(t.xAxisRangeTracker.reset(n),delete t.namedXAxes[n]),e===t.axisX&&delete t.axisX,e===t.axisY&&delete t.axisY},seriesPaneName:function(t){var n=this,i=n.options,r=t.xAxis,o=[].concat(i.xAxis),a=e.grep(o,function(e){return e.name===r})[0],s=t.yAxis,l=[].concat(i.yAxis),c=e.grep(l,function(e){return e.name===s})[0],d=i.panes||[{}],u=d[0].name||"default",h=(a||{}).pane||(c||{}).pane||u;return h},createScatterChart:function(e,t){var n=this;e.length>0&&n.appendChart(new It(n,{series:e,clip:t.options.clip}),t)},createScatterLineChart:function(e,t){var n=this;e.length>0&&n.appendChart(new Pt(n,{series:e,clip:t.options.clip}),t)},createBubbleChart:function(e,t){var n=this;e.length>0&&n.appendChart(new Mt(n,{series:e,clip:t.options.clip}),t)},createXYAxis:function(e,t,n){var i,r,o,a,s,l,c,d,u=this,h=e.name,p=t?u.namedYAxes:u.namedXAxes,f=t?u.yAxisRangeTracker:u.xAxisRangeTracker,g=Cn({},e,{vertical:t}),m=C(g.type,Cr),v=f.query(),_=m?{min:.1,max:1}:{min:0,max:1},w=f.query(h)||v||_,y=u.series,b=[g.min,g.max];for(o=0;y.length>o;o++)if(a=y[o],s=a[t?"yAxis":"xAxis"],s==g.name||0===n&&!s){l=q.current.bindPoint(a,0).valueFields,b.push(l[t?"y":"x"]);break}for(0===n&&v&&(w.min=gn.min(w.min,v.min),w.max=gn.max(w.max,v.max)),d=0;b.length>d;d++)if(b[d]instanceof Date){c=!0;break}if(r=C(g.type,Ui)||!g.type&&c?X:m?Ln:Nn,i=new r(w.min,w.max,g),h){if(p[h])throw Error((t?"Y":"X")+" axis with name "+h+" is already defined");p[h]=i}return u.appendAxis(i),i},createAxes:function(e){var t,n=this,i=n.options,r=[].concat(i.xAxis),o=[],a=[].concat(i.yAxis),s=[];hn(r,function(i){t=n.findPane(this.pane),Xn(t,e)&&o.push(n.createXYAxis(this,!1,i))}),hn(a,function(i){t=n.findPane(this.pane),Xn(t,e)&&s.push(n.createXYAxis(this,!0,i))}),n.axisX=n.axisX||o[0],n.axisY=n.axisY||s[0]},click:function(t,n){var i,r,o,a,s=this,l=t._eventCoordinates(n),c=new On(l.x,l.y),d=s.axes,u=d.length,h=[],p=[];for(i=0;u>i;i++)r=d[i],a=r.options.vertical?p:h,o=r.getValue(c),null!==o&&a.push(o);h.length>0&&p.length>0&&t.trigger(Yr,{element:e(n.target),originalEvent:n,x:k(h),y:k(p)})}}),Zt=Yt.extend({render:function(){var e=this,t=e.series;e.createPieChart(t)},createPieChart:function(e){var t=this,n=e[0],i=new Vt(t,{series:e,padding:n.padding,startAngle:n.startAngle,connectors:n.connectors,legend:t.options.legend});t.appendChart(i)},appendChart:function(e,t){Yt.fn.appendChart.call(this,e,t),ni(this.options.legend.items,e.legendItems)}}),Jt=Zt.extend({render:function(){var e=this,t=e.series;e.createDonutChart(t)},createDonutChart:function(e){var t=this,n=e[0],i=new Wt(t,{series:e,padding:n.padding,connectors:n.connectors,legend:t.options.legend});t.appendChart(i)}}),en=hi.Animation.extend({options:{easing:"easeOutElastic",duration:fr},setup:function(){this.element.transform(ui.transform().scale(uo,uo,this.options.center))},step:function(e){this.element.transform(ui.transform().scale(e,e,this.options.center))}}),hi.AnimationFactory.current.register(Gr,en),tn=hi.Animation.extend({options:{easing:"easeOutElastic"},setup:function(){var e=this.center=this.element.bbox().center();this.element.transform(ui.transform().scale(uo,uo,e))},step:function(e){this.element.transform(ui.transform().scale(e,e,this.center))}}),hi.AnimationFactory.current.register(Di,tn),nn=yn.extend({init:function(){this._points=[]},destroy:function(){this._points=[]},show:function(e){var t,n;for(e=[].concat(e),this.hide(),t=0;e.length>t;t++)n=e[t],n&&n.toggleHighlight&&(n.toggleHighlight(!0),this._points.push(n))},hide:function(){for(var e=this._points;e.length;)e.pop().toggleHighlight(!1)},isHighlighted:function(e){var t,n,i=this._points;for(t=0;i.length>t;t++)if(n=i[t],e==n)return!0;return!1}}),rn=yn.extend({init:function(t,n){var i=this;i.options=Cn({},i.options,n),i.chartElement=t,i.template=rn.template,i.template||(i.template=rn.template=ci("<div class='"+Ni+"tooltip "+Ni+"chart-tooltip' style='display:none; position: absolute; font: #= d.font #;border: #= d.border.width #px solid;opacity: #= d.opacity #; filter: alpha(opacity=#= d.opacity * 100 #);'></div>")),i.element=e(i.template(i.options)),i.move=_n(i.move,i),i._mouseleave=_n(i._mouseleave,i)},destroy:function(){this._clearShowTimeout(),this.element&&(this.element.off(Mr).remove(),this.element=null)},options:{border:{width:1},opacity:1,animation:{duration:Ao}},move:function(){var e,t=this,n=t.options,i=t.element;t.anchor&&(e=t._offset(),t.visible||i.css({top:e.top,left:e.left}),t._ensureElement(document.body),i.stop(!0,!0).show().animate({left:e.left,top:e.top},n.animation.duration),t.visible=!0)},_clearShowTimeout:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null)},_padding:function(){if(!this._chartPadding){var e=this.chartElement;this._chartPadding={top:parseInt(e.css("paddingTop"),10),left:parseInt(e.css("paddingLeft"),10)}}return this._chartPadding},_offset:function(){var t=this,n=t._measure(),i=t.anchor,r=t._padding(),o=t.chartElement.offset(),a=ei(i.y+r.top+o.top),s=ei(i.x+r.left+o.left),l=wn.support.zoomLevel(),c=e(window),d=window.pageYOffset||document.documentElement.scrollTop||0,u=window.pageXOffset||document.documentElement.scrollLeft||0;return a+=t._fit(a-d,n.height,c.outerHeight()/l),s+=t._fit(s-u,n.width,c.outerWidth()/l),{top:a,left:s}},setStyle:function(e,t){var n,i,r=e.background,o=e.border.color;t&&(n=t.color||t.options.color,r=di(r,n),o=di(o,n)),ii(e.color)||(i=new zn(r).percBrightness(),this.element.toggleClass(Ni+Mo,i>180)),this.element.css({backgroundColor:r,borderColor:o,font:e.font,color:e.color,opacity:e.opacity,borderWidth:e.border.width})},show:function(){this._clearShowTimeout(),this.showTimeout=setTimeout(this.move,Io)},hide:function(){var e=this;clearTimeout(e.showTimeout),e._hideElement(),e.visible&&(e.point=null,e.visible=!1,e.index=null)},_measure:function(){this._ensureElement();var e={width:this.element.outerWidth(),height:this.element.outerHeight()};return e},_ensureElement:function(){this.element&&this.element.appendTo(document.body).on(Mr,this._mouseleave)},_mouseleave:function(t){var n=t.relatedTarget,i=this.chartElement[0];n&&n!==i&&!e.contains(i,n)&&this.hide()},_hideElement:function(){this.element&&this.element.fadeOut({always:function(){e(this).off(Mr).remove()}})},_pointContent:function(e){var t,n,i=this,r=Cn({},i.options,e.options.tooltip);return ii(e.value)&&(t=""+e.value),r.template?(n=Dn(r.template),t=n({value:e.value,category:e.category,series:e.series,dataItem:e.dataItem,percentage:e.percentage,runningTotal:e.runningTotal,total:e.total,low:e.low,high:e.high,xLow:e.xLow,xHigh:e.xHigh,yLow:e.yLow,yHigh:e.yHigh})):r.format&&(t=e.formatValue(r.format)),t},_pointAnchor:function(e){var t=this._measure();return e.tooltipAnchor(t.width,t.height)},_fit:function(e,t,n){var i=0;return e+t>n&&(i=n-(e+t)),0>e&&(i=-e),i}}),on=rn.extend({show:function(e){var t=this,n=Cn({},t.options,e.options.tooltip);e&&e.tooltipAnchor&&t.element&&(t.element.html(t._pointContent(e)),t.anchor=t._pointAnchor(e),t.anchor?(t.setStyle(n,e),rn.fn.show.call(t,e)):t.hide())}}),an=rn.extend({init:function(e,t,n){var i=this;rn.fn.init.call(i,e,n),i.plotArea=t},options:{sharedTemplate:"<table><th colspan='2'>#= categoryText #</th># for(var i = 0; i < points.length; i++) { ## var point = points[i]; #<tr># if(point.series.name) { # <td> #= point.series.name #:</td># } #<td>#= content(point) #</td></tr># } #</table>",categoryFormat:"{0:d}"},showAt:function(t,n){var i,r=this,o=r.options,a=r.plotArea,s=a.categoryAxis,l=s.pointCategoryIndex(n),c=s.getCategory(n),d=s.getSlot(l);t=e.grep(t,function(e){var t=e.series.tooltip,n=t&&t.visible===!1;return!n}),t.length>0&&(i=r._content(t,c),r.element.html(i),r.anchor=r._slotAnchor(n,d),r.setStyle(o,t[0]),rn.fn.show.call(r))},_slotAnchor:function(e,t){var n,i=this,r=i.plotArea,o=r.categoryAxis,a=this._measure(),s=e.y-a.height/2;return n=o.options.vertical?On(e.x,s):On(t.center().x,s)},_content:function(e,t){var n,i,r=this;return n=wn.template(r.options.sharedTemplate),i=n({points:e,category:t,categoryText:Yn(r.options.categoryFormat,t),content:r._pointContent})}}),sn=Fn.extend({init:function(e,t){Fn.fn.init.call(this,t),this.axis=e,this.stickyMode=e instanceof Q},options:{color:xi,width:1,zIndex:-1,tooltip:{visible:!1}},showAt:function(e){var t;this.point=e,this.moveLine(),this.line.visible(!0),t=this.options.tooltip,t.visible&&(this.tooltip||(this.tooltip=new ln(this,Cn({},t,{stickyMode:this.stickyMode}))),this.tooltip.showAt(e))},hide:function(){this.line.visible(!1),this.tooltip&&this.tooltip.hide()},moveLine:function(){var e,t,n,i=this,r=i.axis,o=r.options.vertical,a=i.getBox(),s=i.point,l=o?Vo:Oo;t=new ui.Point(a.x1,a.y1),n=o?new ui.Point(a.x2,a.y1):new ui.Point(a.x1,a.y2),s&&(i.stickyMode?(e=r.getSlot(r.pointCategoryIndex(s)),t[l]=n[l]=e.center()[l]):t[l]=n[l]=s[l]),i.box=a,this.line.moveTo(t).lineTo(n)},getBox:function(){var e,t,n,i=this,r=i.axis,o=r.pane.axes,a=o.length,s=r.options.vertical,l=r.lineBox().clone(),c=s?Oo:Vo;for(n=0;a>n;n++)t=o[n],t.options.vertical!=s&&(e?e.wrap(t.lineBox()):e=t.lineBox().clone());return l[c+1]=e[c+1],l[c+2]=e[c+2],l},createVisual:function(){Fn.fn.createVisual.call(this);var e=this.options;this.line=new hi.Path({stroke:{color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType},visible:!1}),this.moveLine(),this.visual.append(this.line)},destroy:function(){var e=this;e.tooltip&&e.tooltip.destroy(),Fn.fn.destroy.call(e)}}),ln=rn.extend({init:function(e,t){var n=this,i=e.axis.getRoot().chart.element;n.crosshair=e,rn.fn.init.call(n,i,Cn({},n.options,{background:e.axis.plotArea.options.seriesColors[0]},t)),n.setStyle(n.options)},options:{padding:10},showAt:function(e){var t=this,n=t.element;n&&(t.point=e,t.element.html(t.content(e)),t.anchor=t.getAnchor(),t.move())},move:function(){var e=this,t=e.element,n=e._offset();e._ensureElement(),t.css({top:n.top,left:n.left}).show()},content:function(e){var t,n,i,r=this,o=r.options,a=r.crosshair.axis,s=a.options;return n=t=a[o.stickyMode?"getCategory":"getValue"](e),o.template?(i=Dn(o.template),t=i({value:n})):o.format?t=Yn(o.format,n):s.type===Ui&&(t=Yn(s.labels.dateFormats[s.baseUnit],n)),t},getAnchor:function(){var e,t=this,n=t.options,i=n.position,r=this.crosshair,o=!r.axis.options.vertical,a=r.line.bbox(),s=this._measure(),l=s.width/2,c=s.height/2,d=n.padding;return e=o?i===Ti?a.bottomLeft().translate(-l,d):a.topLeft().translate(-l,-s.height-d):i===_r?a.topLeft().translate(-s.width-d,-c):a.topRight().translate(d,-c)},hide:function(){this.element.hide(),this.point=null},destroy:function(){rn.fn.destroy.call(this),this.point=null}}),cn={min:function(e){var t,n,i=Dr,r=e.length;for(t=0;r>t;t++)n=e[t],A(n)&&(i=gn.min(i,n));return i===Dr?e[0]:i},max:function(e){var t,n,i=Er,r=e.length;for(t=0;r>t;t++)n=e[t],A(n)&&(i=gn.max(i,n));return i===Er?e[0]:i},sum:function(e){var t,n,i=e.length,r=0;for(t=0;i>t;t++)n=e[t],A(n)&&(r+=n);return r},sumOrNull:function(e){var t=null;return E(e)&&(t=cn.sum(e)),t},count:function(e){var t,n,i=e.length,r=0;for(t=0;i>t;t++)n=e[t],null!==n&&ii(n)&&r++;return r},avg:function(e){var t=e[0],n=E(e);return n>0&&(t=cn.sum(e)/n),t},first:function(e){var t,n,i=e.length;for(t=0;i>t;t++)if(n=e[t],null!==n&&ii(n))return n;return e[0]}},n.prototype={register:function(e,t){for(var n=0;e.length>n;n++)this._defaults[e[n]]=t},query:function(e){return this._defaults[e]}},n.current=new n,dn=bn.extend({init:function(t,n,i){var r,o,a=this,s=t.element,l=n.lineBox(),c=a.getValueAxis(n),d=c.lineBox(),u="."+Ni;bn.fn.init.call(a),a.options=Cn({},a.options,i),i=a.options,a.chart=t,a.chartElement=s,a.categoryAxis=n,a._dateAxis=a.categoryAxis instanceof K,a.valueAxis=c,a._dateAxis&&Cn(i,{min:p(i.min),max:p(i.max),from:p(i.from),to:p(i.to)}),a.template=dn.template,a.template||(a.template=dn.template=ci("<div class='"+Ni+"selector' style='width: #= d.width #px; height: #= d.height #px; top: #= d.offset.top #px; left: #= d.offset.left #px;'><div class='"+Ni+"mask'></div><div class='"+Ni+"mask'></div><div class='"+Ni+"selection'><div class='"+Ni+"selection-bg'></div><div class='"+Ni+"handle "+Ni+"leftHandle'><div></div></div><div class='"+Ni+"handle "+Ni+"rightHandle'><div></div></div></div></div>")),o={left:parseInt(s.css("paddingLeft"),10),right:parseInt(s.css("paddingTop"),10)},a.options=Cn({},{width:l.width(),height:d.height(),padding:o,offset:{left:d.x2+o.left,top:d.y1+o.right},from:i.min,to:i.max},i),a.options.visible&&(a.wrapper=r=e(a.template(a.options)).appendTo(s),a.selection=r.find(u+"selection"),a.leftMask=r.find(u+"mask").first(),a.rightMask=r.find(u+"mask").last(),a.leftHandle=r.find(u+"leftHandle"),a.rightHandle=r.find(u+"rightHandle"),a.options.selection={border:{left:parseFloat(a.selection.css("border-left-width"),10),right:parseFloat(a.selection.css("border-right-width"),10)}},a.leftHandle.css("top",(a.selection.height()-a.leftHandle.height())/2),a.rightHandle.css("top",(a.selection.height()-a.rightHandle.height())/2),a.set(a._index(i.from),a._index(i.to)),a.bind(a.events,a.options),a.wrapper[0].style.cssText=a.wrapper[0].style.cssText,a.wrapper.on(Nr,_n(a._mousewheel,a)),wn.UserEvents?a.userEvents=new wn.UserEvents(a.wrapper,{global:!0,stopPropagation:!0,multiTouch:!0,start:_n(a._start,a),move:_n(a._move,a),end:_n(a._end,a),tap:_n(a._tap,a),gesturestart:_n(a._gesturechange,a),gesturechange:_n(a._gesturechange,a)}):a.leftHandle.add(a.rightHandle).removeClass(Ni+"handle"))},events:[oo,ao,so],options:{visible:!0,mousewheel:{zoom:Ci},min:Er,max:Dr},destroy:function(){var e=this,t=e.userEvents;t&&t.destroy(),clearTimeout(e._mwTimeout),e._state=null,e.wrapper.remove()},_rangeEventArgs:function(e){var t=this;return{axis:t.categoryAxis.options,from:t._value(e.from),to:t._value(e.to)}},_start:function(t){var n,i=this,r=i.options,o=e(t.event.target);!i._state&&o&&(i.chart._unsetActivePoint(),i._state={moveTarget:o.parents(".k-handle").add(o).first(),startLocation:t.x?t.x.location:0,range:{from:i._index(r.from),to:i._index(r.to)}},n=i._rangeEventArgs({from:i._index(r.from),to:i._index(r.to)}),i.trigger(oo,n)&&(i.userEvents.cancel(),i._state=null))},_move:function(e){if(this._state){var t=this,n=t._state,i=t.options,r=t.categoryAxis.options.categories,o=t._index(i.from),a=t._index(i.to),s=t._index(i.min),l=t._index(i.max),c=n.startLocation-e.x.location,d=n.range,u={from:d.from,to:d.to},h=d.to-d.from,p=n.moveTarget,f=t.wrapper.width()/(r.length-1),g=gn.round(c/f);p&&(e.preventDefault(),p.is(".k-selection, .k-selection-bg")?(d.from=gn.min(gn.max(s,o-g),l-h),d.to=gn.min(d.from+h,l)):p.is(".k-leftHandle")?(d.from=gn.min(gn.max(s,o-g),l-1),d.to=gn.max(d.from+1,d.to)):p.is(".k-rightHandle")&&(d.to=gn.min(gn.max(s+1,a-g),l),d.from=gn.min(d.to-1,d.from)),(d.from!==u.from||d.to!==u.to)&&(t.move(d.from,d.to),t.trigger(ao,t._rangeEventArgs(d))))}},_end:function(){var e=this,t=e._state.range;delete e._state,e.set(t.from,t.to),e.trigger(so,e._rangeEventArgs(t))},_gesturechange:function(e){if(this._state){var t=this,n=t.chart,i=t._state,r=t.options,o=t.categoryAxis,a=i.range,s=n._toModelCoordinates(e.touches[0].x.location).x,l=n._toModelCoordinates(e.touches[1].x.location).x,c=gn.min(s,l),d=gn.max(s,l);e.preventDefault(),i.moveTarget=null,a.from=o.pointCategoryIndex(new An.Point2D(c))||r.min,a.to=o.pointCategoryIndex(new An.Point2D(d))||r.max,t.move(a.from,a.to)}},_tap:function(e){var t=this,n=t.options,i=t.chart._eventCoordinates(e),r=t.categoryAxis,o=r.pointCategoryIndex(new An.Point2D(i.x,r.box.y1)),a=t._index(n.from),s=t._index(n.to),l=t._index(n.min),c=t._index(n.max),d=s-a,u=a+d/2,h=gn.round(u-o),p={},f=3===e.event.which;t._state||f||(e.preventDefault(),t.chart._unsetActivePoint(),r.options.justified||h--,p.from=gn.min(gn.max(l,a-h),c-d),p.to=gn.min(p.from+d,c),t._start(e),t._state&&(t._state.range=p,t.trigger(ao,t._rangeEventArgs(p)),t._end()))},_mousewheel:function(e){var t,n=this,i=n.options,r=Jn(e);n._start({event:{target:n.selection}}),n._state&&(t=n._state.range,e.preventDefault(),e.stopPropagation(),gn.abs(r)>1&&(r*=jo),i.mousewheel.reverse&&(r*=-1),n.expand(r)&&n.trigger(ao,{axis:n.categoryAxis.options,delta:r,originalEvent:e,from:n._value(t.from),to:n._value(t.to)}),n._mwTimeout&&clearTimeout(n._mwTimeout),n._mwTimeout=setTimeout(function(){n._end()},Lr))},_index:function(e){var t=this,n=t.categoryAxis,i=n.options.categories,r=e;return e instanceof Date&&(r=D(e,i),!n.options.justified&&e>ri(i)&&(r+=1)),r},_value:function(e){var t=this,n=this.categoryAxis,i=n.options.categories,r=e;return t._dateAxis&&(r=e>i.length-1?t.options.max:i[e]),r},_slot:function(e){var t=this,n=this.categoryAxis;return n.getSlot(t._index(e))},move:function(e,t){var n,i,r,o,a=this,s=a.options,l=s.offset,c=s.padding,d=s.selection.border;r=a._slot(e),n=ei(r.x1-l.left+c.left),a.leftMask.width(n),a.selection.css("left",n),r=a._slot(t),i=ei(s.width-(r.x1-l.left+c.left)),a.rightMask.width(i),o=s.width-i,o!=s.width&&(o+=d.right),a.rightMask.css("left",o),a.selection.width(gn.max(s.width-(n+i)-d.right,0))},set:function(e,t){var n=this,i=n.options,r=n._index(i.min),o=n._index(i.max);e=oi(n._index(e),r,o),t=oi(n._index(t),e+1,o),i.visible&&n.move(e,t),i.from=n._value(e),i.to=n._value(t)},expand:function(e){var n=this,i=n.options,r=n._index(i.min),o=n._index(i.max),a=i.mousewheel.zoom,s=n._index(i.from),l=n._index(i.to),c={from:s,to:l},d=Cn({},c);return n._state&&(c=n._state.range),a!==Jr&&(c.from=oi(oi(s-e,0,l-1),r,o)),a!==_r&&(c.to=oi(oi(l+e,c.from+1,o),r,o)),c.from!==d.from||c.to!==d.to?(n.set(c.from,c.to),!0):t},getValueAxis:function(e){var t,n,i=e.pane.axes,r=i.length;for(t=0;r>t;t++)if(n=i[t],n.options.vertical!==e.options.vertical)return n}}),un=function(e,t,n){var i,r,o,a=this,s=t.canonicalFields(e),l=t.valueFields(e),c=t.sourceFields(e,s),d=a._seriesFields=[],u=n.query(e.type),h=e.aggregate||u;for(a._series=e,a._binder=t,i=0;s.length>i;i++){if(r=s[i],typeof h===Wr)o=h[r];else{if(0!==i&&!Xn(r,l))break;o=h}o&&d.push({canonicalName:r,name:c[i],transform:Sn(o)?o:cn[o]})}},un.prototype={aggregatePoints:function(e,t){var n,i,r,o,a,s=this,l=s._bindPoints(e||[]),c=s._series,d=s._seriesFields,u=l.dataItems[0],h={};for(!u||A(u)||pn(u)||(a=function(){},a.prototype=u,h=new a),n=0;d.length>n;n++){if(i=d[n],r=s._bindField(l.values,i.canonicalName),o=i.transform(r,c,l.dataItems,t),null!==o&&typeof o===Wr&&!ii(o.length)){h=o;break}ii(o)&&(O(i.name,h),wn.setter(i.name)(h,o))}return h},_bindPoints:function(e){var t,n,i=this,r=i._binder,o=i._series,a=[],s=[];for(t=0;e.length>t;t++)n=e[t],a.push(r.bindPoint(o,n)),s.push(o.data[n]);return{values:a,dataItems:s}},_bindField:function(e,t){var n,i,r,o,a=[],s=e.length;for(n=0;s>n;n++)i=e[n],o=i.valueFields,r=ii(o[t])?o[t]:i.fields[t],a.push(r);return a}},vn(e.easing,{easeOutElastic:function(e,t,n,i){var r=1.70158,o=0,a=i;return 0===e?n:1===e?n+i:(o||(o=.5),a<gn.abs(i)?(a=i,r=o/4):r=o/(2*gn.PI)*gn.asin(i/a),a*gn.pow(2,-10*e)*gn.sin(1.1*(1*e-r)*gn.PI/o)+i+n)}}),An.ui.plugin(Xo),j.current.register(Qt,[wi,Bi,br,Bo,gi,zo,Ei,jr,Ai,Ro,Si,Xr,Kr,Ho,hr]),j.current.register(Xt,[no,io,Di]),j.current.register(Zt,[Gr]),j.current.register(Jt,[Qi]),q.current.register([wi,Bi,br,Bo,gi,zo],[Fo],[Ii,Ri,Ur,er,tr]),q.current.register([Xr,Kr],[lr,So],[Ii,Ri,Ur]),q.current.register([Ho,hr],[Fo],[Ii,Ri,Ur,vo]),n.current.register([wi,Bi,br,Bo,gi,zo,Ho,hr],{value:Tr,color:sr,noteText:sr,errorLow:Ar,errorHigh:Tr}),n.current.register([Xr,Kr],{from:Ar,to:Tr,color:sr,noteText:sr}),q.current.register([no,io,Di],[Oo,Vo],[Ri,Ur,nr,ir,rr,or]),q.current.register([Di],[Oo,Vo,"size"],[Ri,Ii,Ur]),q.current.register([Ei,jr],["open","high","low","close"],[Ii,Ri,"downColor",Ur]),n.current.register([Ei,jr],{open:Tr,high:Tr,low:Ar,close:Tr,color:sr,downColor:sr,noteText:sr}),q.current.register([Si],["lower","q1","median","q3","upper","mean","outliers"],[Ii,Ri,Ur]),n.current.register([Si],{lower:Tr,q1:Tr,median:Tr,q3:Tr,upper:Tr,mean:Tr,outliers:sr,color:sr,noteText:sr}),q.current.register([Ai,Ro],["current","target"],[Ii,Ri,"visibleInLegend",Ur]),n.current.register([Ai,Ro],{current:Tr,target:Tr,color:sr,noteText:sr}),q.current.register([Gr,Qi],[Fo],[Ii,Ri,"explode","visibleInLegend","visible"]),Cn(An,{EQUALLY_SPACED_SERIES:Qo,Aggregates:cn,AreaChart:Dt,AreaSegment:St,AxisGroupRangeTracker:Kt,Bar:it,BarChart:ct,BarLabel:G,BubbleChart:Mt,Bullet:pt,BulletChart:ht,CandlestickChart:zt,Candlestick:Ft,CategoricalChart:lt,CategoricalErrorBar:mt,CategoricalPlotArea:Qt,CategoryAxis:Q,ChartContainer:$t,ClusterLayout:J,Crosshair:sn,CrosshairTooltip:ln,DateCategoryAxis:K,DateValueAxis:X,DefaultAggregates:n,DonutChart:Wt,DonutPlotArea:Jt,DonutSegment:Ut,ErrorBarBase:gt,ErrorRangeCalculator:st,Highlight:nn,SharedTooltip:an,Legend:Y,LegendItem:$,LineChart:kt,LinePoint:_t,LineSegment:yt,Pane:Gt,PieAnimation:en,PieChart:Vt,PieChartMixin:Ot,PiePlotArea:Zt,PieSegment:Nt,PlotAreaBase:Yt,PlotAreaFactory:j,PointEventsMixin:tt,RangeBar:dt,RangeBarChart:ut,ScatterChart:It,ScatterErrorBar:vt,ScatterLineChart:Pt,Selection:dn,SeriesAggregator:un,SeriesBinder:q,ShapeElement:Wn,SplineSegment:Ct,SplineAreaSegment:At,StackWrap:et,Tooltip:on,OHLCChart:Bt,OHLCPoint:Rt,WaterfallChart:jt,WaterfallSegment:qt,XYPlotArea:Xt,addDuration:g,areNumbers:I,axisGroupBox:x,categoriesCount:c,ceilDate:_,countNumbers:E,duration:b,ensureTree:O,indexOf:R,isNumber:A,floorDate:v,filterSeriesByType:z,lteDateIndex:D,evalOptions:M,seriesTotal:V,singleItemOrArray:k,sortDates:B,startOfWeek:m,transpose:N,toDate:p,toTime:f,uniqueDates:H})
}(window.kendo.jQuery),function(e,t){function n(e,t){return e.value.x-t.value.x}function i(e,t){return 180-C.abs(C.abs(e-t)-180)}var r,o,a,s,l,c,d,u,h,p,f,g,m,v,_,w,y,b,k,x,C=Math,T=window.kendo,S=T.deepExtend,D=T.util,A=D.append,E=T.drawing,I=T.geometry,P=T.dataviz,M=P.AreaSegment,F=P.Axis,z=P.AxisGroupRangeTracker,R=P.BarChart,B=P.Box2D,H=P.CategoryAxis,L=P.CategoricalChart,N=P.CategoricalPlotArea,O=P.ChartElement,V=P.CurveProcessor,U=P.DonutSegment,W=P.LineChart,j=P.LineSegment,q=P.LogarithmicAxis,G=P.NumericAxis,$=P.PlotAreaBase,Y=P.PlotAreaFactory,Q=P.Point2D,K=P.Ring,X=P.ScatterChart,Z=P.ScatterLineChart,J=P.SeriesBinder,et=P.ShapeBuilder,tt=P.SplineSegment,nt=P.SplineAreaSegment,it=P.getSpacing,rt=P.filterSeriesByType,ot=D.limitValue,at=P.round,st="arc",lt="#000",ct=P.COORD_PRECISION,dt=.15,ut=C.PI/180,ht="log",pt="plotAreaClick",ft="polarArea",gt="polarLine",mt="polarScatter",vt="radarArea",_t="radarColumn",wt="radarLine",yt="smooth",bt="x",kt="y",xt="zero",Ct=[ft,gt,mt],Tt=[vt,_t,wt],St={createGridLines:function(e){var t,n,i=this,r=i.options,o=C.abs(i.box.center().y-e.lineBox().y1),a=!1,s=[];return r.majorGridLines.visible&&(t=i.majorGridLineAngles(e),a=!0,s=i.renderGridLines(t,o,r.majorGridLines)),r.minorGridLines.visible&&(n=i.minorGridLineAngles(e,a),A(s,i.renderGridLines(n,o,r.minorGridLines))),s},renderGridLines:function(e,t,n){var i,r,o={stroke:{width:n.width,color:n.color,dashType:n.dashType}},a=this.box.center(),s=new I.Circle([a.x,a.y],t),l=this.gridLinesVisual();for(i=0;e.length>i;i++)r=new E.Path(o),r.moveTo(s.center).lineTo(s.pointAt(e[i])),l.append(r);return l.children},gridLineAngles:function(n,i,r){var o=this,a=o.intervals(i,r);return e.map(a,function(e){var i=o.intervalAngle(e);return n.options.visible&&90===i?t:i})}},Dt=H.extend({options:{startAngle:90,labels:{margin:it(10)},majorGridLines:{visible:!0},justified:!0},range:function(){return{min:0,max:this.options.categories.length}},reflow:function(e){this.box=e,this.reflowLabels()},lineBox:function(){return this.box},reflowLabels:function(){var e,t,n=this,i=new B,r=n.labels;for(t=0;r.length>t;t++)r[t].reflow(i),e=r[t].box,r[t].reflow(n.getSlot(t).adjacentBox(0,e.width(),e.height()))},intervals:function(e,t){var n,i=this,r=i.options,o=r.categories.length,a=0,s=0,l=o/e||1,c=360/l,d=[];for(t&&(s=360/(o/t)),n=0;l>n;n++)a=at(a,ct),a%s!==0&&d.push(a%360),r.reverse?a=360+a-c:a+=c;return d},majorIntervals:function(){return this.intervals(1)},minorIntervals:function(){return this.intervals(.5)},intervalAngle:function(e){return(360+e+this.options.startAngle)%360},majorAngles:function(){return e.map(this.majorIntervals(),e.proxy(this.intervalAngle,this))},createLine:function(){return[]},majorGridLineAngles:function(e){return this.gridLineAngles(e,1)},minorGridLineAngles:function(e,t){return this.gridLineAngles(e,.5,t?1:0)},createPlotBands:function(){var e,t,n,i,r,o,a,s=this,l=s.options,c=l.plotBands||[],d=this._plotbandGroup=new E.Group({zIndex:-1});for(e=0;c.length>e;e++)t=c[e],n=s.plotBandSlot(t),i=s.getSlot(t.from),r=t.from-C.floor(t.from),n.startAngle+=r*i.angle,o=C.ceil(t.to)-t.to,n.angle-=(o+r)*i.angle,a=et.current.createRing(n,{fill:{color:t.color,opacity:t.opacity},stroke:{opacity:t.opacity}}),d.append(a);s.appendVisual(d)},plotBandSlot:function(e){return this.getSlot(e.from,e.to-1)},getSlot:function(e,t){var n,i,r,o=this,a=o.options,s=a.justified,l=o.box,c=o.majorAngles(),d=c.length,u=360/d;return a.reverse&&!s&&(e=(e+1)%d),e=ot(C.floor(e),0,d-1),i=c[e],s&&(i-=u/2,0>i&&(i+=360)),t=ot(C.ceil(t||e),e,d-1),n=t-e+1,r=u*n,new K(l.center(),0,l.height()/2,i,r)},pointCategoryIndex:function(e){var t,n,i=this,r=null,o=i.options.categories.length;for(t=0;o>t;t++)if(n=i.getSlot(t),n.containsPoint(e)){r=t;break}return r}});S(Dt.fn,St),r={options:{majorGridLines:{visible:!0}},createPlotBands:function(){var e,t,n,i,r,o,a=this,s=a.options,l=s.plotBands||[],c=s.majorGridLines.type,d=a.plotArea.polarAxis,u=d.majorAngles(),h=d.box.center(),p=this._plotbandGroup=new E.Group({zIndex:-1});for(e=0;l.length>e;e++)t=l[e],n={fill:{color:t.color,opacity:t.opacity},stroke:{opacity:t.opacity}},i=a.getSlot(t.from,t.to,!0),r=new K(h,h.y-i.y2,h.y-i.y1,0,360),o=c===st?et.current.createRing(r,n):E.Path.fromPoints(a.plotBandPoints(r,u),n).close(),p.append(o);a.appendVisual(p)},plotBandPoints:function(e,t){var n,i=[],r=[],o=[e.c.x,e.c.y],a=new I.Circle(o,e.ir),s=new I.Circle(o,e.r);for(n=0;t.length>n;n++)i.push(a.pointAt(t[n])),r.push(s.pointAt(t[n]));return i.reverse(),i.push(i[0]),r.push(r[0]),r.concat(i)},createGridLines:function(e){var t,n=this,i=n.options,r=n.radarMajorGridLinePositions(),o=e.majorAngles(),a=e.box.center(),s=[];return i.majorGridLines.visible&&(s=n.renderGridLines(a,r,o,i.majorGridLines)),i.minorGridLines.visible&&(t=n.radarMinorGridLinePositions(),A(s,n.renderGridLines(a,t,o,i.minorGridLines))),s},renderGridLines:function(e,t,n,i){var r,o,a,s,l,c={stroke:{width:i.width,color:i.color,dashType:i.dashType}},d=this.gridLinesVisual();for(o=0;t.length>o;o++)if(r=e.y-t[o],r>0)if(s=new I.Circle([e.x,e.y],r),i.type===st)d.append(new E.Circle(s,c));else{for(l=new E.Path(c),a=0;n.length>a;a++)l.lineTo(s.pointAt(n[a]));l.close(),d.append(l)}return d.children},getValue:function(e){var t,n,r,o,a,s,l,c=this,d=c.options,u=c.lineBox(),h=c.plotArea.polarAxis,p=h.majorAngles(),f=h.box.center(),g=e.distanceTo(f),m=g;return d.majorGridLines.type!==st&&p.length>1&&(t=e.x-f.x,n=e.y-f.y,r=(C.atan2(n,t)/ut+540)%360,p.sort(function(e,t){return i(e,r)-i(t,r)}),o=i(p[0],p[1])/2,a=i(r,p[0]),s=90-o,l=180-a-s,m=g*(C.sin(l*ut)/C.sin(s*ut))),c.axisType().fn.getValue.call(c,new Q(u.x1,u.y2-m))}},o=G.extend({radarMajorGridLinePositions:function(){return this.getTickPositions(this.options.majorUnit)},radarMinorGridLinePositions:function(){var e=this,t=e.options,n=0;return t.majorGridLines.visible&&(n=t.majorUnit),e.getTickPositions(t.minorUnit,n)},axisType:function(){return G}}),S(o.fn,r),a=q.extend({radarMajorGridLinePositions:function(){var e=this,t=[];return e.traverseMajorTicksPositions(function(e){t.push(e)},e.options.majorGridLines),t},radarMinorGridLinePositions:function(){var e=this,t=[];return e.traverseMinorTicksPositions(function(e){t.push(e)},e.options.minorGridLines),t},axisType:function(){return q}}),S(a.fn,r),s=F.extend({init:function(e){var t=this;F.fn.init.call(t,e),e=t.options,e.minorUnit=e.minorUnit||t.options.majorUnit/2},options:{type:"polar",startAngle:0,reverse:!1,majorUnit:60,min:0,max:360,labels:{margin:it(10)},majorGridLines:{color:lt,visible:!0,width:1},minorGridLines:{color:"#aaa"}},getDivisions:function(e){return G.fn.getDivisions.call(this,e)-1},reflow:function(e){this.box=e,this.reflowLabels()},reflowLabels:function(){var e,t,n=this,i=new B,r=n.majorIntervals(),o=n.labels;for(t=0;o.length>t;t++)o[t].reflow(i),e=o[t].box,o[t].reflow(n.getSlot(r[t]).adjacentBox(0,e.width(),e.height()))},lineBox:function(){return this.box},intervals:function(e,t){var n,i=this,r=i.options,o=i.getDivisions(e),a=r.min,s=[];for(t&&(t/=e),n=0;o>n;n++)n%t!==0&&s.push((360+a)%360),a+=e;return s},majorIntervals:function(){return this.intervals(this.options.majorUnit)},minorIntervals:function(){return this.intervals(this.options.minorUnit)},intervalAngle:function(e){return(360+e-this.options.startAngle)%360},majorAngles:Dt.fn.majorAngles,createLine:function(){return[]},majorGridLineAngles:function(e){return this.gridLineAngles(e,this.options.majorUnit)},minorGridLineAngles:function(e,t){return this.gridLineAngles(e,this.options.minorUnit,t?this.options.majorUnit:0)},createPlotBands:Dt.fn.createPlotBands,plotBandSlot:function(e){return this.getSlot(e.from,e.to)},getSlot:function(e,t){var n,i=this,r=i.options,o=r.startAngle,a=i.box;return e=ot(e,r.min,r.max),t=ot(t||e,e,r.max),r.reverse&&(e*=-1,t*=-1),e=(540-e-o)%360,t=(540-t-o)%360,e>t&&(n=e,e=t,t=n),new K(a.center(),0,a.height()/2,e,t-e)},getValue:function(e){var t=this,n=t.options,i=t.box.center(),r=e.x-i.x,o=e.y-i.y,a=C.round(C.atan2(o,r)/ut),s=n.startAngle;return n.reverse||(a*=-1,s*=-1),(a+s+360)%360},labelsCount:G.fn.labelsCount,createAxisLabel:G.fn.createAxisLabel}),S(s.fn,St),l=O.extend({options:{gap:1,spacing:0},reflow:function(e){var t,n,i=this,r=i.options,o=i.children,a=r.gap,s=r.spacing,l=o.length,c=l+a+s*(l-1),d=e.angle/c,u=e.startAngle+d*(a/2);for(n=0;l>n;n++)t=e.clone(),t.startAngle=u,t.angle=d,o[n].sector&&(t.r=o[n].sector.r),o[n].reflow(t),o[n].sector=t,u+=d+d*s}}),c=O.extend({reflow:function(e){var t,n,i=this,r=i.options.isReversed,o=i.children,a=o.length,s=r?a-1:0,l=r?-1:1;for(i.box=new B,n=s;n>=0&&a>n;n+=l)t=o[n].sector,t.startAngle=e.startAngle,t.angle=e.angle}}),d=U.extend({init:function(e,t){U.fn.init.call(this,e,null,t)},options:{overlay:{gradient:null},labels:{distance:10}}}),u=R.extend({pointType:function(){return d},clusterType:function(){return l},stackType:function(){return c},categorySlot:function(e,t){return e.getSlot(t)},pointSlot:function(e,t){var n=e.clone(),i=e.c.y;return n.r=i-t.y1,n.ir=i-t.y2,n},reflow:L.fn.reflow,reflowPoint:function(e,t){e.sector=t,e.reflow()},options:{clip:!1,animation:{type:"pie"}},createAnimation:function(){this.options.animation.center=this.box.toRect().center(),R.fn.createAnimation.call(this)}}),h=W.extend({options:{clip:!1},pointSlot:function(e,t){var n=e.c.y-t.y1,i=Q.onCircle(e.c,e.middle(),n);return new B(i.x,i.y,i.x,i.y)},createSegment:function(e,t,n){var i,r,o=t.style;return r=o==yt?tt:j,i=new r(e,t,n),e.length===t.data.length&&(i.options.closed=!0),i}}),p=M.extend({points:function(){return j.fn.points.call(this,this.stackPoints)}}),f=nt.extend({areaPoints:function(){return[]}}),g=h.extend({createSegment:function(e,t,n,i){var r,o,a=this,s=a.options,l=s.isStacked,c=(t.line||{}).style;return c===yt?(o=new f(e,i,l,t,n),o.options.closed=!0):(l&&n>0&&i&&(r=i.linePoints.slice(0).reverse()),e.push(e[0]),o=new p(e,r,t,n)),o},seriesMissingValues:function(e){return e.missingValues||xt}}),m=X.extend({pointSlot:function(e,t){var n=e.c.y-t.y1,i=Q.onCircle(e.c,e.startAngle,n);return new B(i.x,i.y,i.x,i.y)},options:{clip:!1}}),v=Z.extend({pointSlot:m.fn.pointSlot,options:{clip:!1}}),_=M.extend({points:function(){var e=this,t=e.parent,n=t.plotArea,i=n.polarAxis,r=i.box.center(),o=e.stackPoints,a=j.fn.points.call(e,o);return a.unshift([r.x,r.y]),a.push([r.x,r.y]),a}}),w=nt.extend({areaPoints:function(){var e=this,t=e.parent,n=t.plotArea,i=n.polarAxis,r=i.box.center();return[r]},points:function(){var e,t=this,n=t.parent,i=n.plotArea,r=i.polarAxis,o=r.box.center(),a=new V(!1),s=j.fn.points.call(this);return s.push(o),e=a.process(s),e.splice(e.length-3,e.length-1),t.curvePoints=e,e}}),y=v.extend({createSegment:function(e,t,n){var i,r=(t.line||{}).style;return i=r==yt?new w(e,null,!1,t,n):new _(e,[],t,n)},seriesMissingValues:function(e){return e.missingValues||xt},sortPoints:function(e){return e.sort(n)}}),b=$.extend({init:function(e,t){var n=this;n.valueAxisRangeTracker=new z,$.fn.init.call(n,e,t)},render:function(){var e=this;e.addToLegend(e.series),e.createPolarAxis(),e.createCharts(),e.createValueAxis()},createValueAxis:function(){var e,t,n,i,r=this,s=r.valueAxisRangeTracker,l=s.query(),c=r.valueAxisOptions({roundToMajorUnit:!1,zIndex:-1});c.type===ht?(n=a,i={min:.1,max:1}):(n=o,i={min:0,max:1}),e=s.query(name)||l||i,e&&l&&(e.min=C.min(e.min,l.min),e.max=C.max(e.max,l.max)),t=new n(e.min,e.max,c),r.valueAxis=t,r.appendAxis(t)},reflowAxes:function(){var e,t=this,n=t.options.plotArea,i=t.valueAxis,r=t.polarAxis,o=t.box,a=C.min(o.width(),o.height())*dt,s=it(n.padding||{},a),l=o.clone().unpad(s),c=l.clone().shrink(0,l.height()/2);r.reflow(l),i.reflow(c),e=i.lineBox().height()-i.box.height(),i.reflow(i.box.unpad({top:e})),t.axisBox=l,t.alignAxes(l)},alignAxes:function(){var e=this,t=e.valueAxis,n=t.getSlot(t.options.min),i=t.options.reverse?2:1,r=e.polarAxis.getSlot(0).c,o=t.box.translate(r.x-n[bt+i],r.y-n[kt+i]);t.reflow(o)},backgroundBox:function(){return this.box}}),k=b.extend({options:{categoryAxis:{categories:[]},valueAxis:{}},createPolarAxis:function(){var e,t=this;e=new Dt(t.options.categoryAxis),t.polarAxis=e,t.categoryAxis=e,t.appendAxis(e)},valueAxisOptions:function(e){var t=this;return t._hasBarCharts&&S(e,{majorGridLines:{type:st},minorGridLines:{type:st}}),t._isStacked100&&S(e,{roundToMajorUnit:!1,labels:{format:"P0"}}),S(e,t.options.valueAxis)},appendChart:N.fn.appendChart,createCharts:function(){var e=this,t=e.filterVisibleSeries(e.series),n=e.panes[0];e.createAreaChart(rt(t,[vt]),n),e.createLineChart(rt(t,[wt]),n),e.createBarChart(rt(t,[_t]),n)},chartOptions:function(e){var t,n,i={series:e},r=e[0];return r&&(t=this.filterVisibleSeries(e),n=r.stack,i.isStacked=n&&t.length>1,i.isStacked100=n&&"100%"===n.type&&t.length>1,i.isStacked100&&(this._isStacked100=!0)),i},createAreaChart:function(e,t){if(0!==e.length){var n=new g(this,this.chartOptions(e));this.appendChart(n,t)}},createLineChart:function(e,t){if(0!==e.length){var n=new h(this,this.chartOptions(e));this.appendChart(n,t)}},createBarChart:function(e,t){var n,i,r;0!==e.length&&(n=e[0],i=this.chartOptions(e),i.gap=n.gap,i.spacing=n.spacing,r=new u(this,i),this.appendChart(r,t),this._hasBarCharts=!0)},seriesCategoryAxis:function(){return this.categoryAxis},click:function(t,n){var i,r,o=this,a=t._eventCoordinates(n),s=new Q(a.x,a.y);i=o.categoryAxis.getCategory(s),r=o.valueAxis.getValue(s),null!==i&&null!==r&&t.trigger(pt,{element:e(n.target),category:i,value:r})}}),x=b.extend({options:{xAxis:{},yAxis:{}},createPolarAxis:function(){var e,t=this;e=new s(t.options.xAxis),t.polarAxis=e,t.axisX=e,t.appendAxis(e)},valueAxisOptions:function(e){var t=this;return S(e,{majorGridLines:{type:st},minorGridLines:{type:st}},t.options.yAxis)},createValueAxis:function(){var e=this;b.fn.createValueAxis.call(e),e.axisY=e.valueAxis},appendChart:function(e,t){var n=this;n.valueAxisRangeTracker.update(e.yAxisRanges),$.fn.appendChart.call(n,e,t)},createCharts:function(){var e=this,t=e.filterVisibleSeries(e.series),n=e.panes[0];e.createLineChart(rt(t,[gt]),n),e.createScatterChart(rt(t,[mt]),n),e.createAreaChart(rt(t,[ft]),n)},createLineChart:function(e,t){if(0!==e.length){var n=this,i=new v(n,{series:e});n.appendChart(i,t)}},createScatterChart:function(e,t){if(0!==e.length){var n=this,i=new m(n,{series:e});n.appendChart(i,t)}},createAreaChart:function(e,t){if(0!==e.length){var n=this,i=new y(n,{series:e});n.appendChart(i,t)}},click:function(t,n){var i,r,o=this,a=t._eventCoordinates(n),s=new Q(a.x,a.y);i=o.axisX.getValue(s),r=o.axisY.getValue(s),null!==i&&null!==r&&t.trigger(pt,{element:e(n.target),x:i,y:r})}}),Y.current.register(x,Ct),Y.current.register(k,Tt),J.current.register(Ct,[bt,kt],["color"]),J.current.register(Tt,["value"],["color"]),P.DefaultAggregates.current.register(Tt,{value:"max",color:"first"}),S(P,{PolarAreaChart:y,PolarAxis:s,PolarLineChart:v,PolarPlotArea:x,RadarAreaChart:g,RadarBarChart:u,RadarCategoryAxis:Dt,RadarClusterLayout:l,RadarLineChart:h,RadarNumericAxis:o,RadarPlotArea:k,SplinePolarAreaSegment:w,SplineRadarAreaSegment:f,RadarStackLayout:c})}(window.kendo.jQuery),function(e,t){var n,i=window.kendo,r=i.deepExtend,o=e.extend,a=i.isFunction,s=i.template,l=i.util,c=l.append,d=i.drawing,u=i.geometry,h=i.dataviz,p=i.drawing.Color,f=h.ChartElement,g=h.PieChartMixin,m=h.PlotAreaBase,v=h.PlotAreaFactory,_=h.Point2D,w=h.Box2D,y=h.SeriesBinder,b=h.TextBox,k=h.autoFormat,x=h.evalOptions,C=l.limitValue,T=h.seriesTotal,S="category",D="color",A="funnel",E="value",I="black",P="white",M=m.extend({render:function(){var e=this,t=e.series;e.createFunnelChart(t)},createFunnelChart:function(e){var t=this,n=e[0],i=new F(t,{series:e,legend:t.options.legend,neckRatio:n.neckRatio,dynamicHeight:n.dynamicHeight,dynamicSlope:n.dynamicSlope,segmentSpacing:n.segmentSpacing,highlight:n.highlight});t.appendChart(i)},appendChart:function(e,t){m.fn.appendChart.call(this,e,t),c(this.options.legend.items,e.legendItems)}}),F=f.extend({init:function(e,t){var n=this;f.fn.init.call(n,t),n.plotArea=e,n.points=[],n.labels=[],n.legendItems=[],n.render()},options:{neckRatio:.3,width:300,dynamicSlope:!1,dynamicHeight:!0,segmentSpacing:0,labels:{visible:!1,align:"center",position:"center"}},formatPointValue:function(e,t){return k(t,e.value)},render:function(){var e,n,i,o,s,l,c,d=this,u=d.options,h=d.plotArea.options.seriesColors||[],p=h.length,f=u.series[0],g=f.data;if(g)for(i=T(f),s=0;g.length>s;s++)e=y.current.bindPoint(f,s),o=e.valueFields.value,null!==o&&o!==t&&(n=e.fields,a(f.color)||(f.color=n.color||h[s%p]),n=r({index:s,owner:d,series:f,category:n.category,dataItem:g[s],percentage:Math.abs(o)/i,visibleInLegend:n.visibleInLegend,visible:n.visible},n),l=d.createSegment(o,n),c=d.createLabel(o,n),l&&c&&l.append(c))},evalSegmentOptions:function(e,t,n){var i=n.series;x(e,{value:t,series:i,dataItem:n.dataItem,index:n.index},{defaults:i._defaults,excluded:["data"]})},createSegment:function(e,i){var a,s=this,l=r({},i.series);return s.evalSegmentOptions(l,e,i),s.createLegendItem(e,l,i),i.visible!==!1?(a=new n(e,l,i),o(a,i),s.append(a),s.points.push(a),a):t},createLabel:function(e,n){var i,o,a,l=this,c=n.series,d=n.dataItem,u=r({},l.options.labels,c.labels),h=e;return u.visible?(u.template?(o=s(u.template),h=o({dataItem:d,value:e,percentage:n.percentage,category:n.category,series:c})):u.format&&(h=k(u.format,h)),u.color||"center"!==u.align||(a=new p(c.color).percBrightness(),u.color=a>180?I:P),l.evalSegmentOptions(u,e,n),i=new b(h,r({vAlign:u.position},u)),l.labels.push(i),i):t},labelPadding:function(){var e,t,n,i,r=this.labels,o={left:0,right:0};for(i=0;r.length>i;i++)e=r[i],t=e.options.align,"center"!==t&&(n=r[i].box.width(),"left"===t?o.left=Math.max(o.left,n):o.right=Math.max(o.right,n));return o},reflow:function(t){var n,i,r,o,a,s,l,c,d,h,p,f,g=this,m=g.options,v=g.points,_=v.length,w=1>=m.neckRatio,y=t.clone().unpad(g.labelPadding()),b=y.width(),k=0,x=w?0:(b-b/m.neckRatio)/2,T=m.segmentSpacing,S=m.dynamicSlope,D=y.height()-T*(_-1),A=w?m.neckRatio*b:b;if(_){if(S)for(l=v[0],c=l,e.each(v,function(e,t){t.percentage>c.percentage&&(c=t)}),r=l.percentage/c.percentage*b,x=(b-r)/2,n=0;_>n;n++)a=v[n].percentage,d=v[n+1],h=d?d.percentage:a,o=v[n].points=[],i=m.dynamicHeight?D*a:D/_,s=(b-r*(h/a))/2,s=C(s,0,b),o.push(new u.Point(y.x1+x,y.y1+k)),o.push(new u.Point(y.x1+b-x,y.y1+k)),o.push(new u.Point(y.x1+b-s,y.y1+i+k)),o.push(new u.Point(y.x1+s,y.y1+i+k)),x=s,k+=i+T,r*=h/a,r=C(r,0,b);else for(p=w?b:b-2*x,f=(p-A)/2,n=0;_>n;n++)o=v[n].points=[],a=v[n].percentage,s=m.dynamicHeight?f*a:f/_,i=m.dynamicHeight?D*a:D/_,o.push(new u.Point(y.x1+x,y.y1+k)),o.push(new u.Point(y.x1+b-x,y.y1+k)),o.push(new u.Point(y.x1+b-x-s,y.y1+i+k)),o.push(new u.Point(y.x1+x+s,y.y1+i+k)),x+=s,k+=i+T;for(n=0;_>n;n++)v[n].reflow(t)}}});r(F.fn,g),n=f.extend({init:function(e,t,n){var i=this;f.fn.init.call(i,t),i.value=e,i.options.index=n.index},options:{color:P,border:{width:1}},reflow:function(e){var t=this,n=t.points,i=t.children[0];t.box=new w(n[0].x,n[0].y,n[1].x,n[2].y),i&&i.reflow(new w(e.x1,n[0].y,e.x2,n[2].y))},createVisual:function(){var e,t,n;f.fn.createVisual.call(this),e=this.options,t=e.border,n=d.Path.fromPoints(this.points,{fill:{color:e.color,opacity:e.opacity},stroke:{color:t.color,opacity:t.opacity,width:t.width}}).close(),this.visual.append(n)},createHighlight:function(e){return d.Path.fromPoints(this.points,e)},highlightOverlay:function(e,t){var n,i,r,a=this.options,s=a.highlight||{};if(s.visible!==!1)return n=s.border||{},i=o({},t,{fill:s.color,stroke:n.color,strokeOpacity:n.opacity,strokeWidth:n.width,fillOpacity:s.opacity}),r=e.createPolyline(this.points,!0,i)},tooltipAnchor:function(e){var t=this.box;return new _(t.center().x-e/2,t.y1)},formatValue:function(e){var t=this;return t.owner.formatPointValue(t,e)}}),r(n.fn,h.PointEventsMixin),v.current.register(M,[A]),y.current.register([A],[E],[S,D,"visibleInLegend","visible"]),r(h,{FunnelChart:F})}(window.kendo.jQuery),function(e,t){function n(e,t){var n=e.box,i=e.children[0].box,o=t.border||{},a=t.background||"",s=new A,l=E.fromRect(new I([n.x1,n.y1],[n.width(),n.height()]),{stroke:{}}),c=new P(e.text,new D(i.x1,i.y1),{font:t.font,fill:{color:t.color}}),d=r(c.bbox().clone(),t.padding),u=E.fromRect(d,{stroke:{color:o.width?o.color:"",width:o.width,dashType:o.dashType,lineJoin:"round",lineCap:"round"},fill:{color:a}});return s.append(l),s.append(u),s.append(c),s}function i(e,t,n){var i=y(e.from)?e.from:V,r=y(e.to)?e.to:O;return e.from=l.max(l.min(r,i),t),e.to=l.min(l.max(r,i),n),e}function r(e,t){var n=e.getOrigin(),i=e.getSize(),r=x(t);return e.setOrigin([n.x-r.left,n.y-r.top]),e.setSize([i.width+(r.left+r.right),i.height+(r.top+r.bottom)]),e}function o(e,t){var n=x(t);return n.left=-n.left,n.top=-n.top,n.right=-n.right,n.bottom=-n.bottom,r(e,n)}var a,s,l=Math,c=window.kendo,d=c.util,u=c.ui.Widget,h=c.deepExtend,p=c.dataviz,f=p.autoMajorUnit,g=p.ChartElement,m=p.NumericAxis,v=p.Axis,_=p.Box2D,w=c.Class,y=d.defined,b=d.isNumber,k=p.interpolateValue,x=p.getSpacing,C=p.round,T=p.geometry,S=p.drawing,D=T.Point,A=S.Group,E=S.Path,I=T.Rect,P=S.Text,M=150,F=250,z="arrow",R="arrowPointer",B="barPointer",H="#000",L=.05,N=p.COORD_PRECISION,O=Number.MAX_VALUE,V=-Number.MAX_VALUE,U=200,W=.5,j=200,q=60,G=60,$=5,Y=l.PI/180,Q=180,K="inside",X="linear",Z="needle",J="outside",et="radialPointer",tt="x",nt="y",it=w.extend({init:function(e,t){var n=this,i=e.options;g.fn.init.call(n,t),t=n.options,t.fill=t.color,n.scale=e,t.value=y(t.value)?l.min(l.max(t.value,i.min),i.max):i.min},options:{color:H},value:function(e){var n=this,i=n.options,r=i.value,o=n.scale.options;return 0===arguments.length?r:(i._oldValue=i._oldValue!==t?i.value:o.min,i.value=l.min(l.max(e,o.min),o.max),n.elements&&n.repaint(),t)}}),rt=it.extend({options:{shape:Z,cap:{size:L},arrow:{width:16,height:14},animation:{type:et,duration:M}},setRadius:function(e){var t=this;e&&(t.elements.clear(),t.render(t.parent,t.center,e))},setAngle:function(e){this.elements.transform(T.transform().rotate(e,this.center))},repaint:function(){var e=this,t=e.scale,n=e.options,i=t.slotAngle(n._oldValue),r=t.slotAngle(n.value);n.animation.transitions===!1?e.setAngle(r):new pt(e.elements,h(n.animation,{oldAngle:i,newAngle:r})).play()},render:function(){var e=this,t=e.scale,n=t.arc.center,i=e.options,r=(t.slotAngle(t.options.min),new A);return i.animation!==!1&&h(i.animation,{startAngle:0,center:n,reverse:t.options.reverse}),i.shape===Z?r.append(e._renderNeedle(),e._renderCap()):r.append(e._renderArrow()),e.elements=r,e.setAngle(Y),r},reflow:function(e){var t=this,n=t.center=e.center,i=t.radius=e.getRadiusX(),r=t.capSize=Math.round(i*t.options.cap.size);t.bbox=I.fromPoints(new D(n.x-r,n.y-r),new D(n.x+r,n.y+r))},_renderNeedle:function(){var e=this,t=e.options,n=e.scale.options.minorTicks.size,i=e.center,r=t.color,o=new E({fill:{color:r},stroke:{color:r,width:W}});return o.moveTo(i.x+e.radius-n,i.y).lineTo(i.x,i.y-e.capSize/2).lineTo(i.x,i.y+e.capSize/2).close(),o},_renderCap:function(){var e=this,t=e.options,n=t.cap.color||t.color,i=new T.Circle(e.center,e.capSize),r=new S.Circle(i,{fill:{color:n},stroke:{color:n}});return r}}),ot=m.extend({init:function(e){var t=this;t.options=h({},t.options,e),t.options.majorUnit=t.options.majorUnit||f(t.options.min,t.options.max),t.options.minorUnit=t.options.minorUnit||t.options.majorUnit/10,v.fn.init.call(t,t.options)},options:{min:0,max:100,majorTicks:{size:15,align:K,color:H,width:W,visible:!0},minorTicks:{size:10,align:K,color:H,width:W,visible:!0},startAngle:-30,endAngle:210,labels:{position:K,padding:2}},render:function(e,t){var n=this,i=n.renderArc(e,t);n.bbox=i.bbox(),n.labelElements=n.renderLabels(),n.ticks=n.renderTicks(),n.ranges=n.renderRanges()},reflow:function(e){var n=this,i=e.center(),r=l.min(e.height(),e.width())/2;return n.bbox===t?n.render(i,r):(n.bbox=n.arc.bbox(),n.radius(n.arc.getRadiusX()),n.repositionRanges(),n.renderLabels(),t)},slotAngle:function(e){var t,n=this.options,i=n.startAngle,r=n.reverse,o=n.endAngle-i,a=n.min,s=n.max;return t=r?n.endAngle-(e-a)/(s-a)*o:(e-a)/(s-a)*o+i,t+Q},renderLabels:function(){var e,i,r,o,a,s,c,d,u,h,f,g,m,v,_=this,w=_.options,y=w.majorTicks.size,b=_.arc.clone(),k=b.getRadiusX(),x=_.tickAngles(b,w.majorUnit),C=_.labels,S=C.length,E=w.labels,P=E.padding,M=.05*k,F=w.rangeSize=w.rangeSize||.1*k,z=w.ranges||[],R=new A;for(_.options.rangeDistance!==t?M=_.options.rangeDistance:_.options.rangeDistance=M,E.position===K&&(k-=y,z.length&&_.labelElements===t&&(k-=F+M),b.setRadiusX(k).setRadiusY(k)),c=0;S>c;c++)a=C[c],e=a.box.width()/2,i=a.box.height()/2,o=x[c],r=(o-Q)*Y,h=E.position===K,s=b.pointAt(o),d=s.x+l.cos(r)*(e+P)*(h?1:-1),u=s.y+l.sin(r)*(i+P)*(h?1:-1),a.reflow(new p.Box2D(d-e,u-i,d+e,u+i)),g=new D(a.box.x1,a.box.y1),_.labelElements===t?(f=n(a,w.labels),R.append(f)):(f=_.labelElements.children[c],m=f.bbox().origin,v=f.transform()||T.transform(),v.translate(g.x-m.x,g.y-m.y),f.transform(v)),_.bbox=I.union(_.bbox,f.bbox());return R},repositionRanges:function(){var e,t,n,i=this,r=i.ranges.children,o=i.options.rangeSize,a=i.options.rangeDistance;if(r.length>0){for(e=i.getRangeRadius(),i.options.labels.position===K&&(e+=o+a),t=e+o/2,n=0;r.length>n;n++)r[n]._geometry.setRadiusX(t).setRadiusY(t);i.bbox=I.union(i.bbox,i.ranges.bbox())}},renderRanges:function(){var e,t,n,i,r,o,a=this,s=a.arc,l=new A,c=a.rangeSegments(),d=c.length,u=a.options.reverse,h=(a.radius(),a.options.rangeSize),p=a.options.rangeDistance;if(d)for(i=a.getRangeRadius(),a.radius(a.radius()-h-p),o=0;d>o;o++)n=c[o],e=a.slotAngle(n[u?"to":"from"]),t=a.slotAngle(n[u?"from":"to"]),t-e!==0&&(r=new T.Arc(s.center,{radiusX:i+h/2,radiusY:i+h/2,startAngle:e,endAngle:t}),l.append(new S.Arc(r,{stroke:{width:h,color:n.color,opacity:n.opacity}})));return l},rangeSegments:function(){function e(e,t,n,i){return{from:e,to:t,color:n,opacity:i}}var t,n,r,o,a,s=this,l=s.options,c=l.ranges||[],d=c.length,u=l.rangePlaceholderColor,h=[],p=l.min,f=l.max;if(d)for(h.push(e(p,f,u)),o=0;d>o;o++)for(t=i(c[o],p,f),n=h.length,a=0;n>a;a++)if(r=h[a],t.from>=r.from&&r.to>=t.from){h.push(e(t.from,t.to,t.color,t.opacity)),t.to>=r.from&&r.to>=t.to&&h.push(e(t.to,r.to,u,t.opacity)),r.to=t.from;break}return h},getRangeRadius:function(){var e,t=this,n=t.options,i=n.majorTicks.size,r=n.rangeSize,o=n.rangeDistance,a=t.arc;return e=n.labels.position===J?a.getRadiusX()-i-o-r:a.getRadiusX()-r},renderArc:function(e,t){var n=this,i=n.options,r=n.arc=new T.Arc(e,{radiusX:t,radiusY:t,startAngle:i.startAngle+Q,endAngle:i.endAngle+Q});return r},renderTicks:function(){function e(e,t,n,i){var r,o,a,s=new A,l=e.center,c=e.getRadiusX(),d=i.visible;if(d)for(r=0;t.length>r;r++)o=e.pointAt(t[r]),a=new D(l.x+c-i.size,l.y).rotate(t[r],l),s.append(new E({stroke:{color:i.color,width:i.width}}).moveTo(o).lineTo(a));return s}var t=this,n=t.arc,i=t.options,r=i.labels.position,o=new A,a=i.majorTicks.size,s=i.minorTicks.size,l=n.clone(),c=l.getRadiusX();return t.majorTickAngles=t.tickAngles(n,i.majorUnit),t.majorTicks=e(l,t.majorTickAngles,i.majorUnit,i.majorTicks),o.append(t.majorTicks),t._tickDifference=a-s,r===J&&l.setRadiusX(c-a+s).setRadiusY(c-a+s),t.minorTickAngles=t.normalizeTickAngles(t.tickAngles(n,i.minorUnit)),t.minorTicks=e(l,t.minorTickAngles,i.minorUnit,i.minorTicks,i.majorUnit),o.append(t.minorTicks),o},normalizeTickAngles:function(e){var t,n=this,i=n.options,r=i.majorUnit/i.minorUnit;for(t=e.length-1;t>=0;t--)t%r===0&&e.splice(t,1);return e},tickAngles:function(e,t){var n,i=this,r=i.options,o=r.reverse,a=r.max-r.min,s=e.endAngle-e.startAngle,l=e.startAngle,c=a/t,d=s/c,u=[];for(o&&(l+=s,d=-d),n=0;c>n;n++)u.push(C(l,N)),l+=d;return C(l)<=e.endAngle&&u.push(l),u},radius:function(e){var n=this;return e?(n.arc.setRadiusX(e).setRadiusY(e),n.repositionTicks(n.majorTicks.children,n.majorTickAngles),n.repositionTicks(n.minorTicks.children,n.minorTickAngles,!0),t):n.arc.getRadiusX()},repositionTicks:function(e,t,n){var i,r,o,a,s,l=this,c=n?l._tickDifference||0:0,d=l.arc,u=d.getRadiusX();for(n&&l.options.labels.position===J&&0!==c&&(d=l.arc.clone(),d.setRadiusX(u-c).setRadiusY(u-c)),i=0;e.length>i;i++)r=d.pointAt(t[i]),o=e[i].segments,a=r.x-o[0].anchor().x,s=r.y-o[0].anchor().y,e[i].transform((new T.Transformation).translate(a,s))}}),at=u.extend({init:function(t,n){var i,r,o,a,s,l=this,d=p.ui.themes||{};if(c.destroy(t),e(t).empty(),u.fn.init.call(l,t),l.wrapper=l.element,l._originalOptions=h({},n),i=h({},l.options,n),o=i.theme,a=d[o]||d[o.toLowerCase()],r=o&&a?a.gauge:{},l.options=h({},r,i),e.isArray(i.pointer))for(s=0;i.pointer.length>s;s++)l.options.pointer[s]=h({},r.pointer,i.pointer[s]);l.element.addClass("k-gauge"),l.surface=l._createSurface(),l.redraw()},options:{plotArea:{},theme:"default",renderAs:"",pointer:{},scale:{},gaugeArea:{}},destroy:function(){this.surface.destroy(),u.fn.destroy.call(this)},value:function(e){var n=this,i=n.pointers[0];return 0===arguments.length?i.value():(i.value(e),n._setValueOptions(e),t)},_draw:function(){var e=this.surface;e.clear(),e.draw(this._visuals)},exportVisual:function(){return this._visuals},allValues:function(t){var n,i=this,r=i.pointers,o=[];if(0===arguments.length){for(n=0;r.length>n;n++)o.push(r[n].value());return o}if(e.isArray(t))for(n=0;t.length>n;n++)b(t[n])&&r[n].value(t[n]);i._setValueOptions(t)},_setValueOptions:function(e){var t,n=[].concat(this.options.pointer);for(e=[].concat(e),t=0;e.length>t;t++)n[t].value=e[t]},_resize:function(){var e,t=this,n=t.options.transitions;for(t.options.transitions=!1,e=0;t.pointers.length>e;e++)t.pointers[e].options.animation.transitions=!1;for(t.redraw(),t.options.transitions=n,e=0;t.pointers.length>e;e++)t.pointers[e].options.animation.transitions=n},redraw:function(){var e,t=this,n=h(t._getSize(),t.options.gaugeArea),i=new I([0,0],[n.width,n.height]);t.surface.clear(),t.gaugeArea=t._createGaugeArea(),t._createModel(),e=o(i.bbox(),t._gaugeAreaMargin),t.reflow(e)},_createGaugeArea:function(){var e,t=this,n=t.options.gaugeArea,i=t.surface.size(),r=(t._gaugeAreaMargin=n.margin||$,n.border||{}),a=new I([0,0],[i.width,i.height]);return r.width>0&&(a=o(a,r.width)),e=E.fromRect(a,{stroke:{color:r.width?r.color:"",width:r.width,dashType:r.dashType,lineJoin:"round",lineCap:"round"},fill:{color:n.background}})},_createSurface:function(){var t,n=this,i=n.options,r=n._getSize();return r=i.gaugeArea?h(r,i.gaugeArea):r,t=e("<div></div>").appendTo(n.element).css({width:r.width,height:r.height}),new S.Surface.create(t,{type:i.renderAs})},getSize:function(){return this._getSize()},_getSize:function(){var e=this,t=e.element,n=t.width(),i=t.height();return n||(n=j),i||(i=U),{width:n,height:i}}}),st=at.extend({init:function(e,t){var n=this;at.fn.init.call(n,e,t),c.notify(n,p.ui)},options:{name:"RadialGauge",transitions:!0,gaugeArea:{background:""}},reflow:function(e){{var t,n,i=this,r=i.pointers;i.scale.reflow(e)}for(i._initialPlotArea=i.scale.bbox,t=0;r.length>t;t++)n=r[t].reflow(i.scale.arc),i._initialPlotArea=I.union(i._initialPlotArea,r[t].bbox);i.fitScale(e),i.alignScale(e),i._buildVisual(i.gaugeArea,r,i.scale),i._draw()},_buildVisual:function(e,t,n){var i,r,o=new A;for(o.append(e),o.append(n.ticks),o.append(n.ranges),r=0;t.length>r;r++)i=t[r],i.render(),o.append(i.elements),i.value(i.options.value);o.append(n.labelElements),this._visuals=o},fitScale:function(e){for(var t,n,i,r,o=this,a=o.scale,s=a.arc,c=o._initialPlotArea,d=l.abs(o.getDiff(c,e)),u=C(d,N),h=C(-d,N),p=0;!(!(100>p)||(p++,u!=r&&(t=o.getPlotBox(u,e,s),t>=0&&2>=t))||h!=r&&(i=o.getPlotBox(h,e,s),i>=0&&2>=i)||(r=t>0&&i>0?2*u:0>t&&0>i?2*h:C((u+h)/2||1,N),n=o.getPlotBox(r,e,s),n>=0&&2>=n));)n>0?(h=r,i=n):(u=r,t=n)},getPlotBox:function(e,t,n){var i,r=this,o=r.scale,a=r.pointers,s=n.getRadiusX();for(n=n.clone(),n.setRadiusX(s+e).setRadiusY(s+e),o.arc=n,o.reflow(t),r.plotBbox=o.bbox,i=0;a.length>i;i++)a[i].reflow(n),r.plotBbox=I.union(r.plotBbox,a[i].bbox);return r.getDiff(r.plotBbox,t)},getDiff:function(e,t){return l.min(t.width()-e.width(),t.height()-e.height())},alignScale:function(e){var t,n=this,i=n.plotBbox.center(),r=e.center(),o=i.x-r.x,a=i.y-r.y,s=n.scale,l=n.pointers;
for(s.arc.center.x-=o,s.arc.center.y-=a,s.reflow(e),t=0;l.length>t;t++)l[t].reflow(s.arc),n.plotBbox=I.union(s.bbox,l[t].bbox)},_createModel:function(){var t,n,i=this,r=i.options,o=r.pointer,a=i.scale=new ot(r.scale);for(i.pointers=[],o=e.isArray(o)?o:[o],n=0;o.length>n;n++)t=new rt(a,h({},o[n],{animation:{transitions:r.transitions}})),i.pointers.push(t)}}),lt=at.extend({init:function(e,t){var n=this;at.fn.init.call(n,e,t),c.notify(n,p.ui)},options:{name:"LinearGauge",transitions:!0,gaugeArea:{background:""},scale:{vertical:!0}},reflow:function(e){var t,n=this,i=n.pointers,r=e.origin.x,o=e.origin.y,a=new p.Box2D(r,r,r+e.width(),o+e.height());for(n.scale.reflow(a),t=0;i.length>t;t++)i[t].reflow();n.bbox=n._getBox(a),n._alignElements(),n._shrinkElements(),n._buildVisual(),n._draw()},_buildVisual:function(){var e,t,n=this,i=new A,r=n.scale.render(),o=n.pointers;for(i.append(n.gaugeArea),i.append(r),t=0;o.length>t;t++)e=o[t],i.append(e.render()),e.value(e.options.value);n._visuals=i},_createModel:function(){var t,n,i,r=this,o=r.options,a=o.pointer,s=r.scale=new ct(o.scale);for(r.pointers=[],a=e.isArray(a)?a:[a],i=0;a.length>i;i++)n=h({},a[i],{animation:{transitions:o.transitions}}),t=n.shape===z?new ut(s,n):new ht(s,n),r.pointers.push(t)},_getSize:function(){var e=this,t=e.element,n=t.width(),i=t.height(),r=e.options.scale.vertical;return n||(n=r?q:j),i||(i=r?U:G),{width:n,height:i}},_getBox:function(e){var t,n,i=this,r=i.scale,o=i.pointers,a=e.center(),s=o[0].box.clone().wrap(r.box);for(n=0;o.length>n;n++)s.wrap(o[n].box.clone());return r.options.vertical?(t=s.width()/2,s=new _(a.x-t,e.y1,a.x+t,e.y2)):(t=s.height()/2,s=new _(e.x1,a.y-t,e.x2,a.y+t)),s},_alignElements:function(){var e,t,n=this,i=n.scale,r=n.pointers,o=i.box,a=r[0].box.clone().wrap(i.box),s=n.bbox;for(t=0;r.length>t;t++)a.wrap(r[t].box.clone());for(i.options.vertical?(e=s.center().x-a.center().x,i.reflow(new _(o.x1+e,s.y1,o.x2+e,s.y2))):(e=s.center().y-a.center().y,i.reflow(new _(s.x1,o.y1+e,s.x2,o.y2+e))),t=0;r.length>t;t++)r[t].reflow(n.bbox)},_shrinkElements:function(){var e,t=this,n=t.scale,i=t.pointers,r=n.box.clone(),o=n.options.vertical?"y":"x",a=i[0].box;for(e=0;i.length>e;e++)a.wrap(i[e].box.clone());for(r[o+1]+=l.max(r[o+1]-a[o+1],0),r[o+2]-=l.max(a[o+2]-r[o+2],0),n.reflow(r),e=0;i.length>e;e++)i[e].reflow(t.bbox)}}),ct=m.extend({init:function(e){var t=this;t.options=h({},t.options,e),t.options=h({},t.options,{labels:{mirror:t.options.mirror}}),t.options.majorUnit=t.options.majorUnit||f(t.options.min,t.options.max),v.fn.init.call(t,t.options),t.options.minorUnit=t.options.minorUnit||t.options.majorUnit/10},options:{min:0,max:50,majorTicks:{size:15,align:K,color:H,width:W,visible:!0},minorTicks:{size:10,align:K,color:H,width:W,visible:!0},line:{width:W},labels:{position:K,padding:2},mirror:!1,_alignLines:!1},render:function(){var e=this,t=e.elements=new A,n=e.renderLabels(),i=e.renderLine(),r=e.renderTicks(),o=e.renderRanges();return t.append(i,n,r,o),t},renderRanges:function(){var e,t,n,r,o,a=this,s=a.options,l=s.min,c=s.max,d=s.ranges||[],u=s.vertical,h=s.labels.mirror,p=new A,f=d.length,g=s.rangeSize||s.minorTicks.size/2;if(f)for(o=0;f>o;o++)e=i(d[o],l,c),t=a.getSlot(e.from,e.to),n=u?a.lineBox():t,r=u?t:a.lineBox(),u?n.x1-=g*(h?-1:1):r.y2+=g*(h?-1:1),p.append(E.fromRect(new I([n.x1,r.y1],[n.x2-n.x1,r.y2-r.y1]),{fill:{color:e.color,opacity:e.opacity},stroke:{}}));return p},renderLabels:function(){var e,t=this,i=t.options,r=t.labels,o=new A;for(e=0;r.length>e;e++)o.append(n(r[e],i.labels));return o},renderLine:function(){var e,t=this,n=t.options,i=n.line,r=t.lineBox(),o=new A;return i.width>0&&i.visible&&(e=new E({stroke:{color:i.color,dashType:i.dashType,width:i.width}}),e.moveTo(r.x1,r.y1).lineTo(r.x2,r.y2),o.append(e)),o},renderTicks:function(){function e(e,i){var a,l=e.length;if(i.visible)for(a=i.skip;l>a;a+=i.step)a%i.skipUnit!==0&&(s.tickX=o?r.x2:r.x2-i.size,s.tickY=o?r.y1-i.size:r.y1,s.position=e[a],n.append(t.renderAxisTick(s,i)))}var t=this,n=new A,i=t.options,r=t.lineBox(),o=i.labels.mirror,a=i.majorTicks.visible?i.majorUnit:0,s={_alignLines:i._alignLines,vertical:i.vertical};return e(t.getMajorTickPositions(),i.majorTicks),e(t.getMinorTickPositions(),h({},{skipUnit:a/i.minorUnit},i.minorTicks)),n},renderAxisTick:function(e,t){var n,i,r,o=e.tickX,a=e.tickY,s=e.position;return e.vertical?(n=new D(o,s),i=new D(o+t.size,s)):(n=new D(s,a),i=new D(s,a+t.size)),r=new E({stroke:{color:t.color,width:t.width}}).moveTo(n).lineTo(i)}}),dt=it.extend({init:function(e,t){var n=this;it.fn.init.call(n,e,t),n.options=h({track:{visible:y(t.track)}},n.options)},options:{shape:B,track:{border:{width:1}},color:H,border:{width:1},opacity:1,margin:x(3),animation:{type:B},visible:!0},reflow:function(){var e,t,n,i=this,r=i.options,o=i.scale,a=o.lineBox(),s=r.track.size||r.size,l=r.size/2,c=o.options.mirror,d=x(r.margin),u=o.options.vertical,h=u?d[c?"left":"right"]:d[c?"bottom":"top"];h=c?-h:h,u?(n=new _(a.x1+h,a.y1,a.x1+h,a.y2),c?n.x1-=s:n.x2+=s,r.shape!==B&&(t=new _(a.x2+h,a.y1-l,a.x2+h,a.y2+l),e=t)):(n=new _(a.x1,a.y1-h,a.x2,a.y1-h),c?n.y2+=s:n.y1-=s,r.shape!==B&&(t=new _(a.x1-l,a.y1-h,a.x2+l,a.y1-h),e=t)),i.trackBox=n,i.pointerRangeBox=t,i.box=e||n.clone().pad(r.border.width)},getElementOptions:function(){{var e=this.options;new A}return{fill:{color:e.color,opacity:e.opacity},stroke:y(e.border)?{color:e.border.width?e.border.color||e.color:"",width:e.border.width,dashType:e.border.dashType,opacity:e.opacity}:null}},_margin:function(){var e=this,t=e.options,n=e.scale,i=n.options.mirror,r=x(t.margin),o=n.options.vertical,a=o?r[i?"left":"right"]:r[i?"bottom":"top"];return a}}),ut=dt.extend({init:function(e,n){dt.fn.init.call(this,e,n),this.options.size===t&&(this.options.size=.6*this.scale.options.majorTicks.size)},pointerShape:function(){var e,t,n=this,i=n.options,r=n.scale,o=i.size,a=r.options.vertical,s=o/2,l=r.options.mirror?-1:1,c=r.options.reverse;return a?(e=c?"y2":"y1",t=[new D(0,0-s),new D(0-l*o,0),new D(0,0+s)]):(e=c?"x1":"x2",t=[new D(0-s,0),new D(0,0+l*o),new D(0+s,0)]),t},repaint:function(){var e=this,t=e.scale,n=e.options,i=new a(e.elements,h(n.animation,{vertical:t.options.vertical,mirror:t.options.mirror,margin:e._margin(n.margin),from:t.getSlot(n._oldValue),to:t.getSlot(n.value)}));n.animation.transitions===!1&&(i.options.duration=0),i.setup(),i.play()},render:function(){var e,t=this,n=t.options,i=new A,r=t.scale,o=t.getElementOptions(),a=t.pointerShape(n.value);return n.animation.type=R,i=new E({stroke:o.stroke,fill:o.fill}).moveTo(a[0]).lineTo(a[1]).lineTo(a[2]).close(),e=r.getSlot(n.value),i.transform(T.transform().translate(e.x1,e.y1)),t.elements=i,i}}),ht=dt.extend({init:function(e,n){dt.fn.init.call(this,e,n),this.options.size===t&&(this.options.size=.3*this.scale.options.majorTicks.size)},pointerShape:function(e){var t,n,i,r=this,o=r.options,a=r.scale,s=a.options.vertical,l=a.options.mirror,c=l==s?-1:1,d=o.size*c,u=a.getSlot(a.options.min),h=a.getSlot(e),p=s?nt:tt,f=s?tt:nt,g=r._margin()*c,m=new D;return m[p]=u[p+"1"],m[f]=u[f+"1"],t=new D,t[p]=h[p+"1"],t[f]=h[f+"1"],s?(m.translate(g,0),t.translate(g,0)):(m.translate(0,g),t.translate(0,g)),n=t.clone(),i=m.clone(),s?(n.translate(d,0),i.translate(d,0)):(n.translate(0,d),i.translate(0,d)),[m,t,n,i]},repaint:function(){var e,t=this,n=t.scale,i=t.options,r=t.pointerShape(i.value),o=t.elements.children[0],a=t.pointerShape(i._oldValue);o.moveTo(r[0]).lineTo(r[1]).lineTo(r[2]).lineTo(r[3]).close(),e=new s(o,h(i.animation,{reverse:n.options.reverse,vertical:n.options.vertical,oldPoints:[a[1],a[2]],newPoints:[r[1],r[2]]})),i.animation.transitions===!1&&(e.options.duration=0),e.setup(),e.play()},render:function(){var e=this,t=new A,n=e.getElementOptions(),i=new E({stroke:n.stroke,fill:n.fill});return t.append(i),e.elements=t,t}}),pt=S.Animation.extend({init:function(e,t){S.Animation.fn.init.call(this,e,t),t=this.options,t.duration=l.max(l.abs(t.newAngle-t.oldAngle)/t.duration*1e3,1)},options:{easing:X,duration:M},step:function(e){var t=this,n=t.options,i=k(n.oldAngle,n.newAngle,e);t.element.transform(T.transform().rotate(i,n.center))}});S.AnimationFactory.current.register(et,pt),a=S.Animation.extend({options:{easing:X,duration:F},setup:function(){var e,t,n=this.options,i=(this.element.bbox().width()/2,n.margin),r=n.from,o=n.to,a=n.vertical?"x1":"y1";n.mirror==n.vertical?(r[a]-=i,o[a]-=i):(r[a]+=i,o[a]+=i),e=this.fromScale=new D(r.x1,r.y1),t=this.toScale=new D(o.x1,o.y1),0!==n.duration&&(n.duration=l.max(e.distanceTo(t)/n.duration*1e3,1))},step:function(e){var t=k(this.fromScale.x,this.toScale.x,e),n=k(this.fromScale.y,this.toScale.y,e);this.element.transform(T.transform().translate(t,n))}}),S.AnimationFactory.current.register(R,a),s=S.Animation.extend({options:{easing:X,speed:F},setup:function(){var e=this.options,t=e.newPoints,n=e.oldPoints,i=this.axis=e.vertical?nt:tt,r=this.to=t[0][i],o=this.from=n[0][i];0!==e.duration&&(e.duration=l.max(l.abs(r-o)/e.speed*1e3,1)),this._set(o)},step:function(e){var t=k(this.from,this.to,e);this._set(t)},_set:function(e){var t="set"+this.axis.toUpperCase(),n=this.options.newPoints;n[0][t](e),n[1][t](e)}}),S.AnimationFactory.current.register(B,s),p.ui.plugin(st),p.ui.plugin(lt),p.ExportMixin.extend(at.fn),h(p,{Gauge:at,RadialPointer:rt,LinearPointer:dt,ArrowLinearPointer:ut,BarLinearPointer:ht,LinearScale:ct,RadialScale:ot,LinearGauge:lt,RadialGauge:st})}(window.kendo.jQuery),function(e,t){function n(e,t,n){return e.substring(t,t+n)}var i,r,o,a,s,l,c=window.kendo,d=c.ui.Widget,u=e.extend,h=c.deepExtend,p=e.inArray,f=e.isPlainObject,g=c.drawing,m=c.geometry,v=c.util,_=v.defined,w=c.dataviz,y=w.Box2D,b=w.TextBox,k=300,x=100,C=10,T=/^\d+$/,S=/^[a-z0-9]+$/i,D="Character '{0}' is not valid for symbology {1}",A=c.Class.extend({init:function(e){this.setOptions(e)},setOptions:function(e){var t=this;t.options=u({},t.options,e),t.quietZoneLength=t.options.addQuietZone?2*t.options.quietZoneLength:0},encode:function(e,t,n){var i=this;return _(e)&&(e+=""),i.initValue(e,t,n),i.options.addQuietZone&&i.addQuietZone(),i.addData(),i.options.addQuietZone&&i.addQuietZone(),{baseUnit:i.baseUnit,pattern:i.pattern}},options:{quietZoneLength:C,addQuietZone:!0,addCheckSum:!0},initValue:function(){},addQuietZone:function(){this.pattern.push(this.options.quietZoneLength||C)},addData:function(){},invalidCharacterError:function(e){throw Error(c.format(D,e,this.name))}}),E={},I=A.extend({minBaseUnitLength:.7,addData:function(){var e,t=this,n=t.value;for(t.addStart(),e=0;n.length>e;e++)t.addCharacter(n.charAt(e));t.options.addCheckSum&&t.pushCheckSum(),t.addStop(),t.prepareValues()},addCharacter:function(e){var t=this,n=t.characterMap[e];n||t.invalidCharacterError(e),t.addBase(n)},addBase:function(){}}),P={addCharacter:function(e){var t=this;t.characterMap[e]?t.addBase(t.characterMap[e]):e.charCodeAt(0)>127?t.invalidCharacterError(e):t.addExtended(e.charCodeAt(0))},addExtended:function(e){var n,i,r,o=this;for(i=0;o.extendedMappings.length>i;i++)if(n=o.extendedMappings[i].call(o,e)){for(r=0;n.length>r;r++)o.addBase(n[r]);return o.dataLength+=n.length-1,t}},extendedMappings:[function(e){if(e>=97&&122>=e){var t=this;return[t.characterMap[t.shiftCharacters[0]],t.characterMap[String.fromCharCode(e-32)]]}},function(e){if(e>=33&&58>=e){var t=this;return[t.characterMap[t.shiftCharacters[1]],t.characterMap[String.fromCharCode(e+32)]]}},function(e){if(e>=1&&26>=e){var t=this;return[t.characterMap[t.shiftCharacters[2]],t.characterMap[String.fromCharCode(e+64)]]}},function(e){var t,n,i,r=this;if(r.specialAsciiCodes[e])for(t=[],i=0;r.specialAsciiCodes[e].length>i;i++)t.push(r.characterMap[r.shiftCharacters[3]]),t.push(r.characterMap[r.specialAsciiCodes[e][i]]);else n=6*Math.floor(e/32)+(e-27)%32+64,t=[r.characterMap[r.shiftCharacters[3]],r.characterMap[String.fromCharCode(n)]];return t}],specialAsciiCodes:{0:["U"],64:["V"],96:["W"],127:["T","X","Y","Z"]},shiftValuesAsciiCodes:{39:36,40:47,41:43,42:37},characterMap:{"+":!1,"/":!1,$:!1,"%":!1},shiftCharacters:["SHIFT0","SHIFT1","SHIFT2","SHIFT3"]};E.code39=I.extend({name:"Code 39",checkSumMod:43,minRatio:2.5,maxRatio:3,gapWidth:1,splitCharacter:"|",initValue:function(e,t,n){var i=this;i.width=t,i.height=n,i.value=e,i.dataLength=e.length,i.pattern=[],i.patternString=""},prepareValues:function(){var e,t,n=this,i=n.minBaseUnitLength,r=n.maxRatio,o=n.minRatio,a=Math.max(.15*n.width,24);if(a>n.height)throw Error("Insufficient Height. The minimum height for value: "+n.value+" is: "+a);for(;(e=n.getBaseUnit(r))<i&&r>o;)r=parseFloat((r-.1).toFixed(1));if(i>e)throw t=Math.ceil(n.getBaseWidth(o)*i),Error("Insufficient width. The minimum width for value: "+n.value+" is: "+t);n.ratio=r,n.baseUnit=e,n.patternString=n.patternString.substring(0,n.patternString.length-1),n.pattern=n.pattern.concat(n.patternString.replace(/ratio/g,r).split(n.splitCharacter))},getBaseUnit:function(e){return this.width/this.getBaseWidth(e)},getBaseWidth:function(e){var t=this,n=3*(e+2);return t.quietZoneLength+n*(t.dataLength+2)+t.gapWidth*(t.dataLength+1)},addStart:function(){var e=this;e.addPattern(e.characterMap.START.pattern),e.addCharacterGap()},addBase:function(e){this.addPattern(e.pattern),this.addCharacterGap()},addStop:function(){this.addPattern(this.characterMap.START.pattern)},addPattern:function(e){for(var t=0;e.length>t;t++)this.patternString+=this.patternMappings[e.charAt(t)]},addCharacterGap:function(){var e=this;e.patternString+=e.gapWidth+e.splitCharacter},patternMappings:{b:"1|",w:"1|",B:"ratio|",W:"ratio|"},characterMap:{0:{pattern:"bwbWBwBwb",value:0},1:{pattern:"BwbWbwbwB",value:1},2:{pattern:"bwBWbwbwB",value:2},3:{pattern:"BwBWbwbwb",value:3},4:{pattern:"bwbWBwbwB",value:4},5:{pattern:"BwbWBwbwb",value:5},6:{pattern:"bwBWBwbwb",value:6},7:{pattern:"bwbWbwBwB",value:7},8:{pattern:"BwbWbwBwb",value:8},9:{pattern:"bwBWbwBwb",value:9},A:{pattern:"BwbwbWbwB",value:10},B:{pattern:"bwBwbWbwB",value:11},C:{pattern:"BwBwbWbwb",value:12},D:{pattern:"bwbwBWbwB",value:13},E:{pattern:"BwbwBWbwb",value:14},F:{pattern:"bwBwBWbwb",value:15},G:{pattern:"bwbwbWBwB",value:16},H:{pattern:"BwbwbWBwb",value:17},I:{pattern:"bwBwbWBwb",value:18},J:{pattern:"bwbwBWBwb",value:19},K:{pattern:"BwbwbwbWB",value:20},L:{pattern:"bwBwbwbWB",value:21},M:{pattern:"BwBwbwbWb",value:22},N:{pattern:"bwbwBwbWB",value:23},O:{pattern:"BwbwBwbWb",value:24},P:{pattern:"bwBwBwbWb",value:25},Q:{pattern:"bwbwbwBWB",value:26},R:{pattern:"BwbwbwBWb",value:27},S:{pattern:"bwBwbwBWb",value:28},T:{pattern:"bwbwBwBWb",value:29},U:{pattern:"BWbwbwbwB",value:30},V:{pattern:"bWBwbwbwB",value:31},W:{pattern:"BWBwbwbwb",value:32},X:{pattern:"bWbwBwbwB",value:33},Y:{pattern:"BWbwBwbwb",value:34},Z:{pattern:"bWBwBwbwb",value:35},"-":{pattern:"bWbwbwBwB",value:36},".":{pattern:"BWbwbwBwb",value:37}," ":{pattern:"bWBwbwBwb",value:38},$:{pattern:"bWbWbWbwb",value:39},"/":{pattern:"bWbWbwbWb",value:40},"+":{pattern:"bWbwbWbWb",value:41},"%":{pattern:"bwbWbWbWb",value:42},START:{pattern:"bWbwBwBwb"}},options:{addCheckSum:!1}}),E.code39extended=E.code39.extend(h({},P,{name:"Code 39 extended",characterMap:{SHIFT0:{pattern:"bWbwbWbWb",value:41},SHIFT1:{pattern:"bWbWbwbWb",value:40},SHIFT2:{pattern:"bWbWbWbwb",value:39},SHIFT3:{pattern:"bwbWbWbWb",value:42}}})),E.code93=I.extend({name:"Code 93",cCheckSumTotal:20,kCheckSumTotal:15,checkSumMod:47,initValue:function(e,t,n){var i=this;i.value=e,i.width=t,i.height=n,i.pattern=[],i.values=[],i.dataLength=e.length},prepareValues:function(){var e=this,t=Math.max(.15*e.width,24);if(t>e.height)throw Error("Insufficient Height");if(e.setBaseUnit(),e.minBaseUnitLength>e.baseUnit)throw Error("Insufficient Width")},setBaseUnit:function(){var e=this,t=2;e.baseUnit=e.width/(9*(e.dataLength+2+t)+e.quietZoneLength+1)},addStart:function(){var e=this.characterMap.START.pattern;this.addPattern(e)},addStop:function(){var e=this;e.addStart(),e.pattern.push(e.characterMap.TERMINATION_BAR)},addBase:function(e){this.addPattern(e.pattern),this.values.push(e.value)},pushCheckSum:function(){var e,t,n=this,i=n._getCheckValues();for(n.checksum=i.join(""),t=0;i.length>t;t++)e=n.characterMap[n._findCharacterByValue(i[t])],n.addPattern(e.pattern)},_getCheckValues:function(){var e,t,n,i=this,r=i.values,o=r.length,a=0;for(n=o-1;n>=0;n--)a+=i.weightedValue(r[n],o-n,i.cCheckSumTotal);for(e=a%i.checkSumMod,a=i.weightedValue(e,1,i.kCheckSumTotal),n=o-1;n>=0;n--)a+=i.weightedValue(r[n],o-n+1,i.kCheckSumTotal);return t=a%i.checkSumMod,[e,t]},_findCharacterByValue:function(e){for(var t in this.characterMap)if(this.characterMap[t].value===e)return t},weightedValue:function(e,t,n){return(t%n||n)*e},addPattern:function(e){var t,n;for(n=0;e.length>n;n++)t=parseInt(e.charAt(n),10),this.pattern.push(t)},characterMap:{0:{pattern:"131112",value:0},1:{pattern:"111213",value:1},2:{pattern:"111312",value:2},3:{pattern:"111411",value:3},4:{pattern:"121113",value:4},5:{pattern:"121212",value:5},6:{pattern:"121311",value:6},7:{pattern:"111114",value:7},8:{pattern:"131211",value:8},9:{pattern:"141111",value:9},A:{pattern:"211113",value:10},B:{pattern:"211212",value:11},C:{pattern:"211311",value:12},D:{pattern:"221112",value:13},E:{pattern:"221211",value:14},F:{pattern:"231111",value:15},G:{pattern:"112113",value:16},H:{pattern:"112212",value:17},I:{pattern:"112311",value:18},J:{pattern:"122112",value:19},K:{pattern:"132111",value:20},L:{pattern:"111123",value:21},M:{pattern:"111222",value:22},N:{pattern:"111321",value:23},O:{pattern:"121122",value:24},P:{pattern:"131121",value:25},Q:{pattern:"212112",value:26},R:{pattern:"212211",value:27},S:{pattern:"211122",value:28},T:{pattern:"211221",value:29},U:{pattern:"221121",value:30},V:{pattern:"222111",value:31},W:{pattern:"112122",value:32},X:{pattern:"112221",value:33},Y:{pattern:"122121",value:34},Z:{pattern:"123111",value:35},"-":{pattern:"121131",value:36},".":{pattern:"311112",value:37}," ":{pattern:"311211",value:38},$:{pattern:"321111",value:39},"/":{pattern:"112131",value:40},"+":{pattern:"113121",value:41},"%":{pattern:"211131",value:42},SHIFT0:{pattern:"122211",value:46},SHIFT1:{pattern:"311121",value:45},SHIFT2:{pattern:"121221",value:43},SHIFT3:{pattern:"312111",value:44},START:{pattern:"111141"},TERMINATION_BAR:"1"}}),E.code93extended=E.code93.extend(h({},P,{name:"Code 93 extended",pushCheckSum:function(){var e,t,n=this,i=n._getCheckValues();for(n.checksum=i.join(""),t=0;i.length>t;t++)e=i[t],n.shiftValuesAsciiCodes[e]?n.addExtended(n.shiftValuesAsciiCodes[e]):n.addPattern(n.characterMap[n._findCharacterByValue(e)].pattern)}})),i=c.Class.extend({init:function(e){this.encoding=e},addStart:function(){},is:function(){},move:function(){},pushState:function(){}}),r=i.extend({FNC4:"FNC4",init:function(e,t){var n=this;n.encoding=e,n.states=t,n._initMoves(t)},addStart:function(){this.encoding.addPattern(this.START)},is:function(e,t){var n=e.charCodeAt(t);return this.isCode(n)},move:function(e){for(var t=this,n=0;!t._moves[n].call(t,e)&&t._moves.length>n;)n++},pushState:function(e){var t,n,i=this,r=i.states,o=e.value,a=o.length;for(p("C",r)>=0&&(n=o.substr(e.index).match(/\d{4,}/g),n&&(a=o.indexOf(n[0],e.index)));(t=e.value.charCodeAt(e.index))>=0&&i.isCode(t)&&a>e.index;)i.encoding.addPattern(i.getValue(t)),e.index++},_initMoves:function(e){var t=this;t._moves=[],p(t.FNC4,e)>=0&&t._moves.push(t._moveFNC),p(t.shiftKey,e)>=0&&t._moves.push(t._shiftState),t._moves.push(t._moveState)},_moveFNC:function(e){return e.fnc?(e.fnc=!1,e.previousState==this.key):t},_shiftState:function(e){var n=this;return e.previousState==n.shiftKey&&(e.index+1>=e.value.length||n.encoding[n.shiftKey].is(e.value,e.index+1))?(n.encoding.addPattern(n.SHIFT),e.shifted=!0,!0):t},_moveState:function(){return this.encoding.addPattern(this.MOVE),!0},SHIFT:98}),o={},o.A=r.extend({key:"A",shiftKey:"B",isCode:function(e){return e>=0&&96>e},getValue:function(e){return 32>e?e+64:e-32},MOVE:101,START:103}),o.B=r.extend({key:"B",shiftKey:"A",isCode:function(e){return e>=32&&128>e},getValue:function(e){return e-32},MOVE:100,START:104}),o.C=i.extend({key:"C",addStart:function(){this.encoding.addPattern(this.START)},is:function(e,t){var i=n(e,t,4);return(e.length>=t+4||2==e.length)&&T.test(i)},move:function(){this.encoding.addPattern(this.MOVE)},pushState:function(e){for(var t;(t=n(e.value,e.index,2))&&T.test(t)&&2==t.length;)this.encoding.addPattern(parseInt(t,10)),e.index+=2},getValue:function(e){return e},MOVE:99,START:105}),o.FNC4=i.extend({key:"FNC4",dependentStates:["A","B"],init:function(e,t){this.encoding=e,this._initSubStates(t)},addStart:function(e){var t=e.value.charCodeAt(0)-128,n=this._getSubState(t);this.encoding[n].addStart()},is:function(e,t){var n=e.charCodeAt(t);return this.isCode(n)},isCode:function(e){return e>=128&&256>e},pushState:function(e){var t,n=this,i=n._initSubState(e),r=n.encoding,o=i.value.length;if(e.index+=o,3>o)for(;o>i.index;i.index++)t=i.value.charCodeAt(i.index),i.state=n._getSubState(t),i.previousState!=i.state&&(i.previousState=i.state,r[i.state].move(i)),r.addPattern(r[i.state].MOVE),r.addPattern(r[i.state].getValue(t));else i.state!=i.previousState&&r[i.state].move(i),n._pushStart(i),r.pushData(i,n.subStates),e.value.length>e.index&&n._pushStart(i);e.fnc=!0,e.state=i.state},_pushStart:function(e){var t=this;t.encoding.addPattern(t.encoding[e.state].MOVE),t.encoding.addPattern(t.encoding[e.state].MOVE)},_initSubState:function(e){var t=this,n={value:t._getAll(e.value,e.index),index:0};return n.state=t._getSubState(n.value.charCodeAt(0)),n.previousState=e.previousState==t.key?n.state:e.previousState,n},_initSubStates:function(e){var t,n=this;for(n.subStates=[],t=0;e.length>t;t++)p(e[t],n.dependentStates)>=0&&n.subStates.push(e[t])},_getSubState:function(e){var t,n=this;for(t=0;n.subStates.length>t;t++)if(n.encoding[n.subStates[t]].isCode(e))return n.subStates[t]},_getAll:function(e,t){for(var n,i="";(n=e.charCodeAt(t++))&&this.isCode(n);)i+=String.fromCharCode(n-128);return i}}),o.FNC1=i.extend({key:"FNC1",startState:"C",dependentStates:["C","B"],startAI:"(",endAI:")",init:function(e,t){this.encoding=e,this.states=t},addStart:function(){this.encoding[this.startState].addStart()},is:function(){return p(this.key,this.states)>=0},pushState:function(e){var t,n,i,r=this,o=r.encoding,a=e.value.replace(/\s/g,""),s=RegExp("["+r.startAI+r.endAI+"]","g"),l=e.index,c={state:r.startState};for(o.addPattern(r.START);;){if(c.index=0,i=a.charAt(l)===r.startAI?2:0,t=i>0?r.getBySeparator(a,l):r.getByLength(a,l),t.ai.length)n=l+i+t.id.length+t.ai.length;else if(n=a.indexOf(r.startAI,l+1),0>n){if(a.length>l+t.ai.max+t.id.length+i)throw Error("Separators are required after variable length identifiers");n=a.length}if(c.value=a.substring(l,n).replace(s,""),r.validate(t,c.value),o.pushData(c,r.dependentStates),n>=a.length)break;l=n,c.state!=r.startState&&(o[r.startState].move(c),c.state=r.startState),t.ai.length||o.addPattern(r.START)}e.index=e.value.length},validate:function(e,t){var n=t.substr(e.id.length),i=e.ai;if(!i.type&&!T.test(n))throw Error("Application identifier "+e.id+" is numeric only but contains non numeric character(s).");if("alphanumeric"==i.type&&!S.test(n))throw Error("Application identifier "+e.id+" is alphanumeric only but contains non alphanumeric character(s).");if(i.length&&i.length!==n.length)throw Error("Application identifier "+e.id+" must be "+i.length+" characters long.");if(i.min&&i.min>n.length)throw Error("Application identifier "+e.id+" must be at least "+i.min+" characters long.");if(i.max&&n.length>i.max)throw Error("Application identifier "+e.id+" must be at most "+i.max+" characters long.")},getByLength:function(e,t){var i,r,o,a=this;for(o=2;4>=o;o++)if(i=n(e,t,o),r=a.getAI(i)||a.getAI(i.substring(0,i.length-1)))return{id:i,ai:r};a.unsupportedAIError(i)},unsupportedAIError:function(e){throw Error(c.format("'{0}' is not a supported Application Identifier"),e)},getBySeparator:function(e,t){var n=this,i=e.indexOf(n.startAI,t),r=e.indexOf(n.endAI,i),o=e.substring(i+1,r),a=n.getAI(o)||n.getAI(o.substr(o.length-1));return a||n.unsupportedAIError(o),{ai:a,id:o}},getAI:function(e){var t,n,i,r=this.applicationIdentifiers,o=r.multiKey;if(r[e])return r[e];for(t=0;o.length>t;t++){if(o[t].ids&&p(e,o[t].ids)>=0)return o[t].type;if(o[t].ranges)for(n=o[t].ranges,i=0;n.length>i;i++)if(e>=n[i][0]&&n[i][1]>=e)return o[t].type}},applicationIdentifiers:{22:{max:29,type:"alphanumeric"},402:{length:17},7004:{max:4,type:"alphanumeric"},242:{max:6,type:"alphanumeric"},8020:{max:25,type:"alphanumeric"},703:{min:3,max:30,type:"alphanumeric"},8008:{min:8,max:12,type:"alphanumeric"},253:{min:13,max:17,type:"alphanumeric"},8003:{min:14,max:30,type:"alphanumeric"},multiKey:[{ids:["15","17","8005","8100"],ranges:[[11,13],[310,316],[320,336],[340,369]],type:{length:6}},{ids:["240","241","250","251","400","401","403","7002","8004","8007","8110"],ranges:[[-9]],type:{max:30,type:"alphanumeric"}},{ids:["7001"],ranges:[[410,414]],type:{length:13}},{ids:["10","21","254","420","8002"],type:{max:20,type:"alphanumeric"}},{ids:["00","8006","8017","8018"],type:{length:18}},{ids:["01","02","8001"],type:{length:14}},{ids:["422"],ranges:[[424,426]],type:{length:3}},{ids:["20","8102"],type:{length:2}},{ids:["30","37"],type:{max:8,type:"alphanumeric"}},{ids:["390","392"],type:{max:15,type:"alphanumeric"}},{ids:["421","423"],type:{min:3,max:15,type:"alphanumeric"}},{ids:["391","393"],type:{min:3,max:18,type:"alphanumeric"}},{ids:["7003","8101"],type:{length:10}}]},START:102}),a=A.extend({init:function(e){A.fn.init.call(this,e),this._initStates()},_initStates:function(){var e,t=this;for(e=0;t.states.length>e;e++)t[t.states[e]]=new o[t.states[e]](t,t.states)},initValue:function(e,t,n){var i=this;i.pattern=[],i.value=e,i.width=t,i.height=n,i.checkSum=0,i.totalUnits=0,i.index=0,i.position=1},addData:function(){var e=this,t={value:e.value,index:0,state:""};0!==e.value.length&&(t.state=t.previousState=e.getNextState(t,e.states),e.addStart(t),e.pushData(t,e.states),e.addCheckSum(),e.addStop(),e.setBaseUnit())},pushData:function(e,t){for(var n,i=this;;){if(i[e.state].pushState(e),e.index>=e.value.length)break;e.shifted?(n=e.state,e.state=e.previousState,e.previousState=n,e.shifted=!1):(e.previousState=e.state,e.state=i.getNextState(e,t),i[e.state].move(e))}},addStart:function(e){this[e.state].addStart(e),this.position=1},addCheckSum:function(){var e=this;e.checksum=e.checkSum%103,e.addPattern(e.checksum)},addStop:function(){this.addPattern(this.STOP)},setBaseUnit:function(){var e=this;e.baseUnit=e.width/(e.totalUnits+e.quietZoneLength)},addPattern:function(e){var t,n,i=this,r=""+i.characterMap[e];for(n=0;r.length>n;n++)t=parseInt(r.charAt(n),10),i.pattern.push(t),i.totalUnits+=t;i.checkSum+=e*i.position++},getNextState:function(e,t){for(var n=0;t.length>n;n++)if(this[t[n]].is(e.value,e.index))return t[n];this.invalidCharacterError(e.value.charAt(e.index))},characterMap:[212222,222122,222221,121223,121322,131222,122213,122312,132212,221213,221312,231212,112232,122132,122231,113222,123122,123221,223211,221132,221231,213212,223112,312131,311222,321122,321221,312212,322112,322211,212123,212321,232121,111323,131123,131321,112313,132113,132311,211313,231113,231311,112133,112331,132131,113123,113321,133121,313121,211331,231131,213113,213311,213131,311123,311321,331121,312113,312311,332111,314111,221411,431111,111224,111422,121124,121421,141122,141221,112214,112412,122114,122411,142112,142211,241211,221114,413111,241112,134111,111242,121142,121241,114212,124112,124211,411212,421112,421211,212141,214121,412121,111143,111341,131141,114113,114311,411113,411311,113141,114131,311141,411131,211412,211214,211232,2331112],STOP:106}),E.code128a=a.extend({name:"Code 128 A",states:["A"]}),E.code128b=a.extend({name:"Code 128 B",states:["B"]}),E.code128c=a.extend({name:"Code 128 C",states:["C"]}),E.code128=a.extend({name:"Code 128",states:["C","B","A","FNC4"]}),E["gs1-128"]=a.extend({name:"Code GS1-128",states:["FNC1","C","B"]}),s=A.extend({initValue:function(e,t){var n=this;n.pattern=[],n.value=e,n.checkSumLength=0,n.width=t},setBaseUnit:function(){var e=this,t=7;e.baseUnit=e.width/(12*(e.value.length+e.checkSumLength)+e.quietZoneLength+t)},addData:function(){var e,t=this,n=t.value;for(t.addPattern(t.START),e=0;n.length>e;e++)t.addCharacter(n.charAt(e));t.options.addCheckSum&&t.addCheckSum(),t.addPattern(t.STOP),t.setBaseUnit()},addCharacter:function(e){var t=this,n=t.characterMap[e];n||t.invalidCharacterError(e),t.addPattern(n)},addPattern:function(e){for(var t=0;e.length>t;t++)this.pattern.push(parseInt(e.charAt(t),10))},addCheckSum:function(){var e,t=this,n=t.checkSums[t.checkSumType],i=n.call(t.checkSums,t.value);for(t.checksum=i.join(""),e=0;i.length>e;e++)t.checkSumLength++,t.addPattern(t.characterMap[i[e]])},checkSums:{Modulo10:function(e){var t,n,i,r=[0,""],o=e.length%2;for(t=0;e.length>t;t++)r[(t+o)%2]+=parseInt(e.charAt(t),10);for(i=r[0],n=""+2*r[1],t=0;n.length>t;t++)i+=parseInt(n.charAt(t),10);return[(10-i%10)%10]},Modulo11:function(e){var t,n,i,r=0,o=11,a=e.length;for(i=0;a>i;i++)t=((a-i)%6||6)+1,r+=t*e.charAt(i);return n=(o-r%o)%o,10!=n?[n]:[1,0]},Modulo11Modulo10:function(e){var t,n=this.Modulo11(e);return t=e+n[0],n.concat(this.Modulo10(t))},Modulo10Modulo10:function(e){var t,n=this.Modulo10(e);return t=e+n[0],n.concat(this.Modulo10(t))}},characterMap:["12121212","12121221","12122112","12122121","12211212","12211221","12212112","12212121","21121212","21121221"],START:"21",STOP:"121",checkSumType:""}),E.msimod10=s.extend({name:"MSI Modulo10",checkSumType:"Modulo10"}),E.msimod11=s.extend({name:"MSI Modulo11",checkSumType:"Modulo11"}),E.msimod1110=s.extend({name:"MSI Modulo11 Modulo10",checkSumType:"Modulo11Modulo10"}),E.msimod1010=s.extend({name:"MSI Modulo10 Modulo10",checkSumType:"Modulo10Modulo10"}),E.code11=A.extend({name:"Code 11",cCheckSumTotal:10,kCheckSumTotal:9,kCheckSumMinLength:10,checkSumMod:11,DASH_VALUE:10,DASH:"-",START:"112211",STOP:"11221",initValue:function(e,t){var n=this;n.pattern=[],n.value=e,n.width=t,n.totalUnits=0},addData:function(){var e,t=this,n=t.value;for(t.addPattern(t.START),e=0;n.length>e;e++)t.addCharacter(n.charAt(e));t.options.addCheckSum&&t.addCheckSum(),t.addPattern(t.STOP),t.setBaseUnit()},setBaseUnit:function(){var e=this;e.baseUnit=e.width/(e.totalUnits+e.quietZoneLength)},addCheckSum:function(){var e,t=this,n=t.value,i=n.length,r=t.getWeightedSum(n,i,t.cCheckSumTotal)%t.checkSumMod;t.checksum=r+"",t.addPattern(t.characterMap[r]),i++,i>=t.kCheckSumMinLength&&(e=(r+t.getWeightedSum(n,i,t.kCheckSumTotal))%t.checkSumMod,t.checksum+=e,t.addPattern(t.characterMap[e]))},getWeightedSum:function(e,t,n){var i,r=0;for(i=0;e.length>i;i++)r+=this.weightedValue(this.getValue(e.charAt(i)),t,i,n);return r},weightedValue:function(e,t,n,i){var r=(t-n)%i||i;return r*e},getValue:function(e){var t=this;return isNaN(e)?(e!==t.DASH&&t.invalidCharacterError(e),t.DASH_VALUE):parseInt(e,10)},addCharacter:function(e){var t=this,n=t.getValue(e),i=t.characterMap[n];t.addPattern(i)},addPattern:function(e){var t,n;for(n=0;e.length>n;n++)t=parseInt(e.charAt(n),10),this.pattern.push(t),this.totalUnits+=t},characterMap:["111121","211121","121121","221111","112121","212111","122111","111221","211211","211111","112111"],options:{addCheckSum:!0}}),E.postnet=A.extend({name:"Postnet",START:"2",VALID_CODE_LENGTHS:[5,9,11],DIGIT_SEPARATOR:"-",initValue:function(e,t,n){var i=this;i.height=n,i.width=t,i.baseHeight=n/2,i.value=e.replace(RegExp(i.DIGIT_SEPARATOR,"g"),""),i.pattern=[],i.validate(i.value),i.checkSum=0,i.setBaseUnit()},addData:function(){var e,t=this,n=t.value;for(t.addPattern(t.START),e=0;n.length>e;e++)t.addCharacter(n.charAt(e));t.options.addCheckSum&&t.addCheckSum(),t.addPattern(t.START),t.pattern.pop()},addCharacter:function(e){var t=this,n=t.characterMap[e];t.checkSum+=parseInt(e,10),t.addPattern(n)},addCheckSum:function(){var e=this;e.checksum=(10-e.checkSum%10)%10,e.addCharacter(e.checksum)},setBaseUnit:function(){var e=this,t=3;e.baseUnit=e.width/(10*(e.value.length+1)+t+e.quietZoneLength)},validate:function(e){var t=this;
if(T.test(e)||t.invalidCharacterError(e.match(/[^0-9]/)[0]),p(e.length,t.VALID_CODE_LENGTHS)<0)throw Error("Invalid value length. Valid lengths for the Postnet symbology are "+t.VALID_CODE_LENGTHS.join(","))},addPattern:function(e){var t,n,i=this;for(n=0;e.length>n;n++)t=i.height-i.baseHeight*e.charAt(n),i.pattern.push({width:1,y1:t,y2:i.height}),i.pattern.push(1)},characterMap:["22111","11122","11212","11221","12112","12121","12211","21112","21121","21211"]}),E.ean13=A.extend({initValue:function(e,t,n){if(e+="",12!=e.length||/\D/.test(e))throw Error('The value of the "EAN13" encoding should be 12 symbols');var i=this;i.pattern=[],i.options.height=n,i.baseUnit=t/(95+i.quietZoneLength),i.value=e,i.checksum=i.calculateChecksum(),i.leftKey=e[0],i.leftPart=e.substr(1,6),i.rightPart=e.substr(7)+i.checksum},addData:function(){var e=this;e.addPieces(e.characterMap.start),e.addSide(e.leftPart,e.leftKey),e.addPieces(e.characterMap.middle),e.addSide(e.rightPart),e.addPieces(e.characterMap.start)},addSide:function(e,t){var n,i=this;for(n=0;e.length>n;n++)t&&parseInt(i.keyTable[t].charAt(n),10)?i.addPieces(Array.prototype.slice.call(i.characterMap.digits[e.charAt(n)]).reverse(),!0):i.addPieces(i.characterMap.digits[e.charAt(n)],!0)},addPieces:function(e,t){var n,i=this;for(n=0;e.length>n;n++)i.pattern.push(t?{y1:0,y2:.95*i.options.height,width:e[n]}:e[n])},calculateChecksum:function(){var e,t,n=0,i=0,r=this.value.split("").reverse().join("");for(e=0;r.length>e;e++)e%2?i+=parseInt(r.charAt(e),10):n+=parseInt(r.charAt(e),10);return t=(10-(3*n+i)%10)%10},keyTable:["000000","001011","001101","001110","010011","011001","011100","010101","010110","011010"],characterMap:{digits:[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2]],start:[1,1,1],middle:[1,1,1,1,1]}}),E.ean8=E.ean13.extend({initValue:function(e,t,n){var i=this;if(7!=e.length||/\D/.test(e))throw Error("Invalid value provided");i.value=e,i.options.height=n,i.checksum=i.calculateChecksum(i.value),i.leftPart=i.value.substr(0,4),i.rightPart=i.value.substr(4)+i.checksum,i.pattern=[],i.baseUnit=t/(67+i.quietZoneLength)}}),l=d.extend({init:function(t,n){var i=this;d.fn.init.call(i,t,n),i.element=e(t),i.wrapper=i.element,i.element.addClass("k-barcode").css("display","block"),i.surfaceWrap=e("<div />").css("position","relative").appendTo(this.element),i.surface=g.Surface.create(i.surfaceWrap,{type:i.options.renderAs}),i.setOptions(n)},setOptions:function(e){var t=this;if(t.type=(e.type||t.options.type).toLowerCase(),"upca"==t.type&&(t.type="ean13",e.value="0"+e.value),"upce"==t.type&&(t.type="ean8",e.value="0"+e.value),!E[t.type])throw Error("Encoding "+t.type+"is not supported.");t.encoding=new E[t.type],t.options=u(!0,t.options,e),_(e.value)&&t.redraw()},redraw:function(){var e=this._getSize();this.surfaceWrap.css({width:e.width,height:e.height}),this.surface.clear(),this.createVisual(),this.surface.draw(this.visual)},getSize:function(){return c.dimensions(this.element)},_resize:function(){this.redraw()},createVisual:function(){this.visual=this._render()},_render:function(){var e,t,n,i,r=this,o=r.options,a=o.value,s=o.text,l=w.getSpacing(s.margin),c=r._getSize(),d=o.border||{},u=r.encoding,h=y(0,0,c.width,c.height).unpad(d.width).unpad(o.padding),p=h.height(),f=new g.Group;return r.contentBox=h,f.append(r._getBackground(c)),s.visible&&(t=a,o.checksum&&_(u.checksum)&&(t+=" "+u.checksum),i=r._getText(t),n=i.bbox().height(),p-=n+l.top+l.bottom,f.append(i)),e=u.encode(a,h.width(),p),r.barHeight=p,f.append(this._getBands(e.pattern,e.baseUnit)),f},exportVisual:function(){return this._render()},_getSize:function(){var e=this,t=e.element,n=new m.Size(k,x);return t.width()>0&&(n.width=t.width()),t.height()>0&&(n.height=t.height()),e.options.width&&(n.width=e.options.width),e.options.height&&(n.height=e.options.height),n},value:function(e){var n=this;return _(e)?(n.options.value=e+"",n.redraw(),t):n.options.value},_getBands:function(e,t){var n,i,r,o,a,s=this,l=s.contentBox,c=l.x1,d=new g.Group;for(r=0;e.length>r;r++)i=f(e[r])?e[r]:{width:e[r],y1:0,y2:s.barHeight},n=i.width*t,r%2&&(o=m.Rect.fromPoints(new m.Point(c,i.y1+l.y1),new m.Point(c+n,i.y2+l.y1)),a=g.Path.fromRect(o,{fill:{color:s.options.color},stroke:null}),d.append(a)),c+=n;return d},_getBackground:function(e){var t=this,n=t.options,i=n.border||{},r=y(0,0,e.width,e.height).unpad(i.width/2),o=g.Path.fromRect(r.toRect(),{fill:{color:n.background},stroke:{color:i.width?i.color:"",width:i.width,dashType:i.dashType}});return o},_getText:function(e){var t=this,n=t.options.text,i=new b(e,{font:n.font,color:n.color,align:"center",vAlign:"bottom",margin:n.margin});return i.reflow(t.contentBox),i.renderVisual(),i.visual},options:{name:"Barcode",renderAs:"svg",value:"",type:"code39",checksum:!1,width:0,height:0,color:"black",background:"white",text:{visible:!0,font:"16px Consolas, Monaco, Sans Mono, monospace, sans-serif",color:"black",margin:{top:0,bottom:0,left:0,right:0}},border:{width:0,dashType:"solid",color:"black"},padding:{top:0,bottom:0,left:0,right:0}}}),w.ExportMixin.extend(l.fn),w.ui.plugin(l),c.deepExtend(w,{encodings:E,Encoding:A})}(window.kendo.jQuery),function(e,t){function n(e){return parseInt(e,2)}function i(e,t){var n=(+e).toString(2);return t>n.length&&(n=Array(t-n.length+1).join(0)+n),n}function r(e,t){for(var n=[],i=0;e.length>i;)n.push(e.substring(i,i+t)),i+=t;return n}function o(e,t,n,i){for(var r=0;e.length>r;r++)e[r][n][i]=t}function a(e,t,n,i){for(var r=0;vt.length>r;r++)e[r][n][i]=vt[r](n,i)?1^t:parseInt(t,10)}function s(){var e,t;for(t=1;255>t;t++)e=2*ot[t-1],e>255&&(e=285^e),ot[t]=e,rt[e]=t;e=2*ot[t-1]^285,ot[t]=e,ot[-1]=0}function l(){var e,t,n,i=68;for(e=2;i>=e;e++)t=at[e-1],n=[e,0],at[e]=y(t,n)}function c(e,n){var i=[],r=e.length-1;do i[r]=ot[(e[r]+n)%255],r--;while(e[r]!==t);return i}function d(e,t){return parseInt(e.charAt(t),10)}function u(e,t,n,i,r){t[e][i]=(t[e][i]<<1^r)%128,t[e][i]==mt&&(n[e]+=40)}function h(e,t,n,i,r,o){n[e][o]==i?r[e][o]++:(n[e][o]=i,r[e][o]>=5&&(t[e]+=3+r[e][o]-5),r[e][o]=1)}function p(e,t){var n=Math.floor(e/t*100),i=n%5,r=Math.abs(n-i-50),o=Math.abs(n+5-i-50),a=10*Math.min(r/5,o/5);return a}var f,g,m,v,_,w,y,b,k,x,C,T,S,D,A,E,I,P,M,F,z,R,B,H,L,N,O,V,U,W,j,q,G,$,Y=window.kendo,Q=e.extend,K=Y.drawing,X=Y.dataviz,Z=Y.ui.Widget,J=X.Box2D,et="0000",tt="numeric",nt="alphanumeric",it="byte",rt={1:0},ot={0:1},at=[[1,0],[1,25,0]],st={15:20,16:20,18:24,19:24,22:20,24:22,26:24,28:20,30:20,31:24,32:28,33:24,36:18,37:22,39:20,40:24},lt=[{L:{groups:[[1,19]],totalDataCodewords:19,errorCodewordsPerBlock:7},M:{groups:[[1,16]],totalDataCodewords:16,errorCodewordsPerBlock:10},Q:{groups:[[1,13]],totalDataCodewords:13,errorCodewordsPerBlock:13},H:{groups:[[1,9]],totalDataCodewords:9,errorCodewordsPerBlock:17}},{L:{groups:[[1,34]],totalDataCodewords:34,errorCodewordsPerBlock:10},M:{groups:[[1,28]],totalDataCodewords:28,errorCodewordsPerBlock:16},Q:{groups:[[1,22]],totalDataCodewords:22,errorCodewordsPerBlock:22},H:{groups:[[1,16]],totalDataCodewords:16,errorCodewordsPerBlock:28}},{L:{groups:[[1,55]],totalDataCodewords:55,errorCodewordsPerBlock:15},M:{groups:[[1,44]],totalDataCodewords:44,errorCodewordsPerBlock:26},Q:{groups:[[2,17]],totalDataCodewords:34,errorCodewordsPerBlock:18},H:{groups:[[2,13]],totalDataCodewords:26,errorCodewordsPerBlock:22}},{L:{groups:[[1,80]],totalDataCodewords:80,errorCodewordsPerBlock:20},M:{groups:[[2,32]],totalDataCodewords:64,errorCodewordsPerBlock:18},Q:{groups:[[2,24]],totalDataCodewords:48,errorCodewordsPerBlock:26},H:{groups:[[4,9]],totalDataCodewords:36,errorCodewordsPerBlock:16}},{L:{groups:[[1,108]],totalDataCodewords:108,errorCodewordsPerBlock:26},M:{groups:[[2,43]],totalDataCodewords:86,errorCodewordsPerBlock:24},Q:{groups:[[2,15],[2,16]],totalDataCodewords:62,errorCodewordsPerBlock:18},H:{groups:[[2,11],[2,12]],totalDataCodewords:46,errorCodewordsPerBlock:22}},{L:{groups:[[2,68]],totalDataCodewords:136,errorCodewordsPerBlock:18},M:{groups:[[4,27]],totalDataCodewords:108,errorCodewordsPerBlock:16},Q:{groups:[[4,19]],totalDataCodewords:76,errorCodewordsPerBlock:24},H:{groups:[[4,15]],totalDataCodewords:60,errorCodewordsPerBlock:28}},{L:{groups:[[2,78]],totalDataCodewords:156,errorCodewordsPerBlock:20},M:{groups:[[4,31]],totalDataCodewords:124,errorCodewordsPerBlock:18},Q:{groups:[[2,14],[4,15]],totalDataCodewords:88,errorCodewordsPerBlock:18},H:{groups:[[4,13],[1,14]],totalDataCodewords:66,errorCodewordsPerBlock:26}},{L:{groups:[[2,97]],totalDataCodewords:194,errorCodewordsPerBlock:24},M:{groups:[[2,38],[2,39]],totalDataCodewords:154,errorCodewordsPerBlock:22},Q:{groups:[[4,18],[2,19]],totalDataCodewords:110,errorCodewordsPerBlock:22},H:{groups:[[4,14],[2,15]],totalDataCodewords:86,errorCodewordsPerBlock:26}},{L:{groups:[[2,116]],totalDataCodewords:232,errorCodewordsPerBlock:30},M:{groups:[[3,36],[2,37]],totalDataCodewords:182,errorCodewordsPerBlock:22},Q:{groups:[[4,16],[4,17]],totalDataCodewords:132,errorCodewordsPerBlock:20},H:{groups:[[4,12],[4,13]],totalDataCodewords:100,errorCodewordsPerBlock:24}},{L:{groups:[[2,68],[2,69]],totalDataCodewords:274,errorCodewordsPerBlock:18},M:{groups:[[4,43],[1,44]],totalDataCodewords:216,errorCodewordsPerBlock:26},Q:{groups:[[6,19],[2,20]],totalDataCodewords:154,errorCodewordsPerBlock:24},H:{groups:[[6,15],[2,16]],totalDataCodewords:122,errorCodewordsPerBlock:28}},{L:{groups:[[4,81]],totalDataCodewords:324,errorCodewordsPerBlock:20},M:{groups:[[1,50],[4,51]],totalDataCodewords:254,errorCodewordsPerBlock:30},Q:{groups:[[4,22],[4,23]],totalDataCodewords:180,errorCodewordsPerBlock:28},H:{groups:[[3,12],[8,13]],totalDataCodewords:140,errorCodewordsPerBlock:24}},{L:{groups:[[2,92],[2,93]],totalDataCodewords:370,errorCodewordsPerBlock:24},M:{groups:[[6,36],[2,37]],totalDataCodewords:290,errorCodewordsPerBlock:22},Q:{groups:[[4,20],[6,21]],totalDataCodewords:206,errorCodewordsPerBlock:26},H:{groups:[[7,14],[4,15]],totalDataCodewords:158,errorCodewordsPerBlock:28}},{L:{groups:[[4,107]],totalDataCodewords:428,errorCodewordsPerBlock:26},M:{groups:[[8,37],[1,38]],totalDataCodewords:334,errorCodewordsPerBlock:22},Q:{groups:[[8,20],[4,21]],totalDataCodewords:244,errorCodewordsPerBlock:24},H:{groups:[[12,11],[4,12]],totalDataCodewords:180,errorCodewordsPerBlock:22}},{L:{groups:[[3,115],[1,116]],totalDataCodewords:461,errorCodewordsPerBlock:30},M:{groups:[[4,40],[5,41]],totalDataCodewords:365,errorCodewordsPerBlock:24},Q:{groups:[[11,16],[5,17]],totalDataCodewords:261,errorCodewordsPerBlock:20},H:{groups:[[11,12],[5,13]],totalDataCodewords:197,errorCodewordsPerBlock:24}},{L:{groups:[[5,87],[1,88]],totalDataCodewords:523,errorCodewordsPerBlock:22},M:{groups:[[5,41],[5,42]],totalDataCodewords:415,errorCodewordsPerBlock:24},Q:{groups:[[5,24],[7,25]],totalDataCodewords:295,errorCodewordsPerBlock:30},H:{groups:[[11,12],[7,13]],totalDataCodewords:223,errorCodewordsPerBlock:24}},{L:{groups:[[5,98],[1,99]],totalDataCodewords:589,errorCodewordsPerBlock:24},M:{groups:[[7,45],[3,46]],totalDataCodewords:453,errorCodewordsPerBlock:28},Q:{groups:[[15,19],[2,20]],totalDataCodewords:325,errorCodewordsPerBlock:24},H:{groups:[[3,15],[13,16]],totalDataCodewords:253,errorCodewordsPerBlock:30}},{L:{groups:[[1,107],[5,108]],totalDataCodewords:647,errorCodewordsPerBlock:28},M:{groups:[[10,46],[1,47]],totalDataCodewords:507,errorCodewordsPerBlock:28},Q:{groups:[[1,22],[15,23]],totalDataCodewords:367,errorCodewordsPerBlock:28},H:{groups:[[2,14],[17,15]],totalDataCodewords:283,errorCodewordsPerBlock:28}},{L:{groups:[[5,120],[1,121]],totalDataCodewords:721,errorCodewordsPerBlock:30},M:{groups:[[9,43],[4,44]],totalDataCodewords:563,errorCodewordsPerBlock:26},Q:{groups:[[17,22],[1,23]],totalDataCodewords:397,errorCodewordsPerBlock:28},H:{groups:[[2,14],[19,15]],totalDataCodewords:313,errorCodewordsPerBlock:28}},{L:{groups:[[3,113],[4,114]],totalDataCodewords:795,errorCodewordsPerBlock:28},M:{groups:[[3,44],[11,45]],totalDataCodewords:627,errorCodewordsPerBlock:26},Q:{groups:[[17,21],[4,22]],totalDataCodewords:445,errorCodewordsPerBlock:26},H:{groups:[[9,13],[16,14]],totalDataCodewords:341,errorCodewordsPerBlock:26}},{L:{groups:[[3,107],[5,108]],totalDataCodewords:861,errorCodewordsPerBlock:28},M:{groups:[[3,41],[13,42]],totalDataCodewords:669,errorCodewordsPerBlock:26},Q:{groups:[[15,24],[5,25]],totalDataCodewords:485,errorCodewordsPerBlock:30},H:{groups:[[15,15],[10,16]],totalDataCodewords:385,errorCodewordsPerBlock:28}},{L:{groups:[[4,116],[4,117]],totalDataCodewords:932,errorCodewordsPerBlock:28},M:{groups:[[17,42]],totalDataCodewords:714,errorCodewordsPerBlock:26},Q:{groups:[[17,22],[6,23]],totalDataCodewords:512,errorCodewordsPerBlock:28},H:{groups:[[19,16],[6,17]],totalDataCodewords:406,errorCodewordsPerBlock:30}},{L:{groups:[[2,111],[7,112]],totalDataCodewords:1006,errorCodewordsPerBlock:28},M:{groups:[[17,46]],totalDataCodewords:782,errorCodewordsPerBlock:28},Q:{groups:[[7,24],[16,25]],totalDataCodewords:568,errorCodewordsPerBlock:30},H:{groups:[[34,13]],totalDataCodewords:442,errorCodewordsPerBlock:24}},{L:{groups:[[4,121],[5,122]],totalDataCodewords:1094,errorCodewordsPerBlock:30},M:{groups:[[4,47],[14,48]],totalDataCodewords:860,errorCodewordsPerBlock:28},Q:{groups:[[11,24],[14,25]],totalDataCodewords:614,errorCodewordsPerBlock:30},H:{groups:[[16,15],[14,16]],totalDataCodewords:464,errorCodewordsPerBlock:30}},{L:{groups:[[6,117],[4,118]],totalDataCodewords:1174,errorCodewordsPerBlock:30},M:{groups:[[6,45],[14,46]],totalDataCodewords:914,errorCodewordsPerBlock:28},Q:{groups:[[11,24],[16,25]],totalDataCodewords:664,errorCodewordsPerBlock:30},H:{groups:[[30,16],[2,17]],totalDataCodewords:514,errorCodewordsPerBlock:30}},{L:{groups:[[8,106],[4,107]],totalDataCodewords:1276,errorCodewordsPerBlock:26},M:{groups:[[8,47],[13,48]],totalDataCodewords:1e3,errorCodewordsPerBlock:28},Q:{groups:[[7,24],[22,25]],totalDataCodewords:718,errorCodewordsPerBlock:30},H:{groups:[[22,15],[13,16]],totalDataCodewords:538,errorCodewordsPerBlock:30}},{L:{groups:[[10,114],[2,115]],totalDataCodewords:1370,errorCodewordsPerBlock:28},M:{groups:[[19,46],[4,47]],totalDataCodewords:1062,errorCodewordsPerBlock:28},Q:{groups:[[28,22],[6,23]],totalDataCodewords:754,errorCodewordsPerBlock:28},H:{groups:[[33,16],[4,17]],totalDataCodewords:596,errorCodewordsPerBlock:30}},{L:{groups:[[8,122],[4,123]],totalDataCodewords:1468,errorCodewordsPerBlock:30},M:{groups:[[22,45],[3,46]],totalDataCodewords:1128,errorCodewordsPerBlock:28},Q:{groups:[[8,23],[26,24]],totalDataCodewords:808,errorCodewordsPerBlock:30},H:{groups:[[12,15],[28,16]],totalDataCodewords:628,errorCodewordsPerBlock:30}},{L:{groups:[[3,117],[10,118]],totalDataCodewords:1531,errorCodewordsPerBlock:30},M:{groups:[[3,45],[23,46]],totalDataCodewords:1193,errorCodewordsPerBlock:28},Q:{groups:[[4,24],[31,25]],totalDataCodewords:871,errorCodewordsPerBlock:30},H:{groups:[[11,15],[31,16]],totalDataCodewords:661,errorCodewordsPerBlock:30}},{L:{groups:[[7,116],[7,117]],totalDataCodewords:1631,errorCodewordsPerBlock:30},M:{groups:[[21,45],[7,46]],totalDataCodewords:1267,errorCodewordsPerBlock:28},Q:{groups:[[1,23],[37,24]],totalDataCodewords:911,errorCodewordsPerBlock:30},H:{groups:[[19,15],[26,16]],totalDataCodewords:701,errorCodewordsPerBlock:30}},{L:{groups:[[5,115],[10,116]],totalDataCodewords:1735,errorCodewordsPerBlock:30},M:{groups:[[19,47],[10,48]],totalDataCodewords:1373,errorCodewordsPerBlock:28},Q:{groups:[[15,24],[25,25]],totalDataCodewords:985,errorCodewordsPerBlock:30},H:{groups:[[23,15],[25,16]],totalDataCodewords:745,errorCodewordsPerBlock:30}},{L:{groups:[[13,115],[3,116]],totalDataCodewords:1843,errorCodewordsPerBlock:30},M:{groups:[[2,46],[29,47]],totalDataCodewords:1455,errorCodewordsPerBlock:28},Q:{groups:[[42,24],[1,25]],totalDataCodewords:1033,errorCodewordsPerBlock:30},H:{groups:[[23,15],[28,16]],totalDataCodewords:793,errorCodewordsPerBlock:30}},{L:{groups:[[17,115]],totalDataCodewords:1955,errorCodewordsPerBlock:30},M:{groups:[[10,46],[23,47]],totalDataCodewords:1541,errorCodewordsPerBlock:28},Q:{groups:[[10,24],[35,25]],totalDataCodewords:1115,errorCodewordsPerBlock:30},H:{groups:[[19,15],[35,16]],totalDataCodewords:845,errorCodewordsPerBlock:30}},{L:{groups:[[17,115],[1,116]],totalDataCodewords:2071,errorCodewordsPerBlock:30},M:{groups:[[14,46],[21,47]],totalDataCodewords:1631,errorCodewordsPerBlock:28},Q:{groups:[[29,24],[19,25]],totalDataCodewords:1171,errorCodewordsPerBlock:30},H:{groups:[[11,15],[46,16]],totalDataCodewords:901,errorCodewordsPerBlock:30}},{L:{groups:[[13,115],[6,116]],totalDataCodewords:2191,errorCodewordsPerBlock:30},M:{groups:[[14,46],[23,47]],totalDataCodewords:1725,errorCodewordsPerBlock:28},Q:{groups:[[44,24],[7,25]],totalDataCodewords:1231,errorCodewordsPerBlock:30},H:{groups:[[59,16],[1,17]],totalDataCodewords:961,errorCodewordsPerBlock:30}},{L:{groups:[[12,121],[7,122]],totalDataCodewords:2306,errorCodewordsPerBlock:30},M:{groups:[[12,47],[26,48]],totalDataCodewords:1812,errorCodewordsPerBlock:28},Q:{groups:[[39,24],[14,25]],totalDataCodewords:1286,errorCodewordsPerBlock:30},H:{groups:[[22,15],[41,16]],totalDataCodewords:986,errorCodewordsPerBlock:30}},{L:{groups:[[6,121],[14,122]],totalDataCodewords:2434,errorCodewordsPerBlock:30},M:{groups:[[6,47],[34,48]],totalDataCodewords:1914,errorCodewordsPerBlock:28},Q:{groups:[[46,24],[10,25]],totalDataCodewords:1354,errorCodewordsPerBlock:30},H:{groups:[[2,15],[64,16]],totalDataCodewords:1054,errorCodewordsPerBlock:30}},{L:{groups:[[17,122],[4,123]],totalDataCodewords:2566,errorCodewordsPerBlock:30},M:{groups:[[29,46],[14,47]],totalDataCodewords:1992,errorCodewordsPerBlock:28},Q:{groups:[[49,24],[10,25]],totalDataCodewords:1426,errorCodewordsPerBlock:30},H:{groups:[[24,15],[46,16]],totalDataCodewords:1096,errorCodewordsPerBlock:30}},{L:{groups:[[4,122],[18,123]],totalDataCodewords:2702,errorCodewordsPerBlock:30},M:{groups:[[13,46],[32,47]],totalDataCodewords:2102,errorCodewordsPerBlock:28},Q:{groups:[[48,24],[14,25]],totalDataCodewords:1502,errorCodewordsPerBlock:30},H:{groups:[[42,15],[32,16]],totalDataCodewords:1142,errorCodewordsPerBlock:30}},{L:{groups:[[20,117],[4,118]],totalDataCodewords:2812,errorCodewordsPerBlock:30},M:{groups:[[40,47],[7,48]],totalDataCodewords:2216,errorCodewordsPerBlock:28},Q:{groups:[[43,24],[22,25]],totalDataCodewords:1582,errorCodewordsPerBlock:30},H:{groups:[[10,15],[67,16]],totalDataCodewords:1222,errorCodewordsPerBlock:30}},{L:{groups:[[19,118],[6,119]],totalDataCodewords:2956,errorCodewordsPerBlock:30},M:{groups:[[18,47],[31,48]],totalDataCodewords:2334,errorCodewordsPerBlock:28},Q:{groups:[[34,24],[34,25]],totalDataCodewords:1666,errorCodewordsPerBlock:30},H:{groups:[[20,15],[61,16]],totalDataCodewords:1276,errorCodewordsPerBlock:30}}],ct=[1,0,1,1,1],dt=[1,0,1],ut={L:"01",M:"00",Q:"11",H:"10"},ht="101010000010010",pt="10100110111",ft="1111100100101",gt=["11101100","00010001"],mt=93,vt=[function(e,t){return(e+t)%2===0},function(e){return e%2===0},function(e,t){return t%3===0},function(e,t){return(e+t)%3===0},function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2===0},function(e,t){return e*t%2+e*t%3===0},function(e,t){return(e*t%2+e*t%3)%2===0},function(e,t){return((e+t)%2+e*t%3)%2===0}],_t=/^\d+/,wt="A-Z0-9 $%*+./:-",yt="A-Z $%*+./:-",bt=RegExp("^["+yt+"]+"),kt=RegExp("^["+wt+"]+"),xt=RegExp("^[^"+wt+"]+"),Ct=8,Tt=5,St=8,Dt=17,At=9,Et=16,It=Math.round,Pt=Y.Class.extend({getVersionIndex:function(e){return 10>e?0:e>26?2:1},getBitsCharacterCount:function(e){var t=this;return t.bitsInCharacterCount[t.getVersionIndex(e||40)]},getModeCountString:function(e,t){var n=this;return n.modeIndicator+i(e,n.getBitsCharacterCount(t))},encode:function(){},getStringBitsLength:function(){},getValue:function(){},modeIndicator:"",bitsInCharacterCount:[]}),Mt={};Mt[tt]=Pt.extend({bitsInCharacterCount:[10,12,14],modeIndicator:"0001",getValue:function(e){return parseInt(e,10)},encode:function(e,t){var n,o=this,a=r(e,3),s=o.getModeCountString(e.length,t);for(n=0;a.length-1>n;n++)s+=i(a[n],10);return s+i(a[n],1+3*a[n].length)},getStringBitsLength:function(e,t){var n=e%3;return 4+this.getBitsCharacterCount(t)+10*Math.floor(e/3)+3*n+(0===n?0:1)}}),Mt[nt]=Pt.extend({characters:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:18,J:19,K:20,L:21,M:22,N:23,O:24,P:25,Q:26,R:27,S:28,T:29,U:30,V:31,W:32,X:33,Y:34,Z:35," ":36,$:37,"%":38,"*":39,"+":40,"-":41,".":42,"/":43,":":44},bitsInCharacterCount:[9,11,13],modeIndicator:"0010",getValue:function(e){return this.characters[e]},encode:function(e,t){var n,o,a=this,s=r(e,2),l=a.getModeCountString(e.length,t);for(o=0;s.length-1>o;o++)n=45*a.getValue(s[o].charAt(0))+a.getValue(s[o].charAt(1)),l+=i(n,11);return n=2==s[o].length?45*a.getValue(s[o].charAt(0))+a.getValue(s[o].charAt(1)):a.getValue(s[o].charAt(0)),l+i(n,1+5*s[o].length)},getStringBitsLength:function(e,t){return 4+this.getBitsCharacterCount(t)+11*Math.floor(e/2)+6*(e%2)}}),Mt[it]=Pt.extend({bitsInCharacterCount:[8,16,16],modeIndicator:"0100",getValue:function(e){var t=e.charCodeAt(0);if(127>=t||t>=160&&255>=t)return t;throw Error("Unsupported character: "+e)},encode:function(e,t){var n,r=this,o=r.getModeCountString(e.length,t);for(n=0;e.length>n;n++)o+=i(r.getValue(e.charAt(n)),8);return o},getStringBitsLength:function(e,t){return 4+this.getBitsCharacterCount(t)+8*e}}),f={};for(g in Mt)f[g]=new Mt[g];m=function(e){var n=this,i=e.length-1,r=e.length-1,o=r,a=-1,s=0;n.move=function(){i+=a*s,s^=1,r=o-s},n.getNextCell=function(){for(;e[i][r]!==t;)n.move(),(0>i||i>=e.length)&&(a=-a,o-=8!=o?2:3,r=o,i=0>a?e.length-1:0);return{row:i,column:r}},n.getNextRemainderCell=function(){return n.move(),e[i][r]===t?{row:i,column:r}:t}},v=function(e,t){var n,i,r,o,s,l,c=new m(e[0]);for(o=0;t.length>o;o++)for(n=t[o],i=0;n.length>0;){for(s=0;n.length>s;s++)for(l=0;8>l;l++)r=c.getNextCell(),a(e,n[s][i].charAt(l),r.row,r.column);for(i++;n[0]&&i==n[0].length;)n.splice(0,1)}for(;r=c.getNextRemainderCell();)a(e,0,r.row,r.column)},_=function(e,t){for(var n=8*t,i=0,r=0;n>e.length&&et.length>i;)e+=et.charAt(i++);for(e.length%8!==0&&(e+=Array(9-e.length%8).join("0"));n>e.length;)e+=gt[r],r^=1;return e},w=function(e,t){var n,i=[],r=e.length-2;for(n=r;n>=0;n--)i[n]=e[n]^t[n];return i},y=function(e,n){var i,r,o=[];for(i=0;e.length>i;i++)for(r=0;n.length>r;r++)o[i+r]=o[i+r]===t?(e[i]+(n[r]>=0?n[r]:0))%255:rt[ot[o[i+r]]^ot[(e[i]+n[r])%255]];return o},s(),l(),b=function(e,t){var n,r,o=at[t-1],a=Array(t).concat(e),s=Array(a.length-o.length).concat(o),l=e.length,d=[];for(r=0;l>r;r++)n=c(s,rt[a[a.length-1]]),s.splice(0,1),a=w(n,a);for(r=a.length-1;r>=0;r--)d[t-1-r]=i(a[r],8);return d},k=function(e,t){var i,r,o,a,s,l,c,d,u=0,h=[],p=[],f=t.groups;for(l=0;f.length>l;l++)for(o=f[l][0],c=0;o>c;c++){for(r=f[l][1],i=[],a=[],d=1;r>=d;d++)s=e.substring(u,u+8),i.push(s),a[r-d]=n(s),u+=8;h.push(i),p.push(b(a,t.errorCodewordsPerBlock))}return[h,p]},x=function(e,t,n,i,r){var o,a,s=_t.exec(e),l=s?s[0]:"",c=bt.exec(e),d=c?c[0]:"",u=kt.exec(e),h=u?u[0]:"";return l&&(l.length>=t||e.length==l.length||l.length>=n&&!kt.test(e.charAt(l.length)))?(o=tt,a=l):h&&(e.length==h.length||h.length>=i||r==nt)?(o=nt,a=l||d):(o=it,a=h?h+xt.exec(e.substring(h.length))[0]:xt.exec(e)[0]),{mode:o,modeString:a}},C=function(e){var t,n,i=[],r=0;for(i.push(x(e,Ct,Tt,St,t)),t=i[0].mode,e=e.substr(i[0].modeString.length);e.length>0;)n=x(e,Dt,At,Et,t),n.mode!=t?(t=n.mode,i.push(n),r++):i[r].modeString+=n.modeString,e=e.substr(n.modeString.length);return i},T=function(e){var t,n,i=0;for(n=0;e.length>n;n++)t=f[e[n].mode],i+=t.getStringBitsLength(e[n].modeString.length);return Math.ceil(i/8)},S=function(e,t){var n=0,i=lt.length-1,r=Math.floor(lt.length/2);do lt[r][t].totalDataCodewords>e?i=r:n=r,r=n+Math.floor((i-n)/2);while(i-n>1);return lt[n][t].totalDataCodewords>=e?r+1:i+1},D=function(e,t){var n,i,r="";for(i=0;e.length>i;i++)n=f[e[i].mode],r+=n.encode(e[i].modeString,t);return r},A=function(e){var t,i,r=n(e),o="";if(0===r)return"101010000010010";for(t=E(n(e),pt,15),i=0;t.length>i;i++)o+=t.charAt(i)^ht.charAt(i);return o},E=function(e,t,r){var o=n(t),a=t.length-1,s=e<<a,l=r-a,c=i(e,l),d=I(s,o);return d=c+i(d,a)},I=function(e,t){var n=t.toString(2).length,i=e.toString(2).length;do e^=t<<i-n,i=e.toString(2).length;while(i>=n);return e},P=function(e){var t,n,i=[],r=17+4*e;for(t=0;vt.length>t;t++)for(i[t]=Array(r),n=0;r>n;n++)i[t][n]=Array(r);return i},M=function(e,t){var n,i,r=e[0],a=0,s=t.length;for(n=0,i=8;8>=n;n++)6!==n&&o(e,d(t,s-1-a++),n,i);for(n=8,i=7;i>=0;i--)6!==i&&o(e,d(t,s-1-a++),n,i);for(a=0,i=r.length-1,n=8;i>=r.length-8;i--)o(e,d(t,s-1-a++),n,i);for(o(e,1,r.length-8,8),n=r.length-7,i=8;r.length>n;n++)o(e,d(t,s-1-a++),n,i)},F=function(e){return E(e,ft,18)},z=function(e,t){var n,i,r,a,s=e[0],l=s.length,c=0,u=l-11,h=l-11,p=0;for(a=0;t.length>a;a++)n=Math.floor(a/3),i=a%3,r=d(t,t.length-a-1),o(e,r,c+n,u+i),o(e,r,h+i,p+n)},R=function(e,t,n,i){var r,a,s,l=t.length+2,c=t.length+1;for(a=0;t.length>a;a++)for(s=a;l-a>s;s++)r=t[a],o(e,r,n+s,i+a),o(e,r,n+a,i+s),o(e,r,n+c-s,i+c-a),o(e,r,n+c-a,i+c-s)},B=function(e,t,n,i){var r=n,a=i,s=e[0];do o(e,0,r,i),o(e,0,n,a),r+=t[0],a+=t[1];while(r>=0&&s.length>r)},H=function(e){var t=e[0].length;R(e,ct,0,0),B(e,[-1,-1],7,7),R(e,ct,t-7,0),B(e,[1,-1],t-8,7),R(e,ct,0,t-7),B(e,[-1,1],7,t-8)},L=function(e,n){var i,r,o,a,s,l,c,d,u;if(!(2>n)){for(i=e[0],r=i.length,o=Math.floor(n/7),a=[6],c=0,(s=st[n])?l=(r-13-s)/o:s=l=(r-13)/(o+1),a.push(a[c++]+s);r>a[c]+l;)a.push(a[c++]+l);for(d=0;a.length>d;d++)for(u=0;a.length>u;u++)i[a[d]][a[u]]===t&&R(e,dt,a[d]-2,a[u]-2)}},N=function(e){var t,n=6,i=6,r=1,a=e[0].length;for(t=8;a-8>t;t++)o(e,r,n,t),o(e,r,t,i),r^=1},O=function(e){var t,n,i,r,o,a,s,l=[],c=[],d=[],f=[],g=[],m=0,v=1,_=e[0].length;for(n=0;e.length>n;n++)l[n]=0,d[n]=0,g[n]=[0,0],f[n]=[0,0],c[n]=[];for(n=0;_>n;n++)for(i=0;_>i;i++)for(r=0;e.length>r;r++)t=e[r],d[r]+=parseInt(t[n][i],10),c[r][m]===t[n][i]&&_>n+1&&i-1>=0&&t[n+1][i]==c[r][m]&&t[n+1][i-1]==c[r][m]&&(l[r]+=3),u(r,f,l,m,t[n][i]),u(r,f,l,v,t[i][n]),h(r,l,c,t[n][i],g,m),h(r,l,c,t[i][n],g,v);for(o=_*_,s=Number.MAX_VALUE,n=0;l.length>n;n++)l[n]+=p(d[n],o),s>l[n]&&(s=l[n],a=n);return a},V=function(e,t){this.dataString=e,this.version=t},U=function(){this.getEncodingResult=function(e,t){var n=C(e),i=T(n),r=S(i,t),o=D(n,r);return new V(o,r)}},W=function(){this.mode=f[this.encodingMode]},W.fn=W.prototype={encodingMode:it,utfBOM:"111011111011101110111111",initialModeCountStringLength:20,getEncodingResult:function(e,t){var n=this,i=n.encode(e),r=n.getDataCodewordsCount(i),o=S(r,t),a=n.mode.getModeCountString(i.length/8,o)+i;return new V(a,o)},getDataCodewordsCount:function(e){var t=this,n=e.length,i=Math.ceil((t.initialModeCountStringLength+n)/8);return i},encode:function(e){var t,n=this,i=n.utfBOM;for(t=0;e.length>t;t++)i+=n.encodeCharacter(e.charCodeAt(t));return i},encodeCharacter:function(e){var t,n,r=this.getBytesCount(e),o=r-1,a="";if(1==r)a=i(e,8);else{for(t=8-r,n=0;o>n;n++)a=i(e>>6*n&63|128,8)+a;a=(e>>6*o|255>>t<<t).toString(2)+a}return a},getBytesCount:function(e){var t,n=this.ranges;for(t=0;n.length>t;t++)if(n[t]>e)return t+1},ranges:[128,2048,65536,2097152,67108864]},j=function(e){return e&&e.toLowerCase().indexOf("utf_8")>=0?new W:new U},q=function(e,t,n){var r,o,a,s=new j(n),l=s.getEncodingResult(e,t),c=l.version,d=lt[c-1][t],u=_(l.dataString,d.totalDataCodewords),h=k(u,d),p=P(c);return H(p),L(p,c),N(p),c>=7&&z(p,i(0,18)),M(p,i(0,15)),v(p,h),r=O(p),o=p[r],c>=7&&z([o],F(c)),a=ut[t]+i(r,3),M([o],A(a)),o},G={DEFAULT_SIZE:200,QUIET_ZONE_LENGTH:4,DEFAULT_ERROR_CORRECTION_LEVEL:"L",DEFAULT_BACKGROUND:"#fff",DEFAULT_DARK_MODULE_COLOR:"#000",MIN_BASE_UNIT_SIZE:1},$=Z.extend({init:function(t,n){var i=this;Z.fn.init.call(i,t,n),i.element=e(t),i.wrapper=i.element,i.element.addClass("k-qrcode"),i.surfaceWrap=e("<div />").css("position","relative").appendTo(this.element),i.surface=K.Surface.create(i.surfaceWrap,{type:i.options.renderAs}),i.setOptions(n)},redraw:function(){var e=this._getSize();this.surfaceWrap.css({width:e,height:e}),this.surface.clear(),this.createVisual(),this.surface.draw(this.visual)},getSize:function(){return Y.dimensions(this.element)},_resize:function(){this.redraw()},createVisual:function(){this.visual=this._render()},exportVisual:function(){return this._render()},_render:function(){var e,t,n,i,r,o,a,s=this,l=s._value,c=s.options.border||{},d=s.options.padding||0,u=c.width||0;return c.width=u,a=new K.Group,l&&(n=q(l,s.options.errorCorrection,s.options.encoding),i=s._getSize(),o=i-2*(u+d),e=s._calculateBaseUnit(o,n.length),r=n.length*e,t=u+d+(o-r)/2,a.append(s._renderBackground(i,c)),a.append(s._renderMatrix(n,e,t))),a},_getSize:function(){var e,t,n,i=this;return i.options.size?e=parseInt(i.options.size,10):(t=i.element,n=Math.min(t.width(),t.height()),e=n>0?n:G.DEFAULT_SIZE),e},_calculateBaseUnit:function(e,t){var n=Math.floor(e/t);if(G.MIN_BASE_UNIT_SIZE>n)throw Error("Insufficient size.");return n*t>=e&&n-1>=G.MIN_BASE_UNIT_SIZE&&n--,n},_renderMatrix:function(e,t,n){var i,r,o,a,s,l,c,d,u=new K.MultiPath({fill:{color:this.options.color},stroke:null});for(i=0;e.length>i;i++)for(r=n+i*t,o=0;e.length>o;){for(;0===e[i][o]&&e.length>o;)o++;if(e.length>o){for(a=o;1==e[i][o];)o++;s=It(n+a*t),l=It(r),c=It(n+o*t),d=It(r+t),u.moveTo(s,l).lineTo(s,d).lineTo(c,d).lineTo(c,l).close()}}return u},_renderBackground:function(e,t){var n=J(0,0,e,e).unpad(t.width/2);return K.Path.fromRect(n.toRect(),{fill:{color:this.options.background},stroke:{color:t.color,width:t.width}})},setOptions:function(e){var n=this;e=e||{},n.options=Q(n.options,e),e.value!==t&&(n._value=n.options.value+""),n.redraw()},value:function(e){var n=this;return e===t?n._value:(n._value=e+"",n.redraw(),t)},options:{name:"QRCode",renderAs:"svg",encoding:"ISO_8859_1",value:"",errorCorrection:G.DEFAULT_ERROR_CORRECTION_LEVEL,background:G.DEFAULT_BACKGROUND,color:G.DEFAULT_DARK_MODULE_COLOR,size:"",padding:0,border:{color:"",width:0}}}),X.ExportMixin.extend($.fn),X.ui.plugin($),Y.deepExtend(X,{QRCode:$,QRCodeDefaults:G,QRCodeFunctions:{FreeCellVisitor:m,fillData:v,padDataString:_,generateErrorCodewords:b,xorPolynomials:w,getBlocks:k,multiplyPolynomials:y,chooseMode:x,getModes:C,getDataCodewordsCount:T,getVersion:S,getDataString:D,encodeFormatInformation:A,encodeBCH:E,dividePolynomials:I,initMatrices:P,addFormatInformation:M,encodeVersionInformation:F,addVersionInformation:z,addCentricPattern:R,addFinderSeparator:B,addFinderPatterns:H,addAlignmentPatterns:L,addTimingFunctions:N,scoreMaskMatrixes:O,encodeData:q,UTF8Encoder:W},QRCodeFields:{modes:f,powersOfTwo:rt,powersOfTwoResult:ot,generatorPolynomials:at}})}(window.kendo.jQuery),function(e,t){function n(){}function i(e){return n.prototype=e,new n}var r,o=window.kendo,a=o.Class,s=o.Observable,l=o.deepExtend,c=Math,d=e.proxy,u=o.util,h=u.last,p=u.renderTemplate,f=o.dataviz,g=u.defined,m=f.filterSeriesByType,v=o.template,_=f.ui.Chart,w=f.Selection,y=f.addDuration,b=u.limitValue,k=f.lteDateIndex,x=f.toDate,C=f.toTime,T=28,S="change",D="k-",A="drag",E="dragEnd",I="_navigator",P=I,M=f.EQUALLY_SPACED_SERIES,F=3,z="zoom",R="zoomEnd",B=_.extend({init:function(t,n){e(t).addClass(D+"chart"),_.fn.init.call(this,t,n)},_applyDefaults:function(e,t){var n=this,i=n.element.width()||f.DEFAULT_WIDTH,r={seriesDefaults:{categoryField:e.dateField},axisDefaults:{categoryAxis:{name:"default",majorGridLines:{visible:!1},labels:{step:2},majorTicks:{visible:!1},maxDateGroups:c.floor(i/T)}}};t&&(t=l({},t,r)),n._navigator||H.setup(e,t),_.fn._applyDefaults.call(n,e,t)},_initDataSource:function(e){var t,n,i=e||{},r=i.dataSource,o=r&&r.serverFiltering,a=[].concat(i.categoryAxis)[0],s=i.navigator||{},c=s.select,d=c&&c.from&&c.to;o&&d&&(t=[].concat(r.filter||[]),n=new f.DateCategoryAxis(l({baseUnit:"fit"},a,{categories:[c.from,c.to]})),r.filter=H.buildFilter(n.range().min,c.to).concat(t)),_.fn._initDataSource.call(this,e)},options:{name:"StockChart",dateField:"date",axisDefaults:{categoryAxis:{type:"date",baseUnit:"fit",justified:!0},valueAxis:{narrowRange:!0,labels:{format:"C"}}},navigator:{select:{},seriesDefaults:{markers:{visible:!1},tooltip:{visible:!0,template:"#= kendo.toString(category, 'd') #"},line:{width:2}},hint:{},visible:!0},tooltip:{visible:!0},legend:{visible:!1}},_resize:function(){var e=this.options.transitions;
this.options.transitions=!1,this._fullRedraw(),this.options.transitions=e},_redraw:function(){var e=this,t=e._navigator;t&&t.dataSource?t.redrawSlaves():e._fullRedraw()},_fullRedraw:function(){var e=this,t=e._navigator;t||(t=e._navigator=new H(e)),t._setRange(),_.fn._redraw.call(e),t._initSelection()},_onDataChanged:function(){var e=this;_.fn._onDataChanged.call(e),e._dataBound=!0},_bindCategoryAxis:function(e,t,n){var i,r=this,o=r.options.categoryAxis,a=o.length;if(_.fn._bindCategoryAxis.apply(this,arguments),e.name===P)for(;a>n;)i=o[n++],i.pane==I&&(i.categories=e.categories)},_trackSharedTooltip:function(e){var t=this,n=t._plotArea,i=n.paneByPoint(e);i&&i.options.name===I?t._unsetActivePoint():_.fn._trackSharedTooltip.call(t,e)},destroy:function(){var e=this;e._navigator.destroy(),_.fn.destroy.call(e)}}),H=s.extend({init:function(e){var t=this;t.chart=e,t.options=l({},t.options,e.options.navigator),t._initDataSource(),g(t.options.hint.visible)||(t.options.hint.visible=t.options.visible),e.bind(A,d(t._drag,t)),e.bind(E,d(t._dragEnd,t)),e.bind(z,d(t._zoom,t)),e.bind(R,d(t._zoomEnd,t))},options:{},_initDataSource:function(){var e=this,t=e.options,n=t.autoBind,i=t.dataSource;g(n)||(n=e.chart.options.autoBind),e._dataChangedHandler=d(e._onDataChanged,e),i&&(e.dataSource=o.data.DataSource.create(i).bind(S,e._dataChangedHandler),n&&e.dataSource.fetch())},_onDataChanged:function(){var e,t,n,i,r,o=this,a=o.chart,s=a.options.series,l=s.length,c=a.options.categoryAxis,d=c.length,u=o.dataSource.view();for(e=0;l>e;e++)n=s[e],n.axis==P&&a._isBindable(n)&&(n.data=u);for(t=0;d>t;t++)i=c[t],i.pane==I&&(i.name==P?(a._bindCategoryAxis(i,u,t),r=i.categories):i.categories=r);a._model&&(o.redraw(),o.filterAxes(),(!a.options.dataSource||a.options.dataSource&&a._dataBound)&&o.redrawSlaves())},destroy:function(){var e=this,t=e.dataSource;t&&t.unbind(S,e._dataChangeHandler),e.selection&&e.selection.destroy()},redraw:function(){this._redrawSelf(),this._initSelection()},_initSelection:function(){var t=this,n=t.chart,o=t.options,a=t.mainAxis(),s=i(a),l=a.range(),c=l.min,d=l.max,u=a.options.categories,h=t.options.select,p=t.selection,f=x(h.from),g=x(h.to);0!==u.length&&(p&&(p.destroy(),p.wrapper.remove()),s.box=a.box,p=t.selection=new w(n,s,{min:c,max:d,from:f,to:g,selectStart:e.proxy(t._selectStart,t),select:e.proxy(t._select,t),selectEnd:e.proxy(t._selectEnd,t),mousewheel:{zoom:"left"}}),o.hint.visible&&(t.hint=new r(n.element,{min:c,max:d,template:o.hint.template,format:o.hint.format})))},_setRange:function(){var e,t=this.chart._createPlotArea(!0),n=t.namedCategoryAxes[P],i=n.options,r=n.range(),o=r.min,a=y(r.max,i.baseUnitStep,i.baseUnit),s=this.options.select||{},l=x(s.from)||o;o>l&&(l=o),e=x(s.to)||a,e>a&&(e=a),this.options.select={from:l,to:e},this.filterAxes()},_redrawSelf:function(e){var t=this.chart._plotArea;t&&t.redraw(h(t.panes),e)},redrawSlaves:function(){var e=this,t=e.chart,n=t._plotArea,i=n.panes.slice(0,-1);n.srcSeries=t.options.series,n.redraw(i)},_drag:function(e){var t,n,i,r=this,o=r.chart,a=o._eventCoordinates(e.originalEvent),s=r.mainAxis(),l=s.range(),c=s.pane.box.containsPoint(a),d=o._plotArea.categoryAxis,u=e.axisRanges[d.options.name],h=r.options.select,p=r.selection;u&&!c&&p&&(t=h.from&&h.to?C(h.to)-C(h.from):C(p.options.to)-C(p.options.from),n=x(b(C(u.min),l.min,C(l.max)-t)),i=x(b(C(n)+t,C(l.min)+t,l.max)),r.options.select={from:n,to:i},r._liveDrag()&&(r.filterAxes(),r.redrawSlaves()),p.set(n,i),r.showHint(n,i))},_dragEnd:function(){var e=this;e.filterAxes(),e.filterDataSource(),e.redrawSlaves(),e.hint&&e.hint.hide()},_liveDrag:function(){var e=o.support,t=e.touch,n=e.browser,i=n.mozilla,r=n.msie&&9>n.version;return!t&&!i&&!r},readSelection:function(){var e=this,t=e.selection,n=t.options,i=e.options.select;i.from=n.from,i.to=n.to},filterAxes:function(){var e,t,n=this,i=n.options.select||{},r=n.chart,o=r.options.categoryAxis,a=i.from,s=i.to;for(e=0;o.length>e;e++)t=o[e],t.pane!==I&&(t.min=x(a),t.max=x(s))},filterDataSource:function(){var e,t=this,n=t.options.select||{},i=t.chart,r=i.dataSource,o=r&&r.options.serverFiltering;t.dataSource&&o&&(e=new f.DateCategoryAxis(l({baseUnit:"fit"},i.options.categoryAxis[0],{categories:[n.from,n.to]})).options,r.filter(H.buildFilter(y(e.min,-e.baseUnitStep,e.baseUnit),y(e.max,e.baseUnitStep,e.baseUnit))))},_zoom:function(e){var t,n,i=this,r=i.chart,a=e.delta,s=r._plotArea.categoryAxis,l=i.options.select,d=i.selection,u=i.mainAxis().options.categories;d&&(t=k(d.options.from,u),n=k(d.options.to,u),e.originalEvent.preventDefault(),c.abs(a)>1&&(a*=F),n-t>1?(d.expand(a),i.readSelection()):(s.options.min=l.from,l.from=s.scaleRange(-e.delta).min),o.support.touch||(i.filterAxes(),i.redrawSlaves()),d.set(l.from,l.to),i.showHint(i.options.select.from,i.options.select.to))},_zoomEnd:function(e){this._dragEnd(e)},showHint:function(e,t){var n=this,i=n.chart,r=i._plotArea;n.hint&&n.hint.show(e,t,r.backgroundBox())},_selectStart:function(e){var t=this.chart;t._selectStart.call(t,e)},_select:function(e){var t=this,n=t.chart;t.showHint(e.from,e.to),n._select.call(n,e)},_selectEnd:function(e){var t=this,n=t.chart;t.hint&&t.hint.hide(),t.readSelection(),t.filterAxes(),t.filterDataSource(),t.redrawSlaves(),n._selectEnd.call(n,e)},mainAxis:function(){var e=this.chart._plotArea;return e?e.namedCategoryAxes[P]:t}});H.setup=function(e,t){e=e||{},t=t||{};var n=l({},t.navigator,e.navigator),i=e.panes=[].concat(e.panes),r=l({},n.pane,{name:I});n.visible||(r.visible=!1,r.height=.1),i.push(r),H.attachAxes(e,n),H.attachSeries(e,n,t)},H.attachAxes=function(e,t){var n=t.series||[],i=e.categoryAxis=[].concat(e.categoryAxis),r=e.valueAxis=[].concat(e.valueAxis),o=m(n,M),a=0===o.length,s=l({type:"date",pane:I,roundToBaseUnit:!a,justified:a,_collapse:!1,tooltip:{visible:!1},labels:{step:1},autoBind:!t.dataSource,autoBaseUnitSteps:{minutes:[1],hours:[1,2],days:[1,2],weeks:[],months:[1],years:[1]},_overlap:!1}),c=t.categoryAxis;i.push(l({},s,{maxDateGroups:200},c,{name:P,baseUnit:"fit",baseUnitStep:"auto",labels:{visible:!1},majorTicks:{visible:!1}}),l({},s,c,{name:P+"_labels",maxDateGroups:20,baseUnitStep:"auto",autoBaseUnitSteps:{minutes:[]},majorTicks:{visible:!0}}),l({},s,c,{name:P+"_ticks",maxDateGroups:200,majorTicks:{visible:!0,width:.5},labels:{visible:!1,mirror:!0}})),r.push(l({name:P,pane:I,majorGridLines:{visible:!1},visible:!1},t.valueAxis))},H.attachSeries=function(e,t,n){var i,r=e.series=e.series||[],o=[].concat(t.series||[]),a=n.seriesColors,s=t.seriesDefaults;for(i=0;o.length>i;i++)r.push(l({color:a[i%a.length],categoryField:t.dateField,visibleInLegend:!1,tooltip:{visible:!1}},s,o[i],{axis:P,categoryAxis:P,autoBind:!t.dataSource}))},H.buildFilter=function(e,t){return[{field:"Date",operator:"gte",value:x(e)},{field:"Date",operator:"lt",value:x(t)}]},r=a.extend({init:function(t,n){var i=this;i.options=l({},i.options,n),i.container=t,i.chartPadding={top:parseInt(t.css("paddingTop"),10),left:parseInt(t.css("paddingLeft"),10)},i.template=i.template,i.template||(i.template=i.template=p("<div class='"+D+"navigator-hint' style='display: none; position: absolute; top: 1px; left: 1px;'><div class='"+D+"tooltip "+D+"chart-tooltip'>&nbsp;</div><div class='"+D+"scroll' /></div>")),i.element=e(i.template()).appendTo(t)},options:{format:"{0:d} - {1:d}",hideDelay:500},show:function(e,t,n){var i,r=this,a=x(C(e)+C(t-e)/2),s=r.options,l=o.format(r.options.format,e,t),c=r.element.find("."+D+"tooltip"),d=r.element.find("."+D+"scroll"),u=.4*n.width(),h=n.center().x-u,p=n.center().x,f=p-h,g=s.max-s.min,m=f/g,_=a-s.min;r._hideTimeout&&clearTimeout(r._hideTimeout),r._visible||(r.element.stop(!1,!0).css("visibility","hidden").show(),r._visible=!0),s.template&&(i=v(s.template),l=i({from:e,to:t})),c.html(l).css({left:n.center().x-c.outerWidth()/2,top:n.y1}),d.css({width:u,left:h+_*m,top:n.y1+parseInt(c.css("margin-top"),10)+parseInt(c.css("border-top-width"),10)+c.height()/2}),r.element.css("visibility","visible")},hide:function(){var e=this;e._hideTimeout&&clearTimeout(e._hideTimeout),e._hideTimeout=setTimeout(function(){e._visible=!1,e.element.fadeOut("slow")},e.options.hideDelay)}}),f.ui.plugin(B),l(f,{Navigator:H})}(window.kendo.jQuery),function(e){function t(e){return"number"==typeof e?[e]:e}var n=window.kendo,i=n.dataviz,r=i.ui.Chart,o=n.data.ObservableArray,a=i.SharedTooltip,s=n.deepExtend,l=e.isArray,c=i.inArray,d=Math,u="k-",h=150,p=150,f="bar",g="bullet",m="pie",v=[f,g],_=r.extend({init:function(n,i){var a=this,h=a.stage=e("<span />"),p=i||{};n=e(n).addClass(u+"sparkline").empty().append(h),a._initialWidth=d.floor(n.width()),p=t(p),(l(p)||p instanceof o)&&(p={seriesDefaults:{data:p}}),p.series||(p.series=[{data:t(p.data)}]),s(p,{seriesDefaults:{type:p.type}}),(c(p.series[0].type,v)||c(p.seriesDefaults.type,v))&&(p=s({},{categoryAxis:{crosshair:{visible:!1}}},p)),r.fn.init.call(a,n,p)},options:{name:"Sparkline",chartArea:{margin:2},axisDefaults:{visible:!1,majorGridLines:{visible:!1},valueAxis:{narrowRange:!0}},seriesDefaults:{type:"line",area:{line:{width:.5}},bar:{stack:!0},padding:2,width:.5,overlay:{gradient:null},highlight:{visible:!1},border:{width:0},markers:{size:2,visible:!1}},tooltip:{visible:!0,shared:!0},categoryAxis:{crosshair:{visible:!0,tooltip:{visible:!1}}},legend:{visible:!1},transitions:!1,pointWidth:5,panes:[{clip:!1}]},_modelOptions:function(){var t,n,i=this,r=i.options,o=i._initialWidth,a=i.stage;return i.stage.children().hide(),n=e("<span>&nbsp;</span>"),i.stage.append(n),t=s({width:o?o:i._autoWidth(),height:a.height(),transitions:r.transitions},r.chartArea,{inline:!0,align:!1}),a.css({width:t.width,height:t.height}),n.remove(),i.stage.children().show(),i.surface.resize(),t},_createTooltip:function(){var e,t=this,n=t.options,i=t.element;return e=t._sharedTooltip()?new w(i,t._plotArea,n.tooltip):r.fn._createTooltip.call(t)},_surfaceWrap:function(){return this.stage},_autoWidth:function(){var e,t,n,r=this,o=r.options,a=i.getSpacing(o.chartArea.margin),s=o.series,l=r.dataSource.total(),c=0;for(t=0;s.length>t;t++){if(n=s[t],n.type===f)return h;if(n.type===g)return p;if(n.type===m)return r.stage.height();n.data&&(c=d.max(c,n.data.length))}return e=d.max(l,c)*o.pointWidth,e>0&&(e+=a.left+a.right),e}}),w=a.extend({options:{animation:{duration:0}},_anchor:function(e,t){var n=a.fn._anchor.call(this,e,t),i=this._measure();return n.y=-i.height-this.options.offset,n},_hideElement:function(){this.element&&this.element.hide().remove()}});i.ui.plugin(_),s(i,{SparklineSharedTooltip:w})}(window.kendo.jQuery),function(e,t){var n,i=Math,r=i.abs,o=i.atan,a=i.atan2,s=i.cos,l=i.max,c=i.min,d=i.sin,u=i.tan,h=window.kendo,p=h.Class,f=h.dataviz,g=h.deepExtend,m=h.util,v=m.defined,_=m.deg,w=m.rad,y=m.round,b=m.sqr,k=m.valueOrDefault,x=p.extend({init:function(e,t){1===arguments.length?(this.lat=e[0],this.lng=e[1]):(this.lat=e,this.lng=t)},DISTANCE_ITERATIONS:100,DISTANCE_CONVERGENCE:1e-12,DISTANCE_PRECISION:2,FORMAT:"{0:N6},{1:N6}",toArray:function(){return[this.lat,this.lng]},equals:function(e){return e&&e.lat===this.lat&&e.lng===this.lng},clone:function(){return new x(this.lat,this.lng)},round:function(e){return this.lng=y(this.lng,e),this.lat=y(this.lat,e),this},wrap:function(){return this.lng=this.lng%180,this.lat=this.lat%90,this},distanceTo:function(e,t){return this.greatCircleTo(e,t).distance},destination:function(e,t,n){var r,o,l,c,u;return t=w(t),n=n||f.map.datums.WGS84,r=w(this.lat),o=w(this.lng),l=e/h.dataviz.map.datums.WGS84.a,c=i.asin(d(r)*s(l)+s(r)*d(l)*s(t)),u=o+a(d(t)*d(l)*s(r),s(l)-d(r)*d(c)),new x(_(c),_(u))},greatCircleTo:function(e,t){var n,l,c,h,p,g,m,v,k,C,T,S,D,A,E,I,P,M,F,z,R,B,H,L,N,O,V,U,W;if(e=x.create(e),t=t||f.map.datums.WGS84,!e||this.clone().round(8).equals(e.clone().round(8)))return{distance:0,azimuthFrom:0,azimuthTo:0};for(n=t.a,l=t.b,c=t.f,h=w(e.lng-this.lng),p=o((1-c)*u(w(this.lat))),g=d(p),m=s(p),v=o((1-c)*u(w(e.lat))),k=d(v),C=s(v),T=h,D=this.DISTANCE_ITERATIONS,A=!1;!A&&D-->0;)E=d(T),I=s(T),P=i.sqrt(b(C*E)+b(m*k-g*C*I)),F=g*k+m*C*I,R=a(P,F),B=m*C*E/P,M=1-b(B),z=0,0!==M&&(z=F-2*g*k/M),S=T,H=c/16*M*(4+c*(4-3*M)),T=h+(1-H)*c*B*(R+H*P*(z+H*F*(-1+2*b(z)))),A=r(T-S)<=this.DISTANCE_CONVERGENCE;return L=M*(b(n)-b(l))/b(l),N=1+L/16384*(4096+L*(-768+L*(320-175*L))),O=L/1024*(256+L*(-128+L*(74-47*L))),V=O*P*(z+O/4*(F*(-1+2*b(z))-O/6*z*(-3+4*b(P))*(-3+4*b(z)))),U=a(C*E,m*k-g*C*I),W=a(m*E,-g*C+m*k*I),{distance:y(l*N*(R-V),this.DISTANCE_PRECISION),azimuthFrom:_(U),azimuthTo:_(W)}}});x.fn.toString=function(){return h.format(this.FORMAT,this.lng,this.lat)},x.fromLngLat=function(e){return new x(e[1],e[0])},x.fromLatLng=function(e){return new x(e[0],e[1])},x.create=function(e,n){return v(e)?e instanceof x?e.clone():1===arguments.length&&2===e.length?x.fromLatLng(e):new x(e,n):t},n=p.extend({init:function(e,t){e=x.create(e),t=x.create(t),e.lng+180>t.lng+180&&t.lat+90>e.lat+90?(this.se=e,this.nw=t):(this.se=t,this.nw=e)},contains:function(e){var t=this.nw,n=this.se,i=k(e.lng,e[1]),r=k(e.lat,e[0]);return e&&i+180>=t.lng+180&&n.lng+180>=i+180&&r+90>=n.lat+90&&t.lat+90>=r+90},center:function(){var e=this.nw,t=this.se,n=e.lng+(t.lng-e.lng)/2,i=e.lat+(t.lat-e.lat)/2;return new x(i,n)},containsAny:function(e){var t,n=!1;for(t=0;e.length>t;t++)n=n||this.contains(e[t]);return n},include:function(e){var t=this.nw,n=this.se,i=k(e.lng,e[1]),r=k(e.lat,e[0]);t.lng=c(t.lng,i),t.lat=l(t.lat,r),n.lng=l(n.lng,i),n.lat=c(n.lat,r)},includeAll:function(e){for(var t=0;e.length>t;t++)this.include(e[t])},edges:function(){var e=this.nw,t=this.se;return{nw:this.nw,ne:new x(e.lat,t.lng),se:this.se,sw:new x(t.lat,e.lng)}},toArray:function(){var e=this.nw,t=this.se;return[e,new x(e.lat,t.lng),t,new x(t.lat,e.lng)]},overlaps:function(e){return this.containsAny(e.toArray())||e.containsAny(this.toArray())}}),n.World=new n([90,-180],[-90,180]),n.create=function(e,i){return e instanceof n?e:e&&i?new n(e,i):e&&4===e.length&&!i?new n([e[0],e[1]],[e[2],e[3]]):t},g(f,{map:{Extent:n,Location:x}})}(window.kendo.jQuery),function(){var e=window.kendo,t=e.ui.Widget,n=e.template,i=e.util.valueOrDefault,r=e.util.defined,o=t.extend({init:function(e,n){t.fn.init.call(this,e,n),this._initOptions(n),this.items=[],this.element.addClass("k-widget k-attribution")},options:{name:"Attribution",separator:"&nbsp;|&nbsp;",itemTemplate:"#= text #"},filter:function(e,t){this._extent=e,this._zoom=t,this._render()},add:function(e){r(e)&&("string"==typeof e&&(e={text:e}),this.items.push(e),this._render())},remove:function(e){var t,n,i=[];for(t=0;this.items.length>t;t++)n=this.items[t],n.text!==e&&i.push(n);this.items=i,this._render()},clear:function(){this.items=[],this.element.empty()},_render:function(){var e,t,i,r=[],o=n(this.options.itemTemplate);for(e=0;this.items.length>e;e++)t=this.items[e],i=this._itemText(t),""!==i&&r.push(o({text:i}));r.length>0?this.element.empty().append(r.join(this.options.separator)).show():this.element.hide()},_itemText:function(e){var t="",n=this._inZoomLevel(e.minZoom,e.maxZoom),i=this._inArea(e.extent);return n&&i&&(t+=e.text),t},_inZoomLevel:function(e,t){var n=!0;return e=i(e,-Number.MAX_VALUE),t=i(t,Number.MAX_VALUE),n=this._zoom>e&&t>this._zoom},_inArea:function(e){var t=!0;return e&&(t=e.contains(this._extent)),t}});e.dataviz.ui.plugin(o)}(window.kendo.jQuery),function(e){function t(e){return n.format('<button class="k-button k-navigator-{0}"><span class="k-icon k-i-arrow-{0}"/></button>',e)}var n=window.kendo,i=n.ui.Widget,r=n.keys,o=e.proxy,a=".kendoNavigator",s=t("n")+t("e")+t("s")+t("w"),l=i.extend({init:function(e,t){i.fn.init.call(this,e,t),this._initOptions(t),this.element.addClass("k-widget k-header k-shadow k-navigator").append(s).on("click"+a,".k-button",o(this,"_click"));var r=this.element.parent().closest("["+n.attr("role")+"]");this._keyroot=r.length>0?r:this.element,this._tabindex(this._keyroot),this._keydown=o(this._keydown,this),this._keyroot.on("keydown",this._keydown)},options:{name:"Navigator",panStep:1},events:["pan"],dispose:function(){this._keyroot.off("keydown",this._keydown)},_pan:function(e,t){var n=this.options.panStep;this.trigger("pan",{x:e*n,y:t*n})},_click:function(t){var n=0,i=0,r=e(t.currentTarget);r.is(".k-navigator-n")?i=1:r.is(".k-navigator-s")?i=-1:r.is(".k-navigator-e")?n=1:r.is(".k-navigator-w")&&(n=-1),this._pan(n,i),t.preventDefault()},_keydown:function(e){switch(e.which){case r.UP:this._pan(0,1),e.preventDefault();break;case r.DOWN:this._pan(0,-1),e.preventDefault();break;case r.RIGHT:this._pan(1,0),e.preventDefault();break;case r.LEFT:this._pan(-1,0),e.preventDefault()}}});n.dataviz.ui.plugin(l)}(window.kendo.jQuery),function(e){function t(e,t){return n.format('<button class="k-button k-zoom-{0}" title="zoom-{0}">{1}</button>',e,t)}var n=window.kendo,i=n.ui.Widget,r=n.keys,o=e.proxy,a=".kendoZoomControl",s=t("in","+")+t("out","-"),l=187,c=189,d=61,u=173,h=i.extend({init:function(e,t){i.fn.init.call(this,e,t),this._initOptions(t),this.element.addClass("k-widget k-zoom-control k-button-wrap k-buttons-horizontal").append(s).on("click"+a,".k-button",o(this,"_click"));var r=this.element.parent().closest("["+n.attr("role")+"]");this._keyroot=r.length>0?r:this.element,this._tabindex(this._keyroot),this._keydown=o(this._keydown,this),this._keyroot.on("keydown",this._keydown)},options:{name:"ZoomControl",zoomStep:1},events:["change"],_change:function(e){var t=this.options.zoomStep;this.trigger("change",{delta:e*t})},_click:function(t){var n=e(t.currentTarget),i=1;n.is(".k-zoom-out")&&(i=-1),this._change(i),t.preventDefault()},_keydown:function(e){switch(e.which){case r.NUMPAD_PLUS:case l:case d:this._change(1);break;case r.NUMPAD_MINUS:case c:case u:this._change(-1)}}});n.dataviz.ui.plugin(h)}(window.kendo.jQuery),function(){var e=Math,t=e.atan,n=e.exp,i=e.pow,r=e.sin,o=e.log,a=e.tan,s=window.kendo,l=s.Class,c=s.dataviz,d=s.deepExtend,u=s.geometry,h=u.Point,p=c.map,f=p.Location,g=s.util,m=g.rad,v=g.deg,_=g.limitValue,w=e.PI,y=w/2,b=w/4,k=w/180,x={a:6378137,b:6356752.314245179,f:.0033528106647474805,e:.08181919084262149},C=l.extend({init:function(e){this._initOptions(e)},MAX_LNG:180,MAX_LAT:85.0840590501,INVERSE_ITERATIONS:15,INVERSE_CONVERGENCE:1e-12,options:{centralMeridian:0,datum:x},forward:function(e,t){var n=this,i=n.options,r=i.datum,o=r.a,a=i.centralMeridian,s=_(e.lat,-n.MAX_LAT,n.MAX_LAT),l=t?_(e.lng,-n.MAX_LNG,n.MAX_LNG):e.lng,c=m(l-a)*o,d=n._projectLat(s);return new h(c,d)},_projectLat:function(e){var t=this.options.datum,n=t.e,s=t.a,l=m(e),c=a(b+l/2),d=n*r(l),u=i((1-d)/(1+d),n/2);return s*o(c*u)},inverse:function(e,t){var n=this,i=n.options,r=i.datum,o=r.a,a=i.centralMeridian,s=e.x/(k*o)+a,l=_(n._inverseY(e.y),-n.MAX_LAT,n.MAX_LAT);return t&&(s=_(s,-n.MAX_LNG,n.MAX_LNG)),new f(l,s)},_inverseY:function(o){var a,s,l,c,d=this,u=d.options.datum,h=u.a,p=u.e,f=p/2,g=n(-o/h),m=y-2*t(g);for(a=0;d.INVERSE_ITERATIONS>=a&&(s=p*r(m),l=i((1-s)/(1+s),f),c=y-2*t(g*l)-m,m+=c,!(e.abs(c)<=d.INVERSE_CONVERGENCE));a++);return v(m)}}),T=C.extend({MAX_LAT:85.0511287798,_projectLat:function(e){var t=this.options.datum.a,n=m(e),i=a(b+n/2);return t*o(i)},_inverseY:function(e){var i=this.options.datum.a,r=n(-e/i);return v(y-2*t(r))}}),S=l.extend({forward:function(e){return new h(e.lng,e.lat)},inverse:function(e){return new f(e.y,e.x)}}),D=l.extend({init:function(){var e=this,t=e._proj=new T,n=this.c=2*w*t.options.datum.a;this._tm=u.transform().translate(.5,.5).scale(1/n,-1/n),this._itm=u.transform().scale(n,-n).translate(-.5,-.5)},toPoint:function(e,t,n){var i=this._proj.forward(e,n);return i.transform(this._tm).scale(t||1)},toLocation:function(e,t,n){return e=e.clone().scale(1/(t||1)).transform(this._itm),this._proj.inverse(e,n)}}),A=l.extend({init:function(){this._proj=new C},toPoint:function(e){return this._proj.forward(e)},toLocation:function(e){return this._proj.inverse(e)}}),E=l.extend({init:function(){this._proj=new S},toPoint:function(e){return this._proj.forward(e)},toLocation:function(e){return this._proj.inverse(e)}});d(c,{map:{crs:{EPSG3395:A,EPSG3857:D,EPSG4326:E},datums:{WGS84:x},projections:{Equirectangular:S,Mercator:C,SphericalMercator:T}}})}(window.kendo.jQuery),function(e){var t=e.proxy,n=window.kendo,i=n.Class,r=n.dataviz,o=n.deepExtend,a=r.map.Extent,s=n.util,l=s.defined,c=i.extend({init:function(n,i){this._initOptions(i),this.map=n,this.element=e("<div class='k-layer'></div>").css({zIndex:this.options.zIndex,opacity:this.options.opacity}).appendTo(n.scrollElement),this._beforeReset=t(this._beforeReset,this),this._reset=t(this._reset,this),this._resize=t(this._resize,this),this._panEnd=t(this._panEnd,this),this._activate(),this._updateAttribution()},destroy:function(){this._deactivate()},show:function(){this.reset(),this._activate(),this._applyExtent(!0)},hide:function(){this._deactivate(),this._setVisibility(!1)},reset:function(){this._beforeReset(),this._reset()},_reset:function(){this._applyExtent()},_beforeReset:e.noop,_resize:e.noop,_panEnd:function(){this._applyExtent()},_applyExtent:function(){var e=this.options,t=this.map.zoom(),n=!l(e.minZoom)||t>=e.minZoom,i=!l(e.maxZoom)||e.maxZoom>=t,r=a.create(e.extent),o=!r||r.overlaps(this.map.extent());this._setVisibility(n&&i&&o)},_setVisibility:function(e){this.element.css("display",e?"":"none")},_activate:function(){var e=this.map;e.bind("beforeReset",this._beforeReset),e.bind("reset",this._reset),e.bind("resize",this._resize),e.bind("panEnd",this._panEnd)},_deactivate:function(){var e=this.map;e.unbind("beforeReset",this._beforeReset),e.unbind("reset",this._reset),e.unbind("resize",this._resize),e.unbind("panEnd",this._panEnd)},_updateAttribution:function(){var e=this.map.attribution;e&&e.add(this.options.attribution)}});o(r,{map:{layers:{Layer:c}}})}(window.kendo.jQuery),function(e){var t=e.proxy,n=window.kendo,i=n.Class,r=n.data.DataSource,o=n.dataviz,a=n.deepExtend,s=n.util.last,l=n.util.defined,c=n.geometry,d=n.drawing,u=d.Group,h=o.map,p=h.Location,f=h.layers.Layer,g=f.extend({init:function(e,t){f.fn.init.call(this,e,t),this.surface=d.Surface.create(this.element,{width:e.scrollElement.width(),height:e.scrollElement.height()}),this._initRoot(),this.movable=new n.ui.Movable(this.surface.element),this._markers=[],this._click=this._handler("shapeClick"),this.surface.bind("click",this._click),this._mouseenter=this._handler("shapeMouseEnter"),this.surface.bind("mouseenter",this._mouseenter),this._mouseleave=this._handler("shapeMouseLeave"),this.surface.bind("mouseleave",this._mouseleave),this._initDataSource()},options:{autoBind:!0},destroy:function(){f.fn.destroy.call(this),this.surface.destroy(),this.dataSource.unbind("change",this._dataChange)},setDataSource:function(e){this.dataSource&&this.dataSource.unbind("change",this._dataChange),this.dataSource=e,this.dataSource.bind("change",this._dataChange),this.options.autoBind&&this.dataSource.fetch()},_reset:function(){f.fn._reset.call(this),this._translateSurface(),this._data&&this._load(this._data)},_initRoot:function(){this._root=new u,this.surface.draw(this._root)},_beforeReset:function(){this.surface.clear(),this._initRoot()},_resize:function(){this.surface.size(this.map.size())},_initDataSource:function(){var e=this.options.dataSource;this._dataChange=t(this._dataChange,this),this.dataSource=r.create(e).bind("change",this._dataChange),e&&this.options.autoBind&&this.dataSource.fetch()},_dataChange:function(e){this._data=e.sender.view(),this._load(this._data)},_load:function(e){var t,n,i;for(this._clearMarkers(),this._loader||(this._loader=new m(this.map,this.options.style,this)),t=new u,n=0;e.length>n;n++)i=this._loader.parse(e[n]),i&&t.append(i);this._root.clear(),this._root.append(t)},shapeCreated:function(e){var t,n=!1;return e instanceof d.Circle&&(n=l(this._createMarker(e))),n||(t={layer:this,shape:e},n=this.map.trigger("shapeCreated",t)),n},_createMarker:function(e){var t=this.map.markers.bind({location:e.location},e.dataItem);return t&&this._markers.push(t),t},_clearMarkers:function(){for(var e=0;this._markers.length>e;e++)this.map.markers.remove(this._markers[e]);this._markers=[]},_panEnd:function(e){f.fn._panEnd.call(this,e),this._translateSurface()},_translateSurface:function(){var e=this.map,t=e.locationToView(e.extent().nw);this.surface.translate&&(this.surface.translate(t),this.movable.moveTo({x:t.x,y:t.y}))},_handler:function(e){var t=this;return function(n){if(n.element){var i={layer:t,shape:n.element,originalEvent:n.originalEvent};t.map.trigger(e,i)}}}}),m=i.extend({init:function(e,t,n){this.observer=n,this.locator=e,this.style=t},parse:function(e){var t=new u;return"Feature"===e.type?this._loadGeometryTo(t,e.geometry,e):this._loadGeometryTo(t,e,e),2>t.children.length&&(t=t.children[0]),t},_shapeCreated:function(e){var t=!1;return this.observer&&this.observer.shapeCreated&&(t=this.observer.shapeCreated(e)),t},_loadGeometryTo:function(e,t,n){var i,r,o=t.coordinates;switch(t.type){case"LineString":r=this._loadPolygon(e,[o],n),this._setLineFill(r);break;case"MultiLineString":for(i=0;o.length>i;i++)r=this._loadPolygon(e,[o[i]],n),this._setLineFill(r);break;case"Polygon":this._loadPolygon(e,o,n);break;case"MultiPolygon":for(i=0;o.length>i;i++)this._loadPolygon(e,o[i],n);break;case"Point":this._loadPoint(e,o,n);break;case"MultiPoint":for(i=0;o.length>i;i++)this._loadPoint(e,o[i],n)}},_setLineFill:function(e){var t=e.segments;(4>t.length||!t[0].anchor().equals(s(t).anchor()))&&(e.options.fill=null)},_loadShape:function(e,t){return this._shapeCreated(t)||e.append(t),t},_loadPolygon:function(e,t,n){var i=this._buildPolygon(t);return i.dataItem=n,this._loadShape(e,i)},_buildPolygon:function(e){var t,n,i,r=e.length>1?d.MultiPath:d.Path,o=new r(this.style);for(t=0;e.length>t;t++)for(n=0;e[t].length>n;n++)i=this.locator.locationToView(p.fromLngLat(e[t][n])),0===n?o.moveTo(i.x,i.y):o.lineTo(i.x,i.y);return o},_loadPoint:function(e,t,n){var i=p.fromLngLat(t),r=this.locator.locationToView(i),o=new c.Circle(r,10),a=new d.Circle(o,this.style);return a.dataItem=n,a.location=i,this._loadShape(e,a)}});a(n.data,{schemas:{geojson:{type:"json",data:function(e){return"FeatureCollection"===e.type?e.features:"GeometryCollection"===e.type?e.geometries:e}}},transports:{geojson:{read:{dataType:"json"}}}}),a(o,{map:{layers:{shape:g,ShapeLayer:g},GeoJSONLoader:m}})}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.getter,i=t.dataviz,r=t.deepExtend,o=t.util,a=o.defined,s=t.geometry,l=t.drawing,c=i.map,d=c.Location,u=c.layers.ShapeLayer,h=u.extend({options:{autoBind:!0,locationField:"location",valueField:"value",minSize:0,maxSize:100,scale:"sqrt",symbol:"circle"},_load:function(e){var t,i,r,o,s,l,c,u,h,p,f,g;if(0!==e.length)for(t=this.options,i=n(t.valueField),e=e.slice(0),e.sort(function(e,t){return i(t)-i(e)}),r=i(e[0]),o=this._scaleType(),l=0;e.length>l;l++)c=e[l],u=n(t.locationField)(c),h=n(t.valueField)(c),a(u)&&a(h)&&(s||(s=new o([0,h],[t.minSize,t.maxSize])),u=d.create(u),p=this.map.locationToView(u),f=s.map(h),g=this._createSymbol({center:p,size:f,style:t.style,dataItem:c,location:u}),g.dataItem=c,g.location=u,g.value=h,this._drawSymbol(g))},_scaleType:function(){var e=this.options.scale;return t.isFunction(e)?e:i.map.scales[e]},_createSymbol:function(e){var n=this.options.symbol;return t.isFunction(n)||(n=i.map.symbols[n]),n(e)},_drawSymbol:function(e){var t={layer:this,shape:e},n=this.map.trigger("shapeCreated",t);n||this.surface.draw(e)}}),p=t.Class.extend({init:function(e,t){var n,i;this._domain=e,this._range=t,n=Math.sqrt(e[1])-Math.sqrt(e[0]),i=t[1]-t[0],this._ratio=i/n},map:function(e){var t=(Math.sqrt(e)-Math.sqrt(this._domain[0]))*this._ratio;return this._range[0]+t}}),f={circle:function(e){var t=new s.Circle(e.center,e.size/2);return new l.Circle(t,e.style)},square:function(e){var t=new l.Path(e.style),n=e.size/2,i=e.center;return t.moveTo(i.x-n,i.y-n).lineTo(i.x+n,i.y-n).lineTo(i.x+n,i.y+n).lineTo(i.x-n,i.y+n).close(),t}};r(i,{map:{layers:{bubble:h,BubbleLayer:h},scales:{sqrt:p},symbols:f}})}(window.kendo.jQuery),function(e){function t(e){return new u(f(e.x),f(e.y))}function n(e,t){return"x:"+e.x+"y:"+e.y+"zoom:"+t}var i=Math,r=e.proxy,o=window.kendo,a=o.Class,s=o.template,l=o.dataviz,c=o.deepExtend,d=o.geometry,u=d.Point,h=l.map.layers.Layer,p=o.util,f=p.round,g=p.renderSize,m=p.limitValue,v=h.extend({init:function(e,t){h.fn.init.call(this,e,t),"string"==typeof this.options.subdomains&&(this.options.subdomains=this.options.subdomains.split(""));var n=this._viewType();this._view=new n(this.element,this.options)},destroy:function(){h.fn.destroy.call(this),this._view.destroy(),this._view=null},_reset:function(){h.fn._reset.call(this),this._updateView(),this._view.clear(),this._view.reset()},_viewType:function(){return _},_activate:function(){h.fn._activate.call(this),o.support.mobileOS||(this._pan||(this._pan=o.throttle(r(this._render,this),100)),this.map.bind("pan",this._pan))},_deactivate:function(){h.fn._deactivate.call(this),this._pan&&this.map.unbind("pan",this._pan)},_updateView:function(){var e=this._view,t=this.map,n=t.extent(),i={nw:t.locationToLayer(n.nw).round(),se:t.locationToLayer(n.se).round()};e.center(t.locationToLayer(t.center())),e.extent(i),e.zoom(t.zoom())},_resize:function(){this._render()},_panEnd:function(e){h.fn._panEnd.call(this,e),this._render()},_render:function(){this._updateView(),this._view.render()}}),_=a.extend({init:function(e,t){this.element=e,this._initOptions(t),this.pool=new y},options:{tileSize:256,subdomains:["a","b","c"],urlTemplate:""},center:function(e){this._center=e},extent:function(e){this._extent=e},zoom:function(e){this._zoom=e},pointToTileIndex:function(e){return new u(i.floor(e.x/this.options.tileSize),i.floor(e.y/this.options.tileSize))},clear:function(){this.pool.empty()},tileCount:function(){var e=this.size(),t=this.pointToTileIndex(this._extent.nw),n=this._extent.nw,r=this.indexToPoint(t).translate(-n.x,-n.y);return{x:i.ceil((i.abs(r.x)+e.width)/this.options.tileSize),y:i.ceil((i.abs(r.y)+e.height)/this.options.tileSize)}},size:function(){var e=this._extent.nw,t=this._extent.se,n=t.clone().translate(-e.x,-e.y);return{width:n.x,height:n.y}},indexToPoint:function(e){var t=e.x,n=e.y;return new u(t*this.options.tileSize,n*this.options.tileSize)},subdomainText:function(){var e=this.options.subdomains;return e[this.subdomainIndex++%e.length]},destroy:function(){this.element.empty(),this.pool.empty()},reset:function(){this.subdomainIndex=0,this.basePoint=this._extent.nw,this.render()},render:function(){var e,t,n,i=this.tileCount(),r=this.pointToTileIndex(this._extent.nw);for(t=0;i.x>t;t++)for(n=0;i.y>n;n++)e=this.createTile({x:r.x+t,y:r.y+n}),e.options.visible||(this.element.append(e.element),e.options.visible=!0)},createTile:function(e){var t=this.tileOptions(e);return this.pool.get(this._center,t)},tileOptions:function(e){var n=this.wrapIndex(e),i=this.indexToPoint(e),r=this.basePoint,o=i.clone().translate(-r.x,-r.y);return{index:n,currentIndex:e,point:i,offset:t(o),zoom:this._zoom,subdomain:this.subdomainText(),urlTemplate:this.options.urlTemplate,errorUrlTemplate:this.options.errorUrlTemplate}},wrapIndex:function(e){var t=i.pow(2,this._zoom);return{x:this.wrapValue(e.x,t),y:m(e.y,0,t-1)}},wrapValue:function(e,t){var n=i.abs(e)%t;return e=e>=0?n:t-(0===n?t:n)}}),w=a.extend({init:function(e){this._initOptions(e),this.createElement(),this.load(),this.options.visible=!1},options:{urlTemplate:"",errorUrlTemplate:"",visible:!1},createElement:function(){this.element=e("<img style='position: absolute; display: block; visibility: visible;' />").error(r(function(e){this.errorUrl()?e.target.setAttribute("src",this.errorUrl()):e.target.removeAttribute("src")},this))},load:function(e){this.options=c({},this.options,e);var t=this.element[0];t.style.visibility="visible",t.style.display="block",t.style.top=g(this.options.offset.y),t.style.left=g(this.options.offset.x),t.setAttribute("src",this.url()),this.options.id=n(this.options.currentIndex,this.options.zoom),this.options.visible=!0},url:function(){var e=s(this.options.urlTemplate);return e(this.urlOptions())},errorUrl:function(){var e=s(this.options.errorUrlTemplate);
return e(this.urlOptions())},urlOptions:function(){var e=this.options;return{zoom:e.zoom,subdomain:e.subdomain,z:e.zoom,x:e.index.x,y:e.index.y,s:e.subdomain,quadkey:e.quadkey,q:e.quadkey,culture:e.culture,c:e.culture}},destroy:function(){this.element&&(this.element.remove(),this.element=null)}}),y=a.extend({init:function(){this._items=[]},options:{maxSize:100},get:function(e,t){var n,i=this;return n=i._items.length>=i.options.maxSize?i._update(e,t):i._create(t)},empty:function(){var e,t=this._items;for(e=0;t.length>e;e++)t[e].destroy();this._items=[]},_create:function(e){var t,i,r,o,a=this,s=a._items,l=n(e.currentIndex,e.zoom);for(i=0;s.length>i;i++)r=s[i],r.options.id===l&&(t=r,o=t);return t?t.load(e):(o=new w(e),this._items.push(o)),o},_update:function(e,t){var i,r,o,a,s=this,l=s._items,c=-Number.MAX_VALUE,d=n(t.currentIndex,t.zoom);for(o=0;l.length>o;o++){if(a=l[o],i=a.options.point.clone().distanceTo(e),a.options.id===d)return l[o];i>c&&(r=o,c=i)}return l[r].load(t),l[r]}});c(l,{map:{layers:{tile:v,TileLayer:v,ImageTile:w,TilePool:y,TileView:_}}})}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.dataviz,r=n.deepExtend,o=n.util.defined,a=i.map.Extent,s=i.map.Location,l=i.map.layers.TileLayer,c=i.map.layers.TileView,d=l.extend({init:function(t,n){l.fn.init.call(this,t,n),this._onMetadata=e.proxy(this._onMetadata,this),this._fetchMetadata()},options:{baseUrl:"//dev.virtualearth.net/REST/v1/Imagery/Metadata/",imagerySet:"road"},_fetchMetadata:function(){var t=this.options;if(!t.key)throw Error("Bing tile layer: API key is required");e.ajax({url:t.baseUrl+t.imagerySet,data:{output:"json",include:"ImageryProviders",key:t.key,uriScheme:this._scheme(window.location.protocol)},type:"get",dataType:"jsonp",jsonp:"jsonp",success:this._onMetadata})},_scheme:function(e){return"https"===e.replace(":","")?"https":"http"},_onMetadata:function(e){var t,n;e&&e.resourceSets.length&&(t=this.resource=e.resourceSets[0].resources[0],r(this._view.options,{urlTemplate:t.imageUrl.replace("{subdomain}","#= subdomain #").replace("{quadkey}","#= quadkey #").replace("{culture}","#= culture #"),subdomains:t.imageUrlSubdomains}),n=this.options,o(n.minZoom)||(n.minZoom=t.zoomMin),o(n.maxZoom)||(n.maxZoom=t.zoomMax),this._addAttribution(),this.reset())},_viewType:function(){return u},_addAttribution:function(){var e,t,n,i,r,o=this.map.attribution;if(o&&(e=this.resource.imageryProviders))for(t=0;e.length>t;t++)for(n=e[t],i=0;n.coverageAreas.length>i;i++)r=n.coverageAreas[i],o.add({text:n.attribution,minZoom:r.zoomMin,maxZoom:r.zoomMax,extent:new a(new s(r.bbox[2],r.bbox[1]),new s(r.bbox[0],r.bbox[3]))})},imagerySet:function(e){return e?(this.options.imagerySet=e,this.map.attribution.clear(),this._fetchMetadata(),this._reset(),t):this.options.imagerySet}}),u=c.extend({options:{culture:"en-US"},tileOptions:function(e){var t=c.fn.tileOptions.call(this,e);return t.culture=this.options.culture,t.quadkey=this.tileQuadKey(this.wrapIndex(e)),t},tileQuadKey:function(e){var t,n,i,r="";for(i=this._zoom;i>0;i--)t=0,n=1<<i-1,0!==(e.x&n)&&t++,0!==(e.y&n)&&(t+=2),r+=t;return r}});r(i,{map:{layers:{bing:d,BingLayer:d,BingView:u}}})}(window.kendo.jQuery),function(e,t){var n=document,i=Math,r=e.inArray,o=e.proxy,a=window.kendo,s=a.Class,l=a.data.DataSource,c=a.ui.Tooltip,d=a.dataviz,u=a.deepExtend,h=d.map,p=h.Location,f=h.layers.Layer,g=f.extend({init:function(e,t){f.fn.init.call(this,e,t),this._markerClick=o(this._markerClick,this),this.element.on("click",".k-marker",this._markerClick),this.items=[],this._initDataSource()},destroy:function(){f.fn.destroy.call(this),this.element.off("click",".k-marker",this._markerClick),this.dataSource.unbind("change",this._dataChange),this.clear()},options:{zIndex:1e3,autoBind:!0,dataSource:{},locationField:"location",titleField:"title"},add:function(t){if(!e.isArray(t))return this._addOne(t);for(var n=0;t.length>n;n++)this._addOne(t[n])},remove:function(e){e.destroy();var t=r(e,this.items);t>-1&&this.items.splice(t,1)},clear:function(){for(var e=0;this.items.length>e;e++)this.items[e].destroy();this.items=[]},update:function(e){var t,n=e.location();n&&(e.showAt(this.map.locationToView(n)),t={marker:e,layer:this},this.map.trigger("markerActivate",t))},_reset:function(){var e,t;for(f.fn._reset.call(this),e=this.items,t=0;e.length>t;t++)this.update(e[t])},bind:function(e,n){var i,r,o=h.Marker.create(e,this.options);return o.dataItem=n,i={marker:o,layer:this},r=this.map.trigger("markerCreated",i),r?t:(this.add(o),o)},setDataSource:function(e){this.dataSource&&this.dataSource.unbind("change",this._dataChange),this.dataSource=e,this.dataSource.bind("change",this._dataChange),this.options.autoBind&&this.dataSource.fetch()},_addOne:function(e){var t=m.create(e,this.options);return t.addTo(this),t},_initDataSource:function(){var e=this.options.dataSource;this._dataChange=o(this._dataChange,this),this.dataSource=l.create(e).bind("change",this._dataChange),e&&this.options.autoBind&&this.dataSource.fetch()},_dataChange:function(e){this._load(e.sender.view())},_load:function(e){var t,n,i,r;for(this._data=e,this.clear(),t=a.getter(this.options.locationField),n=a.getter(this.options.titleField),i=0;e.length>i;i++)r=e[i],this.bind({location:t(r),title:n(r)},r)},_markerClick:function(t){var n={marker:e(t.target).data("kendoMarker"),layer:this};this.map.trigger("markerClick",n)}}),m=s.extend({init:function(e){this.options=e||{}},addTo:function(e){this.layer=e.markers||e,this.layer.items.push(this),this.layer.update(this)},location:function(e){return e?(this.options.location=p.create(e).toArray(),this.layer&&this.layer.update(this),this):p.create(this.options.location)},showAt:function(e){this.render(),this.element.css({left:i.round(e.x),top:i.round(e.y)}),this.tooltip&&this.tooltip.popup&&this.tooltip.popup._position()},hide:function(){this.element&&(this.element.remove(),this.element=null),this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)},destroy:function(){this.layer=null,this.hide()},render:function(){var t,i;this.element||(t=this.options,i=this.layer,this.element=e(n.createElement("span")).addClass("k-marker k-marker-"+a.toHyphens(t.shape||"pin")).attr("title",t.title).data("kendoMarker",this).css("zIndex",t.zIndex),i&&i.element.append(this.element),this.renderTooltip())},renderTooltip:function(){var e,t,n=this,i=n.options.title,r=n.options.tooltip||{};r&&c&&(e=r.template,e&&(t=a.template(e),r.content=function(e){return e.location=n.location(),e.marker=n,t(e)}),(i||r.content||r.contentUrl)&&(this.tooltip=new c(this.element,r),this.tooltip.marker=this))}});m.create=function(e,t){return e instanceof m?e:new m(u({},t,e))},u(d,{map:{layers:{marker:g,MarkerLayer:g},Marker:m}})}(window.kendo.jQuery),function(e){var t=document,n=Math,i=n.min,r=n.pow,o=e.proxy,a=window.kendo,s=a.ui.Widget,l=a.deepExtend,c=a.dataviz,d=c.ui,u=a.geometry,h=u.Point,p=c.map,f=p.Extent,g=p.Location,m=p.crs.EPSG3857,v=a.util,_=v.defined,w=v.limitValue,y=v.renderPos,b=v.valueOrDefault,k="k-",x=.9,C=.93,T="DOMMouseScroll mousewheel",S=5,D=s.extend({init:function(e,n){a.destroy(e),s.fn.init.call(this,e),this._initOptions(n),this.bind(this.events,n),this.crs=new m,this.element.addClass(k+this.options.name.toLowerCase()).css("position","relative").empty().append(t.createElement("div")),this._viewOrigin=this._getOrigin(),this._initScroller(),this._initMarkers(),this._initControls(),this._initLayers(),this._reset(),this._mousewheel=o(this._mousewheel,this),this.element.bind("click",o(this._click,this)),this.element.bind(T,this._mousewheel)},options:{name:"Map",controls:{attribution:!0,navigator:{panStep:100},zoom:!0},layers:[],layerDefaults:{shape:{style:{fill:{color:"#fff"},stroke:{color:"#aaa",width:.5}}},bubble:{style:{fill:{color:"#fff",opacity:.5},stroke:{color:"#aaa",width:.5}}},marker:{shape:"pinTarget",tooltip:{position:"top"}}},center:[0,0],zoom:3,minSize:256,minZoom:1,maxZoom:19,markers:[],markerDefaults:{shape:"pinTarget",tooltip:{position:"top"}},wraparound:!0},events:["beforeReset","click","reset","pan","panEnd","markerActivate","markerClick","markerCreated","shapeClick","shapeCreated","shapeMouseEnter","shapeMouseLeave","zoomStart","zoomEnd"],destroy:function(){this.scroller.destroy(),this.navigator&&this.navigator.destroy(),this.attribution&&this.attribution.destroy(),this.zoomControl&&this.zoomControl.destroy(),this.markers.destroy();for(var e=0;this.layers.length>e;e++)this.layers[e].destroy();s.fn.destroy.call(this)},zoom:function(e){var t=this.options;return _(e)?(e=w(e,t.minZoom,t.maxZoom),t.zoom!==e&&(t.zoom=e,this._reset()),this):t.zoom},center:function(e){return e?(this.options.center=g.create(e).toArray(),this._reset(),this):g.create(this.options.center)},extent:function(e){return e?(this._setExtent(e),this):this._getExtent()},setOptions:function(e){s.fn.setOptions.call(this,e),this._reset()},locationToLayer:function(e,t){var n=!this.options.wraparound;return e=g.create(e),this.crs.toPoint(e,this._layerSize(t),n)},layerToLocation:function(e,t){var n=!this.options.wraparound;return e=h.create(e),this.crs.toLocation(e,this._layerSize(t),n)},locationToView:function(e){var t,n;return e=g.create(e),t=this.locationToLayer(this._viewOrigin),n=this.locationToLayer(e),n.translateWith(t.scale(-1))},viewToLocation:function(e,t){var n=this.locationToLayer(this._getOrigin(),t);return e=h.create(e),e=e.clone().translateWith(n),this.layerToLocation(e,t)},eventOffset:function(e){var t=this.element.offset(),n=e.originalEvent||e,i=b(n.pageX,n.clientX)-t.left,r=b(n.pageY,n.clientY)-t.top;return new u.Point(i,r)},eventToView:function(e){var t=this.eventOffset(e);return this.locationToView(this.viewToLocation(t))},eventToLayer:function(e){return this.locationToLayer(this.eventToLocation(e))},eventToLocation:function(e){var t=this.eventOffset(e);return this.viewToLocation(t)},viewSize:function(){var e=this.element,t=this._layerSize(),n=e.width();return this.options.wraparound||(n=i(t,n)),{width:n,height:i(t,e.height())}},_setOrigin:function(e,t){var n,i=this.viewSize();return e=this._origin=g.create(e),n=this.locationToLayer(e,t),n.x+=i.width/2,n.y+=i.height/2,this.options.center=this.layerToLocation(n,t).toArray(),this},_getOrigin:function(e){var t,n=this.viewSize();return(e||!this._origin)&&(t=this.locationToLayer(this.center()),t.x-=n.width/2,t.y-=n.height/2,this._origin=this.layerToLocation(t)),this._origin},_setExtent:function(e){var t,i,r,o,a,s,l;for(e=f.create(e),this.center(e.center()),t=this.element.width(),i=this.element.height(),r=this.options.maxZoom;r>=this.options.minZoom&&(o=this.locationToLayer(e.nw,r),a=this.locationToLayer(e.se,r),s=n.abs(a.x-o.x),l=n.abs(a.y-o.y),!(t>=s&&i>=l));r--);this.zoom(r)},_getExtent:function(){var e,t=this._getOrigin(),n=this.locationToLayer(t),i=this.viewSize();return n.x+=i.width,n.y+=i.height,e=this.layerToLocation(n),new f(t,e)},_zoomAround:function(e,t){this._setOrigin(this.layerToLocation(e,t),t),this.zoom(t)},_initControls:function(){var e=this.options.controls;d.Attribution&&e.attribution&&this._createAttribution(e.attribution),a.support.mobileOS||(d.Navigator&&e.navigator&&this._createNavigator(e.navigator),d.ZoomControl&&e.zoom&&this._createZoomControl(e.zoom))},_createControlElement:function(t,n){var i=t.position||n,r="."+y(i).replace(" ","."),o=e(".k-map-controls"+r,this.element);return 0===o.length&&(o=e("<div>").addClass("k-map-controls "+y(i)).appendTo(this.element)),e("<div>").appendTo(o)},_createAttribution:function(e){var t=this._createControlElement(e,"bottomRight");this.attribution=new d.Attribution(t,e)},_createNavigator:function(e){var t=this._createControlElement(e,"topLeft"),n=this.navigator=new d.Navigator(t,e);this._navigatorPan=o(this._navigatorPan,this),n.bind("pan",this._navigatorPan),this._navigatorCenter=o(this._navigatorCenter,this),n.bind("center",this._navigatorCenter)},_navigatorPan:function(e){var t=this,n=t.scroller,i=n.scrollLeft+e.x,r=n.scrollTop-e.y,o=this._virtualSize,a=this.element.height(),s=this.element.width();i=w(i,o.x.min,o.x.max-s),r=w(r,o.y.min,o.y.max-a),t.scroller.one("scroll",function(e){t._scrollEnd(e)}),t.scroller.scrollTo(-i,-r)},_navigatorCenter:function(){this.center(this.options.center)},_createZoomControl:function(e){var t=this._createControlElement(e,"topLeft"),n=this.zoomControl=new d.ZoomControl(t,e);this._zoomControlChange=o(this._zoomControlChange,this),n.bind("change",this._zoomControlChange)},_zoomControlChange:function(e){this.trigger("zoomStart",{originalEvent:e})||(this.zoom(this.zoom()+e.delta),this.trigger("zoomEnd",{originalEvent:e}))},_initScroller:function(){var e=a.support.mobileOS?C:x,t=this.options.zoomable!==!1,n=this.scroller=new a.mobile.ui.Scroller(this.element.children(0),{friction:e,velocityMultiplier:S,zoom:t,mousewheelScrolling:!1});n.bind("scroll",o(this._scroll,this)),n.bind("scrollEnd",o(this._scrollEnd,this)),n.userEvents.bind("gesturestart",o(this._scaleStart,this)),n.userEvents.bind("gestureend",o(this._scale,this)),this.scrollElement=n.scrollElement},_initLayers:function(){var e,t,n,i,r,o=this.options.layers,a=this.layers=[];for(e=0;o.length>e;e++)t=o[e],n=t.type||"shape",i=this.options.layerDefaults[n],r=c.map.layers[n],a.push(new r(this,l({},i,t)))},_initMarkers:function(){this.markers=new p.layers.MarkerLayer(this,this.options.markerDefaults),this.markers.add(this.options.markers)},_scroll:function(e){var t=this.locationToLayer(this._viewOrigin).round(),n=e.sender.movable,i=new u.Point(n.x,n.y).scale(-1).scale(1/n.scale);t.x+=i.x,t.y+=i.y,this._setOrigin(this.layerToLocation(t)),this.trigger("pan",{originalEvent:e,origin:this._getOrigin(),center:this.center()})},_scrollEnd:function(e){this.trigger("panEnd",{originalEvent:e,origin:this._getOrigin(),center:this.center()})},_scaleStart:function(e){if(this.trigger("zoomStart",{originalEvent:e})){var t=e.touches[1];t&&t.cancel()}},_scale:function(e){var t=this.scroller.movable.scale,n=this._scaleToZoom(t),i=new u.Point(e.center.x,e.center.y),r=this.viewToLocation(i,n),o=this.locationToLayer(r,n),a=o.translate(-i.x,-i.y);this._zoomAround(a,n),this.trigger("zoomEnd",{originalEvent:e})},_scaleToZoom:function(e){var t=this._layerSize()*e,i=t/this.options.minSize,r=n.log(i)/n.log(2);return n.round(r)},_reset:function(){this.attribution&&this.attribution.filter(this.center(),this.zoom()),this._viewOrigin=this._getOrigin(!0),this._resetScroller(),this.trigger("beforeReset"),this.trigger("reset")},_resetScroller:function(){var e,t,n,i,o=this.scroller,a=o.dimensions.x,s=o.dimensions.y,l=this._layerSize(),c=20*l,d=this.extent().nw,u=this.locationToLayer(d).round();o.movable.round=!0,o.reset(),o.userEvents.cancel(),e=this.options.maxZoom-this.zoom(),o.dimensions.maxScale=r(2,e),t={min:-u.x,max:l-u.x},n={min:-u.y,max:l-u.y},this.options.wraparound&&(t.min=-c,t.max=c),this.options.pannable===!1&&(i=this.viewSize(),t.min=n.min=0,t.max=i.width,n.max=i.height),a.makeVirtual(),s.makeVirtual(),a.virtualSize(t.min,t.max),s.virtualSize(n.min,n.max),this._virtualSize={x:t,y:n}},_renderLayers:function(){var e,t,n,i,r,o=this.options.layers,a=this.layers=[],s=this.scrollWrap;for(s.empty(),e=0;o.length>e;e++)t=o[e],n=t.type||"shape",i=this.options.layerDefaults[n],r=c.map.layers[n],a.push(new r(this,l({},i,t)))},_layerSize:function(e){return e=b(e,this.options.zoom),this.options.minSize*r(2,e)},_click:function(e){var t=this.eventOffset(e);this.trigger("click",{originalEvent:e,location:this.viewToLocation(t)})},_mousewheel:function(e){var t,n,i,r,o,a,s,l;e.preventDefault(),t=c.mwDelta(e)>0?-1:1,n=this.options,i=this.zoom(),r=w(i+t,n.minZoom,n.maxZoom),n.zoomable!==!1&&r!==i&&(this.trigger("zoomStart",{originalEvent:e})||(o=this.eventOffset(e),a=this.viewToLocation(o),s=this.locationToLayer(a,r),l=s.translate(-o.x,-o.y),this._zoomAround(l,r),this.trigger("zoomEnd",{originalEvent:e})))}});c.ui.plugin(D)}(window.kendo.jQuery),function(e,t){function n(e,n,i){function r(e){for(var t=1;e*t%1;)t*=10;return t}var o,a,s,l;if(t===e||t===n)return[];if(i&&u.sign(n-e)!=u.sign(i))throw"The sign of the increment should allow to reach the stop-value.";if(i=i||1,e=e||0,n=n||e,(n-e)/i===1/0)throw"Infinite range defined.";if(o=[],a=-1,l=r(Math.abs(i)),e*=l,n*=l,i*=l,e>n&&i>0&&(i=-i),0>i)for(;(s=e+i*++a)>=n;)o.push(s/l);else for(;(s=e+i*++a)<=n;)o.push(s/l);return o}function i(e,t){if(e==t)return 0;var n=t.x-e.x,i=e.y-t.y,r=Math.atan(n/i);return i>=0?0>n?r+2*Math.PI:r:r+Math.PI}var r,o,a=window.kendo,s=a.dataviz.diagram={},l=a.deepExtend,c=e.isArray,d=1e-6,u={};l(u,{isNearZero:function(e){return Math.abs(e)<d},isDefined:function(e){return t!==e},isUndefined:function(e){return t===e||null===e},isObject:function(e){return e===Object(e)},has:function(e,t){return Object.hasOwnProperty.call(e,t)},isString:function(e){return"[object String]"==Object.prototype.toString.call(e)},isBoolean:function(e){return"[object Boolean]"==Object.prototype.toString.call(e)},isType:function(e,t){return Object.prototype.toString.call(e)=="[object "+t+"]"},isNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},isEmpty:function(e){if(null===e)return!0;if(c(e)||u.isString(e))return 0===e.length;for(var t in e)if(u.has(e,t))return!1;return!0},simpleExtend:function(e,t){if(u.isObject(t))for(var n in t)e[n]=t[n]},initArray:function(e,t){var n,i=[];for(n=0;e>n;++n)i[n]=t;return i},serializePoints:function(e){var t,n,i=[];for(t=0;e.length>t;t++)n=e[t],i.push(n.x+";"+n.y);return i.join(";")},deserializePoints:function(e){var t,n=e.split(";"),i=[];if(n.length%2!==0)throw"Not an array of points.";for(t=0;n.length>t;t+=2)i.push(new s.Point(parseInt(n[t],10),parseInt(n[t+1],10)));return i},randomInteger:function(e,t){return parseInt(Math.floor(Math.random()*t)+e,10)},DFT:function(e,t){var n,i;if(t(e),e.childNodes)for(n=0;e.childNodes.length>n;n++)i=e.childNodes[n],this.DFT(i,t)},getMatrixAngle:function(e){return null===e||0===e.d?0:180*Math.atan2(e.b,e.d)/Math.PI},getMatrixScaling:function(e){var t=Math.sqrt(e.a*e.a+e.c*e.c),n=Math.sqrt(e.b*e.b+e.d*e.d);return[t,n]}}),u.sign=function(e){return e?0>e?-1:1:0},u.findAngle=function(e,t){return 180*i(e,t)/Math.PI},u.forEach=function(e,t,n){for(var i=0;e.length>i;i++)t.call(n,e[i],i,e)},u.any=function(e,t){for(var n=0;e.length>n;++n)if(t(e[n]))return e[n];return null},u.remove=function(e,t){for(var n;-1!==(n=u.indexOf(e,t));)e.splice(n,1);return e},u.contains=function(e,t){return-1!==u.indexOf(e,t)},u.indexOf=function(t,n){return e.inArray(n,t)},u.fold=function(e,t,n,i){var r,o,a=arguments.length>2;for(r=0;e.length>r;r++)o=e[r],a?n=t.call(i,n,o,r,e):(n=o,a=!0);if(!a)throw"Reduce of empty array with no initial value";return n},u.find=function(e,t,n){var i;return u.any(e,function(e,r,o){return t.call(n,e,r,o)?(i=e,!0):!1}),i},u.first=function(e,t,n){return 0===e.length?null:u.isUndefined(t)?e[0]:u.find(e,t,n)},u.insert=function(e,t,n){return e.splice(n,0,t),e},u.all=function(e,t,n){var i,r,o=!0;for(r=0;e.length>r&&(i=e[r],o=o&&t.call(n,i,r,e),o);r++);return o},u.clear=function(e){e.splice(0,e.length)},u.bisort=function(e,t,n){if(u.isUndefined(e))throw"First array is not specified.";if(u.isUndefined(t))throw"Second array is not specified.";if(e.length!=t.length)throw"The two arrays should have equal length";var i,r=[];for(i=0;e.length>i;i++)r.push({x:e[i],y:t[i]});for(r.sort(u.isUndefined(n)?function(e,t){return e.x-t.x}:function(e,t){return n(e.x,t.x)}),u.clear(e),u.clear(t),i=0;r.length>i;i++)e.push(r[i].x),t.push(r[i].y)},u.addRange=function(e,t){e.push.apply(e,t)},r={easeInOut:function(e){return-Math.cos(e*Math.PI)/2+.5}},o=a.Class.extend({init:function(){this.adapters=[],this.target=0,this.tick=0,this.interval=20,this.duration=800,this.lastTime=null,this.handlers=[];var e=this;this.transition=r.easeInOut,this.timerDelegate=function(){e.onTimerEvent()}},addAdapter:function(e){this.adapters.push(e)},onComplete:function(e){this.handlers.push(e)},removeHandler:function(t){this.handlers=e.grep(this.handlers,function(e){return e!==t})},trigger:function(){var e=this;this.handlers&&u.forEach(this.handlers,function(t){return t.call(null!==e.caller?e.caller:e)})},onStep:function(){},seekTo:function(e){this.seekFromTo(this.tick,e)},seekFromTo:function(e,t){this.target=Math.max(0,Math.min(1,t)),this.tick=Math.max(0,Math.min(1,e)),this.lastTime=(new Date).getTime(),this.intervalId||(this.intervalId=window.setInterval(this.timerDelegate,this.interval))},stop:function(){this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null,this.trigger())},play:function(e){0!==this.adapters.length&&(null!==e&&(this.caller=e),this.initState(),this.seekFromTo(0,1))},reverse:function(){this.seekFromTo(1,0)},initState:function(){if(0!==this.adapters.length)for(var e=0;this.adapters.length>e;e++)this.adapters[e].initState()},propagate:function(){var e,t=this.transition(this.tick);for(e=0;this.adapters.length>e;e++)this.adapters[e].update(t)},onTimerEvent:function(){var e,t=(new Date).getTime(),n=t-this.lastTime;this.lastTime=t,e=n/this.duration*(this.target>this.tick?1:-1),Math.abs(e)>=Math.abs(this.tick-this.target)?this.tick=this.target:this.tick+=e;try{this.propagate()}finally{this.onStep.call(this),this.target==this.tick&&this.stop()}}}),a.deepExtend(s,{init:function(e){a.init(e,s.ui)},Utils:u,Range:n,Ticker:o})}(window.kendo.jQuery),function(e,t){function n(e){return Math.abs(e)<F}function i(e,t,i,r,o){var a,s,l,c,d=(t.x-e.x)*(r.y-i.y)-(t.y-e.y)*(r.x-i.x);if(!n(d)&&(a=(e.y-i.y)*(r.x-i.x)-(e.x-i.x)*(r.y-i.y),s=(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y),l=a/d,c=s/d,!o||!(0>l||l>1||0>c||c>1)))return new A(e.x+l*(t.x-e.x),e.y+l*(t.y-e.y))}function r(e,t){var n,i,r;do n=2*Math.random()-1,i=2*Math.random()-1,r=n*n+i*i;while(!r||r>1);return e+t*n*Math.sqrt(-2*Math.log(r)/r)}function o(e){var t,n,i;for(D.isUndefined(e)&&(e=10),t="",n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",i=e;i>0;--i)t+=n.charAt(Math.round(Math.random()*(n.length-1)));return t}var a,s,l,c,d,u,h,p,f,g,m,v,_,w,y,b,k=window.kendo,x=k.dataviz.diagram,C=k.Class,T=k.deepExtend,S=k.dataviz,D=x.Utils,A=S.Point2D,E=k.isFunction,I=D.contains,P=e.map,M=3,F=1e-6;T(A.fn,{plus:function(e){return new A(this.x+e.x,this.y+e.y)},minus:function(e){return new A(this.x-e.x,this.y-e.y)},offset:function(e){return new A(this.x-e,this.y-e)},times:function(e){return new A(this.x*e,this.y*e)},normalize:function(){return 0===this.length()?new A:this.times(1/this.length())},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},toString:function(){return"("+this.x+","+this.y+")"},lengthSquared:function(){return this.x*this.x+this.y*this.y},middleOf:function(e,t){return new A(t.x-e.x,t.y-e.y).times(.5).plus(e)},toPolar:function(e){var t,n,i,r=1;if(e&&(r=180/Math.PI),t=Math.atan2(Math.abs(this.y),Math.abs(this.x)),n=Math.PI/2,i=this.length(),0===this.x){if(0===this.y)return new u(0,0);if(this.y>0)return new u(i,r*n);if(0>this.y)return new u(i,3*r*n)}else if(this.x>0){if(0===this.y)return new u(i,0);if(this.y>0)return new u(i,r*t);if(0>this.y)return new u(i,r*(4*n-t))}else{if(0===this.y)return new u(i,2*n);if(this.y>0)return new u(i,r*(2*n-t));if(0>this.y)return new u(i,r*(2*n+t))}},isOnLine:function(e,t){var n,i,r,o,a;return e.x>t.x&&(n=t,t=e,e=n),i=new s(e.x,e.y).inflate(M,M),r=new s(t.x,t.y).inflate(M,M),i.union(r).contains(this)?e.x===t.x||e.y===t.y?!0:(t.y>e.y?(o=i.x+(r.x-i.x)*(this.y-(i.y+i.height))/(r.y+r.height-(i.y+i.height)),a=i.x+i.width+(r.x+r.width-(i.x+i.width))*(this.y-i.y)/(r.y-i.y)):(o=i.x+(r.x-i.x)*(this.y-i.y)/(r.y-i.y),a=i.x+i.width+(r.x+r.width-(i.x+i.width))*(this.y-(i.y+i.height))/(r.y+r.height-(i.y+i.height))),this.x>o&&a>this.x):!1}}),T(A,{parse:function(e){var n=e.slice(1,e.length-1),i=n.split(","),r=parseInt(i[0],10),o=parseInt(i[1],10);return isNaN(r)||isNaN(o)?t:new A(r,o)}}),a=C.extend({init:function(e,t,n){this.point=e,this.left=t,this.right=n}}),s=C.extend({init:function(e,t,n,i){this.x=e||0,this.y=t||0,this.width=n||0,this.height=i||0},contains:function(e){return e.x>=this.x&&this.x+this.width>=e.x&&e.y>=this.y&&this.y+this.height>=e.y},inflate:function(e,n){return n===t&&(n=e),this.x-=e,this.y-=n,this.width+=2*e+1,this.height+=2*n+1,this},offset:function(e,t){var n=e,i=t;return e instanceof A&&(n=e.x,i=e.y),this.x+=n,this.y+=i,this},union:function(e){var t=Math.min(this.x,e.x),n=Math.min(this.y,e.y),i=Math.max(this.x+this.width,e.x+e.width),r=Math.max(this.y+this.height,e.y+e.height);return new s(t,n,i-t,r-n)},center:function(){return new A(this.x+this.width/2,this.y+this.height/2)},top:function(){return new A(this.x+this.width/2,this.y)},right:function(){return new A(this.x+this.width,this.y+this.height/2)},bottom:function(){return new A(this.x+this.width/2,this.y+this.height)},left:function(){return new A(this.x,this.y+this.height/2)},topLeft:function(){return new A(this.x,this.y)},topRight:function(){return new A(this.x+this.width,this.y)},bottomLeft:function(){return new A(this.x,this.y+this.height)},bottomRight:function(){return new A(this.x+this.width,this.y+this.height)},clone:function(){return new s(this.x,this.y,this.width,this.height)},isEmpty:function(){return!this.width&&!this.height},equals:function(e){return this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},rotatedBounds:function(e){var t=this.clone(),n=this.rotatedPoints(e),i=n[0],r=n[1],o=n[2],a=n[3];return t.x=Math.min(o.x,i.x,r.x,a.x),t.y=Math.min(o.y,i.y,r.y,a.y),t.width=Math.max(o.x,i.x,r.x,a.x)-t.x,t.height=Math.max(o.y,i.y,r.y,a.y)-t.y,t},rotatedPoints:function(e){var t=this,n=t.center(),i=t.bottomRight().rotate(n,360-e),r=t.topLeft().rotate(n,360-e),o=t.topRight().rotate(n,360-e),a=t.bottomLeft().rotate(n,360-e);return[r,o,i,a]},toString:function(e){return e=e||" ",this.x+e+this.y+e+this.width+e+this.height},scale:function(e,t,n,i,r){var o,a,s,l=this.topLeft(),c=this.center();l.rotate(c,360-r).rotate(i,r),o=n.minus(l),a=new A(o.x*e,o.y*t),s=o.minus(a),l=l.plus(s),l.rotate(i,360-r).rotate(c,r),this.x=l.x,this.y=l.y,this.width*=e,this.height*=t},zoom:function(e){return this.x*=e,this.y*=e,this.width*=e,this.height*=e,this}}),l=C.extend({init:function(e,t){this.width=e,this.height=t}}),l.prototype.Empty=new l(0,0),s.toRect=function(e){return e instanceof s||(e=new s(e.x,e.y,e.width,e.height)),e},s.empty=function(){return new s(0,0,0,0)},s.fromPoints=function(e,t){if(isNaN(e.x)||isNaN(e.y)||isNaN(t.x)||isNaN(t.y))throw"Some values are NaN.";return new s(Math.min(e.x,t.x),Math.min(e.y,t.y),Math.abs(e.x-t.x),Math.abs(e.y-t.y))},c={lines:function(e,t,n,r){return i(e,t,n,r)},segments:function(e,t,n,r){return i(e,t,n,r,!0)},rectWithLine:function(e,t,n){return c.segments(t,n,e.topLeft(),e.topRight())||c.segments(t,n,e.topRight(),e.bottomRight())||c.segments(t,n,e.bottomLeft(),e.bottomRight())||c.segments(t,n,e.topLeft(),e.bottomLeft())},rects:function(e,t,n){var i,r,o=t.topLeft(),a=t.topRight(),s=t.bottomLeft(),l=t.bottomRight(),d=t.center();return n&&(o=o.rotate(d,n),a=a.rotate(d,n),s=s.rotate(d,n),l=l.rotate(d,n)),i=e.contains(o)||e.contains(a)||e.contains(s)||e.contains(l)||c.rectWithLine(e,o,a)||c.rectWithLine(e,o,s)||c.rectWithLine(e,a,l)||c.rectWithLine(e,s,l),i||(o=e.topLeft(),a=e.topRight(),s=e.bottomLeft(),l=e.bottomRight(),n&&(r=360-n,o=o.rotate(d,r),a=a.rotate(d,r),s=s.rotate(d,r),l=l.rotate(d,r)),i=t.contains(o)||t.contains(a)||t.contains(s)||t.contains(l)),i}},d=C.extend({init:function(e){this.container=s.toRect(e)},align:function(e,t){var n,i=t.toLowerCase().split(" ");for(n=0;i.length>n;n++)e=this._singleAlign(e,i[n]);return e},_singleAlign:function(e,t){return E(this[t])?this[t](e):e},left:function(e){return this._align(e,this._left)},center:function(e){return this._align(e,this._center)},right:function(e){return this._align(e,this._right)},stretch:function(e){return this._align(e,this._stretch)},top:function(e){return this._align(e,this._top)},middle:function(e){return this._align(e,this._middle)},bottom:function(e){return this._align(e,this._bottom)},_left:function(e,t){t.x=e.x},_center:function(e,t){t.x=(e.width-t.width)/2||0},_right:function(e,t){t.x=e.width-t.width},_top:function(e,t){t.y=e.y},_middle:function(e,t){t.y=(e.height-t.height)/2||0},_bottom:function(e,t){t.y=e.height-t.height},_stretch:function(e,t){t.x=0,t.y=0,t.height=e.height,t.width=e.width},_align:function(e,t){return e=s.toRect(e),t(this.container,e),e}}),u=C.extend({init:function(e,t){this.r=e,this.angle=t}}),h=C.extend({init:function(e,t,n,i,r,o){this.a=e||0,this.b=t||0,this.c=n||0,this.d=i||0,this.e=r||0,this.f=o||0},plus:function(e){this.a+=e.a,this.b+=e.b,this.c+=e.c,this.d+=e.d,this.e+=e.e,this.f+=e.f},minus:function(e){this.a-=e.a,this.b-=e.b,this.c-=e.c,this.d-=e.d,this.e-=e.e,this.f-=e.f},times:function(e){return new h(this.a*e.a+this.c*e.b,this.b*e.a+this.d*e.b,this.a*e.c+this.c*e.d,this.b*e.c+this.d*e.d,this.a*e.e+this.c*e.f+this.e,this.b*e.e+this.d*e.f+this.f)},apply:function(e){return new A(this.a*e.x+this.c*e.y+this.e,this.b*e.x+this.d*e.y+this.f)},applyRect:function(e){return s.fromPoints(this.apply(e.topLeft()),this.apply(e.bottomRight()))},toString:function(){return"matrix("+this.a+" "+this.b+" "+this.c+" "+this.d+" "+this.e+" "+this.f+")"}}),T(h,{fromSVGMatrix:function(e){var t=new h;return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f,t},fromMatrixVector:function(e){var t=new h;return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f,t},fromList:function(e){if(6!==e.length)throw"The given list should consist of six elements.";var t=new h;return t.a=e[0],t.b=e[1],t.c=e[2],t.d=e[3],t.e=e[4],t.f=e[5],t},translation:function(e,t){var n=new h;return n.a=1,n.b=0,n.c=0,n.d=1,n.e=e,n.f=t,n},unit:function(){return new h(1,0,0,1,0,0)},rotation:function(e,t,n){var i=new h;return i.a=Math.cos(e*Math.PI/180),i.b=Math.sin(e*Math.PI/180),i.c=-i.b,i.d=i.a,i.e=t-t*i.a+n*i.b||0,i.f=n-n*i.a-t*i.b||0,i},scaling:function(e,t){var n=new h;return n.a=e,n.b=0,n.c=0,n.d=t,n.e=0,n.f=0,n},parse:function(e){var t,n;if(e){if(e=e.trim(),"matrix"===e.slice(0,6).toLowerCase()){if(n=e.slice(7,e.length-1).trim(),t=n.split(","),6===t.length)return h.fromList(P(t,function(e){return parseFloat(e)}));if(t=n.split(" "),6===t.length)return h.fromList(P(t,function(e){return parseFloat(e)}))}if("("===e.slice(0,1)&&")"===e.slice(e.length-1)&&(e=e.substr(1,e.length-1)),e.indexOf(",")>0&&(t=e.split(","),6===t.length))return h.fromList(P(t,function(e){return parseFloat(e)}));if(e.indexOf(" ")>0&&(t=e.split(" "),6===t.length))return h.fromList(P(t,function(e){return parseFloat(e)}))}return t}}),p=C.extend({init:function(e,t,n,i,r,o){this.a=e||0,this.b=t||0,this.c=n||0,this.d=i||0,this.e=r||0,this.f=o||0},fromMatrix:function(e){var t=new p;return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f,t}}),f={_distanceToLineSquared:function(e,t,n){function i(e,t){return(e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y)}if(t===n)return i(e,t);var r=n.x-t.x,o=n.y-t.y,a=(e.x-t.x)*r+(e.y-t.y)*o;return 0>a?i(t,e):(a=(n.x-e.x)*r+(n.y-e.y)*o,0>a?i(n,e):(a=(n.x-e.x)*o-(n.y-e.y)*r,a*a/(r*r+o*o)))},distanceToLine:function(e,t,n){return Math.sqrt(this._distanceToLineSquared(e,t,n))},distanceToPolyline:function(e,t){var n,i,r,o,a=Number.MAX_VALUE;if(D.isUndefined(t)||0===t.length)return Number.MAX_VALUE;for(n=0;t.length-1>n;n++)i=t[n],r=t[n+1],o=this._distanceToLineSquared(e,i,r),a>o&&(a=o);return Math.sqrt(a)}},g=k.Class.extend({init:function(){this._buckets=[],this.length=0},add:function(e,t){var n=this._createGetBucket(e);return D.isDefined(t)&&(n.value=t),n},get:function(e){return this._bucketExists(e)?this._createGetBucket(e):null},set:function(e,t){this.add(e,t)},containsKey:function(e){return this._bucketExists(e)},remove:function(e){if(this._bucketExists(e)){var t=this._hash(e);return delete this._buckets[t],this.length--,e}},forEach:function(e){var t,n,i,r,o=this._hashes();for(t=0,n=o.length;n>t;t++)i=o[t],r=this._buckets[i],D.isUndefined(r)||e(r)},clone:function(){var e,t,n,i,r=new g,o=this._hashes();for(e=0,t=o.length;t>e;e++)n=o[e],i=this._buckets[n],D.isUndefined(i)||r.add(i.key,i.value);return r},_hashes:function(){var e,t=[];for(e in this._buckets)this._buckets.hasOwnProperty(e)&&t.push(e);
return t},_bucketExists:function(e){var t=this._hash(e);return D.isDefined(this._buckets[t])},_createGetBucket:function(e){var t=this._hash(e),n=this._buckets[t];return D.isUndefined(n)&&(n={key:e},this._buckets[t]=n,this.length++),n},_hash:function(e){if(D.isNumber(e))return e;if(D.isString(e))return this._hashString(e);if(D.isObject(e))return this._objectHashId(e);throw"Unsupported key type."},_hashString:function(e){var t,n,i=0;if(0===e.length)return i;for(t=0;e.length>t;t++)n=e.charCodeAt(t),i=32*i-i+n;return i},_objectHashId:function(e){var t=e._hashId;return D.isUndefined(t)&&(t=o(),e._hashId=t),t}}),m=k.Observable.extend({init:function(t){var n,i=this;if(k.Observable.fn.init.call(i),this._hashTable=new g,this.length=0,D.isDefined(t))if(e.isArray(t))for(n=0;t.length>n;n++)this.add(t[n]);else t.forEach(function(e,t){this.add(e,t)},this)},add:function(e,t){var n=this._hashTable.get(e);n||(n=this._hashTable.add(e),this.length++,this.trigger("changed")),n.value=t},set:function(e,t){this.add(e,t)},get:function(e){var t=this._hashTable.get(e);if(t)return t.value;throw Error("Cannot find key "+e)},containsKey:function(e){return this._hashTable.containsKey(e)},remove:function(e){return this.containsKey(e)?(this.trigger("changed"),this.length--,this._hashTable.remove(e)):t},forEach:function(e,t){this._hashTable.forEach(function(n){e.call(t,n.key,n.value)})},forEachValue:function(e,t){this._hashTable.forEach(function(n){e.call(t,n.value)})},forEachKey:function(e,t){this._hashTable.forEach(function(n){e.call(t,n.key)})},keys:function(){var e=[];return this.forEachKey(function(t){e.push(t)}),e}}),v=k.Class.extend({init:function(){this._tail=null,this._head=null,this.length=0},enqueue:function(e){var t={value:e,next:null};this._head?(this._tail.next=t,this._tail=this._tail.next):(this._head=t,this._tail=this._head),this.length++},dequeue:function(){if(1>this.length)throw Error("The queue is empty.");var e=this._head.value;return this._head=this._head.next,this.length--,e},contains:function(e){for(var t=this._head;t;){if(t.value===e)return!0;t=t.next}return!1}}),_=k.Observable.extend({init:function(e){var t=this;k.Observable.fn.init.call(t),this._hashTable=new g,this.length=0,D.isDefined(e)&&(e instanceof g?e.forEach(function(e){this.add(e)}):e instanceof m&&e.forEach(function(e,t){this.add({key:e,value:t})},this))},contains:function(e){return this._hashTable.containsKey(e)},add:function(e){var t=this._hashTable.get(e);t||(this._hashTable.add(e,e),this.length++,this.trigger("changed"))},get:function(e){return this.contains(e)?this._hashTable.get(e).value:null},hash:function(e){return this._hashTable._hash(e)},remove:function(e){this.contains(e)&&(this._hashTable.remove(e),this.length--,this.trigger("changed"))},forEach:function(e,t){this._hashTable.forEach(function(t){e(t.value)},t)},toArray:function(){var e=[];return this.forEach(function(t){e.push(t)}),e}}),w=k.Class.extend({init:function(e,t){if(this.links=[],this.outgoing=[],this.incoming=[],this.weight=1,this.id=D.isDefined(e)?e:o(),D.isDefined(t)){this.associatedShape=t;var n=t.bounds();this.width=n.width,this.height=n.height,this.x=n.x,this.y=n.y}else this.associatedShape=null;this.data=null,this.type="Node",this.shortForm="Node '"+this.id+"'",this.isVirtual=!1},isIsolated:function(){return D.isEmpty(this.links)},bounds:function(e){return D.isDefined(e)?(this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,t):new x.Rect(this.x,this.y,this.width,this.height)},isLinkedTo:function(e){var t=this;return D.any(t.links,function(n){return n.getComplement(t)===e})},getChildren:function(){var e,t,n,i;if(0===this.outgoing.length)return[];for(e=[],t=0,n=this.outgoing.length;n>t;t++)i=this.outgoing[t],e.push(i.getComplement(this));return e},getParents:function(){var e,t,n,i;if(0===this.incoming.length)return[];for(e=[],t=0,n=this.incoming.length;n>t;t++)i=this.incoming[t],e.push(i.getComplement(this));return e},clone:function(){var e=new w;return D.isDefined(this.weight)&&(e.weight=this.weight),D.isDefined(this.balance)&&(e.balance=this.balance),D.isDefined(this.owner)&&(e.owner=this.owner),e.associatedShape=this.associatedShape,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},adjacentTo:function(e){return null!==this.isLinkedTo(e)},removeLink:function(e){e.source===this&&(D.remove(this.links,e),D.remove(this.outgoing,e),e.source=null),e.target===this&&(D.remove(this.links,e),D.remove(this.incoming,e),e.target=null)},hasLinkTo:function(e){return D.any(this.outgoing,function(t){return t.target===e})},degree:function(){return this.links.length},incidentWith:function(e){return I(this.links,e)},getLinksWith:function(e){return D.all(this.links,function(t){return t.getComplement(this)===e},this)},getNeighbors:function(){var e=[];return D.forEach(this.incoming,function(t){e.push(t.getComplement(this))},this),D.forEach(this.outgoing,function(t){e.push(t.getComplement(this))},this),e}}),y=k.Class.extend({init:function(e,t,n,i){if(D.isUndefined(e))throw"The source of the new link is not set.";if(D.isUndefined(t))throw"The target of the new link is not set.";var r,a;r=D.isString(e)?new w(e):e,a=D.isString(t)?new w(t):t,this.source=r,this.target=a,this.source.links.push(this),this.target.links.push(this),this.source.outgoing.push(this),this.target.incoming.push(this),this.id=D.isDefined(n)?n:o(),this.associatedConnection=D.isDefined(i)?i:null,this.type="Link",this.shortForm="Link '"+this.source.id+"->"+this.target.id+"'"},getComplement:function(e){if(this.source!==e&&this.target!==e)throw"The given node is not incident with this link.";return this.source===e?this.target:this.source},getCommonNode:function(e){return this.source===e.source||this.source===e.target?this.source:this.target===e.source||this.target===e.target?this.target:null},isBridging:function(e,t){return this.source===e&&this.target===t||this.source===t&&this.target===e},getNodes:function(){return[this.source,this.target]},incidentWith:function(e){return this.source===e||this.target===e},adjacentTo:function(e){return I(this.source.links,e)||I(this.target.links,e)},changeSource:function(e){D.remove(this.source.links,this),D.remove(this.source.outgoing,this),e.links.push(this),e.outgoing.push(this),this.source=e},changeTarget:function(e){D.remove(this.target.links,this),D.remove(this.target.incoming,this),e.links.push(this),e.incoming.push(this),this.target=e},changesNodes:function(e,t){this.source===e?this.changeSource(t):this.target===e&&this.changeTarget(t)},reverse:function(){var e=this.source,t=this.target;return this.source=t,D.remove(e.outgoing,this),this.source.outgoing.push(this),this.target=e,D.remove(t.incoming,this),this.target.incoming.push(this),this},directTo:function(e){if(this.source!==e&&this.target!==e)throw"The given node is not incident with this link.";this.target!==e&&this.reverse()},createReverseEdge:function(){var e=this.clone();return e.reverse(),e.reversed=!0,e},clone:function(){var e=new y(this.source,this.target);return e}}),b=k.Class.extend({init:function(e){this.links=[],this.nodes=[],this.diagram=null,this._root=null,D.isDefined(e)?D.isString(e)?this.id=e:(this.diagram=e,this.id=e.id):this.id=o(),this.bounds=new s,this._hasCachedRelationships=!1,this.type="Graph"},cacheRelationships:function(e){var t,n,i;if(D.isUndefined(e)&&(e=!1),!this._hasCachedRelationships||e){for(t=0,n=this.nodes.length;n>t;t++)i=this.nodes[t],i.children=this.getChildren(i),i.parents=this.getParents(i);this._hasCachedRelationships=!0}},assignLevels:function(e,t,n){var i,r,o,a;if(!e)throw"Start node not specified.";for(D.isUndefined(t)&&(t=0),this.cacheRelationships(),D.isUndefined(n)&&(n=new m,D.forEach(this.nodes,function(e){n.add(e,!1)})),n.set(e,!0),e.level=t,i=e.children,r=0,o=i.length;o>r;r++)a=i[r],a&&!n.get(a)&&this.assignLevels(a,t+1,n)},root:function(e){if(D.isUndefined(e)){if(this._root)return this._root;var t=D.first(this.nodes,function(e){return 0===e.incoming.length});return t?t:D.first(this.nodes)}this._root=e},getConnectedComponents:function(){var e,t,n,i,r;for(this.componentIndex=0,this.setItemIndices(),e=D.initArray(this.nodes.length,-1),t=0;this.nodes.length>t;t++)-1===e[t]&&(this._collectConnectedNodes(e,t),this.componentIndex++);for(n=[],i=0;this.componentIndex>i;++i)n[i]=new b;for(i=0;e.length>i;++i)r=n[e[i]],r.addNodeAndOutgoings(this.nodes[i]);return n.sort(function(e,t){return t.nodes.length-e.nodes.length}),n},_collectConnectedNodes:function(e,t){e[t]=this.componentIndex;var n=this.nodes[t];D.forEach(n.links,function(t){var i=t.getComplement(n),r=i.index;-1===e[r]&&this._collectConnectedNodes(e,r)},this)},calcBounds:function(){var e,t,n,i;if(this.isEmpty())return this.bounds=new s;for(e=null,t=0,n=this.nodes.length;n>t;t++)i=this.nodes[t],e=e?e.union(i.bounds()):i.bounds();return this.bounds=e},getSpanningTree:function(e){var t,n,i,r,o,a,s,l,c,d,u,h,p=new b,f=new m;for(p.root=e.clone(),p.root.level=0,p.root.id=e.id,f.add(e,p.root),e.level=0,i=[],r=[],p.nodes.push(p.root),i.push(e),r.push(e),o=1;r.length>0;)for(a=r.pop(),s=0;a.links.length>s;s++)l=a.links[s],c=l.getComplement(a),I(i,c)||(c.level=a.level+1,c.level+1>o&&(o=c.level+1),I(r,c)||r.push(c),I(i,c)||i.push(c),f.containsKey(a)?t=f.get(a):(t=a.clone(),t.level=a.level,t.id=a.id,f.add(a,t)),f.containsKey(c)?n=f.get(c):(n=c.clone(),n.level=c.level,n.id=c.id,f.add(c,n)),d=new y(t,n),p.addLink(d));for(u=[],h=0;o>h;h++)u.push([]);return D.forEach(p.nodes,function(e){u[e.level].push(e)}),p.treeLevels=u,p.cacheRelationships(),p},takeRandomNode:function(t,n){if(D.isUndefined(t)&&(t=[]),D.isUndefined(n)&&(n=4),0===this.nodes.length)return null;if(1===this.nodes.length)return I(t,this.nodes[0])?null:this.nodes[0];var i=e.grep(this.nodes,function(e){return!I(t,e)&&e.degree()<=n});return D.isEmpty(i)?null:i[D.randomInteger(0,i.length)]},isEmpty:function(){return D.isEmpty(this.nodes)},isHealthy:function(){return D.all(this.links,function(e){return I(this.nodes,e.source)&&I(this.nodes,e.target)},this)},getParents:function(e){if(!this.hasNode(e))throw"The given node is not part of this graph.";return e.getParents()},getChildren:function(e){if(!this.hasNode(e))throw"The given node is not part of this graph.";return e.getChildren()},addLink:function(e,n,i){var r,o,a;if(D.isUndefined(e))throw"The source of the link is not defined.";if(D.isUndefined(n)){if(D.isDefined(e.type)&&"Link"===e.type)return this.addExistingLink(e),t;throw"The target of the link is not defined."}return r=this.getNode(e),D.isUndefined(r)&&(r=this.addNode(e)),o=this.getNode(n),D.isUndefined(o)&&(o=this.addNode(n)),a=new y(r,o),D.isDefined(i)&&(a.owner=i),this.links.push(a),a},removeAllLinks:function(){for(;this.links.length>0;){var e=this.links[0];this.removeLink(e)}},addExistingLink:function(e){var t,n;this.hasLink(e)||(this.links.push(e),this.hasNode(e.source.id)?(t=this.getNode(e.source.id),e.changeSource(t)):this.addNode(e.source),this.hasNode(e.target.id)?(n=this.getNode(e.target.id),e.changeTarget(n)):this.addNode(e.target))},hasLink:function(e){if(D.isString(e))return D.any(this.links,function(t){return t.id===e});if("Link"===e.type)return I(this.links,e);throw"The given object is neither an identifier nor a Link."},getNode:function(e){if(D.isUndefined(e))throw"No identifier or Node specified.";return D.isString(e)?D.find(this.nodes,function(t){return t.id==e}):this.hasNode(e)?e:null},hasNode:function(e){if(D.isString(e))return D.any(this.nodes,function(t){return t.id===e});if(D.isObject(e))return D.any(this.nodes,function(t){return t===e});throw"The identifier should be a Node or the Id (string) of a node."},removeNode:function(e){var t,n,i,r,o=e;if(D.isString(e)&&(o=this.getNode(e)),!D.isDefined(o))throw"The identifier should be a Node or the Id (string) of a node.";for(t=o.links,o.links=[],n=0,i=t.length;i>n;n++)r=t[n],this.removeLink(r);D.remove(this.nodes,o)},areConnected:function(e,t){return D.any(this.links,function(n){return n.source==e&&n.target==t||n.source==t&&n.target==e})},removeLink:function(e){D.remove(this.links,e),D.remove(e.source.outgoing,e),D.remove(e.source.links,e),D.remove(e.target.incoming,e),D.remove(e.target.links,e)},addNode:function(e,t,n){var i=null;if(!D.isDefined(e))throw"No Node or identifier for a new Node is given.";if(D.isString(e)){if(this.hasNode(e))return this.getNode(e);i=new w(e)}else{if(this.hasNode(e))return this.getNode(e);i=e}return D.isDefined(t)&&i.bounds(t),D.isDefined(n)&&(i.owner=n),this.nodes.push(i),i},addNodeAndOutgoings:function(e){I(this.nodes,e)||this.nodes.push(e);var t=e.outgoing;e.outgoing=[],D.forEach(t,function(e){this.addExistingLink(e)},this)},setItemIndices:function(){var e;for(e=0;this.nodes.length>e;++e)this.nodes[e].index=e;for(e=0;this.links.length>e;++e)this.links[e].index=e},clone:function(e){var t,n=new b,i=D.isDefined(e)&&e===!0;return i&&(n.nodeMap=new m,n.linkMap=new m),t=new m,D.forEach(this.nodes,function(e){var r=e.clone();t.set(e,r),n.nodes.push(r),i&&n.nodeMap.set(r,e)}),D.forEach(this.links,function(e){if(t.containsKey(e.source)&&t.containsKey(e.target)){var r=n.addLink(t.get(e.source),t.get(e.target));i&&n.linkMap.set(r,e)}}),n},linearize:function(e){return b.Utils.linearize(this,e)},depthFirstTraversal:function(e,t){var n,i;if(D.isUndefined(e))throw"You need to supply a starting node.";if(D.isUndefined(t))throw"You need to supply an action.";if(!this.hasNode(e))throw"The given start-node is not part of this graph";n=this.getNode(e),i=[],this._dftIterator(n,t,i)},_dftIterator:function(e,t,n){var i,r,o,a;for(t(e),n.push(e),i=e.getChildren(),r=0,o=i.length;o>r;r++)a=i[r],I(n,a)||this._dftIterator(a,t,n)},breadthFirstTraversal:function(e,t){var n,i,r,o,a,s,l,c;if(D.isUndefined(e))throw"You need to supply a starting node.";if(D.isUndefined(t))throw"You need to supply an action.";if(!this.hasNode(e))throw"The given start-node is not part of this graph";for(n=this.getNode(e),i=new v,r=[],i.enqueue(n);i.length>0;)for(o=i.dequeue(),t(o),r.push(o),a=o.getChildren(),s=0,l=a.length;l>s;s++)c=a[s],I(r,c)||I(i,c)||i.enqueue(c)},_stronglyConnectedComponents:function(e,t,n,i,r,o,a){var s,l,c,d,u;for(n.add(t,a),i.add(t,a),a++,o.push(t),s=t.getChildren(),c=0,d=s.length;d>c;c++)l=s[c],n.containsKey(l)?I(o,l)&&i.add(t,Math.min(i.get(t),n.get(l))):(this._stronglyConnectedComponents(e,l,n,i,r,o,a),i.add(t,Math.min(i.get(t),i.get(l))));if(i.get(t)===n.get(t)){u=[];do l=o.pop(),u.push(l);while(l!==t);(!e||u.length>1)&&r.push(u)}},findCycles:function(e){var t,n,i,r,o,a,s;for(D.isUndefined(e)&&(e=!0),t=new m,n=new m,i=[],r=[],o=0,a=this.nodes.length;a>o;o++)s=this.nodes[o],t.containsKey(s)||this._stronglyConnectedComponents(e,s,t,n,i,r,0);return i},isAcyclic:function(){return D.isEmpty(this.findCycles())},isSubGraph:function(e){var t=e.linearize(),n=this.linearize();return D.all(t,function(e){return I(n,e)})},makeAcyclic:function(){var e,t,n,i,r,o,a,s,l,c,d,u,h,p,f,g,v,_,w,y,b,k,x,C,T,S,A,E,I,P,M,F;if(this.isEmpty()||1>=this.nodes.length||1>=this.links.length)return[];if(2==this.nodes.length){if(e=[],this.links.length>1)for(t=this.links[0],n=t.source,i=0,r=this.links.length;r>i;i++)o=this.links[i],o.source!=n&&(a=o.reverse(),e.push(a));return e}for(s=this.clone(!0),l=this.nodes.length,c=new m,d=function(e){return 0===e.outgoing.length?2-l:0===e.incoming.length?l-2:e.outgoing.length-e.incoming.length},u=function(e,t){var n=d(e,l);t.containsKey(n)||t.set(n,[]),t.get(n).push(e)},D.forEach(s.nodes,function(e){u(e,c)}),h=[],p=[];s.nodes.length>0;){if(c.containsKey(2-l))for(_=c.get(2-l);_.length>0;){for(g=_.pop(),w=0;g.links.length>w;w++)y=g.links[w],f=y.getComplement(g),v=d(f,l),D.remove(c.get(v),f),f.removeLink(y),u(f,c);D.remove(s.nodes,g),p.unshift(g)}if(c.containsKey(l-2))for(b=c.get(l-2);b.length>0;){for(f=b.pop(),k=0;f.links.length>k;k++)x=f.links[k],g=x.getComplement(f),v=d(g,l),D.remove(c.get(v),g),g.removeLink(x),u(g,c);h.push(f),D.remove(s.nodes,f)}if(s.nodes.length>0)for(C=l-3;C>2-l;C--)if(c.containsKey(C)&&c.get(C).length>0){for(T=c.get(C),S=T.pop(),A=0;S.links.length>A;A++)E=S.links[A],I=E.getComplement(S),v=d(I,l),D.remove(c.get(v),I),I.removeLink(E),u(I,c);h.push(S),D.remove(s.nodes,S);break}}for(h=h.concat(p),P=new m,M=0;this.nodes.length>M;M++)P.set(s.nodeMap.get(h[M]),M);return F=[],D.forEach(this.links,function(e){P.get(e.source)>P.get(e.target)&&(e.reverse(),F.push(e))}),F}}),b.Predefined={EightGraph:function(){return b.Utils.parse(["1->2","2->3","3->4","4->1","3->5","5->6","6->7","7->3"])},Mindmap:function(){return b.Utils.parse(["0->1","0->2","0->3","0->4","0->5","1->6","1->7","7->8","2->9","9->10","9->11","3->12","12->13","13->14","4->15","4->16","15->17","15->18","18->19","18->20","14->21","14->22","5->23","23->24","23->25","6->26"])},ThreeGraph:function(){return b.Utils.parse(["1->2","2->3","3->1"])},BinaryTree:function(e){return D.isUndefined(e)&&(e=5),b.Utils.createBalancedTree(e,2)},Linear:function(e){return D.isUndefined(e)&&(e=10),b.Utils.createBalancedTree(e,1)},Tree:function(e,t){return b.Utils.createBalancedTree(e,t)},Forest:function(e,t,n){return b.Utils.createBalancedForest(e,t,n)},Workflow:function(){return b.Utils.parse(["0->1","1->2","2->3","1->4","4->3","3->5","5->6","6->3","6->7","5->4"])},Grid:function(e,t){var n,i,r,o,a,s=new x.Graph;if(0>=e&&0>=t)return s;for(n=0;e+1>n;n++)for(i=null,r=0;t+1>r;r++)o=new w(""+n+"."+r),s.addNode(o),i&&s.addLink(i,o),n>0&&(a=s.getNode(""+(n-1)+"."+r),s.addLink(a,o)),i=o;return s}},b.Utils={parse:function(e){var t,n,i,r,o,a=new x.Graph,s=e.slice();for(n=0,i=s.length;i>n;n++){if(r=s[n],D.isString(r)){if(r.indexOf("->")<0)throw"The link should be specified as 'a->b'.";if(o=r.split("->"),2!=o.length)throw"The link should be specified as 'a->b'.";t=new y(o[0],o[1]),a.addLink(t)}if(D.isObject(r)){if(!t)throw"Specification found before Link definition.";k.deepExtend(t,r)}}return a},linearize:function(e,t){var n,i,r,o;if(D.isUndefined(e))throw"Expected an instance of a Graph object in slot one.";for(D.isUndefined(t)&&(t=!1),n=[],i=0,r=e.links.length;r>i;i++)o=e.links[i],n.push(o.source.id+"->"+o.target.id),t&&n.push({id:o.id});return n},_addShape:function(e,t,n,i){return D.isUndefined(t)&&(t=new x.Point(0,0)),D.isUndefined(n)&&(n=o()),i=k.deepExtend({width:20,height:20,id:n,radius:10,fill:"#778899",data:"circle",undoable:!1,x:t.x,y:t.y},i),e.addShape(i)},_addConnection:function(e,t,n,i){return e.connect(t,n,i)},createDiagramFromGraph:function(e,t,n,i){var r,o,a,l,c,d,u,h,p,f,g,m,v,_,w,y;if(D.isUndefined(e))throw"The diagram surface is undefined.";if(D.isUndefined(t))throw"No graph specification defined.";for(D.isUndefined(n)&&(n=!0),D.isUndefined(i)&&(i=!1),r=e.element.clientWidth||200,o=e.element.clientHeight||200,a=[],d=0,u=t.nodes.length;u>d;d++)l=t.nodes[d],h=l.position,D.isUndefined(h)&&(h=D.isDefined(l.x)&&D.isDefined(l.y)?new A(l.x,l.y):new A(D.randomInteger(10,r-20),D.randomInteger(10,o-20))),p={},"0"===l.id||i&&k.deepExtend(p,{width:150*Math.random()+20,height:80*Math.random()+50,data:"rectangle",fill:{color:"#778899"}}),c=this._addShape(e,h,l.id,p),f=c.bounds(),D.isDefined(f)&&(l.x=f.x,l.y=f.y,l.width=f.width,l.height=f.height),a[l.id]=c;for(g=0;t.links.length>g;g++)m=t.links[g],v=a[m.source.id],D.isUndefined(v)||(_=a[m.target.id],D.isUndefined(_)||this._addConnection(e,v,_,{id:m.id}));if(n)for(w=new e.SpringLayout(e),w.layoutGraph(t,{limitToView:!1}),y=0;t.nodes.length>y;y++)l=t.nodes[y],c=a[l.id],c.bounds(new s(l.x,l.y,l.width,l.height))},createBalancedTree:function(e,t){var n,i,r,o,a,s,l,c,d,u;if(D.isUndefined(e)&&(e=3),D.isUndefined(t)&&(t=3),n=new x.Graph,i=-1,r=[],0>=e||0>=t)return n;for(a=new w(""+ ++i),n.addNode(a),n.root=a,r.push(a),s=0;e>s;s++){for(o=[],l=0;r.length>l;l++)for(c=r[l],d=0;t>d;d++)u=new w(""+ ++i),n.addLink(c,u),o.push(u);r=o}return n},createBalancedForest:function(e,t,n){var i,r,o,a,s,l,c,d,u,h,p;if(D.isUndefined(e)&&(e=3),D.isUndefined(t)&&(t=3),D.isUndefined(n)&&(n=5),i=new x.Graph,r=-1,o=[],0>=e||0>=t||0>=n)return i;for(s=0;n>s;s++)for(l=new w(""+ ++r),i.addNode(l),o=[l],c=0;e>c;c++){for(a=[],d=0;o.length>d;d++)for(u=o[d],h=0;t>h;h++)p=new w(""+ ++r),i.addLink(u,p),a.push(p);o=a}return i},createRandomConnectedGraph:function(e,t,n){var i,r,o,a,s,l,c,d,u,h;if(D.isUndefined(e)&&(e=40),D.isUndefined(t)&&(t=4),D.isUndefined(n)&&(n=!1),i=new x.Graph,r=-1,0>=e)return i;if(o=new w(""+ ++r),i.addNode(o),1===e)return i;if(e>1){for(a=1;e>a&&(s=i.takeRandomNode([],t),s);a++)l=i.addNode(""+a),i.addLink(s,l);if(!n&&e>1)for(c=D.randomInteger(1,e),d=0;c>d;d++)u=i.takeRandomNode([],t),h=i.takeRandomNode([],t),u&&h&&!i.areConnected(u,h)&&i.addLink(u,h);return i}},randomDiagram:function(e,t,n,i,r){var o=k.dataviz.diagram.Graph.Utils.createRandomConnectedGraph(t,n,i);b.Utils.createDiagramFromGraph(e,o,!1,r)}},k.deepExtend(x,{init:function(e){k.init(e,x.ui)},Point:A,Intersect:c,Geometry:f,Rect:s,Size:l,RectAlign:d,Matrix:h,MatrixVector:p,normalVariable:r,randomId:o,Dictionary:m,HashTable:g,Queue:v,Set:_,Node:w,Link:y,Graph:b,PathDefiner:a})}(window.kendo.jQuery),function(e,t){function n(e){return{x:e.x||0,y:e.y||0,width:e.width||0,height:e.height||0}}function i(e){if(e){var t=e;return H(t)&&(t={color:t}),t.color&&(t.color=r(t.color)),t}}function r(e){var t;return t=e!=W?new O.Color(e).toHex():e}function o(e,t){var n=t.x-e.x,i=t.y-e.y,r=A.util.deg(Math.atan2(i,n));return r}function a(e,t){var n,i,r,o=this.options,a=!1;for(r=0;t.length>r;r++)i=t[r],n=e[i],B(n)&&o[i]!==n&&(o[i]=n,a=!0);return a}function s(e,t){return new O.Segment(new N.Point(e,t))}var l,c,d,u,h,p,f,g,m,v,_,w,y,b,k,x,C,T,S,D,A=window.kendo,E=A.dataviz.diagram,I=A.Class,P=A.deepExtend,M=E.Point,F=E.Rect,z=E.Matrix,R=E.Utils,B=R.isNumber,H=R.isString,L=E.MatrixVector,N=A.geometry,O=A.drawing,V=A.util.defined,U=e.inArray,W="transparent",j={none:"none",arrowStart:"ArrowStart",filledCircle:"FilledCircle",arrowEnd:"ArrowEnd"},q=360,G="start",$="end",Y="width",Q="height",K="x",X="y";E.Markers=j,l=I.extend({init:function(e,t){this.x=e,this.y=t},toMatrix:function(){return z.scaling(this.x,this.y)},toString:function(){return A.format("scale({0},{1})",this.x,this.y)},invert:function(){return new l(1/this.x,1/this.y)}}),c=I.extend({init:function(e,t){this.x=e,this.y=t},toMatrixVector:function(){return new L(0,0,0,0,this.x,this.y)},toMatrix:function(){return z.translation(this.x,this.y)},toString:function(){return A.format("translate({0},{1})",this.x,this.y)},plus:function(e){this.x+=e.x,this.y+=e.y},times:function(e){this.x*=e,this.y*=e},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){0!==this.Length&&this.times(1/this.length())},invert:function(){return new c(-this.x,-this.y)}}),d=I.extend({init:function(e,t,n){this.x=t||0,this.y=n||0,this.angle=e},toString:function(){return this.x&&this.y?A.format("rotate({0},{1},{2})",this.angle,this.x,this.y):A.format("rotate({0})",this.angle)},toMatrix:function(){return z.rotation(this.angle,this.x,this.y)},center:function(){return new M(this.x,this.y)},invert:function(){return new d(q-this.angle,this.x,this.y)}}),d.create=function(e){return new d(e.angle,e.x,e.y)},d.parse=function(e){var t=e.slice(1,e.length-1).split(","),n=t[0],i=t[1],r=t[2],o=new d(n,i,r);return o},u=I.extend({init:function(e,n,i,r,o,a){this.translate=new c(e,n),i!==t&&r!==t&&(this.scale=new l(i,r)),o!==t&&(this.rotate=a?new d(o,a.x,a.y):new d(o))},toString:function(){var e=function(e){return e?""+e:""};return e(this.translate)+e(this.rotate)+e(this.scale)},render:function(e){e._transform=this,e._renderTransform()},toMatrix:function(){var e=z.unit();return this.translate&&(e=e.times(this.translate.toMatrix())),this.rotate&&(e=e.times(this.rotate.toMatrix())),this.scale&&(e=e.times(this.scale.toMatrix())),e},invert:function(){var e,n,i=this.rotate?this.rotate.invert():t,r=i?i.toMatrix():z.unit(),o=this.scale?this.scale.invert():t,a=o?o.toMatrix():z.unit(),s=new M(-this.translate.x,-this.translate.y);return s=r.times(a).apply(s),e=new c(s.x,s.y),n=new u,n.translate=e,n.rotate=i,n.scale=o,n}}),h={_setScale:function(){var e=this.options,t=this._originWidth,n=this._originHeight,i=e.width/t,r=e.height/n;B(i)||(i=1),B(r)||(r=1),this._transform.scale=new l(i,r)},_setTranslate:function(){var e=this.options,t=e.x||0,n=e.y||0;this._transform.translate=new c(t,n)},_initSize:function(){var e=this.options,t=!1;e.autoSize!==!1&&(V(e.width)||V(e.height))&&(this._measure(!0),this._setScale(),t=!0),(V(e.x)||V(e.y))&&(this._setTranslate(),t=!0),t&&this._renderTransform()},_updateSize:function(e){var t=!1;return this.options.autoSize!==!1&&this._diffNumericOptions(e,[Y,Q])&&(t=!0,this._measure(!0),this._setScale()),this._diffNumericOptions(e,[K,X])&&(t=!0,this._setTranslate()),t&&this._renderTransform(),t}},p=I.extend({init:function(e){var t=this;t.options=P({},t.options,e),t.id=t.options.id,t._originSize=F.empty(),t._transform=new u},visible:function(e){return this.drawingContainer().visible(e)},redraw:function(e){e&&e.id&&(this.id=e.id)},position:function(e,n){var i=this.options;return V(e)?(V(n)?(i.x=e,i.y=n):e instanceof M&&(i.x=e.x,i.y=e.y),this._transform.translate=new c(i.x,i.y),this._renderTransform(),t):new M(i.x,i.y)},rotate:function(e,t){return V(e)&&(this._transform.rotate=new d(e,t.x,t.y),this._renderTransform()),this._transform.rotate||new d(0)},drawingContainer:function(){return this.drawingElement},_renderTransform:function(){var e=this._transform.toMatrix();this.drawingContainer().transform(new N.Matrix(e.a,e.b,e.c,e.d,e.e,e.f))},_hover:function(){},_diffNumericOptions:a,_measure:function(e){var t,n,i;return!this._measured||e?(n=this._boundingBox()||new N.Rect,i=n.topLeft(),t=new F(i.x,i.y,n.width(),n.height()),this._originSize=t,this._originWidth=t.width,this._originHeight=t.height,this._measured=!0):t=this._originSize,t},_boundingBox:function(){return this.drawingElement.rawBBox()}}),f=p.extend({init:function(e){p.fn.init.call(this,e),e=this.options,e.fill=i(e.fill),e.stroke=i(e.stroke)},options:{stroke:{color:"gray",width:1},fill:{color:W}},fill:function(e,t){this._fill({color:r(e),opacity:t})},stroke:function(e,t,n){this._stroke({color:r(e),width:t,opacity:n})},redraw:function(e){var t,n;e&&(t=e.stroke,n=e.fill,t&&this._stroke(i(t)),n&&this._fill(i(n)),p.fn.redraw.call(this,e))},_hover:function(e){var t,n=this.drawingElement,r=this.options,o=r.hover;o&&o.fill&&(t=e?i(o.fill):r.fill,n.fill(t.color,t.opacity))},_stroke:function(e){var t,n=this.options;P(n,{stroke:e}),e=n.stroke,t=null,e.width>0&&(t={color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType}),this.drawingElement.options.set("stroke",t)},_fill:function(e){var t,n=this.options;P(n,{fill:e}),t=n.fill,this.drawingElement.fill(t.color,t.opacity)}}),g=f.extend({init:function(e){this._textColor(e),f.fn.init.call(this,e),this._font(),this._initText(),this._initSize()},options:{fontSize:15,fontFamily:"sans-serif",stroke:{width:0},fill:{color:"black"},autoSize:!0},_initText:function(){var e=this.options;this.drawingElement=new O.Text(V(e.text)?e.text:"",new N.Point,{fill:e.fill,font:e.font}),this._stroke()},_textColor:function(e){e&&e.color&&P(e,{fill:{color:e.color}})},_font:function(){var e=this.options;e.fontFamily&&V(e.fontSize)?e.font=e.fontSize+"px "+e.fontFamily:delete e.font},content:function(e){return this.drawingElement.content(e)},redraw:function(e){var t,n;e&&(t=!1,n=this.options,this._textColor(e),f.fn.redraw.call(this,e),(e.fontFamily||V(e.fontSize))&&(P(n,{fontFamily:e.fontFamily,fontSize:e.fontSize}),this._font(),this.drawingElement.options.set("font",n.font),t=!0),e.text&&(this.content(e.text),t=!0),!this._updateSize(e)&&t&&this._initSize())}}),P(g.fn,h),m=f.extend({init:function(e){f.fn.init.call(this,e),this._initPath(),this._setPosition()},_setPosition:function(){var e=this.options,t=e.x,n=e.y;(V(t)||V(n))&&this.position(t||0,n||0)},redraw:function(e){e&&(f.fn.redraw.call(this,e),this._diffNumericOptions(e,[Y,Q])&&this._drawPath(),this._diffNumericOptions(e,[K,X])&&this._setPosition())},_initPath:function(){{var e=this.options;this.drawingElement=new O.Path({fill:e.fill,stroke:e.stroke,closed:!0})}this._drawPath()},_drawPath:function(){var e=this.drawingElement,t=n(this.options),i=t.width,r=t.height;e.segments.elements([s(0,0),s(i,0),s(i,r),s(0,r)])}}),v=f.extend({init:function(e){f.fn.init.call(this,e);var t=this.options.anchor;this.anchor=new N.Point(t.x,t.y),this.createElement()},options:{stroke:{color:W,width:0},fill:{color:"black"}},_transformToPath:function(e,t){var n=t.transform();return e&&n&&(e=e.transformCopy(n)),e},redraw:function(e){e&&(e.position&&(this.options.position=e.position),f.fn.redraw.call(this,e))}}),_=v.extend({options:{radius:4,anchor:{x:0,y:0}},createElement:function(){var e=this.options;this.drawingElement=new O.Circle(new N.Circle(this.anchor,e.radius),{fill:e.fill,stroke:e.stroke})},positionMarker:function(e){var t,n,i=this.options,r=i.position,o=e.segments;t=r==G?o[0]:o[o.length-1],t&&(n=this._transformToPath(t.anchor(),e),this.drawingElement.transform(N.transform().translate(n.x,n.y)))}}),w=v.extend({options:{path:"M 0 0 L 10 5 L 0 10 L 3 5 z",anchor:{x:10,y:5}},createElement:function(){var e=this.options;this.drawingElement=O.Path.parse(e.path,{fill:e.fill,stroke:e.stroke})},positionMarker:function(e){var t,n,i=this._linePoints(e),r=i.start,a=i.end,s=N.transform();r&&s.rotate(o(r,a),a),a&&(t=this.anchor,n=a.clone().translate(-t.x,-t.y),s.translate(n.x,n.y)),this.drawingElement.transform(s)},_linePoints:function(e){var n,i,r,o,a,s=this.options,l=e.segments;return s.position==G?(r=l[0],r&&(i=r.anchor(),n=r.controlOut(),o=l[1],!n&&o&&(n=o.anchor()))):(r=l[l.length-1],r&&(i=r.anchor(),n=r.controlIn(),a=l[l.length-2],!n&&a&&(n=a.anchor()))),i?{start:this._transformToPath(n,e),end:this._transformToPath(i,e)}:t}}),y={_getPath:function(e){var n=this.drawingElement;return n instanceof O.MultiPath&&(n=e==G?n.paths[0]:n.paths[n.paths.length-1]),n&&n.segments.length?n:t},_removeMarker:function(e){var t=this._markers[e];t&&(this.drawingContainer().remove(t.drawingElement),delete this._markers[e])},_createMarkers:function(){var e=this.options,t=e.startCap,n=e.endCap;this._markers={},this._markers[G]=this._createMarker(t,G),this._markers[$]=this._createMarker(n,$)},_createMarker:function(e,n){var i,r,o=this._getPath(n);return o?(e==j.filledCircle?i=_:e==j.arrowStart||e==j.arrowEnd?i=w:this._removeMarker(n),i?(r=new i({position:n}),r.positionMarker(o),this.drawingContainer().append(r.drawingElement),r):t):(this._removeMarker(n),t)},_positionMarker:function(e){var t,n=this._markers[e];n&&(t=this._getPath(e),t?n.positionMarker(t):this._removeMarker(e))},_capMap:{start:"startCap",end:"endCap"},_redrawMarker:function(e,t,n){var i=this.options,r=this._capMap[t],o=n[r],a=!1;return o&&i[r]!=o?(i[r]=o,this._removeMarker(t),this._markers[t]=this._createMarker(o,t),a=!0):e&&!this._markers[t]&&i[r]&&(this._markers[t]=this._createMarker(i[r],t),a=!0),a},_redrawMarkers:function(e,t){!this._redrawMarker(e,G,t)&&e&&this._positionMarker(G),!this._redrawMarker(e,$,t)&&e&&this._positionMarker($)}},b=f.extend({init:function(e){f.fn.init.call(this,e),this.container=new O.Group,this._createElements(),this._initSize()},options:{autoSize:!0},drawingContainer:function(){return this.container},data:function(e){var n=this.options;return e?(n.data!=e&&(n.data=e,this._setData(e),this._initSize(),this._redrawMarkers(!0,{})),t):n.data},redraw:function(e){var t,n;e&&(f.fn.redraw.call(this,e),t=this.options,n=e.data,V(n)&&t.data!=n?(t.data=n,this._setData(n),this._updateSize(e)||this._initSize(),this._redrawMarkers(!0,e)):(this._updateSize(e),this._redrawMarkers(!1,e)))},_createElements:function(){var e=this.options;this.drawingElement=O.Path.parse(e.data||"",{fill:e.fill,stroke:e.stroke}),this.container.append(this.drawingElement),this._createMarkers()},_setData:function(e){var t=this.drawingElement,n=O.Path.parse(e||""),i=n.paths.slice(0);n.paths.elements([]),t.paths.elements(i)}}),P(b.fn,h),P(b.fn,y),k=f.extend({init:function(e){f.fn.init.call(this,e),this.container=new O.Group,this._initPath(),this._createMarkers()},drawingContainer:function(){return this.container
},redraw:function(e){var t,n;e&&(e=e||{},t=e.from,n=e.to,t&&(this.options.from=t),n&&(this.options.to=n),t||n?(this._drawPath(),this._redrawMarkers(!0,e)):this._redrawMarkers(!1,e),f.fn.redraw.call(this,e))},_initPath:function(){var e=this.options,t=this.drawingElement=new O.Path({fill:e.fill,stroke:e.stroke});this._drawPath(),this.container.append(t)},_drawPath:function(){var e=this.options,t=this.drawingElement,n=e.from||new M,i=e.to||new M;t.segments.elements([s(n.x,n.y),s(i.x,i.y)])}}),P(k.fn,y),x=f.extend({init:function(e){f.fn.init.call(this,e),this.container=new O.Group,this._initPath(),this._createMarkers()},drawingContainer:function(){return this.container},points:function(e){var n=this.options;return e?(n.points=e,this._updatePath(),t):n.points},redraw:function(e){if(e){var t=e.points;f.fn.redraw.call(this,e),t&&this._pointsDiffer(t)?(this.points(t),this._redrawMarkers(!0,e)):this._redrawMarkers(!1,e)}},_initPath:function(){var e=this.options;this.drawingElement=new O.Path({fill:e.fill,stroke:e.stroke}),this.container.append(this.drawingElement),e.points&&this._updatePath()},_pointsDiffer:function(e){var t,n=this.options.points,i=n.length!==e.length;if(!i)for(t=0;e.length>t;t++)if(n[t].x!==e[t].x||n[t].y!==e[t].y){i=!0;break}return i},_updatePath:function(){var e,t,n=this.drawingElement,i=this.options,r=i.points,o=[];for(t=0;r.length>t;t++)e=r[t],o.push(s(e.x,e.y));n.segments.elements(o)},options:{points:[]}}),P(x.fn,y),C=p.extend({init:function(e){p.fn.init.call(this,e),this._initImage()},redraw:function(e){e&&(e.source&&this.drawingElement.src(e.source),this._diffNumericOptions(e,[Y,Q,K,X])&&this.drawingElement.rect(this._rect()),p.fn.redraw.call(this,e))},_initImage:function(){var e=this.options,t=this._rect();this.drawingElement=new O.Image(e.source,t,{})},_rect:function(){var e=n(this.options),t=new N.Point(e.x,e.y),i=new N.Size(e.width,e.height);return new N.Rect(t,i)}}),T=p.extend({init:function(e){this.children=[],p.fn.init.call(this,e),this.drawingElement=new O.Group,this._initSize()},options:{autoSize:!1},append:function(e){this.drawingElement.append(e.drawingContainer()),this.children.push(e),this._childrenChange=!0},remove:function(e){this._remove(e)&&(this._childrenChange=!0)},_remove:function(e){var n=U(e,this.children);return n>=0?(this.drawingElement.removeAt(n),this.children.splice(n,1),!0):t},clear:function(){this.drawingElement.clear(),this.children=[],this._childrenChange=!0},toFront:function(e){var t,n;for(n=0;e.length>n;n++)t=e[n],this._remove(t)&&this.append(t)},toBack:function(e){this._reorderChildren(e,0)},toIndex:function(e,t){this._reorderChildren(e,t)},_reorderChildren:function(e,t){var n,i,r,o,a,s=this.drawingElement,l=s.children.slice(0),c=this.children,d=B(t);for(n=0;e.length>n;n++)a=e[n],o=a.drawingContainer(),i=U(a,c),i>=0&&(l.splice(i,1),c.splice(i,1),r=d?t:t[n],l.splice(r,0,o),c.splice(r,0,a));s.clear(),s.append.apply(s,l)},redraw:function(e){e&&(this._childrenChange?(this._childrenChange=!1,this._updateSize(e)||this._initSize()):this._updateSize(e),p.fn.redraw.call(this,e))},_boundingBox:function(){var e,t,n,i,r=this.children;for(i=0;r.length>i;i++)t=r[i],t.visible()&&t._includeInBBox!==!1&&(n=t.drawingContainer().clippedBBox(null),n&&(e=e?F.union(e,n):n));return e}}),P(T.fn,h),S=f.extend({init:function(e){f.fn.init.call(this,e),this._initCircle(),this._initSize()},redraw:function(e){if(e){var t=this.options;e.center&&(P(t,{center:e.center}),this._center.move(t.center.x,t.center.y)),this._diffNumericOptions(e,["radius"])&&this._circle.setRadius(t.radius),this._updateSize(e),f.fn.redraw.call(this,e)}},_initCircle:function(){var e,t=this.options,n=t.width,i=t.height,r=t.radius;V(r)||(V(n)||(n=i),V(i)||(i=n),t.radius=r=Math.min(n,i)/2),e=t.center||{x:r,y:r},this._center=new N.Point(e.x,e.y),this._circle=new N.Circle(this._center,r),this.drawingElement=new O.Circle(this._circle,{fill:t.fill,stroke:t.stroke})}}),P(S.fn,h),D=I.extend({init:function(e,t){t=t||{},this.element=e,this.surface=O.Surface.create(e,t),A.isFunction(this.surface.translate)&&(this.translate=this._translate),this.drawingElement=new O.Group,this._viewBox=new F(0,0,t.width,t.height),this.size(this._viewBox)},bounds:function(){var e=this.drawingElement.clippedBBox();return new F(0,0,e.width(),e.height())},size:function(e){var t=this._viewBox;return V(e)&&(t.width=e.width,t.height=e.height,this.surface.setSize(e)),{width:t.width,height:t.height}},_translate:function(e,t){var n=this._viewBox;return V(e)&&V(t)&&(n.x=e,n.y=t,this.surface.translate({x:e,y:t})),{x:n.x,y:n.y}},draw:function(){this.surface.draw(this.drawingElement)},append:function(e){return this.drawingElement.append(e.drawingContainer()),this},remove:function(e){this.drawingElement.remove(e.drawingContainer())},insertBefore:function(){},clear:function(){this.drawingElement.clear()},destroy:function(t){this.surface.destroy(),t&&e(this.element).remove()}}),A.deepExtend(E,{init:function(e){A.init(e,E.ui)},diffNumericOptions:a,Element:p,Scale:l,Translation:c,Rotation:d,Circle:S,Group:T,Rectangle:m,Canvas:D,Path:b,Line:k,MarkerBase:v,ArrowMarker:w,CircleMarker:_,Polyline:x,CompositeTransform:u,TextBlock:g,Image:C,VisualBase:f})}(window.kendo.jQuery),function(e,t){function n(e,t){e.isSelected?t.ctrlKey&&e.select(!1):e.diagram.select(e,{addToSelection:t.ctrlKey})}function i(e){return e.ctrlKey===!1&&e.altKey===!1&&e.shiftKey===!1}function r(e,t){var n=e!==!1;return e.key&&"none"!=e.key&&(n=t[e.key+"Key"]),n}function o(e,t){return t.charCodeAt(0)==e||t.toUpperCase().charCodeAt(0)==e}function a(e,t){var n;return-1==e.x&&-1==e.y?n=t.bottomRight():1==e.x&&1==e.y?n=t.topLeft():-1==e.x&&1==e.y?n=t.topRight():1==e.x&&-1==e.y?n=t.bottomLeft():0===e.x&&-1==e.y?n=t.bottom():0===e.x&&1==e.y?n=t.top():1==e.x&&0===e.y?n=t.left():-1==e.x&&0===e.y&&(n=t.right()),n}var s,l,c,d,u,h,p,f,g,m,v,_,w,y,b,k,x,C,T,S,D,A,E,I,P,M,F,z,R,B,H,L,N=window.kendo,O=N.dataviz,V=O.diagram,U=N.Class,W=V.Group,j=V.Rect,q=V.Rectangle,G=V.Utils,$=G.isUndefined,Y=V.Point,Q=V.Circle,K=V.Ticker,X=N.deepExtend,Z=N.ui.Movable,J=N.support.browser,et=N.util.defined,tt=e.proxy,nt={arrow:"default",grip:"pointer",cross:"pointer",add:"pointer",move:"move",select:"pointer",south:"s-resize",east:"e-resize",west:"w-resize",north:"n-resize",rowresize:"row-resize",colresize:"col-resize"},it=10,rt="Auto",ot="Top",at="Right",st="Left",lt="Bottom",ct=[ot,at,lt,st,rt],dt="itemRotate",ut="itemBoundsChange",ht="mouseEnter",pt="mouseLeave",ft="zoomStart",gt="zoomEnd",mt=-2e4,vt=2e4,_t=.9,wt=.93,yt=5,bt="transparent",kt="pan";V.Cursors=nt,s=N.Class.extend({init:function(e){this.layoutState=e,this.diagram=e.diagram},initState:function(){function e(e,t){var n=this.diagram.getShapeById(e);n&&(this.subjects.push(n),this.froms.push(n.bounds().topLeft()),this.tos.push(t.topLeft()))}this.froms=[],this.tos=[],this.subjects=[],this.layoutState.nodeMap.forEach(e,this)},update:function(e){if(!(0>=this.subjects.length))for(var t=0;this.subjects.length>t;t++)this.subjects[t].position(new Y(this.froms[t].x+(this.tos[t].x-this.froms[t].x)*e,this.froms[t].y+(this.tos[t].y-this.froms[t].y)*e))}}),l=U.extend({init:function(e,t,n){this.animate=$(n)?!1:n,this._initialState=e,this._finalState=t,this.title="Diagram layout"},undo:function(){this.setState(this._initialState)},redo:function(){this.setState(this._finalState)},setState:function(e){var t,n=e.diagram;this.animate?(e.linkMap.forEach(function(e,t){var i=n.getShapeById(e);i.visible(!1),i&&i.points(t)}),t=new K,t.addAdapter(new s(e)),t.onComplete(function(){e.linkMap.forEach(function(e){var t=n.getShapeById(e);t.visible(!0)})}),t.play()):(e.nodeMap.forEach(function(e,t){var i=n.getShapeById(e);i&&i.position(t.topLeft())}),e.linkMap.forEach(function(e,t){var i=n.getShapeById(e);i&&i.points(t)}))}}),c=U.extend({init:function(e){this.units=[],this.title="Composite unit",e!==t&&this.units.push(e)},add:function(e){this.units.push(e)},undo:function(){for(var e=0;this.units.length>e;e++)this.units[e].undo()},redo:function(){for(var e=0;this.units.length>e;e++)this.units[e].redo()}}),d=U.extend({init:function(e,t,n){this.item=e,this._redoSource=t,this._redoTarget=n,this._undoSource=e.source(),this._undoTarget=e.target(),this.title="Connection Editing"},undo:function(){this._undoSource!==t&&this.item.source(this._undoSource,!1),this._undoTarget!==t&&this.item.target(this._undoTarget,!1),this.item.updateModel(this._undoSource,this._undoTarget)},redo:function(){this._redoSource!==t&&this.item.source(this._redoSource,!1),this._redoTarget!==t&&this.item.target(this._redoTarget,!1),this.item.updateModel(this._undoSource,this._undoTarget)}}),u=U.extend({init:function(e,t,n){this.item=e,this._undoSource=t,this._undoTarget=n,this._redoSource=e.source(),this._redoTarget=e.target(),this.title="Connection Editing"},undo:function(){this.item.source(this._undoSource,!1),this.item.target(this._undoTarget,!1),this.item.updateModel(this._undoSource,this._undoTarget)},redo:function(){this.item.source(this._redoSource,!1),this.item.target(this._redoTarget,!1),this.item.updateModel(this._undoSource,this._undoTarget)}}),h=U.extend({init:function(e){this.connection=e,this.diagram=e.diagram,this.targetConnector=e.targetConnector,this.title="Delete connection"},undo:function(){this.diagram._addConnection(this.connection,!1)},redo:function(){this.diagram._remove(this.connection,!1)}}),p=U.extend({init:function(e){this.shape=e,this.diagram=e.diagram,this.title="Deletion"},undo:function(){this.diagram._addShape(this.shape,{undoable:!1}),this.shape.select(!1)},redo:function(){this.shape.select(!1),this.diagram._remove(this.shape,!1)}}),f=U.extend({init:function(e,t,n){var i,r;for(this.shapes=e,this.undoStates=t,this.title="Transformation",this.redoStates=[],this.adorner=n,i=0;this.shapes.length>i;i++)r=this.shapes[i],this.redoStates.push(r.bounds())},undo:function(){var e,t;for(e=0;this.shapes.length>e;e++)t=this.shapes[e],t.bounds(this.undoStates[e]),t.hasOwnProperty("layout")&&t.layout(t,this.redoStates[e],this.undoStates[e]);this.adorner&&(this.adorner.refreshBounds(),this.adorner.refresh())},redo:function(){var e,t;for(e=0;this.shapes.length>e;e++)t=this.shapes[e],t.bounds(this.redoStates[e]),t.hasOwnProperty("layout")&&t.layout(t,this.undoStates[e],this.redoStates[e]);this.adorner&&(this.adorner.refreshBounds(),this.adorner.refresh())}}),g=U.extend({init:function(e,t){this.connection=e,this.diagram=t,this.title="New connection"},undo:function(){this.diagram._remove(this.connection,!1)},redo:function(){this.diagram._addConnection(this.connection,!1)}}),m=U.extend({init:function(e,t){this.shape=e,this.diagram=t,this.title="New shape"},undo:function(){this.diagram.deselect(),this.diagram._remove(this.shape,!1)},redo:function(){this.diagram._addShape(this.shape,!1)}}),v=U.extend({init:function(e,t,n){this.initial=e,this.finalPos=t,this.diagram=n,this.title="Pan Unit"},undo:function(){this.diagram.pan(this.initial)},redo:function(){this.diagram.pan(this.finalPos)}}),_=U.extend({init:function(e,t,n){var i,r;for(this.shapes=t,this.undoRotates=n,this.title="Rotation",this.redoRotates=[],this.redoAngle=e._angle,this.adorner=e,this.center=e._innerBounds.center(),i=0;this.shapes.length>i;i++)r=this.shapes[i],this.redoRotates.push(r.rotate().angle)},undo:function(){var e,t;for(e=0;this.shapes.length>e;e++)t=this.shapes[e],t.rotate(this.undoRotates[e],this.center,!1),t.hasOwnProperty("layout")&&t.layout(t);this.adorner&&(this.adorner._initialize(),this.adorner.refresh())},redo:function(){var e,t;for(e=0;this.shapes.length>e;e++)t=this.shapes[e],t.rotate(this.redoRotates[e],this.center,!1),t.hasOwnProperty("layout")&&t.layout(t);this.adorner&&(this.adorner._initialize(),this.adorner.refresh())}}),w=U.extend({init:function(e,t,n){this.diagram=e,this.indices=n,this.items=t,this.title="Rotate Unit"},undo:function(){this.diagram._toIndex(this.items,this.indices)},redo:function(){this.diagram.toFront(this.items,!1)}}),y=U.extend({init:function(e,t,n){this.diagram=e,this.indices=n,this.items=t,this.title="Rotate Unit"},undo:function(){this.diagram._toIndex(this.items,this.indices)},redo:function(){this.diagram.toBack(this.items,!1)}}),b=U.extend({init:function(){this.stack=[],this.index=0,this.capacity=100},begin:function(){this.composite=new c},cancel:function(){this.composite=t},commit:function(){this.composite.units.length>0&&this._restart(this.composite),this.composite=t},addCompositeItem:function(e){this.composite?this.composite.add(e):this.add(e)},add:function(e,t){this._restart(e,t)},count:function(){return this.stack.length},undo:function(){this.index>0&&(this.index--,this.stack[this.index].undo())},redo:function(){this.stack.length>0&&this.stack.length>this.index&&(this.stack[this.index].redo(),this.index++)},_restart:function(e,t){this.stack.splice(this.index,this.stack.length-this.index),this.stack.push(e),$(t)||t&&t===!0?this.redo():this.index++,this.stack.length>this.capacity&&(this.stack.splice(0,this.stack.length-this.capacity),this.index=this.capacity)},clear:function(){this.stack=[],this.index=0}}),k=U.extend({init:function(e){this.toolService=e},start:function(){},move:function(){},end:function(){},tryActivate:function(){return!1},getCursor:function(){return nt.arrow}}),x=k.extend({init:function(t){var n,i,r,o,a=this,s=N.support.mobileOS?wt:_t;k.fn.init.call(a,t),n=a.toolService.diagram,i=n.canvas,r=n.scroller=a.scroller=e(n.scrollable).kendoMobileScroller({friction:s,velocityMultiplier:yt,mousewheelScrolling:!1,zoom:!1,scroll:tt(a._move,a)}).data("kendoMobileScroller"),i.translate&&(a.movableCanvas=new Z(i.element)),o=function(e,t,n){e.makeVirtual(),e.virtualSize(t||mt,n||vt)},o(r.dimensions.x),o(r.dimensions.y),r.disable()},tryActivate:function(e,t){var n=this.toolService,r=n.diagram.options.pannable,o=t.ctrlKey;return et(r.key)&&(o=r.key&&"none"!=r.key?t[r.key+"Key"]&&!(t.ctrlKey&&et(n.hoveredItem)):i(t)),r!==!1&&o&&!et(n.hoveredAdorner)&&!et(n._hoveredConnector)},start:function(){this.scroller.enable()},move:function(){},_move:function(e){var t=this,n=t.toolService.diagram,i=n.canvas,r=new Y(e.scrollLeft,e.scrollTop);i.translate?(n._storePan(r.times(-1)),t.movableCanvas.moveTo(r),i.translate(r.x,r.y)):r=r.plus(n._pan.times(-1)),n.trigger(kt,{pan:r})},end:function(){this.scroller.disable()},getCursor:function(){return nt.move}}),C=U.extend({init:function(e){this.toolService=e},tryActivate:function(){return!0},start:function(e,t){var i=this.toolService,o=i.diagram,a=i.hoveredItem,s=o.options.selectable;a&&(r(s,t)&&n(a,t),a.adorner&&(this.adorner=a.adorner,this.handle=this.adorner._hitTest(e))),this.handle||(this.handle=o._resizingAdorner._hitTest(e),this.handle&&(this.adorner=o._resizingAdorner)),this.adorner&&this.adorner.start(e)},move:function(e){var t=this;this.adorner&&this.adorner.move(t.handle,e)},end:function(e,n){var i,r=this.toolService.diagram,o=this.toolService;this.adorner&&(i=this.adorner.stop(),i&&r.undoRedoService.add(i,!1)),o.hoveredItem&&this.toolService.triggerClick({item:o.hoveredItem,point:e,meta:n}),this.adorner=t,this.handle=t},getCursor:function(e){return this.toolService.hoveredItem?this.toolService.hoveredItem._getCursor(e):nt.arrow}}),T=U.extend({init:function(e){this.toolService=e},tryActivate:function(e,t){var n=this.toolService,i=r(n.diagram.options.selectable,t);return i&&!et(n.hoveredItem)&&!et(n.hoveredAdorner)},start:function(e){var t=this.toolService.diagram;t.deselect(),t.selector.start(e)},move:function(e){var t=this.toolService.diagram;t.selector.move(e)},end:function(e,t){var n=this.toolService.diagram,i=this.toolService.hoveredItem,r=n.selector.bounds();i&&i.isSelected||t.ctrlKey||n.deselect(),r.isEmpty()||n.selectArea(r),n.selector.end()},getCursor:function(){return nt.arrow}}),S=U.extend({init:function(e){this.toolService=e,this.type="ConnectionTool"},tryActivate:function(){return this.toolService._hoveredConnector},start:function(e,t){var i=this.toolService.diagram,r=this.toolService._hoveredConnector,o=i.connect(r._c,e);this.toolService._connectionManipulation(o,r._c.shape,!0),this.toolService._removeHover(),n(this.toolService.activeConnection,t)},move:function(e){return this.toolService.activeConnection.target(e),!0},end:function(){var e=this.toolService.activeConnection,t=this.toolService.hoveredItem,n=this.toolService._hoveredConnector;n&&n._c!=e.sourceConnector?e.target(n._c):t&&e.target(t),e.updateModel(),this.toolService._connectionManipulation()},getCursor:function(){return nt.arrow}}),D=U.extend({init:function(e){this.toolService=e,this.type="ConnectionTool"},tryActivate:function(e,t){var n=this.toolService,i=n.diagram,o=i.options.selectable,a=n.hoveredItem,s=r(o,t)&&a&&a.path&&!(a.isSelected&&t.ctrlKey);return s&&(this._c=a),s},start:function(e,t){n(this._c,t),this.handle=this._c.adorner._hitTest(e),this._c.adorner.start(e)},move:function(e){return this._c.adorner.move(this.handle,e),!0},end:function(e,t){this.toolService.triggerClick({item:this._c,point:e,meta:t});var n=this._c.adorner.stop(e);this.toolService.diagram.undoRedoService.add(n,!1)},getCursor:function(){return nt.move}}),A=U.extend({init:function(e){this.diagram=e,this.tools=[new x(this),new D(this),new S(this),new T(this),new C(this)],this.activeTool=t},start:function(e,t){return t=X({},t),this.activeTool&&this.activeTool.end(e,t),this._updateHoveredItem(e),this._activateTool(e,t),this.activeTool.start(e,t),this._updateCursor(e),this.diagram.focus(),this.startPoint=e,!0},move:function(e,t){t=X({},t);var n=!0;return this.activeTool&&(n=this.activeTool.move(e,t)),n&&this._updateHoveredItem(e),this._updateCursor(e),!0},end:function(e,n){return n=X({},n),this.activeTool&&this.activeTool.end(e,n),this.activeTool=t,this._updateCursor(e),!0},keyDown:function(e,t){var n=this.diagram;if(t=X({ctrlKey:!1,metaKey:!1,altKey:!1},t),!t.ctrlKey&&!t.metaKey||t.altKey){if(46===e||8===e)return n.remove(n.select(),!0),n._destroyToolBar(),!0;if(27===e)return this._discardNewConnection(),n.deselect(),n._destroyToolBar(),!0}else{if(o(e,"a"))return n.selectAll(),n._destroyToolBar(),!0;if(o(e,"z"))return n.undo(),n._destroyToolBar(),!0;if(o(e,"y"))return n.redo(),n._destroyToolBar(),!0;o(e,"c")?(n.copy(),n._destroyToolBar()):o(e,"x")?(n.cut(),n._destroyToolBar()):o(e,"v")?(n.paste(),n._destroyToolBar()):o(e,"l")?(n.layout(),n._destroyToolBar()):o(e,"d")&&(n._destroyToolBar(),n.copy(),n.paste())}},wheel:function(e,t){var n=this.diagram,i=t.delta,r=n.zoom(),o=n.options,a=o.zoomRate,s={point:e,meta:t,zoom:r};if(!n.trigger(ft,s))return 0>i?r+=a:r-=a,r=N.dataviz.round(Math.max(o.zoomMin,Math.min(o.zoomMax,r)),2),s.zoom=r,n.zoom(r,s),n.trigger(gt,s),!0},setTool:function(e,t){e.toolService=this,this.tools[t]=e},triggerClick:function(e){this.startPoint.equals(e.point)&&this.diagram.trigger("click",e)},_discardNewConnection:function(){this.newConnection&&(this.diagram.remove(this.newConnection),this.newConnection=t)},_activateTool:function(e,t){var n,i;for(n=0;this.tools.length>n;n++)if(i=this.tools[n],i.tryActivate(e,t)){this.activeTool=i;break}},_updateCursor:function(e){var t=this.diagram.element,n=this.activeTool?this.activeTool.getCursor(e):this.hoveredAdorner?this.hoveredAdorner._getCursor(e):this.hoveredItem?this.hoveredItem._getCursor(e):nt.arrow;t.css({cursor:n}),J.msie&&7==J.version&&(t[0].style.cssText=t[0].style.cssText)},_connectionManipulation:function(e,n,i){this.activeConnection=e,this.disabledShape=n,this.newConnection=i?this.activeConnection:t},_updateHoveredItem:function(e){var n=this._hitTest(e),i=this.diagram;n==this.hoveredItem||this.disabledShape&&n==this.disabledShape||(this.hoveredItem&&(i.trigger(pt,{item:this.hoveredItem}),this.hoveredItem._hover(!1)),n&&n.options.enable?(i.trigger(ht,{item:n}),this.hoveredItem=n,this.hoveredItem._hover(!0)):this.hoveredItem=t)},_removeHover:function(){this.hoveredItem&&(this.hoveredItem._hover(!1),this.hoveredItem=t)},_hitTest:function(e){var n,i,r,o,a=this.diagram;if(this._hoveredConnector&&(this._hoveredConnector._hover(!1),this._hoveredConnector=t),a._connectorsAdorner._visible&&(n=a._connectorsAdorner._hitTest(e)))return n;if(n=this.diagram._resizingAdorner._hitTest(e)){if(this.hoveredAdorner=a._resizingAdorner,0!==n.x&&0!==n.y)return;n=t}else this.hoveredAdorner=t;if(!this.activeTool||"ConnectionTool"!==this.activeTool.type){for(o=[],r=0;a._selectedItems.length>r;r++)i=a._selectedItems[r],i instanceof V.Connection&&o.push(i);n=this._hitTestItems(o,e)}return n||this._hitTestItems(a.shapes,e)||this._hitTestItems(a.connections,e)},_hitTestItems:function(e,t){var n,i,r;for(n=e.length-1;n>=0;n--)if(i=e[n],r=i._hitTest(t))return r}}),E=N.Class.extend({init:function(){}}),I=E.extend({init:function(e){var t=this;E.fn.init.call(t),this.connection=e},hitTest:function(e){var t=this.getBounds().inflate(10);return t.contains(e)?V.Geometry.distanceToPolyline(e,this.connection.allPoints())<it:!1},getBounds:function(){var e,t=this.connection.allPoints(),n=t[0],i=t[t.length-1],r=Math.max(n.x,i.x),o=Math.min(n.x,i.x),a=Math.min(n.y,i.y),s=Math.max(n.y,i.y);for(e=1;t.length-1>e;++e)r=Math.max(r,t[e].x),o=Math.min(o,t[e].x),a=Math.min(a,t[e].y),s=Math.max(s,t[e].y);return new j(o,a,r-o,s-a)}}),P=I.extend({init:function(e){var t=this;I.fn.init.call(t),this.connection=e},route:function(){}}),M=I.extend({init:function(e){var t=this;I.fn.init.call(t),this.connection=e},route:function(){function e(){if(null!==u){if(u===at||u===st)return!0;if(u===ot||u===lt)return!1}return Math.abs(o.x-a.x)>Math.abs(o.y-a.y)}var t,n,i,r=this.connection,o=this.connection.sourcePoint(),a=this.connection.targetPoint(),s=[o,o,a,a],l=a.x-o.x,c=a.y-o.y,d=s.length,u=null,h=null;if(G.isDefined(r._resolvedSourceConnector)&&(u=r._resolvedSourceConnector.options.name),G.isDefined(r._resolvedTargetConnector)&&(h=r._resolvedTargetConnector.options.name),null!==u&&null!==h&&G.contains(ct,u)&&G.contains(ct,h))this.connection.points(u===ot||u==lt?h==ot||h==lt?[new Y(o.x,o.y+c/2),new Y(a.x,o.y+c/2)]:[new Y(o.x,o.y+c)]:h==st||h==at?[new Y(o.x+l/2,o.y),new Y(o.x+l/2,o.y+c)]:[new Y(a.x,o.y)]);else{for(this.connection.cascadeStartHorizontal=e(this.connection),i=1;d-1>i;++i)r.cascadeStartHorizontal?i%2!==0?(t=l/(d/2),n=0):(t=0,n=c/((d-1)/2)):i%2!==0?(t=0,n=c/(d/2)):(t=l/((d-1)/2),n=0),s[i]=new Y(s[i-1].x+t,s[i-1].y+n);i--,s[d-2]=r.cascadeStartHorizontal&&i%2!==0||!r.cascadeStartHorizontal&&i%2===0?new Y(s[d-1].x,s[d-2].y):new Y(s[d-2].x,s[d-1].y),this.connection.points([s[1],s[2]])}}}),F=U.extend({init:function(e,t){var n=this;n.diagram=e,n.options=X({},n.options,t),n.visual=new W,n.diagram._adorners.push(n)},refresh:function(){}}),z=F.extend({init:function(e,t){var n,i,r,o=this;o.connection=e,n=o.connection.diagram,o._ts=n.toolService,F.fn.init.call(o,n,t),i=o.connection.sourcePoint(),r=o.connection.targetPoint(),o.spVisual=new Q(X(o.options.handles,{center:i})),o.epVisual=new Q(X(o.options.handles,{center:r})),o.visual.append(o.spVisual),o.visual.append(o.epVisual)},options:{handles:{}},_getCursor:function(){return nt.move},start:function(e){switch(this.handle=this._hitTest(e),this.startPoint=e,this._initialSource=this.connection.source(),this._initialTarget=this.connection.target(),this.handle){case-1:this.connection.targetConnector&&this._ts._connectionManipulation(this.connection,this.connection.targetConnector.shape);break;case 1:this.connection.sourceConnector&&this._ts._connectionManipulation(this.connection,this.connection.sourceConnector.shape)}},move:function(e,t){switch(e){case-1:this.connection.source(t);break;case 1:this.connection.target(t);break;default:var n=t.minus(this.startPoint);this.startPoint=t,this.connection.sourceConnector||this.connection.source(this.connection.sourcePoint().plus(n)),this.connection.targetConnector||this.connection.target(this.connection.targetPoint().plus(n))}return this.refresh(),!0},stop:function(e){var n,i=this.diagram.toolService,r=i.hoveredItem;return n=i._hoveredConnector?i._hoveredConnector._c:r&&r instanceof V.Shape?r:e,-1===this.handle?this.connection.source(n):1===this.handle&&this.connection.target(n),this.handle&&this.connection.updateModel(),this.handle=t,this._ts._connectionManipulation(),new u(this.connection,this._initialSource,this._initialTarget)},_hitTest:function(e){var t=this.connection.sourcePoint(),n=this.connection.targetPoint(),i=this.options.handles.width/2,r=this.options.handles.height/2,o=new j(t.x,t.y).inflate(i,r),a=new j(n.x,n.y).inflate(i,r);return o.contains(e)?-1:a.contains(e)?1:0},refresh:function(){this.spVisual.redraw({center:this.diagram.modelToLayer(this.connection.sourcePoint())}),this.epVisual.redraw({center:this.diagram.modelToLayer(this.connection.targetPoint())})}}),R=F.extend({init:function(e,t){var n=this;F.fn.init.call(n,e,t),n._refreshHandler=function(e){e.item==n.shape&&n.refresh()}},show:function(e){var t,n,i,r=this;for(r._visible=!0,r.shape=e,r.diagram.bind(ut,r._refreshHandler),t=e.connectors.length,r.connectors=[],r.visual.clear(),n=0;t>n;n++)i=new L(e.connectors[n]),r.connectors.push(i),r.visual.append(i.visual);r.visual.visible(!0),r.refresh()},destroy:function(){var e=this;e.diagram.unbind(ut,e._refreshHandler),e.shape=t,e._visible=t,e.visual.visible(!1)},_hitTest:function(e){var t,n;for(n=0;this.connectors.length>n;n++)if(t=this.connectors[n],t._hitTest(e)){t._hover(!0),this.diagram.toolService._hoveredConnector=t;break}},refresh:function(){if(this.shape){var t=this.shape.bounds();t=this.diagram.modelToLayer(t),this.visual.position(t.topLeft()),e.each(this.connectors,function(){this.refresh()})}}}),B=F.extend({init:function(e,t){var n=this;F.fn.init.call(n,e,t),n._manipulating=!1,n.map=[],n.shapes=[],n._initSelection(),n._createHandles(),n.redraw(),n.diagram.bind("select",function(e){n._initialize(e.selected)}),n._refreshHandler=function(){n._internalChange||(n.refreshBounds(),n.refresh())},n._rotatedHandler=function(){1==n.shapes.length&&(n._angle=n.shapes[0].rotate().angle),n._refreshHandler()},n.diagram.bind(ut,n._refreshHandler).bind(dt,n._rotatedHandler),n.refreshBounds(),n.refresh()},options:{editable:{},selectable:{stroke:{color:"#778899",width:1,dashType:"dash"},fill:{color:bt}},offset:10},_initSelection:function(){var e=this,t=e.diagram,n=t.options.selectable,i=X({},e.options.selectable,n);e.rect=new q(i),e.visual.append(e.rect)},_createHandles:function(){var e,t,n,i,r=this.options.editable;if(r&&r.resize)for(e=r.resize.handles,i=-1;1>=i;i++)for(n=-1;1>=n;n++)(0!==i||0!==n)&&(t=new q(e),t.drawingElement._hover=tt(this._hover,this),this.map.push({x:i,y:n,visual:t}),this.visual.append(t))},bounds:function(e){return e?(this._innerBounds=e.clone(),this._bounds=this.diagram.modelToLayer(e).inflate(this.options.offset,this.options.offset),t):this._bounds},_hitTest:function(e){var n,i,r,o,a=this.diagram.modelToLayer(e),s=this.options.editable,l=this.map.length;if(this._angle&&(a=a.clone().rotate(this._bounds.center(),this._angle)),s&&s.rotate&&this._rotationThumbBounds&&this._rotationThumbBounds.contains(a))return new Y(-1,-2);if(s&&s.resize)for(n=0;l>n;n++)if(o=this.map[n],i=new Y(o.x,o.y),r=this._getHandleBounds(i),r.offset(this._bounds.x,this._bounds.y),r.contains(a))return i;return this._bounds.contains(a)?new Y(0,0):t},_getHandleBounds:function(e){var n,i,r,o,a=this.options.editable;return a&&a.resize?(n=a.resize.handles||{},i=n.width,r=n.height,o=new j(0,0,i,r),0>e.x?o.x=-i/2:0===e.x?o.x=Math.floor(this._bounds.width/2)-i/2:e.x>0&&(o.x=this._bounds.width+1-i/2),0>e.y?o.y=-r/2:0===e.y?o.y=Math.floor(this._bounds.height/2)-r/2:e.y>0&&(o.y=this._bounds.height+1-r/2),o):t},_getCursor:function(e){var t,n=this._hitTest(e);if(n&&n.x>=-1&&1>=n.x&&n.y>=-1&&1>=n.y&&this.options.editable&&this.options.editable.resize){if(t=this._angle,t&&(t=360-t,n.rotate(new Y(0,0),t),n=new Y(Math.round(n.x),Math.round(n.y))),-1==n.x&&-1==n.y)return"nw-resize";if(1==n.x&&1==n.y)return"se-resize";if(-1==n.x&&1==n.y)return"sw-resize";if(1==n.x&&-1==n.y)return"ne-resize";if(0===n.x&&-1==n.y)return"n-resize";if(0===n.x&&1==n.y)return"s-resize";if(1==n.x&&0===n.y)return"e-resize";if(-1==n.x&&0===n.y)return"w-resize"}return this._manipulating?nt.move:nt.select},_initialize:function(){var e,t,n=this,i=n.diagram.select();for(n.shapes=[],e=0;i.length>e;e++)t=i[e],t instanceof V.Shape&&(n.shapes.push(t),t._rotationOffset=new Y);n._angle=1==n.shapes.length?n.shapes[0].rotate().angle:0,n._startAngle=n._angle,n._rotates(),n._positions(),n.refreshBounds(),n.refresh(),n.redraw()},_rotates:function(){var e,t,n=this;for(n.initialRotates=[],e=0;n.shapes.length>e;e++)t=n.shapes[e],n.initialRotates.push(t.rotate().angle)},_positions:function(){var e,t,n=this;for(n.initialStates=[],e=0;n.shapes.length>e;e++)t=n.shapes[e],n.initialStates.push(t.bounds())},_hover:function(e,t){var n,i,r,o,a=this.options.editable;a&&a.resize&&(n=a.resize.handles,i=n.hover,r=n.stroke,o=n.fill,e&&G.isDefined(i.stroke)&&(r=X({},r,i.stroke)),e&&G.isDefined(i.fill)&&(o=i.fill),t.stroke(r.color,r.width,r.opacity),t.fill(o.color,o.opacity))},start:function(e){var t,n;for(this._sp=e,this._cp=e,this._lp=e,this._manipulating=!0,this._internalChange=!0,this.shapeStates=[],t=0;this.shapes.length>t;t++)n=this.shapes[t],this.shapeStates.push(n.bounds())},redraw:function(){var e,t,n=this,i=n.options.editable,r=i.resize,o=i.rotate,a=i&&r?!0:!1,s=i&&o?!0:!1;for(e=0;this.map.length>e;e++)t=this.map[e],t.visual.visible(a);n.rotationThumb&&n.rotationThumb.visible(s)},angle:function(e){return et(e)&&(this._angle=e),this._angle},rotate:function(){var e,t,n=this._innerBounds.center(),i=this.angle();for(this._internalChange=!0,e=0;this.shapes.length>e;e++)t=this.shapes[e],i=(i+this.initialRotates[e]-this._startAngle)%360,t.rotate(i,n);this.refresh()},move:function(e,n){var i,r,o,s,l,c,d,u,h,p,f,g,m,v,_=new Y,w=new Y,y=0;if(-2===e.y&&-1===e.x){for(s=this._innerBounds.center(),this._angle=this._truncateAngle(G.findAngle(s,n)),c=0;this.shapes.length>c;c++)l=this.shapes[c],d=(this._angle+this.initialRotates[c]-this._startAngle)%360,l.rotate(d,s),l.hasOwnProperty("layout")&&l.layout(l),this._rotating=!0;this.refresh()}else{if(this.diagram.options.snap.enabled===!0){if(g=this._truncateDistance(n.minus(this._lp)),0===g.x&&0===g.y)return this._cp=n,t;i=g,this._lp=new Y(this._lp.x+g.x,this._lp.y+g.y)}else i=n.minus(this._cp);for(0===e.x&&0===e.y?(w=_=i,r=!0):(this._angle&&i.rotate(new Y(0,0),this._angle),-1==e.x?_.x=i.x:1==e.x&&(w.x=i.x),-1==e.y?_.y=i.y:1==e.y&&(w.y=i.y)),r||(h=a(e,this._innerBounds),p=(this._innerBounds.width+i.x*e.x)/this._innerBounds.width,f=(this._innerBounds.height+i.y*e.y)/this._innerBounds.height),c=0;this.shapes.length>c;c++)l=this.shapes[c],o=l.bounds(),r?u=this._displaceBounds(o,_,w,r):(u=o.clone(),u.scale(p,f,h,this._innerBounds.center(),l.rotate().angle),m=u.center(),m.rotate(o.center(),-this._angle),u=new j(m.x-u.width/2,m.y-u.height/2,u.width,u.height)),u.width>=l.options.minWidth&&u.height>=l.options.minHeight&&(v=o,l.bounds(u),l.hasOwnProperty("layout")&&l.layout(l,v,u),l.rotate(l.rotate().angle),y+=1);y==c&&(u=this._displaceBounds(this._innerBounds,_,w,r),this.bounds(u),this.refresh()),this._positions()}this._cp=n},_truncatePositionToGuides:function(e){return this.diagram.ruler?this.diagram.ruler.truncatePositionToGuides(e):e},_truncateSizeToGuides:function(e){return this.diagram.ruler?this.diagram.ruler.truncateSizeToGuides(e):e},_truncateAngle:function(e){var t=Math.max(this.diagram.options.snap.angle,5);return this.diagram.options.snap.enabled===!0?Math.floor(e%360/t)*t:e%360},_truncateDistance:function(e){if(e instanceof V.Point)return new V.Point(this._truncateDistance(e.x),this._truncateDistance(e.y));var t=Math.max(this.diagram.options.snap.size,5);return this.diagram.options.snap.enabled===!0?Math.floor(e/t)*t:e},_displaceBounds:function(e,t,n,i){var r,o=e.topLeft().plus(t),a=e.bottomRight().plus(n),s=j.fromPoints(o,a);return i||(r=s.center(),r.rotate(e.center(),-this._angle),s=new j(r.x-s.width/2,r.y-s.height/2,s.width,s.height)),s},stop:function(){var e,n,i,r;if(this._cp!=this._sp)if(this._rotating)e=new _(this,this.shapes,this.initialRotates),this._rotating=!1;
else{if(this.diagram.ruler)for(n=0;this.shapes.length>n;n++)i=this.shapes[n],r=i.bounds(),r=this._truncateSizeToGuides(this._truncatePositionToGuides(r)),i.bounds(r),this.refreshBounds(),this.refresh();for(n=0;this.shapes.length>n;n++)i=this.shapes[n],i.updateModel();e=new f(this.shapes,this.shapeStates,this)}return this._manipulating=t,this._internalChange=t,this._rotating=t,e},refreshBounds:function(){var e=1==this.shapes.length?this.shapes[0].bounds().clone():this.diagram.boundingBox(this.shapes,!0);this.bounds(e)},refresh:function(){var t,n,i,r,o=this;this.shapes.length>0?(n=this.bounds(),this.visual.visible(!0),this.visual.position(n.topLeft()),e.each(this.map,function(){t=o._getHandleBounds(new Y(this.x,this.y)),this.visual.position(t.topLeft())}),this.visual.position(n.topLeft()),i=new Y(n.width/2,n.height/2),this.visual.rotate(this._angle,i),this.rect.redraw({width:n.width,height:n.height}),this.rotationThumb&&(r=this.options.editable.rotate.thumb,this._rotationThumbBounds=new j(n.center().x,n.y+r.y,0,0).inflate(r.width),this.rotationThumb.redraw({x:n.width/2-r.width/2}))):this.visual.visible(!1)}}),H=U.extend({init:function(e){var t=e.options.selectable;this.options=X({},this.options,t),this.visual=new q(this.options),this.diagram=e},options:{stroke:{color:"#778899",width:1,dashType:"dash"},fill:{color:bt}},start:function(e){this._sp=this._ep=e,this.refresh(),this.diagram._adorn(this,!0)},end:function(){this._sp=this._ep=t,this.diagram._adorn(this,!1)},bounds:function(e){return e&&(this._bounds=e),this._bounds},move:function(e){this._ep=e,this.refresh()},refresh:function(){if(this._sp){var e=j.fromPoints(this.diagram.modelToLayer(this._sp),this.diagram.modelToLayer(this._ep));this.bounds(j.fromPoints(this._sp,this._ep)),this.visual.position(e.topLeft()),this.visual.redraw({height:e.height+1,width:e.width+1})}}}),L=U.extend({init:function(e){this.options=X({},e.options),this._c=e,this.visual=new Q(this.options),this.refresh()},_hover:function(e){var t=this.options,n=t.hover,i=t.stroke,r=t.fill;e&&G.isDefined(n.stroke)&&(i=X({},i,n.stroke)),e&&G.isDefined(n.fill)&&(r=n.fill),this.visual.redraw({stroke:i,fill:r})},refresh:function(){var e=this._c.shape.diagram.modelToView(this._c.position()),t=e.minus(this._c.shape.bounds("transformed").topLeft()),n=new j(e.x,e.y,0,0);n.inflate(this.options.width/2,this.options.height/2),this._visualBounds=n,this.visual.redraw({center:new Y(t.x,t.y)})},_hitTest:function(e){var t=this._c.shape.diagram.modelToView(e);return this._visualBounds.contains(t)}}),X(V,{CompositeUnit:c,TransformUnit:f,PanUndoUnit:v,AddShapeUnit:m,AddConnectionUnit:g,DeleteShapeUnit:p,DeleteConnectionUnit:h,ConnectionEditAdorner:z,UndoRedoService:b,ResizingAdorner:B,Selector:H,ToolService:A,ConnectorsAdorner:R,LayoutUndoUnit:l,ConnectionEditUnit:d,ToFrontUnit:w,ToBackUnit:y,ConnectionRouterBase:E,PolylineRouter:P,CascadingRouter:M,SelectionTool:T,ScrollerTool:x,PointerTool:C,ConnectionEditTool:D,RotateUnit:_})}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.dataviz.diagram,i=n.Graph,r=n.Node,o=n.Link,a=t.deepExtend,s=n.Size,l=n.Rect,c=n.Dictionary,d=n.Set,u=n.Graph,h=n.Utils,p=n.Point,f=1e-6,g=Math.PI/180,m=h.contains,v=e.grep,_=t.Class.extend({defaultOptions:{type:"Tree",subtype:"Down",roots:null,animate:!1,limitToView:!1,friction:.9,nodeDistance:50,iterations:300,horizontalSeparation:90,verticalSeparation:50,underneathVerticalTopOffset:15,underneathHorizontalOffset:15,underneathVerticalSeparation:15,grid:{width:1500,offsetX:50,offsetY:50,componentSpacingX:20,componentSpacingY:20},layerSeparation:50,layeredIterations:2,startRadialAngle:0,endRadialAngle:360,radialSeparation:150,radialFirstLevelSeparation:200,keepComponentsInOneRadialLayout:!1,ignoreContainers:!0,layoutContainerChildren:!1,ignoreInvisible:!0,animateTransitions:!1},init:function(){},gridLayoutComponents:function(e){var t,n,i,r,o,a,s,l,c,d,u,f,g,m,v;if(!e)throw"No components supplied.";for(h.forEach(e,function(e){e.calcBounds()}),e.sort(function(e,t){return t.bounds.width-e.bounds.width}),t=this.options.grid.width,n=this.options.grid.componentSpacingX,i=this.options.grid.componentSpacingY,r=0,o=this.options.grid.offsetX,a=this.options.grid.offsetY,s=o,l=a,d=[],u=[];e.length>0;){for(s>=t&&(s=o,l+=r+i,r=0),f=e.pop(),this.moveToOffset(f,new p(s,l)),c=0;f.nodes.length>c;c++)u.push(f.nodes[c]);for(c=0;f.links.length>c;c++)d.push(f.links[c]);g=f.bounds,m=g.height,(0>=m||isNaN(m))&&(m=0),v=g.width,(0>=v||isNaN(v))&&(v=0),m>=r&&(r=m),s+=v+n}return{nodes:u,links:d}},moveToOffset:function(e,t){var n,i,r,o,a,s,c,d,u=e.bounds,h=t.x-u.x,f=t.y-u.y;for(n=0;e.nodes.length>n;n++)r=e.nodes[n],o=r.bounds(),0===o.width&&0===o.height&&0===o.x&&0===o.y&&(o=new l(0,0,0,0)),o.x+=h,o.y+=f,r.bounds(o);for(n=0;e.links.length>n;n++)if(a=e.links[n],a.points){for(s=[],c=a.points,i=0;c.length>i;i++)d=c[i],d.x+=h,d.y+=f,s.push(d);a.points=s}return this.currentHorizontalOffset+=u.width+this.options.grid.offsetX,new p(h,f)},transferOptions:function(e){this.options=t.deepExtend({},this.defaultOptions),h.isUndefined(e)||(this.options=t.deepExtend(this.options,e||{}))}}),w=t.Class.extend({init:function(e){this.nodeMap=new c,this.shapeMap=new c,this.nodes=[],this.edges=[],this.edgeMap=new c,this.finalNodes=[],this.finalLinks=[],this.ignoredConnections=[],this.ignoredShapes=[],this.hyperMap=new c,this.hyperTree=new i,this.finalGraph=null,this.diagram=e},convert:function(e){if(h.isUndefined(this.diagram))throw"No diagram to convert.";return this.options=t.deepExtend({ignoreInvisible:!0,ignoreContainers:!0,layoutContainerChildren:!1},e||{}),this.clear(),this._renormalizeShapes(),this._renormalizeConnections(),this.finalNodes=new c(this.nodes),this.finalLinks=new c(this.edges),this.finalGraph=new i,this.finalNodes.forEach(function(e){this.finalGraph.addNode(e)},this),this.finalLinks.forEach(function(e){this.finalGraph.addExistingLink(e)},this),this.finalGraph},mapConnection:function(e){return this.edgeMap.first(function(t){return m(this.edgeMap.get(t),e)})},mapShape:function(e){var t,n,i,r=this.nodeMap.keys();for(t=0,n=r.length;n>t;t++)if(i=r[t],m(this.nodeMap.get(i),e))return i},getEdge:function(e,t){return h.first(e.links,function(n){return n.getComplement(e)===t})},clear:function(){this.finalGraph=null,this.hyperTree=!this.options.ignoreContainers&&this.options.layoutContainerChildren?new u:null,this.hyperMap=!this.options.ignoreContainers&&this.options.layoutContainerChildren?new c:null,this.nodeMap=new c,this.shapeMap=new c,this.nodes=[],this.edges=[],this.edgeMap=new c,this.ignoredConnections=[],this.ignoredShapes=[],this.finalNodes=[],this.finalLinks=[]},listToRoot:function(e){var t=[],n=e.container;if(!n)return t;for(t.push(n);n.parentContainer;)n=n.parentContainer,t.push(n);return t.reverse(),t},firstNonIgnorableContainer:function(e){return e.isContainer&&!this._isIgnorableItem(e)?e:e.parentContainer?this.firstNonIgnorableContainer(e.parentContainer):null},isContainerConnection:function(e,t){return e.isContainer&&this.isDescendantOf(e,t)?!0:t.isContainer&&this.isDescendantOf(t,e)},isDescendantOf:function(e,t){var n,i,r,o;if(!e.isContainer)throw"Expecting a container.";if(e===t)return!1;if(m(e.children,t))return!0;for(n=[],i=0,r=e.children.length;r>i;i++)o=e.children[i],o.isContainer&&this.isDescendantOf(o,t)&&n.push(o);return n.length>0},isIgnorableItem:function(e){return this.options.ignoreInvisible?e.isCollapsed&&this._isVisible(e)?!1:!e.isCollapsed&&this._isVisible(e)?!1:!0:e.isCollapsed&&!this._isTop(e)},isShapeMapped:function(e){return e.isCollapsed&&!this._isVisible(e)&&!this._isTop(e)},leastCommonAncestor:function(e,t){var n,i,r,o,a,s;if(!e)throw"Parameter should not be null.";if(!t)throw"Parameter should not be null.";if(!this.hyperTree)throw"No hypertree available.";if(n=this.listToRoot(e),i=this.listToRoot(t),r=null,h.isEmpty(n)||h.isEmpty(i))return this.hyperTree.root.data;for(o=n[0],a=i[0],s=0;o===a&&(r=n[s],s++,!(s>=n.length||s>=i.length));)o=n[s],a=i[s];return r?v(this.hyperTree.nodes,function(e){return e.data.container===r}):this.hyperTree.root.data},_isTop:function(e){return!e.parentContainer},_isVisible:function(e){return e.visible()?e.parentContainer?this._isVisible(e.parentContainer):e.visible():!1},_isCollapsed:function(e){return e.isContainer&&e.isCollapsed?!0:e.parentContainer&&this._isCollapsed(e.parentContainer)},_renormalizeShapes:function(){var e,t,n,i;if(!this.options.ignoreContainers)throw"Containers are not supported yet, but stay tuned.";for(e=0,t=this.diagram.shapes.length;t>e;e++)n=this.diagram.shapes[e],this.options.ignoreInvisible&&!this._isVisible(n)||n.isContainer?this.ignoredShapes.push(n):(i=new r(n.id,n),i.isVirtual=!1,this.nodeMap.add(i,[n]),this.nodes.push(i))},_renormalizeConnections:function(){var e,t,n,i,r,a,s,l;if(0!==this.diagram.connections.length)for(e=0,t=this.diagram.connections.length;t>e;e++)if(n=this.diagram.connections[e],this.isIgnorableItem(n))this.ignoredConnections.push(n);else if(i=n.sourceConnector?n.sourceConnector.shape:null,r=n.targetConnector?n.targetConnector.shape:null,i&&r)if(!m(this.ignoredShapes,i)||this.shapeMap.containsKey(i))if(!m(this.ignoredShapes,r)||this.shapeMap.containsKey(r))if(this.shapeMap.containsKey(i)&&(i=this.shapeMap[i]),this.shapeMap.containsKey(r)&&(r=this.shapeMap[r]),a=this.mapShape(i),s=this.mapShape(r),a===s||this.areConnectedAlready(a,s))this.ignoredConnections.push(n);else{if(null===a||null===s)throw"A shape was not mapped to a node.";if(!this.options.ignoreContainers)throw"Containers are not supported yet, but stay tuned.";a.isVirtual||s.isVirtual?this.ignoredConnections.push(n):(l=new o(a,s,n.id,n),this.edgeMap.add(l,[n]),this.edges.push(l))}else this.ignoredConnections.push(n);else this.ignoredConnections.push(n);else this.ignoredConnections.push(n)},areConnectedAlready:function(e,t){return h.any(this.edges,function(n){return n.source===e&&n.target===t||n.source===t&&n.target===e})}}),y=_.extend({init:function(e){var t=this;if(_.fn.init.call(t),h.isUndefined(e))throw"Diagram is not specified.";this.diagram=e},layout:function(e){var t,i,r,o,a,s;if(this.transferOptions(e),t=new w(this.diagram),i=t.convert(e),!i.isEmpty()&&(r=i.getConnectedComponents(),!h.isEmpty(r))){for(o=0;r.length>o;o++)a=r[o],this.layoutGraph(a,e);return s=this.gridLayoutComponents(r),new n.LayoutState(this.diagram,s)}},layoutGraph:function(e,t){var n,i,r;for(h.isDefined(t)&&this.transferOptions(t),this.graph=e,n=9*this.options.nodeDistance,this.temperature=n,i=this._expectedBounds(),this.width=i.width,this.height=i.height,r=0;this.options.iterations>r;r++)this.refineStage=r>=5*this.options.iterations/6,this.tick(),this.temperature=this.refineStage?n/30:n*(1-r/(2*this.options.iterations))},tick:function(){var e,t,n;for(e=0;this.graph.nodes.length>e;e++)this._repulsion(this.graph.nodes[e]);for(e=0;this.graph.links.length>e;e++)this._attraction(this.graph.links[e]);for(e=0;this.graph.nodes.length>e;e++){if(t=this.graph.nodes[e],n=Math.sqrt(t.dx*t.dx+t.dy*t.dy),0===n)return;t.x+=Math.min(n,this.temperature)*t.dx/n,t.y+=Math.min(n,this.temperature)*t.dy/n,this.options.limitToView&&(t.x=Math.min(this.width,Math.max(t.width/2,t.x)),t.y=Math.min(this.height,Math.max(t.height/2,t.y)))}},_shake:function(e){var t=Math.random()*this.options.nodeDistance/4,n=2*Math.random()*Math.PI;e.x+=t*Math.cos(n),e.y-=t*Math.sin(n)},_InverseSquareForce:function(e,t,n){var i,r,o,a,s,l,c;return this.refineStage?(r=t.x-n.x,o=t.y-n.y,a=t.width/2,s=t.height/2,l=n.width/2,c=n.height/2,i=Math.pow(r,2)/Math.pow(a+l+this.options.nodeDistance,2)+Math.pow(o,2)/Math.pow(s+c+this.options.nodeDistance,2)):i=Math.pow(e,2)/Math.pow(this.options.nodeDistance,2),4*i/3},_SquareForce:function(e,t,n){return 1/this._InverseSquareForce(e,t,n)},_repulsion:function(e){e.dx=0,e.dy=0,h.forEach(this.graph.nodes,function(t){var n,i,r,o;if(t!==e){for(;e.x===t.x&&e.y===t.y;)this._shake(t);n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i),o=2*this._SquareForce(r,e,t),e.dx+=n/r*o,e.dy+=i/r*o}},this)},_attraction:function(e){var t,n,i,r,o,a,s=e.target,l=e.source;if(l!==s){for(;l.x===s.x&&l.y===s.y;)this._shake(s);t=l.x-s.x,n=l.y-s.y,i=Math.sqrt(t*t+n*n),r=5*this._InverseSquareForce(i,l,s),o=t/i*r,a=n/i*r,s.dx+=o,s.dy+=a,l.dx-=o,l.dy-=a}},_expectedBounds:function(){var e,t,n,i,r,o=this.graph.nodes.length,a=1.5,s=4;return 0===o?e:(e=h.fold(this.graph.nodes,function(e,t){var n=t.width*t.height;return n>0?e+=Math.sqrt(n):0},0,this),t=e/o,n=t*Math.ceil(Math.sqrt(o)),i=n*Math.sqrt(a),r=n/Math.sqrt(a),{width:i*s,height:r*s})}}),b=t.Class.extend({init:function(e){this.center=null,this.options=e},layout:function(e,t){if(this.graph=e,this.graph.nodes&&0!==this.graph.nodes.length){if(!m(this.graph.nodes,t))throw"The given root is not in the graph.";this.center=t,this.graph.cacheRelationships(),this.layoutSwitch()}},layoutLeft:function(e){var t,n,i,r,o,a,l,c;for(this.setChildrenDirection(this.center,"Left",!1),this.setChildrenLayout(this.center,"Default",!1),t=0,n=0,r=0;e.length>r;r++)o=e[r],o.TreeDirection="Left",a=this.measure(o,s.Empty),n=Math.max(n,a.Width),t+=a.height+this.options.verticalSeparation;for(t-=this.options.verticalSeparation,l=this.center.x-this.options.horizontalSeparation,i=this.center.y+(this.center.height-t)/2,r=0;e.length>r;r++)o=e[r],c=new p(l-o.Size.width,i),this.arrange(o,c),i+=o.Size.height+this.options.verticalSeparation},layoutRight:function(e){var t,n,i,r,o,a,l,c;for(this.setChildrenDirection(this.center,"Right",!1),this.setChildrenLayout(this.center,"Default",!1),t=0,n=0,r=0;e.length>r;r++)o=e[r],o.TreeDirection="Right",a=this.measure(o,s.Empty),n=Math.max(n,a.Width),t+=a.height+this.options.verticalSeparation;for(t-=this.options.verticalSeparation,l=this.center.x+this.options.horizontalSeparation+this.center.width,i=this.center.y+(this.center.height-t)/2,r=0;e.length>r;r++)o=e[r],c=new p(l,i),this.arrange(o,c),i+=o.Size.height+this.options.verticalSeparation},layoutUp:function(e){var t,n,i,r,o,a,l;for(this.setChildrenDirection(this.center,"Up",!1),this.setChildrenLayout(this.center,"Default",!1),t=0,r=0;e.length>r;r++)i=e[r],i.TreeDirection="Up",o=this.measure(i,s.Empty),t+=o.width+this.options.horizontalSeparation;for(t-=this.options.horizontalSeparation,a=this.center.x+this.center.width/2-t/2,r=0;e.length>r;r++)i=e[r],n=this.center.y-this.options.verticalSeparation-i.Size.height,l=new p(a,n),this.arrange(i,l),a+=i.Size.width+this.options.horizontalSeparation},layoutDown:function(e){var t,n,i,r,o,a,l;for(this.setChildrenDirection(this.center,"Down",!1),this.setChildrenLayout(this.center,"Default",!1),i=0,n=0;e.length>n;n++)t=e[n],t.treeDirection="Down",o=this.measure(t,s.Empty),i+=o.width+this.options.horizontalSeparation;for(i-=this.options.horizontalSeparation,a=this.center.x+this.center.width/2-i/2,r=this.center.y+this.options.verticalSeparation+this.center.height,n=0;e.length>n;n++)t=e[n],l=new p(a,r),this.arrange(t,l),a+=t.Size.width+this.options.horizontalSeparation},layoutRadialTree:function(){var e,t;if(this.setChildrenDirection(this.center,"Radial",!1),this.setChildrenLayout(this.center,"Default",!1),this.previousRoot=null,e=this.options.startRadialAngle*g,t=this.options.endRadialAngle*g,e>=t)throw"Final angle should not be less than the start angle.";this.maxDepth=0,this.origin=new p(this.center.x,this.center.y),this.calculateAngularWidth(this.center,0),this.maxDepth>0&&this.radialLayout(this.center,this.options.radialFirstLevelSeparation,e,t),this.center.Angle=t-e},tipOverTree:function(e,t){var n,i,r,o,a,l,c;for(h.isUndefined(t)&&(t=0),this.setChildrenDirection(this.center,"Down",!1),this.setChildrenLayout(this.center,"Default",!1),this.setChildrenLayout(this.center,"Underneath",!1,t),n=0,o=0;e.length>o;o++)r=e[o],r.TreeDirection="Down",a=this.measure(r,s.Empty),n+=a.width+this.options.horizontalSeparation;for(n-=this.options.horizontalSeparation,n-=e[e.length-1].width,n+=e[e.length-1].associatedShape.bounds().width,l=this.center.x+this.center.width/2-n/2,i=this.center.y+this.options.verticalSeparation+this.center.height,o=0;e.length>o;o++)r=e[o],c=new p(l,i),this.arrange(r,c),l+=r.Size.width+this.options.horizontalSeparation},calculateAngularWidth:function(e,t){var n,i,r,o,a,s,l;if(t>this.maxDepth&&(this.maxDepth=t),n=0,i=1e3,r=1e3,o=0===t?0:Math.sqrt(i*i+r*r)/t,e.children.length>0){for(a=0,s=e.children.length;s>a;a++)l=e.children[a],n+=this.calculateAngularWidth(l,t+1);n=Math.max(o,n)}else n=o;return e.sectorAngle=n,n},sortChildren:function(e){var t,n,i,r,o,a,s,l,c,d,u,f=0;if(e.parents.length>1)throw"Node is not part of a tree.";if(n=e.parents[0],n&&(i=new p(n.x,n.y),r=new p(e.x,e.y),f=this.normalizeAngle(Math.atan2(i.y-r.y,i.x-r.x))),o=e.children.length,0===o)return null;for(a=[],s=[],t=0;o>t;++t)l=e.children[t],c=new p(l.x,l.y),s[t]=t,a[t]=this.normalizeAngle(-f+Math.atan2(c.y-c.y,c.x-c.x));for(h.bisort(a,s),d=[],u=e.children,t=0;o>t;++t)d.push(u[s[t]]);return d},normalizeAngle:function(e){for(;e>2*Math.PI;)e-=2*Math.PI;for(;0>e;)e+=2*Math.PI;return e},radialLayout:function(e,t,n,i){var r,o,a,s,l,c=i-n,d=c/2,u=e.sectorAngle,h=0,p=this.sortChildren(e);for(r=0,o=p.length;o>r;r++)a=p[r],s=a,l=s.sectorAngle/u,a.children.length>0&&this.radialLayout(a,t+this.options.radialSeparation,n+h*c,n+(h+l)*c),this.setPolarLocation(a,t,n+h*c+l*d),s.angle=l*c,h+=l},setPolarLocation:function(e,t,n){e.x=this.origin.x+t*Math.cos(n),e.y=this.origin.y+t*Math.sin(n),e.BoundingRectangle=new l(e.x,e.y,e.width,e.height)},setChildrenDirection:function(e,t,n){var i=e.treeDirection;this.graph.depthFirstTraversal(e,function(e){e.treeDirection=t}),n||(e.treeDirection=i)},setChildrenLayout:function(e,t,n,i){h.isUndefined(i)&&(i=0);var r=e.childrenLayout;i>0?(this.graph.assignLevels(e),this.graph.depthFirstTraversal(e,function(e){e.level>=i+1&&(e.childrenLayout=t)})):(this.graph.depthFirstTraversal(e,function(e){e.childrenLayout=t}),n||(e.childrenLayout=r))},measure:function(e,t){var n,i,r,o,a,l,c,d=0,u=0,p=new s(0,0);if(!e)throw"";if(i=e.associatedShape.bounds(),r=i.width,o=i.height,1!==e.parents.length)throw"Node not in a spanning tree.";if(a=e.parents[0],"Undefined"===e.treeDirection&&(e.treeDirection=a.treeDirection),h.isEmpty(e.children))p=new s(Math.abs(r)<f?50:r,Math.abs(o)<f?25:o);else if(1===e.children.length){switch(e.treeDirection){case"Radial":n=this.measure(e.children[0],t),d=r+this.options.radialSeparation*Math.cos(e.AngleToParent)+n.width,u=o+Math.abs(this.options.radialSeparation*Math.sin(e.AngleToParent))+n.height;break;case"Left":case"Right":switch(e.childrenLayout){case"TopAlignedWithParent":break;case"BottomAlignedWithParent":break;case"Underneath":n=this.measure(e.children[0],t),d=r+n.width+this.options.underneathHorizontalOffset,u=o+this.options.underneathVerticalTopOffset+n.height;break;case"Default":n=this.measure(e.children[0],t),d=r+this.options.horizontalSeparation+n.width,u=Math.max(o,n.height);break;default:throw"Unhandled TreeDirection in the Radial layout measuring."}break;case"Up":case"Down":switch(e.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":n=this.measure(e.children[0],t),d=Math.max(r,n.width+this.options.underneathHorizontalOffset),u=o+this.options.underneathVerticalTopOffset+n.height;break;case"Default":n=this.measure(e.children[0],t),u=o+this.options.verticalSeparation+n.height,d=Math.max(r,n.width);break;default:throw"Unhandled TreeDirection in the Down layout measuring."}break;default:throw"Unhandled TreeDirection in the layout measuring."}p=new s(d,u)}else{switch(e.treeDirection){case"Left":case"Right":switch(e.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":for(d=r,u=o+this.options.underneathVerticalTopOffset,l=0;e.children.length>l;l++)c=e.children[l],n=this.measure(c,t),d=Math.max(d,n.width+this.options.underneathHorizontalOffset),u+=n.height+this.options.underneathVerticalSeparation;u-=this.options.underneathVerticalSeparation;break;case"Default":for(d=r,u=0,l=0;e.children.length>l;l++)c=e.children[l],n=this.measure(c,t),d=Math.max(d,r+this.options.horizontalSeparation+n.width),u+=n.height+this.options.verticalSeparation;u-=this.options.verticalSeparation;break;default:throw"Unhandled TreeDirection in the Right layout measuring."}break;case"Up":case"Down":switch(e.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":for(d=r,u=o+this.options.underneathVerticalTopOffset,l=0;e.children.length>l;l++)c=e.children[l],n=this.measure(c,t),d=Math.max(d,n.width+this.options.underneathHorizontalOffset),u+=n.height+this.options.underneathVerticalSeparation;u-=this.options.underneathVerticalSeparation;break;case"Default":for(d=0,u=0,l=0;e.children.length>l;l++)c=e.children[l],n=this.measure(c,t),d+=n.width+this.options.horizontalSeparation,u=Math.max(u,n.height+this.options.verticalSeparation+o);d-=this.options.horizontalSeparation;break;default:throw"Unhandled TreeDirection in the Down layout measuring."}break;default:throw"Unhandled TreeDirection in the layout measuring."}p=new s(d,u)}return e.SectorAngle=Math.sqrt(d*d/4+u*u/4),e.Size=p,p},arrange:function(e,t){var n,i,r,o,a,s,c,d,u=e.associatedShape.bounds(),g=u.width,m=u.height;if(h.isEmpty(e.children))e.x=t.x,e.y=t.y,e.BoundingRectangle=new l(t.x,t.y,g,m);else switch(e.treeDirection){case"Left":switch(e.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":for(d=t,e.x=d.x,e.y=d.y,e.BoundingRectangle=new l(e.x,e.y,e.width,e.height),c=t.y+m+this.options.underneathVerticalTopOffset,n=0;o.children.length>n;n++)o=o.children[n],s=d.x-o.associatedShape.width-this.options.underneathHorizontalOffset,i=new p(s,c),this.arrange(o,i),c+=o.Size.height+this.options.underneathVerticalSeparation;break;case"Default":for(d=new p(t.x+e.Size.width-g,t.y+(e.Size.height-m)/2),e.x=d.x,e.y=d.y,e.BoundingRectangle=new l(e.x,e.y,e.width,e.height),s=d.x-this.options.horizontalSeparation,c=t.y,n=0;e.children.length>n;n++)o=e.children[n],i=new p(s-o.Size.width,c),this.arrange(o,i),c+=o.Size.height+this.options.verticalSeparation;break;default:throw"Unsupported TreeDirection"}break;case"Right":switch(e.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":for(d=t,e.x=d.x,e.y=d.y,e.BoundingRectangle=new l(e.x,e.y,e.width,e.height),s=t.x+g+this.options.underneathHorizontalOffset,c=t.y+m+this.options.underneathVerticalTopOffset,n=0;e.children.length>n;n++)o=e.children[n],i=new p(s,c),this.arrange(o,i),c+=o.Size.height+this.options.underneathVerticalSeparation;break;case"Default":for(d=new p(t.x,t.y+(e.Size.height-m)/2),e.x=d.x,e.y=d.y,e.BoundingRectangle=new l(e.x,e.y,e.width,e.height),s=t.x+g+this.options.horizontalSeparation,c=t.y,n=0;e.children.length>n;n++)o=e.children[n],i=new p(s,c),this.arrange(o,i),c+=o.Size.height+this.options.verticalSeparation;break;default:throw"Unsupported TreeDirection"}break;case"Up":if(d=new p(t.x+(e.Size.width-g)/2,t.y+e.Size.height-m),e.x=d.x,e.y=d.y,e.BoundingRectangle=new l(e.x,e.y,e.width,e.height),Math.abs(d.x-t.x)<f){for(a=0,n=0;e.children.length>n;n++)r=e.children[n],a+=r.Size.width+this.options.horizontalSeparation;a-=this.options.horizontalSeparation,s=t.x+(g-a)/2}else s=t.x;for(n=0;e.children.length>n;n++)o=e.children[n],c=d.y-this.options.verticalSeparation-o.Size.height,i=new p(s,c),this.arrange(o,i),s+=o.Size.width+this.options.horizontalSeparation;break;case"Down":switch(e.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":for(d=t,e.x=d.x,e.y=d.y,e.BoundingRectangle=new l(e.x,e.y,e.width,e.height),s=t.x+this.options.underneathHorizontalOffset,c=t.y+m+this.options.underneathVerticalTopOffset,n=0;e.children.length>n;n++)o=e.children[n],i=new p(s,c),this.arrange(o,i),c+=o.Size.height+this.options.underneathVerticalSeparation;break;case"Default":if(d=new p(t.x+(e.Size.width-g)/2,t.y),e.x=d.x,e.y=d.y,e.BoundingRectangle=new l(e.x,e.y,e.width,e.height),Math.abs(d.x-t.x)<f){for(a=0,n=0;e.children.length>n;n++)r=e.children[n],a+=r.Size.width+this.options.horizontalSeparation;a-=this.options.horizontalSeparation,s=t.x+(g-a)/2}else s=t.x;for(n=0;e.children.length>n;n++)o=e.children[n],c=d.y+this.options.verticalSeparation+m,i=new p(s,c),this.arrange(o,i),s+=o.Size.width+this.options.horizontalSeparation;break;default:throw"Unsupported TreeDirection"}break;case"None":break;default:throw"Unsupported TreeDirection"}},layoutSwitch:function(){var e,t,n,i,r,o;if(this.center&&!h.isEmpty(this.center.children))switch(e=this.options.subtype,h.isUndefined(e)&&(e="Down"),o=this.center.children,e.toLowerCase()){case"radial":case"radialtree":this.layoutRadialTree();break;case"mindmaphorizontal":case"mindmap":t=this.center.children,1===this.center.children.length?this.layoutRight(t):(r=o.length/2,n=v(this.center.children,function(e){return h.indexOf(o,e)<r}),i=v(this.center.children,function(e){return h.indexOf(o,e)>=r}),this.layoutLeft(n),this.layoutRight(i));break;case"mindmapvertical":t=this.center.children,1===this.center.children.length?this.layoutDown(t):(r=o.length/2,n=v(this.center.children,function(e){return h.indexOf(o,e)<r}),i=v(this.center.children,function(e){return h.indexOf(o,e)>=r}),this.layoutUp(n),this.layoutDown(i));break;case"right":this.layoutRight(this.center.children);break;case"left":this.layoutLeft(this.center.children);break;case"up":case"bottom":this.layoutUp(this.center.children);break;case"down":case"top":this.layoutDown(this.center.children);break;case"tipover":case"tipovertree":if(0>this.options.tipOverTreeStartLevel)throw"The tip-over level should be a positive integer.";this.tipOverTree(this.center.children,this.options.tipOverTreeStartLevel);break;case"undefined":case"none":}}}),k=_.extend({init:function(e){var t=this;if(_.fn.init.call(t),h.isUndefined(e))throw"No diagram specified.";this.diagram=e},layout:function(e){var t,i;return this.transferOptions(e),t=new w(this.diagram),this.graph=t.convert(),i=this.layoutComponents(),new n.LayoutState(this.diagram,i)},layoutComponents:function(){var e,t,n,i,r,o,a,s;if(!this.graph.isEmpty()&&(e=this.graph.getConnectedComponents(),!h.isEmpty(e))){for(t=new b(this.options),n=[],i=0;e.length>i;i++){if(r=e[i],o=this.getTree(r),!o)throw"Failed to find a spanning tree for the component.";a=o.root,s=o.tree,t.layout(s,a),n.push(s)}return this.gridLayoutComponents(n)}},getTree:function(e){var t,n,i,r,o,a=null;if(this.options.roots&&this.options.roots.length>0)for(t=0,n=e.nodes.length;n>t;t++)for(i=e.nodes[t],r=0;this.options.roots.length>r;r++)if(o=this.options.roots[r],o===i.associatedShape){a=i;break}if(!a&&(a=e.root(),!a))throw"Unable to find a root for the tree.";return this.getTreeForRoot(e,a)},getTreeForRoot:function(e,t){var n=e.getSpanningTree(t);return h.isUndefined(n)||n.isEmpty()?null:{tree:n,root:n.root}}}),x=_.extend({init:function(e){var t=this;if(_.fn.init.call(t),h.isUndefined(e))throw"Diagram is not specified.";this.diagram=e},layout:function(e){var t,i,r,o,a,s;if(this.transferOptions(e),t=new w(this.diagram),i=t.convert(e),!i.isEmpty()&&(r=i.getConnectedComponents(),!h.isEmpty(r))){for(o=0;r.length>o;o++)a=r[o],this.layoutGraph(a,e);return s=this.gridLayoutComponents(r),new n.LayoutState(this.diagram,s)}},_initRuntimeProperties:function(){var e,t;for(e=0;this.graph.nodes.length>e;e++)t=this.graph.nodes[e],t.layer=-1,t.downstreamLinkCount=0,t.upstreamLinkCount=0,t.isVirtual=!1,t.uBaryCenter=0,t.dBaryCenter=0,t.upstreamPriority=0,t.downstreamPriority=0,t.gridPosition=0},_prepare:function(e){var t,n,i,r,o,a,s,l,d,u,p,f,g=[];for(n=0;e.links.length>n;n++)e.links[n].depthOfDumminess=0;for(r=new c,h.forEach(e.nodes,function(e){0===e.incoming.length&&(r.set(e,0),g.push(e))});g.length>0;)for(o=g.shift(),t=0;o.outgoing.length>t;t++)i=o.outgoing[t],a=i.target,r.containsKey(a)?r.set(a,Math.max(r.get(o)+1,r.get(a))):r.set(a,r.get(o)+1),m(g,a)||g.push(a);for(s=0,r.forEachValue(function(e){s=Math.max(s,e)}),l=[],h.addRange(l,r.keys()),l.sort(function(e,t){var n=r.get(e),i=r.get(t);return h.sign(i-n)}),d=0;l.length>d;++d)if(u=l[d],p=Number.MAX_VALUE,0!==u.outgoing.length){for(n=0;u.outgoing.length>n;++n)i=u.outgoing[n],p=Math.min(p,r.get(i.target));p>1&&r.set(u,p-1)}for(this.layers=[],t=0;s+1>t;t++)this.layers.push([]);for(r.forEach(function(e,t){e.layer=t,this.layers[t].push(e)},this),n=0;this.layers.length>n;n++)for(f=this.layers[n],t=0;f.length>t;t++)f[t].gridPosition=t},layoutGraph:function(e,t){if(h.isUndefined(e))throw"No graph given or graph analysis of the diagram failed.";h.isDefined(t)&&this.transferOptions(t),this.graph=e,e.setItemIndices();var n=e.makeAcyclic();this._initRuntimeProperties(),this._prepare(e,t),this._dummify(),this._optimizeCrossings(),this._swapPairs(),this.arrangeNodes(),this._moveThingsAround(),this._dedummify(),h.forEach(n,function(e){e.points&&e.points.reverse()})},setMinDist:function(e,t,n){var i=e.layer,r=e.layerIndex;this.minDistances[i][r]=n},getMinDist:function(e,t){var n,i=0,r=e.layerIndex,o=t.layerIndex,a=e.layer,s=Math.min(r,o),l=Math.max(r,o);for(n=s;l>n;++n)i+=this.minDistances[a][n];return i},placeLeftToRight:function(e){var t,n,i,r,o,a,s,l,d,u,p=new c;for(i=0;this.layers.length>i;++i)if(r=e[i]){for(t=0;r.length>t;t++)n=r[t],p.containsKey(n)||this.placeLeft(n,p,i);for(o=Number.POSITIVE_INFINITY,t=0;r.length>t;t++)n=r[t],a=this.rightSibling(n),a&&this.nodeLeftClass.get(a)!==i&&(o=Math.min(o,p.get(a)-p.get(n)-this.getMinDist(n,a)));if(o===Number.POSITIVE_INFINITY){for(s=[],t=0;r.length>t;t++)for(n=r[t],l=[],h.addRange(l,this.upNodes.get(n)),h.addRange(l,this.downNodes.get(n)),d=0;l.length>d;d++)u=l[d],this.nodeLeftClass.get(u)<i&&s.push(p.get(u)-p.get(n));s.sort(),o=0===s.length?0:s.length%2===1?s[this.intDiv(s.length,2)]:(s[this.intDiv(s.length,2)-1]+s[this.intDiv(s.length,2)])/2}for(t=0;r.length>t;t++)n=r[t],p.set(n,p.get(n)+o)}return p},placeRightToLeft:function(e){var t,n,i,r,o,a,s,l,d,u,p=new c;for(i=0;this.layers.length>i;++i)if(r=e[i]){for(t=0;r.length>t;t++)n=r[t],p.containsKey(n)||this.placeRight(n,p,i);for(o=Number.NEGATIVE_INFINITY,t=0;r.length>t;t++)n=r[t],a=this.leftSibling(n),a&&this.nodeRightClass.get(a)!==i&&(o=Math.max(o,p.get(a)-p.get(n)+this.getMinDist(a,n)));if(o===Number.NEGATIVE_INFINITY){for(s=[],t=0;r.length>t;t++)for(n=r[t],l=[],h.addRange(l,this.upNodes.get(n)),h.addRange(l,this.downNodes.get(n)),d=0;l.length>d;d++)u=l[d],this.nodeRightClass.get(u)<i&&s.push(p.get(n)-p.get(u));s.sort(),o=0===s.length?0:s.length%2===1?s[this.intDiv(s.length,2)]:(s[this.intDiv(s.length,2)-1]+s[this.intDiv(s.length,2)])/2}for(t=0;r.length>t;t++)n=r[t],p.set(n,p.get(n)+o)}return p},_getLeftWing:function(){var e={value:null},t=this.computeClasses(e,1);return this.nodeLeftClass=e.value,t},_getRightWing:function(){var e={value:null},t=this.computeClasses(e,-1);return this.nodeRightClass=e.value,t},computeClasses:function(e,t){var n,i,r,o,a,s,l,d,u,h=0,p=e.value=new c;for(n=0;this.layers.length>n;++n)for(h=n,i=this.layers[n],r=1===t?0:i.length-1;r>=0&&i.length>r;r+=t)if(o=i[r],p.containsKey(o))h=p.get(o);else if(p.set(o,h),o.isVirtual)for(a=this._nodesInLink(o),s=0;a.length>s;s++)l=a[s],p.set(l,h);for(d=[],u=0;this.layers.length>u;u++)d.push(null);return p.forEach(function(e,t){null===d[t]&&(d[t]=[]),d[t].push(e)}),d},_isVerticalLayout:function(){return"up"===this.options.subtype.toLowerCase()||"down"===this.options.subtype.toLowerCase()||"vertical"===this.options.subtype.toLowerCase()},_isHorizontalLayout:function(){return"right"===this.options.subtype.toLowerCase()||"left"===this.options.subtype.toLowerCase()||"horizontal"===this.options.subtype.toLowerCase()},_isIncreasingLayout:function(){return"right"===this.options.subtype.toLowerCase()||"down"===this.options.subtype.toLowerCase()},_moveThingsAround:function(){function e(e,t){var n,i,r=Number.MIN_VALUE;for(n=0;e.length>n;++n)i=e[n],r=t._isVerticalLayout()?Math.max(r,i.height):Math.max(r,i.width);return r}var t,n,i,r,o,a,s,l,d,u,p,f,g,m,v,_,w,y,b,k,x,C,T,S,D,A,E;for(n=0;this.layers.length>n;++n)r=this.layers[n],r.sort(this._gridPositionComparer);
for(this.minDistances=[],n=0;this.layers.length>n;++n)for(r=this.layers[n],this.minDistances[n]=[],o=0;r.length>o;++o)i=r[o],i.layerIndex=o,this.minDistances[n][o]=this.options.nodeDistance,r.length-1>o&&(this.minDistances[n][o]+=this._isVerticalLayout()?(i.width+r[o+1].width)/2:(i.height+r[o+1].height)/2);for(this.downNodes=new c,this.upNodes=new c,h.forEach(this.graph.nodes,function(e){this.downNodes.set(e,[]),this.upNodes.set(e,[])},this),h.forEach(this.graph.links,function(e){var t=e.source,n=e.target,i=null,r=null;t.layer>n.layer?(i=e.source,r=e.target):(r=e.source,i=e.target),this.downNodes.get(r).push(i),this.upNodes.get(i).push(r)},this),this.downNodes.forEachValue(function(e){e.sort(this._gridPositionComparer)},this),this.upNodes.forEachValue(function(e){e.sort(this._gridPositionComparer)},this),n=0;this.layers.length-1>n;++n)for(r=this.layers[n],a=0;r.length-1>a;a++)if(s=r[a],s.isVirtual&&(l=this.downNodes.get(s)[0],l.isVirtual))for(o=a+1;r.length>o;++o)i=r[o],i.isVirtual&&(d=this.downNodes.get(i)[0],d.isVirtual&&l.gridPosition>d.gridPosition&&(u=l.gridPosition,l.gridPosition=d.gridPosition,d.gridPosition=u,p=l.layerIndex,f=d.layerIndex,this.layers[n+1][p]=d,this.layers[n+1][f]=l,l.layerIndex=f,d.layerIndex=p));for(g=this._getLeftWing(),m=this._getRightWing(),v=this.placeLeftToRight(g),_=this.placeRightToLeft(m),w=new c,h.forEach(this.graph.nodes,function(e){w.set(e,(v.get(e)+_.get(e))/2)}),y=new c,b=new c,n=0;this.layers.length>n;++n)for(r=this.layers[n],k=-1,x=-1,o=0;r.length>o;++o)i=r[o],y.set(i,0),b.set(i,!1),i.isVirtual&&(-1===k?k=o:k===o-1?k=o:(x=o,y.set(r[k],0),w.get(i)-w.get(r[k])===this.getMinDist(r[k],i)?b.set(r[k],!0):b.set(r[k],!1),k=o));for(C=[1,-1],h.forEach(C,function(e){var n,i,r,o,a,s,l,c=1===e?0:this.layers.length-1;for(n=c;n>=0&&this.layers.length>n;n+=e){if(i=this.layers[n],r=this._firstVirtualNode(i),o=null,a=null,-1!==r)for(o=i[r],a=[],t=0;r>t;t++)a.push(i[t]);else o=null,a=i;if(a.length>0){for(this._sequencer(w,null,o,e,a),t=0;a.length-1>t;++t)this.setMinDist(a[t],a[t+1],w.get(a[t+1])-w.get(a[t]));o&&this.setMinDist(a[a.length-1],o,w.get(o)-w.get(a[a.length-1]))}for(;o;){if(s=this.nextVirtualNode(i,o)){if(y.get(o)===e){for(r=o.layerIndex,l=s.layerIndex,a=[],t=r+1;l>t;t++)a.push(i[t]);a.length>0&&this._sequencer(w,o,s,e,a),b.set(o,!0)}}else{for(r=o.layerIndex,a=[],t=r+1;i.length>t;t++)a.push(i[t]);if(a.length>0){for(this._sequencer(w,o,null,e,a),t=0;a.length-1>t;++t)this.setMinDist(a[t],a[t+1],w.get(a[t+1])-w.get(a[t]));this.setMinDist(o,a[0],w.get(a[0])-w.get(o))}}o=s}this.adjustDirections(n,e,y,b)}},this),T=this._isIncreasingLayout()?0:this.layers.length-1,S=function(e,t){return t._isIncreasingLayout()?t.layers.length>e:e>=0},D=this._isIncreasingLayout()?1:-1,A=0,t=T;S(t,this);t+=D){for(r=this.layers[t],E=e(r,this),o=0;r.length>o;++o)i=r[o],this._isVerticalLayout()?(i.x=w.get(i),i.y=A+E/2):(i.x=A+E/2,i.y=w.get(i));A+=this.options.layerSeparation+E}},adjustDirections:function(e,t,n,i){var r,o,a,s,l,c,d,u,h,p,f,g,m,v;if(!(0>e+t||e+t>=this.layers.length))for(r=null,o=null,a=this.layers[e+t],s=0;a.length>s;++s)if(l=a[s],l.isVirtual&&(c=this.getNeighborOnLayer(l,e),c.isVirtual)){if(r){for(d=i.get(o),u=this.layers[e],h=o.layerIndex,p=c.layerIndex,f=h+1;p>f;++f)u[f].isVirtual&&(d=d&&i.get(u[f]));if(d)for(n.set(r,t),g=r.layerIndex,m=l.layerIndex,v=g+1;m>v;++v)a[v].isVirtual&&n.set(a[v],t)}r=l,o=c}},getNeighborOnLayer:function(e,t){var n=this.upNodes.get(e)[0];return n.layer===t?n:(n=this.downNodes.get(e)[0],n.layer===t?n:null)},_sequencer:function(e,t,n,i,r){if(1===r.length&&this._sequenceSingle(e,t,n,i,r[0]),r.length>1){var o=r.length,a=this.intDiv(o,2);this._sequencer(e,t,n,i,r.slice(0,a)),this._sequencer(e,t,n,i,r.slice(a)),this.combineSequences(e,t,n,i,r)}},_sequenceSingle:function(e,t,n,i,r){var o=-1===i?this.downNodes.get(r):this.upNodes.get(r),a=o.length;0!==a&&(a%2===1?e.set(r,e.get(o[this.intDiv(a,2)])):e.set(r,(e.get(o[this.intDiv(a,2)-1])+e.get(o[this.intDiv(a,2)]))/2),t&&e.set(r,Math.max(e.get(r),e.get(t)+this.getMinDist(t,r))),n&&e.set(r,Math.min(e.get(r),e.get(n)-this.getMinDist(r,n))))},combineSequences:function(e,t,n,i,r){var o,a,s,l,c,d,u,h,p,f,g=r.length,m=this.intDiv(g,2),v=[];for(o=0;m>o;++o){for(a=0,l=-1===i?this.downNodes.get(r[o]):this.upNodes.get(r[o]),s=0;l.length>s;++s)c=l[s],e.get(c)>=e.get(r[o])?a++:(a--,v.push({k:e.get(c)+this.getMinDist(r[o],r[m-1]),v:2}));v.push({k:e.get(r[o])+this.getMinDist(r[o],r[m-1]),v:a})}for(t&&v.push({k:e.get(t)+this.getMinDist(t,r[m-1]),v:Number.MAX_VALUE}),v.sort(this._positionDescendingComparer),u=[],o=m;g>o;++o){for(a=0,l=-1===i?this.downNodes.get(r[o]):this.upNodes.get(r[o]),s=0;l.length>s;++s)c=l[s],e.get(c)<=e.get(r[o])?a++:(a--,u.push({k:e.get(c)-this.getMinDist(r[o],r[m]),v:2}));u.push({k:e.get(r[o])-this.getMinDist(r[o],r[m]),v:a})}for(n&&u.push({k:e.get(n)-this.getMinDist(n,r[m]),v:Number.MAX_VALUE}),u.sort(this._positionAscendingComparer),h=0,p=0,f=this.getMinDist(r[m-1],r[m]);e.get(r[m])-e.get(r[m-1])<f;)if(p>h){if(0===v.length){e.set(r[m-1],e.get(r[m])-f);break}d=v.shift(),h+=d.v,e.set(r[m-1],d.k),e.set(r[m-1],Math.max(e.get(r[m-1]),e.get(r[m])-f))}else{if(0===u.length){e.set(r[m],e.get(r[m-1])+f);break}d=u.shift(),p+=d.v,e.set(r[m],d.k),e.set(r[m],Math.min(e.get(r[m]),e.get(r[m-1])+f))}for(o=m-2;o>=0;o--)e.set(r[o],Math.min(e.get(r[o]),e.get(r[m-1])-this.getMinDist(r[o],r[m-1])));for(o=m+1;g>o;o++)e.set(r[o],Math.max(e.get(r[o]),e.get(r[m])+this.getMinDist(r[o],r[m])))},placeLeft:function(e,t,n){var i=Number.NEGATIVE_INFINITY;h.forEach(this._getComposite(e),function(e){var r=this.leftSibling(e);r&&this.nodeLeftClass.get(r)===this.nodeLeftClass.get(e)&&(t.containsKey(r)||this.placeLeft(r,t,n),i=Math.max(i,t.get(r)+this.getMinDist(r,e)))},this),i===Number.NEGATIVE_INFINITY&&(i=0),h.forEach(this._getComposite(e),function(e){t.set(e,i)})},placeRight:function(e,t,n){var i=Number.POSITIVE_INFINITY;h.forEach(this._getComposite(e),function(e){var r=this.rightSibling(e);r&&this.nodeRightClass.get(r)===this.nodeRightClass.get(e)&&(t.containsKey(r)||this.placeRight(r,t,n),i=Math.min(i,t.get(r)-this.getMinDist(e,r)))},this),i===Number.POSITIVE_INFINITY&&(i=0),h.forEach(this._getComposite(e),function(e){t.set(e,i)})},leftSibling:function(e){var t=this.layers[e.layer],n=e.layerIndex;return 0===n?null:t[n-1]},rightSibling:function(e){var t=this.layers[e.layer],n=e.layerIndex;return n===t.length-1?null:t[n+1]},_getComposite:function(e){return e.isVirtual?this._nodesInLink(e):[e]},arrangeNodes:function(){var e,t,n,i,r,o,a,s;for(t=0;this.layers.length>t;t++)for(i=this.layers[t],n=0;i.length>n;n++)r=i[n],r.upstreamPriority=r.upstreamLinkCount,r.downstreamPriority=r.downstreamLinkCount;for(o=2,a=0;o>a;a++){for(e=this.layers.length-1;e>=1;e--)this.layoutLayer(!1,e);for(e=0;this.layers.length-1>e;e++)this.layoutLayer(!0,e)}for(s=Number.MAX_VALUE,t=0;this.layers.length>t;t++)for(i=this.layers[t],n=0;i.length>n;n++)r=i[n],s=Math.min(s,r.gridPosition);if(0>s)for(t=0;this.layers.length>t;t++)for(i=this.layers[t],n=0;i.length>n;n++)r=i[n],r.gridPosition=r.gridPosition-s},layoutLayer:function(e,t){var n,i,r,o;for(i=e?this.layers[n=t+1]:this.layers[n=t-1],r=[],o=0;i.length>o;o++)r.push(i[o]);r.sort(function(e,t){var n=(e.upstreamPriority+e.downstreamPriority)/2,i=(t.upstreamPriority+t.downstreamPriority)/2;return Math.abs(n-i)<1e-4?0:i>n?1:-1}),h.forEach(r,function(e){var t=e.gridPosition,n=this.calcBaryCenter(e),r=(e.upstreamPriority+e.downstreamPriority)/2;if(!(Math.abs(t-n)<1e-4||Math.abs(t-n)<.2501))if(n>t)for(;n>t&&this.moveRight(e,i,r);)t=e.gridPosition;else for(;t>n&&this.moveLeft(e,i,r);)t=e.gridPosition},this),n>0&&this.calcDownData(n-1),this.layers.length-1>n&&this.calcUpData(n+1)},moveRight:function(e,t,n){var i,r,o=h.indexOf(t,e);return o===t.length-1?(e.gridPosition=e.gridPosition+.5,!0):(i=t[o+1],r=(i.upstreamPriority+i.downstreamPriority)/2,i.gridPosition>e.gridPosition+1?(e.gridPosition=e.gridPosition+.5,!0):r>n||Math.abs(r-n)<1e-4?!1:this.moveRight(i,t,n)?(e.gridPosition=e.gridPosition+.5,!0):!1)},moveLeft:function(e,t,n){var i,r,o=h.indexOf(t,e);return 0===o?(e.gridPosition=e.gridPosition-.5,!0):(i=t[o-1],r=(i.upstreamPriority+i.downstreamPriority)/2,e.gridPosition-1>i.gridPosition?(e.gridPosition=e.gridPosition-.5,!0):r>n||Math.abs(r-n)<1e-4?!1:this.moveLeft(i,t,n)?(e.gridPosition=e.gridPosition-.5,!0):!1)},mapVirtualNode:function(e,t){this.nodeToLinkMap.set(e,t),this.linkToNodeMap.containsKey(t)||this.linkToNodeMap.set(t,[]),this.linkToNodeMap.get(t).push(e)},_nodesInLink:function(e){return this.linkToNodeMap.get(this.nodeToLinkMap.get(e))},_dummify:function(){var e,t,n,i,a,s,l,d,u,p,f,g,m,v,_,w,y,b;for(this.linkToNodeMap=new c,this.nodeToLinkMap=new c,u=this.graph.links.slice(0),d=0;u.length>d;d++){if(p=u[d],f=p.source,g=p.target,m=f.layer,v=g.layer,_=f.gridPosition,w=g.gridPosition,y=(w-_)/Math.abs(v-m),b=f,m-v>1){for(l=m-1;l>v;l--){for(n=new r,n.x=f.x,n.y=f.y,n.width=f.width/100,n.height=f.height/100,e=this.layers[l],t=(l-v)*y+_,t>e.length&&(t=e.length),_>=this.layers[m].length-1&&w>=this.layers[v].length-1?t=e.length:0===_&&0===w&&(t=0),n.layer=l,n.uBaryCenter=0,n.dBaryCenter=0,n.upstreamLinkCount=0,n.downstreamLinkCount=0,n.gridPosition=t,n.isVirtual=!0,h.insert(e,n,t),a=t+1;e.length>a;a++)i=e[a],i.gridPosition=i.gridPosition+1;s=new o(b,n),s.depthOfDumminess=0,b=n,this.graph.nodes.push(n),this.graph.addLink(s),n.index=this.graph.nodes.length-1,this.mapVirtualNode(n,p)}p.changeSource(b),p.depthOfDumminess=m-v-1}if(-1>m-v){for(l=m+1;v>l;l++){for(n=new r,n.x=f.x,n.y=f.y,n.width=f.width/100,n.height=f.height/100,e=this.layers[l],t=(l-m)*y+_,t>e.length&&(t=e.length),_>=this.layers[m].length-1&&w>=this.layers[v].length-1?t=e.length:0===_&&0===w&&(t=0),n.layer=l,n.uBaryCenter=0,n.dBaryCenter=0,n.upstreamLinkCount=0,n.downstreamLinkCount=0,n.gridPosition=t,n.isVirtual=!0,t&=t,h.insert(e,n,t),a=t+1;e.length>a;a++)i=e[a],i.gridPosition=i.gridPosition+1;s=new o(b,n),s.depthOfDumminess=0,b=n,this.graph.nodes.push(n),this.graph.addLink(s),n.index=this.graph.nodes.length-1,this.mapVirtualNode(n,p)}p.changeSource(b),p.depthOfDumminess=v-m-1}}},_dedummify:function(){for(var e,t,n,i,r,o,a,s,l=!0;l;)for(l=!1,e=0;this.graph.links.length>e;e++)if(t=this.graph.links[e],0!==t.depthOfDumminess){for(n=[],n.unshift({x:t.target.x,y:t.target.y}),n.unshift({x:t.source.x,y:t.source.y}),i=t,r=t.depthOfDumminess,o=0;r>o;o++)a=i.source,s=a.incoming[0],n.unshift({x:s.source.x,y:s.source.y}),i=s;t.changeSource(i.source),t.depthOfDumminess=0,n.length>2?(n.splice(0,1),n.splice(n.length-1),t.points=n):t.points=[],l=!0;break}},_optimizeCrossings:function(){for(var e,t=-1,n=3,i=0;0!==t&&!(i++>n);){for(t=0,e=this.layers.length-1;e>=1;e--)t+=this.optimizeLayerCrossings(!1,e);for(e=0;this.layers.length-1>e;e++)t+=this.optimizeLayerCrossings(!0,e)}},calcUpData:function(e){var t,n,i,r,o,a,s,l,c;if(0!==e){for(t=this.layers[e],o=new d,a=this.layers[e-1],n=0;a.length>n;n++)o.add(a[n]);for(n=0;t.length>n;n++){for(s=t[n],l=0,c=0,i=0;s.incoming.length>i;i++)r=s.incoming[i],o.contains(r.source)&&(c++,l+=r.source.gridPosition);for(i=0;s.outgoing.length>i;i++)r=s.outgoing[i],o.contains(r.target)&&(c++,l+=r.target.gridPosition);c>0?(s.uBaryCenter=l/c,s.upstreamLinkCount=c):(s.uBaryCenter=n,s.upstreamLinkCount=0)}}},calcDownData:function(e){var t,n,i,r,o,a,s,l,c;if(e!==this.layers.length-1){for(t=this.layers[e],o=new d,a=this.layers[e+1],n=0;a.length>n;n++)o.add(a[n]);for(n=0;t.length>n;n++){for(s=t[n],l=0,c=0,i=0;s.incoming.length>i;i++)r=s.incoming[i],o.contains(r.source)&&(c++,l+=r.source.gridPosition);for(i=0;s.outgoing.length>i;i++)r=s.outgoing[i],o.contains(r.target)&&(c++,l+=r.target.gridPosition);c>0?(s.dBaryCenter=l/c,s.downstreamLinkCount=c):(s.dBaryCenter=n,s.downstreamLinkCount=0)}}},optimizeLayerCrossings:function(e,t){var n,i,r,o,a,s,l,c;for(i=e?this.layers[n=t+1]:this.layers[n=t-1],r=i.slice(0),e?this.calcUpData(n):this.calcDownData(n),o=this,i.sort(function(e,t){var n,i=o.calcBaryCenter(e),r=o.calcBaryCenter(t);return Math.abs(i-r)<1e-4?e.degree()===t.degree()?o.compareByIndex(e,t):e.degree()<t.degree()?1:-1:(n=1e3*(r-i),n>0?-1:0>n?1:o.compareByIndex(e,t))}),s=0,a=0;i.length>a;a++)i[a]!==r[a]&&s++;if(s>0)for(l=0,a=0;i.length>a;a++)c=i[a],c.gridPosition=l++;return s},_swapPairs:function(){for(var e,t,n,i,r,o,a,s,l,c,d,u,h,p,f,g,m,v=this.options.layeredIterations,_=0;;){if(_++>v)break;for(e=1>=_%4,t=_%4===1,n=e?0:this.layers.length-1;e?this.layers.length-1>=n:n>=0;n+=e?1:-1){for(i=this.layers[n],r=!1,o=!0,a=0,s=0;i.length-1>s;s++)l=0,c=0,d=0,o?(0!==n&&(l=this.countLinksCrossingBetweenTwoLayers(n-1,n)),n!==this.layers.length-1&&(c=this.countLinksCrossingBetweenTwoLayers(n,n+1)),e?l*=2:c*=2,d=l+c):d=a,0!==d&&(u=i[s],h=i[s+1],p=u.gridPosition,f=h.gridPosition,i[s]=h,i[s+1]=u,u.gridPosition=f,h.gridPosition=p,l=0,0!==n&&(l=this.countLinksCrossingBetweenTwoLayers(n-1,n)),c=0,n!==this.layers.length-1&&(c=this.countLinksCrossingBetweenTwoLayers(n,n+1)),e?l*=2:c*=2,g=l+c,m=!1,m=t?g>=d:g>d,m?(u=i[s],h=i[s+1],p=u.gridPosition,f=h.gridPosition,i[s]=h,i[s+1]=u,u.gridPosition=f,h.gridPosition=p,a=d,o=!1):(r=!0,o=!0));r&&(n!==this.layers.length-1&&this.calcUpData(n+1),0!==n&&this.calcDownData(n-1))}}},countLinksCrossingBetweenTwoLayers:function(e,t){var n,i,r,o,a,s,l,c,u,p,f,g,m,v,_,w,y,b,k,x,C=0,T=new d,S=this.layers[e];for(n=0;S.length>n;n++)T.add(S[n]);for(i=new d,r=this.layers[t],n=0;r.length>n;n++)i.add(r[n]);for(o=new d,a=[],s=[],T.forEach(function(e){h.addRange(s,e.incoming),h.addRange(s,e.outgoing)}),l=0;s.length>l;l++)c=s[l],T.contains(c.source)&&i.contains(c.target)?(o.add(c),a.push(c)):i.contains(c.source)&&T.contains(c.target)&&a.push(c);for(u=0;a.length>u;u++)for(p=a[u],f=0;a.length>f;f++)u!==f&&(g=a[f],o.contains(p)?(m=p.source,v=p.target):(m=p.target,v=p.source),o.contains(g)?(_=g.source,w=g.target):(_=g.target,w=g.source),y=m.gridPosition,b=v.gridPosition,k=_.gridPosition,x=w.gridPosition,0>(y-k)*(b-x)&&C++);return C/2},calcBaryCenter:function(e){var t=e.upstreamLinkCount,n=e.downstreamLinkCount,i=e.uBaryCenter,r=e.dBaryCenter;return t>0&&n>0?(i+r)/2:t>0?i:n>0?r:0},_gridPositionComparer:function(e,t){return t.gridPosition>e.gridPosition?-1:e.gridPosition>t.gridPosition?1:0},_positionAscendingComparer:function(e,t){return t.k>e.k?-1:e.k>t.k?1:0},_positionDescendingComparer:function(e,t){return t.k>e.k?1:e.k>t.k?-1:0},_firstVirtualNode:function(e){for(var t=0;e.length>t;t++)if(e[t].isVirtual)return t;return-1},compareByIndex:function(e,t){var n=e.index,i=t.index;return i>n?1:n>i?-1:0},intDiv:function(e,t){return(e-e%t)/t},nextVirtualNode:function(e,t){var n,i=t.layerIndex;for(n=i+1;e.length>n;++n)if(e[n].isVirtual)return e[n];return null}}),C=t.Class.extend({init:function(e,t){if(h.isUndefined(e))throw"No diagram given";this.diagram=e,this.nodeMap=new c,this.linkMap=new c,this.capture(t?t:e)},capture:function(e){var t,i,r,o,a,s,c,d,u;if(e instanceof n.Graph){for(o=0;e.nodes.length>o;o++)t=e.nodes[o],r=t.associatedShape,this.nodeMap.set(r.visual.id,new l(t.x,t.y,t.width,t.height));for(o=0;e.links.length>o;o++)s=e.links[o],a=s.associatedConnection,this.linkMap.set(a.visual.id,s.points())}else if(e instanceof Array)for(i=e,o=0;i.length>o;o++)t=i[o],r=t.associatedShape,r&&this.nodeMap.set(r.visual.id,new l(t.x,t.y,t.width,t.height));else if(e.hasOwnProperty("links")&&e.hasOwnProperty("nodes")){for(i=e.nodes,c=e.links,o=0;i.length>o;o++)t=i[o],r=t.associatedShape,r&&this.nodeMap.set(r.visual.id,new l(t.x,t.y,t.width,t.height));for(o=0;c.length>o;o++)s=c[o],a=s.associatedConnection,a&&this.linkMap.set(a.visual.id,s.points)}else{for(d=this.diagram.shapes,u=this.diagram.connections,o=0;d.length>o;o++)r=d[o],this.nodeMap.set(r.visual.id,r.bounds());for(o=0;u.length>o;o++)a=u[o],this.linkMap.set(a.visual.id,a.points())}}});a(n,{init:function(e){t.init(e,n.ui)},SpringLayout:y,TreeLayout:k,GraphAdapter:w,LayeredLayout:x,LayoutBase:_,LayoutState:C})}(window.kendo.jQuery),function(e,t){function n(e){var t=e.originalEvent,n=0;return t.wheelDelta?(n=-t.wheelDelta/40,n=n>0?dt.ceil(n):dt.floor(n)):t.detail&&(n=t.detail),n}function i(e){return e.options.name.toLowerCase()===wt.toLowerCase()}function r(e){var t,n,r,a,s,l,c,d,u,h,f=Ct,g=e.source(),m=e.target(),v=[0,2,3,1,4];if(g instanceof V?t=g:g instanceof p&&(i(g)?r=g.shape:(e._resolvedSourceConnector=g,t=g.position())),m instanceof V?n=m:m instanceof p&&(i(m)?a=m.shape:(e._resolvedTargetConnector=m,n=m.position())),t)a&&(e._resolvedTargetConnector=o(t,a));else if(r)if(n)e._resolvedSourceConnector=o(n,r);else if(a)for(c=0;r.connectors.length>c;c++)l=5==r.connectors.length?v[c]:c,s=r.connectors[l],i(s)||(d=s.position(),u=o(d,a),h=dt.round(u.position().distanceTo(d)),f>h&&(f=h,e._resolvedSourceConnector=s,e._resolvedTargetConnector=u))}function o(e,t){var n,r,o,a,s=Ct,l=t.connectors;for(r=0;l.length>r;r++)o=l[r],i(o)||(a=e.distanceTo(o.position()),s>a&&(s=a,n=o));return n}function a(e,t){var n,i,r,o=[],a=e.drawingContainer().children,s=a.length;for(n=0;t.length>n;n++)for(i=t[n],r=0;s>r;r++)if(a[r]==i.drawingContainer()){o.push(r);break}return o}function s(e){var t=e.drawingContainer().clippedBBox(null);(0!==t.origin.x||0!==t.origin.y)&&e.position(-t.origin.x,-t.origin.y)}function l(e){var t={};return e=e||{},ot(e.text)&&null!==e.text&&(t.text=e.text),ot(e.x)&&null!==e.x&&(t.x=e.x),ot(e.y)&&null!==e.y&&(t.y=e.y),ot(e.width)&&null!==e.width&&(t.width=e.width),ot(e.height)&&null!==e.height&&(t.height=e.height),ot(e.type)&&null!==e.type&&(t.type=e.type),t}function c(e){var t={};return e=e||{},ot(e.text)&&null!==e.text&&(t.content=e.text),ot(e.type)&&null!==e.type&&(t.type=e.type),ot(e.from)&&null!==e.from&&(t.from=e.from),ot(e.fromX)&&null!==e.fromX&&(t.fromX=e.fromX),ot(e.fromY)&&null!==e.fromY&&(t.fromY=e.fromY),ot(e.to)&&null!==e.to&&(t.to=e.to),ot(e.toX)&&null!==e.toX&&(t.toX=e.toX),ot(e.toY)&&null!==e.toY&&(t.toY=e.toY),t}function d(t,n){var i,r=this.dataSource.reader.model;r&&(i=r.fn.fields.text?"text":r.idField,e("<input name='"+n.field+"' />").appendTo(t).kendoDropDownList({dataValueField:r.idField,dataTextField:i,dataSource:this.dataSource.data().toJSON(),optionLabel:" "}))}var u,h,p,f,g,m,v,_,w,y=kendo.dataviz,b=kendo.drawing,k=kendo.geometry,x=y.diagram,C=kendo.ui.Widget,T=kendo.Class,S=e.proxy,D=kendo.deepExtend,A=e.extend,E=kendo.data.HierarchicalDataSource,I=x.Canvas,P=x.Group,M=x.Rectangle,F=x.Circle,z=x.CompositeTransform,R=x.Rect,B=x.Path,H=x.DeleteShapeUnit,L=x.DeleteConnectionUnit,N=x.TextBlock,O=x.Image,V=x.Point,U=x.Intersect,W=x.ConnectionEditAdorner,j=x.UndoRedoService,q=x.ToolService,G=x.Selector,$=x.ResizingAdorner,Y=x.ConnectorsAdorner,Q=x.Cursors,K=x.Utils,X=kendo.Observable,Z=x.ToBackUnit,J=x.ToFrontUnit,et=x.Dictionary,tt=x.PolylineRouter,nt=x.CascadingRouter,it=K.isUndefined,rt=K.isDefined,ot=kendo.util.defined,at=e.isArray,st=kendo.isFunction,lt=K.isString,ct=e.isPlainObject,dt=Math,ut=".kendoDiagram",ht="cascading",pt="itemBoundsChange",ft="change",gt="click",mt="mouseEnter",vt="mouseLeave",_t="error",wt="Auto",yt="Top",bt="Right",kt="Left",xt="Bottom",Ct=9007199254740992,Tt="select",St="itemRotate",Dt="pan",At="zoomStart",Et="zoomEnd",It="none",Pt=600,Mt=600,Ft="rectangle",zt=100,Rt=100,Bt=20,Ht=20,Lt=0,Nt="Yellow",Ot=Number.MAX_VALUE,Vt=-Number.MAX_VALUE,Ut="absolute",Wt="transformed",jt="rotated",qt="transparent",Gt="width",$t="height",Yt="x",Qt="y",Kt="DOMMouseScroll"+ut+" mousewheel"+ut,Xt=.05,Zt=5,Jt='<a class="k-button k-button-icontext #=className#" href="\\#"><span class="#=iconClass# #=imageClass#"></span>#=text#</a>';x.DefaultConnectors=[{name:yt,description:"Top Connector"},{name:bt,description:"Right Connector"},{name:xt,description:"Bottom Connector"},{name:kt,Description:"Left Connector"},{name:wt,Description:"Auto Connector",position:function(e){return e.getPosition("center")}}],u={cancel:{text:"Cancel",imageClass:"k-cancel",className:"k-diagram-cancel",iconClass:"k-icon"},update:{text:"Update",imageClass:"k-update",className:"k-diagram-update",iconClass:"k-icon"}},x.shapeDefaults=function(e){var t={type:Ft,path:"",autoSize:!0,visual:null,x:Lt,y:Lt,minWidth:Bt,minHeight:Ht,width:zt,height:Rt,hover:{},editable:{connect:!0,tools:[]},connectors:x.DefaultConnectors,rotation:{angle:0}};return K.simpleExtend(t,e),t},h=X.extend({init:function(e){var t=this;t.dataItem=(e||{}).dataItem,X.fn.init.call(t),t.options=D({id:x.randomId()},t.options,e),t.dataItem&&(t.options.dataItem=t.dataItem),t.isSelected=!1,t.visual=new P({id:t.options.id,autoSize:t.options.autoSize}),t._template()},options:{hover:{},cursor:Q.grip,content:{align:"center middle"},selectable:!0,serializable:!0,enable:!0},_getCursor:function(e){return this.adorner?this.adorner._getCursor(e):this.options.cursor},visible:function(e){return it(e)?this.visual.visible():(this.visual.visible(e),t)},bounds:function(){},refresh:function(){this.visual.redraw()},position:function(e){this.options.x=e.x,this.options.y=e.y,this.visual.position(e)},toString:function(){return this.options.id},serialize:function(){var e=D({},{options:this.options});return this.options.dataItem&&(e.dataItem=""+this.options.dataItem),e},_content:function(e){var n,i,r,o;return e!==t&&(n=this.options,i=this.bounds(),x.Utils.isString(e)?n.content.text=e:D(n.content,e),r=n.content,o=this._contentVisual,!o&&r.text?(this._contentVisual=new N(r),this._contentVisual._includeInBBox=!1,this.visual.append(this._contentVisual)):o&&o.redraw(r)),this.options.content.text},_hitTest:function(e){var t=this.bounds();return this.visible()&&t.contains(e)&&this.options.enable},_template:function(){var e,t,n=this;n.options.content.template&&(e=n.options.dataItem||{},t=kendo.template(n.options.content.template,{paramName:"dataItem"}),n.options.content.text=t(e))},_canSelect:function(){return this.options.selectable!==!1},toJSON:function(){return{id:this.options.id}}}),p=T.extend({init:function(e,t){this.options=D({},this.options,t),this.connections=[],this.shape=e},options:{width:7,height:7,fill:{color:Nt},hover:{}},position:function(){return this.options.position?this.options.position(this.shape):this.shape.getPosition(this.options.name)},toJSON:function(){return{shapeId:""+this.shape,connector:this.options.name}}}),p.parse=function(e,t){var n,i,r=t.split(":"),o=r[0],a=r[1]||wt;for(n=0;e.shapes.length>n;n++)if(i=e.shapes[n],i.options.id==o)return i.getConnector(a.trim())},f=h.extend({init:function(e,n){var i=this;h.fn.init.call(i,e),this.diagram=n,this.updateOptionsFromModel(),e=i.options,i.connectors=[],i.type=e.type,i.shapeVisual=f.createShapeVisual(i.options),i.visual.append(this.shapeVisual),i.updateBounds(),i.content(i.content()),i._createConnectors(),i.parentContainer=null,i.isContainer=!1,i.isCollapsed=!1,i.id=i.visual.id,e.hasOwnProperty("layout")&&e.layout!==t&&(i.layout=e.layout.bind(e))},options:x.shapeDefaults(),updateOptionsFromModel:function(e,t){var n,i;this.diagram&&this.diagram._isEditable&&(n=l(e||this.options.dataItem),e?t&&!y.inArray(t,["x","y","width","height"])&&(this.options.visual?this.redrawVisual():n.type&&(this.options=D({},this.options,n),this.redrawVisual()),this.options.content&&(this._template(),this.content(this.options.content))):(i=this.options.dataItem,this.options=D({},this.options,n),this.options.dataItem=i))},redrawVisual:function(){this.visual.clear(),this._contentVisual=null,this.shapeVisual=f.createShapeVisual(this.options),this.visual.append(this.shapeVisual),this.updateBounds()},updateModel:function(){var e,t;this.diagram&&this.diagram._isEditable&&(e=this._bounds,this.options.dataItem&&(t=this.diagram.dataSource.getByUid(this.options.dataItem.uid)),t&&(ot(t.x)&&e.x!==t.x&&t.set("x",e.x),ot(t.y)&&e.y!==t.y&&t.set("y",e.y),ot(t.width)&&e.width!==t.width&&t.set("width",e.width),ot(t.height)&&e.height!==t.height&&t.set("height",e.height),this.dataItem=this.options.dataItem=t))},updateBounds:function(){var e=this.visual._measure(!0),t=this.options;this.bounds(new R(t.x,t.y,e.width,e.height)),this._rotate(),this._alignContent()},content:function(e){var t=this._content(e);return this._alignContent(),t},_alignContent:function(){var e,t,n,i,r,o=this.options.content||{},a=this._contentVisual;a&&o.align&&(e=this.visual._measure(),t=new x.RectAlign(e),n=a.drawingElement.bbox(null),i=new R(0,0,n.width(),n.height()),r=t.align(i,o.align),a.position(r.topLeft()))},_createConnectors:function(){var e,t,n=this.options,i=n.connectors.length,r=n.connectorDefaults;for(t=0;i>t;t++)e=new p(this,D({},r,n.connectors[t])),this.connectors.push(e)},bounds:function(e){var t,n;if(e)if(lt(e))switch(e){case Wt:t=this._transformedBounds();break;case Ut:t=this._transformedBounds(),n=this.diagram._pan,t.x+=n.x,t.y+=n.y;break;case jt:t=this._rotatedBounds();break;default:t=this._bounds}else this._setBounds(e),this.refreshConnections(),this._triggerBoundsChange();else t=this._bounds;return t},_setBounds:function(e){var t=this.options,n=e.topLeft(),i=t.x=n.x,r=t.y=n.y,o=t.width=dt.max(e.width,t.minWidth),a=t.height=dt.max(e.height,t.minHeight);this._bounds=new R(i,r,o,a),this.visual.redraw({x:i,y:r,width:o,height:a})},position:function(e){return e?(this.bounds(new R(e.x,e.y,this._bounds.width,this._bounds.height)),t):this._bounds.topLeft()},clone:function(){var e=this.serialize();return e.options.id=x.randomId(),this.diagram&&this.diagram._isEditable&&ot(this.options.dataItem)&&(e.options.dataItem=this.options.dataItem.toJSON(),e.options.dataItem[this.options.dataItem.idField]=this.options.dataItem._defaultId),new f(e.options)},select:function(e){var n,i,r=this.diagram;return it(e)&&(e=!0),this._canSelect()&&this.isSelected!=e?(n=[],i=[],this.isSelected=e,this.isSelected?(r._selectedItems.push(this),n.push(this)):(K.remove(r._selectedItems,this),i.push(this)),r._internalSelection||r._selectionChanged(n,i),!0):t},rotate:function(e,n,i){var r,o,a,s,l=this.visual.rotate();return e!==t&&(i!==!1&&this.diagram&&this.diagram.undoRedoService&&this.diagram.undoRedoService.add(new x.RotateUnit(this.diagram._resizingAdorner,[this],[l.angle]),!1),r=this.bounds(),o=new V(r.width/2,r.height/2),n&&(a=e-l.angle,s=r.center().rotate(n,360-a).minus(o),this._rotationOffset=this._rotationOffset.plus(s.minus(r.topLeft())),this.position(s)),this.visual.rotate(e,o),this.options.rotation.angle=e,this.diagram&&this.diagram._connectorsAdorner&&this.diagram._connectorsAdorner.refresh(),this.refreshConnections(),this.diagram&&this.diagram.trigger(St,{item:this})),l},connections:function(e){var t,n,i,r,o,a,s,l=[];for(t=0;this.connectors.length>t;t++)for(o=this.connectors[t],r=o.connections,n=0,r;r.length>n;n++)i=r[n],"out"==e?(a=i.source(),a.shape&&a.shape==this&&l.push(i)):"in"==e?(s=i.target(),s.shape&&s.shape==this&&l.push(i)):l.push(i);return l},refreshConnections:function(){e.each(this.connections(),function(){this.refresh()})},getConnector:function(e){var t,n;if(!lt(e))return e instanceof V?o(e,this):this.connectors.length?this.connectors[0]:null;for(e=e.toLocaleLowerCase(),t=0;this.connectors.length>t;t++)if(n=this.connectors[t],n.options.name.toLocaleLowerCase()==e)return n},getPosition:function(e){var t=this.bounds(),n=e.charAt(0).toLowerCase()+e.slice(1);return st(t[n])?this._transformPoint(t[n]()):t.center()},redraw:function(e){var t,n;e&&(t=this.options,this.shapeVisual.redraw(this._visualOptions(e)),this._diffNumericOptions(e,[Gt,$t,Yt,Qt])&&(this.bounds(new R(t.x,t.y,t.width,t.height)),n=!0),t=D(t,e),(e.rotation||n)&&this._rotate(),t.content&&this.content(t.content))},_diffNumericOptions:x.diffNumericOptions,_visualOptions:function(e){return{data:e.path,source:e.source,hover:e.hover,fill:e.fill,stroke:e.stroke,startCap:e.startCap,endCap:e.endCap}},_triggerBoundsChange:function(){this.diagram&&this.diagram.trigger(pt,{item:this,bounds:this._bounds.clone()})},_transformPoint:function(e){var t=this.rotate(),n=this.bounds(),i=n.topLeft();return t.angle&&e.rotate(t.center().plus(i),360-t.angle),e},_transformedBounds:function(){var e=this.bounds(),t=e.topLeft(),n=e.bottomRight();return R.fromPoints(this.diagram.modelToView(t),this.diagram.modelToView(n))},_rotatedBounds:function(){var e=this.bounds().rotatedBounds(this.rotate().angle),t=e.topLeft(),n=e.bottomRight();return R.fromPoints(t,n)},_rotate:function(){var e=this.options.rotation;e&&e.angle&&this.rotate(e.angle),this._rotationOffset=new V},_hover:function(e){var t=this.options,n=t.hover,i=t.stroke,r=t.fill;e&&rt(n.stroke)&&(i=D({},i,n.stroke)),e&&rt(n.fill)&&(r=n.fill),this.shapeVisual.redraw({stroke:i,fill:r}),t.editable&&t.editable.connect&&this.diagram._showConnectors(this,e)},_hitTest:function(e){if(this.visible()){var t,n=this.bounds(),i=this.rotate().angle;if(e.isEmpty&&!e.isEmpty())return U.rects(e,n,i?i:0);if(t=e.clone().rotate(n.center(),i),n.contains(t))return this}},toJSON:function(){return{shapeId:this.options.id}}}),f.createShapeVisual=function(e){var t,n,i,r;return delete e.diagram,t=D({},e,{x:0,y:0}),n=t.visual,i=(t.type+"").toLocaleLowerCase(),st(n)?r=n.call(this,t):t.path?(t.data=t.path,r=new B(t),s(r)):r="rectangle"==i?new M(t):"circle"==i?new F(t):"text"==i?new N(t):"image"==i?new O(t):new B(t),r},g=h.extend({init:function(e,t,n){var i=this;h.fn.init.call(i,n),this.updateOptionsFromModel(),this._initRouter(),i.path=new x.Polyline(i.options),i.path.fill(qt),i.visual.append(i.path),i._sourcePoint=i._targetPoint=new V,i.source(e),i.target(t),i.content(i.options.content),i.definers=[],ot(n)&&n.points&&i.points(n.points),i.refresh()},options:{hover:{stroke:{}},startCap:It,endCap:It,points:[],selectable:!0},updateOptionsFromModel:function(e){if(this.diagram&&this.diagram._isEditable){var t=c(e||this.options.dataItem);e?(ot(t.from)?this.source(t.from):ot(t.fromX)&&ot(t.fromY)&&this.source(new V(t.fromX,t.fromY)),ot(t.to)?this.target(t.to):ot(t.toX)&&ot(t.toY)&&this.target(new V(t.toX,t.toY)),this.options.dataItem=e,this._template(),this.redraw(this.options)):this.options=D({},t,this.options)}},updateModel:function(e){if(this.diagram&&this.diagram._isEditable&&this.diagram.connectionsDataSource){var t=this.diagram.connectionsDataSource.getByUid(this.options.dataItem.uid);t&&(this.diagram._shouldRefresh=!1,ot(this.options.fromX)&&null!==this.options.fromX?(t._set("from",null),t._set("fromX",this.options.fromX),t._set("fromY",this.options.fromY)):(t._set("from",this.options.from),t._set("fromX",null),t._set("fromY",null)),ot(this.options.toX)&&null!==this.options.toX?(t._set("to",null),t._set("toX",this.options.toX),t._set("toY",this.options.toY)):(t._set("to",this.options.to),t._set("toX",null),t._set("toY",null)),this.dataItem=this.options.dataItem=t,e!==!1&&(this.diagram._shouldRefresh=!0,t.trigger("change")))}},sourcePoint:function(){return this._resolvedSourceConnector?this._resolvedSourceConnector.position():this._sourcePoint},source:function(e,n){var i;return rt(e)&&(n&&this.diagram?this.diagram.undoRedoService.addCompositeItem(new x.ConnectionEditUnit(this,e)):(e!==t&&(this.from=e),null===e?this.sourceConnector&&(this._sourcePoint=this._resolvedSourceConnector.position(),this._clearSourceConnector()):e instanceof p?(i=e.shape.options.dataItem,i&&(this.options.from=i.id,this.options.fromX=null,this.options.fromY=null),this.sourceConnector=e,this.sourceConnector.connections.push(this)):e instanceof V?(this.options.fromX=e.x,this.options.fromY=e.y,this.options.from=null,this._sourcePoint=e,this.sourceConnector&&this._clearSourceConnector()):e instanceof f&&(i=e.options.dataItem,i&&(this.options.from=i.id,this.options.fromX=null,this.options.fromY=null),this.sourceConnector=e.getConnector(wt),this.sourceConnector.connections.push(this)),this.refresh())),this.sourceConnector?this.sourceConnector:this._sourcePoint},sourceDefiner:function(e){if(!e)return this._sourceDefiner||(this._sourceDefiner=new x.PathDefiner(this.sourcePoint(),null,null)),this._sourceDefiner;if(!(e instanceof x.PathDefiner))throw"The sourceDefiner needs to be a PathDefiner.";e.left=null,this._sourceDefiner=e,this.source(e.point)},targetPoint:function(){return this._resolvedTargetConnector?this._resolvedTargetConnector.position():this._targetPoint
},target:function(e,n){var i;return rt(e)&&(n&&this.diagram?this.diagram.undoRedoService.addCompositeItem(new x.ConnectionEditUnit(this,e)):(e!==t&&(this.to=e),null===e?this.targetConnector&&(this._targetPoint=this._resolvedTargetConnector.position(),this._clearTargetConnector()):e instanceof p?(i=e.shape.options.dataItem,i&&(this.options.to=i.id,this.options.toX=null,this.options.toY=null),this.targetConnector=e,this.targetConnector.connections.push(this)):e instanceof V?(this.options.toX=e.x,this.options.toY=e.y,this.options.to=null,this._targetPoint=e,this.targetConnector&&this._clearTargetConnector()):e instanceof f&&(i=e.options.dataItem,i&&(this.options.to=i.id,this.options.toX=null,this.options.toY=null),this.targetConnector=e.getConnector(wt),this.targetConnector.connections.push(this))),this.refresh()),this.targetConnector?this.targetConnector:this._targetPoint},targetDefiner:function(e){if(!e)return this._targetDefiner||(this._targetDefiner=new x.PathDefiner(this.targetPoint(),null,null)),this._targetDefiner;if(!(e instanceof x.PathDefiner))throw"The sourceDefiner needs to be a PathDefiner.";e.right=null,this._targetDefiner=e,this.target(e.point)},content:function(e){return this._content(e)},select:function(e){var n,i,r=this.diagram;return this._canSelect()&&this.isSelected!==e?(this.isSelected=e,n=[],i=[],this.isSelected?(this.adorner=new W(this,this.options.selection),r._adorn(this.adorner,!0),r._selectedItems.push(this),n.push(this)):this.adorner&&(r._adorn(this.adorner,!1),K.remove(r._selectedItems,this),this.adorner=t,i.push(this)),this.refresh(),r._internalSelection||r._selectionChanged(n,i),!0):t},bounds:function(e){return!e||lt(e)?this._bounds:(this._bounds=e,t)},type:function(e){var n=this.options;return e?(e!==n.type&&(n.type=e,this._initRouter(),this.refresh()),t):n.type},_initRouter:function(){var e=(this.options.type||"").toLowerCase();this._router=e==ht?new nt(this):new tt(this)},points:function(e){var t,n,i,r;if(!e){if(i=[],rt(this.definers))for(r=0;this.definers.length>r;r++)i.push(this.definers[r].point);return i}for(this.definers=[],t=0;e.length>t;t++)if(n=e[t],n instanceof x.Point)this.definers.push(new x.PathDefiner(n));else{if(!n.hasOwnProperty("x")||!n.hasOwnProperty("y"))throw"A Connection point needs to be a Point or an object with x and y properties.";this.definers.push(new x.PathDefiner(new V(n.x,n.y)))}},allPoints:function(){var e,t=[this.sourcePoint()];if(this.definers)for(e=0;this.definers.length>e;e++)t.push(this.definers[e].point);return t.push(this.targetPoint()),t},refresh:function(){r(this);var e,t,n,i,o=this.sourcePoint(),a=this.targetPoint();this._refreshPath(),e=this._bounds.topLeft(),t=o.minus(e),n=a.minus(e),this._contentVisual&&(i=V.fn.middleOf(t,n),this._contentVisual.position(new V(i.x+e.x,i.y+e.y))),this.adorner&&this.adorner.refresh()},redraw:function(e){if(e){this.options=D({},this.options,e);var t=this.options.points;(e&&e.content||e.text)&&this.content(e.content),ot(t)&&t.length>0&&(this.points(t),this._refreshPath()),this.path.redraw({fill:e.fill,stroke:e.stroke,startCap:e.startCap,endCap:e.endCap})}},clone:function(){var e=this.serialize();return this.diagram&&this.diagram._isEditable&&ot(this.options.dataItem)&&(e.options.dataItem=this.options.dataItem.toJSON(),e.options.dataItem[this.options.dataItem.idField]=this.options.dataItem._defaultId),new g(this.from,this.to,e.options)},serialize:function(){var e=this.from.toJSON?this.from.toJSON:""+this.from,t=this.to.toJSON?this.to.toJSON:""+this.to,n=D({},{options:this.options,from:e,to:t});return ot(this.dataItem)&&(n.dataItem=""+this.dataItem),n.options.points=this.points(),n},_hitTest:function(e){if(this.visible()){var t=new V(e.x,e.y),n=this.sourcePoint(),i=this.targetPoint();if(e.isEmpty&&!e.isEmpty()&&e.contains(n)&&e.contains(i))return this;if(this._router.hitTest(t))return this}},_hover:function(e){var t=(this.options.stroke||{}).color;e&&rt(this.options.hover.stroke.color)&&(t=this.options.hover.stroke.color),this.path.redraw({stroke:{color:t}})},_refreshPath:function(){ot(this.path)&&(this._drawPath(),this.bounds(this._router.getBounds()))},_drawPath:function(){var e,t,n;this._router&&this._router.route(),e=this.sourcePoint(),t=this.targetPoint(),n=this.points(),this.path.redraw({points:[e].concat(n,[t])})},_clearSourceConnector:function(){K.remove(this.sourceConnector.connections,this),this.sourceConnector=t,this._resolvedSourceConnector=t},_clearTargetConnector:function(){K.remove(this.targetConnector.connections,this),this.targetConnector=t,this._resolvedTargetConnector=t}}),m=C.extend({init:function(e,t){var n=this;kendo.destroy(e),C.fn.init.call(n,e,t),n._initTheme(),n._initElements(),n._extendLayoutOptions(n.options),n._initShapeDefaults(),n._initCanvas(),n.mainLayer=new P({id:"main-layer"}),n.canvas.append(n.mainLayer),n._pan=new V,n._adorners=[],n.adornerLayer=new P({id:"adorner-layer"}),n.canvas.append(n.adornerLayer),n._createHandlers(),n._initialize(),n._fetchFreshData(),n._createGlobalToolBar(),n._resizingAdorner=new $(n,{editable:n.options.editable}),n._connectorsAdorner=new Y(n),n._adorn(n._resizingAdorner,!0),n._adorn(n._connectorsAdorner,!0),n.selector=new G(n),n._clipboard=[],n.options.layout&&n.layout(n.options.layout),n.pauseMouseHandlers=!1,n._createShapes(),n._createConnections(),n.zoom(n.options.zoom),n.canvas.draw(),this._shouldRefresh=!0},options:{name:"Diagram",theme:"default",layout:"",zoomRate:.1,zoom:1,zoomMin:0,zoomMax:2,dataSource:{},draggable:!0,template:"",autoBind:!0,editable:{rotate:{},resize:{},text:!0,tools:[]},pannable:{key:"ctrl"},selectable:{key:"none"},tooltip:{enabled:!0,format:"{0}"},copy:{enabled:!0,offsetX:20,offsetY:20},snap:{enabled:!0,size:10,angle:10},shapeDefaults:x.shapeDefaults({undoable:!0}),connectionDefaults:{editable:{tools:[]}},shapes:[],connections:[]},events:[Et,At,Dt,Tt,St,pt,ft,gt,mt,vt,"toolBarClick","save","cancel","edit","remove","add","dataBound"],_createGlobalToolBar:function(){var e=this.options.editable.tools;this._isEditable&&0===e.length&&(e=["createShape","undo","redo","rotateClockwise","rotateAnticlockwise"]),e&&e.length&&(this.toolBar=new v(this,{tools:e||{},click:S(this._toolBarClick,this),modal:!1}),this.toolBar.element.css({position:"absolute",top:0,left:0,width:this.element.width(),textAlign:"left"}),this.element.append(this.toolBar.element))},createShape:function(){var e,t,n,i=this;(this.editor&&this.editor.end()||!this.editor)&&!this.trigger("add",{shape:{}})&&(e=this.dataSource.view()||[],t=e.length,n=this.dataSource.insert(t,{}),this.dataSource.one("sync",function(){var e=i._dataMap[n.id];i.edit(e)}),this.dataSource.sync())},createConnection:function(){var e,t,n,i;(this.editor&&this.editor.end()||!this.editor)&&!this.trigger("add",{connection:{}})&&(e=this.connectionsDataSource.view()||[],t=e.length,n=this.connectionsDataSource.insert(t,{}),i=this._connectionsDataMap[n.uid],this.edit(i))},edit:function(e){var t,n,i,r,o;if(this.cancelEdit(),r=this.options.editable,e instanceof f)t="shape",n=r.shapeEditors,i=r.shapeTemplate;else{if(!(e instanceof g))return;t="connection",o=S(d,this),n=D({},{from:o,to:o},r.connectionEditors),i=r.connectionTemplate}e.options.dataItem&&(this.editor=new w(this.element,{update:S(this._update,this),cancel:S(this._cancel,this),model:e.dataItem,type:t,target:this,editors:n,template:i}),this.trigger("edit",this._editArgs()))},cancelEdit:function(){this.editor&&(this._getEditDataSource().cancelChanges(this.editor.model),this._destroyEditor())},saveEdit:function(){this.editor&&this.editor.end()&&!this.trigger("save",this._editArgs())&&this._getEditDataSource().sync()},_update:function(){this.editor&&this.editor.end()&&!this.trigger("save",this._editArgs())&&(this._getEditDataSource().sync(),this._destroyEditor())},_cancel:function(){this.editor&&!this.trigger("cancel",this._editArgs())&&(this._getEditDataSource().cancelChanges(this.editor.model),this._destroyEditor())},_getEditDataSource:function(){return"shape"===this.editor.options.type?this.dataSource:this.connectionsDataSource},_editArgs:function(){var e={container:this.editor.element};return e[this.editor.options.type]=this.editor.model,e},_destroyEditor:function(){this.editor&&(this.editor.close(),this.editor=null)},_initElements:function(){this.wrapper=this.element.empty().css("position","relative").attr("tabindex",0).addClass("k-widget k-diagram"),this.scrollable=e("<div />").appendTo(this.element)},_initShapeDefaults:function(){var e=this.options;e.editable===!1&&D(e.shapeDefaults,{editable:{connect:!1}})},_initCanvas:function(){var t=e("<div class='k-layer'></div>").appendTo(this.scrollable)[0],n=this.viewport();this.canvas=new I(t,{width:n.width||Pt,height:n.height||Mt})},_createHandlers:function(){var e=this,t=e.element;t.on(Kt,S(e._wheel,e)),kendo.support.touch||kendo.support.mobileOS?(e._userEvents=new kendo.UserEvents(t,{multiTouch:!0,tap:S(e._tap,e)}),e._userEvents.bind(["gesturestart","gesturechange","gestureend"],{gesturestart:S(e._gestureStart,e),gesturechange:S(e._gestureChange,e),gestureend:S(e._gestureEnd,e)}),e.toolService=new q(e),e.options.pannable!==!1&&e.scroller.enable()):(e.toolService=new q(e),this.scroller.wrapper.on("mousemove"+ut,S(e._mouseMove,e)).on("mouseup"+ut,S(e._mouseUp,e)).on("mousedown"+ut,S(e._mouseDown,e)).on("mouseover"+ut,S(e._mouseover,e)).on("mouseout"+ut,S(e._mouseout,e)),t.on("keydown"+ut,S(e._keydown,e))),e._resizeHandler=S(e.resize,e),kendo.onResize(e._resizeHandler),this.bind(At,S(e._destroyToolBar,e)),this.bind(Dt,S(e._destroyToolBar,e))},_tap:function(e){var t,n=this.toolService,i=this._caculateMobilePosition(e);n._updateHoveredItem(i),n.hoveredItem&&(t=n.hoveredItem,this.options.selectable!==!1&&(this._destroyToolBar(),t.isSelected?t.select(!1):this.select(t,{addToSelection:!0}),this._createToolBar()),this.trigger("click",{item:t,point:i}))},_caculateMobilePosition:function(e){return this.documentToModel(V(e.x.location,e.y.location))},_gestureStart:function(e){var t,n;this._destroyToolBar(),this.scroller.disable(),t=this.documentToModel(new V(e.center.x,e.center.y)),n={point:t,zoom:this.zoom()},this.trigger(At,n)||(this._gesture=e,this._initialCenter=t)},_gestureChange:function(e){var t,n,i=this._gesture,r=this._initialCenter,o=this.documentToView(new V(e.center.x,e.center.y)),a=e.distance/i.distance,s=this._zoom,l=!1;dt.abs(a-1)>=Xt&&(this._zoom=s=this._getValidZoom(s*a),this.options.zoom=s,this._gesture=e,l=!0),t=r.times(s),n=o.minus(t),(l||this._pan.distanceTo(n)>=Zt)&&(this._panTransform(n),this._updateAdorners()),e.preventDefault()},_gestureEnd:function(){this.options.pannable!==!1&&this.scroller.enable(),this.trigger(Et,{point:this._initialCenter,zoom:this.zoom()})},_resize:function(e){this.canvas&&this.canvas.size(e),this.toolBar&&this.toolBar._toolBar.element.width(this.element.width())},_mouseover:function(e){var t=e.target._kendoNode;t&&t.srcElement._hover&&t.srcElement._hover(!0,t.srcElement)},_mouseout:function(e){var t=e.target._kendoNode;t&&t.srcElement._hover&&t.srcElement._hover(!1,t.srcElement)},_initTheme:function(){var e=this,t=y.ui.themes||{},n=((e.options||{}).theme||"").toLowerCase(),i=(t[n]||{}).diagram;e.options=D({},i,e.options)},_createShapes:function(){var e,t,n=this,i=n.options,r=i.shapes;for(t=0;r.length>t;t++)e=r[t],n.addShape(e)},_createConnections:function(){var e,t,n,i,r=this,o=r.options,a=o.connectionDefaults,s=o.connections;for(i=0;s.length>i;i++)e=s[i],t=r._findConnectionShape(e.from),n=r._findConnectionShape(e.to),r.connect(t,n,D({},a,e))},_findConnectionShape:function(e){var t=this,n=lt(e)?e:e.shapeId,i=t.getShapeById(n);return i.getConnector(e.connector||wt)},destroy:function(){var e=this;C.fn.destroy.call(e),this._userEvents&&this._userEvents.destroy(),kendo.unbindResize(e._resizeHandler),e.clear(),e.element.off(ut),e.scroller.wrapper.off(ut),e.canvas.destroy(!0),e.canvas=t,e._destroyEditor(),e.destroyScroller(),e._destroyGlobalToolBar(),e._destroyToolBar()},destroyScroller:function(){var e=this.scroller;e&&(e.destroy(),e.element.remove(),this.scroller=null)},save:function(){var e,t,n,i,r={};for(r.shapes=[],r.connections=[],e=0;this.shapes.length>e;e++)t=this.shapes[e],t.options.serializable&&r.shapes.push(t.options);for(e=0;this.connections.length>e;e++)n=this.connections[e],i=D({},n.options,{from:n.from.toJSON(),to:n.to.toJSON()}),r.connections.push(i);return r},focus:function(){if(!this.element.is(kendo._activeElement())){var e,t=this.element,n=t[0],i=[],r=[],o=document.documentElement;do n=n.parentNode,n.scrollHeight>n.clientHeight&&(i.push(n),r.push(n.scrollTop));while(n!=o);for(t.focus(),e=0;i.length>e;e++)i[e].scrollTop=r[e]}},load:function(e){this.clear(),this.setOptions(e),this._createShapes(),this._createConnections()},setOptions:function(e){D(this.options,e)},clear:function(){var e=this;e.select(!1),e.mainLayer.clear(),e._initialize()},connect:function(e,t,n){var i,r;return this.connectionsDataSource&&this._isEditable?(r=this.connectionsDataSource.add({}),i=this._connectionsDataMap[r.uid],i.source(e),i.target(t),this.connectionsDataSource.sync()):(i=new g(e,t,D({},this.options.connectionDefaults,n)),this.addConnection(i)),i},connected:function(e,t){var n,i;for(n=0;this.connections.length>n;n++)if(i=this.connections[n],i.from==e&&i.to==t)return!0;return!1},addConnection:function(e,t){return t!==!1&&this.undoRedoService.add(new x.AddConnectionUnit(e,this),!1),e.diagram=this,this.mainLayer.append(e.visual),this.connections.push(e),e.updateOptionsFromModel(),e},_addConnection:function(e,n){var i,r=this;return this.connectionsDataSource&&this._isEditable?(this.trigger("add",{connection:e.options.dataItem})?this._remove(e,!1):(i=this.connectionsDataSource.add(e.options.dataItem),this.connectionsDataSource.one("sync",function(){var t,n;for(t=0;r.connections.length>t;t++)n=r.connections[t],n.options.dataItem.uid===i.uid&&n.redraw(e.options)}),e.options.dataItem=i,this.connectionsDataSource.sync()),t):this.addConnection(e,n)},addShape:function(e,t){var n,i=this.options.shapeDefaults;if(e instanceof f)i=D({},i,t),e.redraw(t),n=e;else{if(e instanceof kendo.Class)return;i=D({},i,e||{}),n=new f(i)}return i.undoable&&this.undoRedoService.add(new x.AddShapeUnit(n,this),!1),this.shapes.push(n),n.diagram=this,this.mainLayer.append(n.visual),this.trigger(ft,{added:[n],removed:[]}),n.hasOwnProperty("layout")&&n.layout(n),n},_addShape:function(e,n){var i,r=this;return this.dataSource&&this._isEditable?(this.trigger("add",{shape:e.options.dataItem})?this._remove(e,!1):(i=this.dataSource.add(e.options.dataItem),this.dataSource.one("sync",function(){var t,n;for(t=0;r.shapes.length>t;t++)n=r.shapes[t],n.options.dataItem.uid===i.uid&&n.redraw(e.options)}),e.options.dataItem=i,this.dataSource.sync()),t):this.addShape(e,n)},remove:function(e,t){var n,i=at(e);if(it(t)&&(t=!0),t&&this.undoRedoService.begin(),i)for(e=e.slice(0),n=0;e.length>n;n++)this._removeItem(e[n],t);else(e instanceof f||e instanceof g)&&this._removeItem(e,t);t&&this.undoRedoService.commit(),this.trigger(ft,{added:[],removed:i?e:[e]})},_remove:function(e,t){var n,i={};this._isEditable&&(e.length?this._destroyToolBar():(e instanceof g?this.connectionsDataSource&&(n=this.connectionsDataSource,i.connection=e.options.dataItem):this.dataSource&&(n=this.dataSource,i.shape=e.options.dataItem),n&&!this.trigger("remove",i)&&(n.remove(e.options.dataItem),n.sync()))),this.remove(e,t)},undo:function(){this.undoRedoService.undo()},redo:function(){this.undoRedoService.redo()},select:function(e,t){if(!rt(e))return this._selectedItems;t=D({addToSelection:!1},t);var n,i,r=t.addToSelection,o=[],a=[];for(r||this.deselect(),this._internalSelection=!0,e instanceof Array?o=e:e instanceof h&&(o=[e]),n=0;o.length>n;n++)i=o[n],i.select(!0)&&a.push(i);this._selectionChanged(a,[]),this._internalSelection=!1},selectAll:function(){this.select(this.shapes.concat(this.connections))},selectArea:function(e){var t,n,i,r;if(this._internalSelection=!0,r=[],e instanceof R)for(n=this.shapes.concat(this.connections),t=0;n.length>t;t++)i=n[t],e&&!i._hitTest(e)||!i.options.enable||i.select(!0)&&r.push(i);this._selectionChanged(r,[]),this._internalSelection=!1},deselect:function(e){this._internalSelection=!0;var t,n,i=[],r=[];for(e instanceof Array?r=e:e instanceof h?r.push(e):rt(e)||(r=this._selectedItems.slice(0)),n=0;r.length>n;n++)t=r[n],t.select(!1)&&i.push(t);this._selectionChanged([],i),this._internalSelection=!1},toFront:function(e,t){var n,i,r;e||(e=this._selectedItems.slice()),n=this._getDiagramItems(e),!ot(t)||t?(i=a(this.mainLayer,n.visuals),r=new J(this,e,i),this.undoRedoService.add(r)):(this.mainLayer.toFront(n.visuals),this._fixOrdering(n,!0))},toBack:function(e,t){var n,i,r;e||(e=this._selectedItems.slice()),n=this._getDiagramItems(e),!ot(t)||t?(i=a(this.mainLayer,n.visuals),r=new Z(this,e,i),this.undoRedoService.add(r)):(this.mainLayer.toBack(n.visuals),this._fixOrdering(n,!1))},bringIntoView:function(e,t){var n,i,r,o,a=this.viewport(),s=new x.RectAlign(a);0!==a.width&&0!==a.height&&(t=D({animate:!1,align:"center middle"},t),"none"==t.align&&(t.align="center middle"),e instanceof h?i=e.bounds(Wt):at(e)?i=this.boundingBox(e):e instanceof R&&(i=e.clone()),r=i.clone(),i.zoom(this._zoom),this._storePan(new V),(i.width>a.width||i.height>a.height)&&(this._zoom=this._getValidZoom(dt.min(a.width/r.width,a.height/r.height)),i=r.clone().zoom(this._zoom)),this._zoomMainLayer(),n=i.clone(),s.align(i,t.align),o=i.topLeft().minus(n.topLeft()),this.pan(o.times(-1),t.animate))},alignShapes:function(e){var t,n,i,r,o,a,s;if(it(e)&&(e="Left"),t=this.select(),0!==t.length){switch(e.toLowerCase()){case"left":case"top":n=Ot;break;case"right":case"bottom":n=Vt}for(r=0;t.length>r;r++)if(i=t[r],i instanceof f)switch(e.toLowerCase()){case"left":n=dt.min(n,i.options.x);break;case"top":n=dt.min(n,i.options.y);break;case"right":n=dt.max(n,i.options.x);break;case"bottom":n=dt.max(n,i.options.y)}for(o=[],a=[],r=0;t.length>r;r++)if(i=t[r],i instanceof f)switch(a.push(i),o.push(i.bounds()),e.toLowerCase()){case"left":case"right":i.position(new V(n,i.options.y));break;case"top":case"bottom":i.position(new V(i.options.x,n))}s=new x.TransformUnit(a,o),this.undoRedoService.add(s,!1)}},zoom:function(e,t){var n,i,r,o;return e&&(n=t?t.point:new x.Point(0,0),e=this._zoom=this._getValidZoom(e),it(n)||(n=new x.Point(dt.round(n.x),dt.round(n.y)),i=n.times(e),r=this.modelToView(n),o=r.minus(i),this._storePan(new x.Point(dt.round(o.x),dt.round(o.y)))),t&&(t.zoom=e),this._panTransform(),this._updateAdorners()),this._zoom},_getPan:function(e){var t=this.canvas;return t.translate||(e=e.plus(this._pan)),e},pan:function(e,t){var n,i;e instanceof V&&(n=this,i=n.scroller,e=n._getPan(e),e=e.times(-1),t?i.animatedScrollTo(e.x,e.y,function(){n._updateAdorners()}):(i.scrollTo(e.x,e.y),n._updateAdorners()))},viewport:function(){var e=this.element;return new R(0,0,e.width(),e.height())},copy:function(){var e,t;if(this.options.copy.enabled)for(this._clipboard=[],this._copyOffset=1,e=0;this._selectedItems.length>e;e++)t=this._selectedItems[e],this._clipboard.push(t)},cut:function(){var e,t;if(this.options.copy.enabled){for(this._clipboard=[],this._copyOffset=0,e=0;this._selectedItems.length>e;e++)t=this._selectedItems[e],this._clipboard.push(t);this.remove(this._clipboard,!0)}},paste:function(){var e,t,n,i,r,o,a,s;if(this._clipboard.length>0){for(s=new et,e=this._copyOffset*this.options.copy.offsetX,t=this._copyOffset*this.options.copy.offsetY,this.deselect(),a=0;this._clipboard.length>a;a++)n=this._clipboard[a],n instanceof g||(i=n.clone(),s.set(n.id,i.id),i.position(new V(n.options.x+e,n.options.y+t)),i.diagram=this,this._addShape(i),i.select(),i.updateModel());for(a=0;this._clipboard.length>a;a++)n=this._clipboard[a],n instanceof f||(i=n.clone(),n.source()instanceof p&&(r=n.source(),s.containsKey(r.shape.id)?(o=this.getShapeById(s.get(r.shape.id)),i.source(o.getConnector(r.options.name))):i.source(new V(n.sourcePoint().x+e,n.sourcePoint().y+t))),n.target()instanceof p&&(r=n.target(),s.containsKey(r.shape.id)?(o=this.getShapeById(s.get(r.shape.id)),i.target(o.getConnector(r.options.name))):i.target(new V(n.targetPoint().x+e,n.targetPoint().y+t))),i.diagram=this,this._addConnection(i),i.position(new V(n.options.x+e,n.options.y+t)),i.select(!0),i.updateModel());this._copyOffset+=1}},boundingBox:function(e,t){var n,i,r,o=R.empty(),a=rt(e)?this._getDiagramItems(e):{shapes:this.shapes};if(a.shapes.length>0)for(i=a.shapes[0],o=i.bounds(jt),r=1;a.shapes.length>r;r++)i=a.shapes[r],n=i.bounds(jt),t===!0&&(n.x-=i._rotationOffset.x,n.y-=i._rotationOffset.y),o=o.union(n);return o},documentToView:function(e){var t=this.element.offset();return new V(e.x-t.left,e.y-t.top)},viewToDocument:function(e){var t=this.element.offset();return new V(e.x+t.left,e.y+t.top)},viewToModel:function(e){return this._transformWithMatrix(e,this._matrixInvert)},modelToView:function(e){return this._transformWithMatrix(e,this._matrix)},modelToLayer:function(e){return this._transformWithMatrix(e,this._layerMatrix)},layerToModel:function(e){return this._transformWithMatrix(e,this._layerMatrixInvert)},documentToModel:function(e){var t=this.documentToView(e);return this.canvas.translate||(t.x=t.x+this.scroller.scrollLeft,t.y=t.y+this.scroller.scrollTop),this.viewToModel(t)},modelToDocument:function(e){return this.viewToDocument(this.modelToView(e))},_transformWithMatrix:function(e,t){var n,i,r=e;return e instanceof V?t&&(r=t.apply(e)):(n=this._transformWithMatrix(e.topLeft(),t),i=this._transformWithMatrix(e.bottomRight(),t),r=R.fromPoints(n,i)),r},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&this.dataSource.fetch()},setConnectionsDataSource:function(e){this.options.connectionsDataSource=e,this._connectionDataSource(),this.options.autoBind&&this.connectionsDataSource.fetch()},layout:function(e){var t,n,i,r,o;switch(this.isLayouting=!0,it(e)&&(e=this.options.layout),t=it(e)||it(e.type)?"Tree":e.type,t.toLowerCase()){case"tree":n=new x.TreeLayout(this);break;case"layered":n=new x.LayeredLayout(this);break;case"forcedirected":case"force":case"spring":case"springembedder":n=new x.SpringLayout(this);break;default:throw"Layout algorithm '"+t+"' is not supported."}i=new x.LayoutState(this),r=n.layout(e),r&&(o=new x.LayoutUndoUnit(i,r,e?e.animate:null),this.undoRedoService.add(o)),this.isLayouting=!1},getShapeById:function(e){var t;return(t=K.first(this.shapes,function(t){return t.visual.id===e}))?t:t=K.first(this.connections,function(t){return t.visual.id===e})},_extendLayoutOptions:function(e){e.layout&&(e.layout=D(x.LayoutBase.fn.defaultOptions||{},e.layout))},_selectionChanged:function(e,t){(e.length||t.length)&&this.trigger(Tt,{selected:e,deselected:t})},_getValidZoom:function(e){return dt.min(dt.max(e,this.options.zoomMin),this.options.zoomMax)},_panTransform:function(e){var t=this,n=e||t._pan;t.canvas.translate?(t.scroller.scrollTo(n.x,n.y),t._zoomMainLayer()):(t._storePan(n),t._transformMainLayer())},_finishPan:function(){this.trigger(Dt,{total:this._pan,delta:Number.NaN})},_storePan:function(e){this._pan=e,this._storeViewMatrix()},_zoomMainLayer:function(){var e=this._zoom,t=new z(0,0,e,e);t.render(this.mainLayer),this._storeLayerMatrix(t),this._storeViewMatrix()},_transformMainLayer:function(){var e=this._pan,t=this._zoom,n=new z(e.x,e.y,t,t);n.render(this.mainLayer),this._storeLayerMatrix(n),this._storeViewMatrix()},_storeLayerMatrix:function(e){this._layerMatrix=e.toMatrix(),this._layerMatrixInvert=e.invert().toMatrix()},_storeViewMatrix:function(){var e=this._pan,t=this._zoom,n=new z(e.x,e.y,t,t);this._matrix=n.toMatrix(),this._matrixInvert=n.invert().toMatrix()},_toIndex:function(e,t){var n=this._getDiagramItems(e);this.mainLayer.toIndex(n.visuals,t),this._fixOrdering(n,!1)},_fixOrdering:function(e,t){var n,i,r=t?this.shapes.length-1:0,o=t?this.connections.length-1:0;for(n=0;e.shapes.length>n;n++)i=e.shapes[n],K.remove(this.shapes,i),K.insert(this.shapes,i,r);for(n=0;e.cons.length>n;n++)i=e.cons[n],K.remove(this.connections,i),K.insert(this.connections,i,o)},_getDiagramItems:function(e){var t,n,i={},r=e;for(i.visuals=[],i.shapes=[],i.cons=[],e?at(e)||(r=[e]):r=this._selectedItems.slice(),t=0;r.length>t;t++)n=r[t],n instanceof f?(i.shapes.push(n),i.visuals.push(n.visual)):n instanceof g&&(i.cons.push(n),i.visuals.push(n.visual));return i},_removeItem:function(e,t){e.select(!1),e instanceof f?this._removeShape(e,t):e instanceof g&&this._removeConnection(e,t),t||this.mainLayer.remove(e.visual)},_removeShape:function(e,t){var n,i,r,o,a=[],s=[];for(this.toolService._removeHover(),t?this.undoRedoService.addCompositeItem(new H(e)):K.remove(this.shapes,e),n=0;e.connectors.length>n;n++)for(r=e.connectors[n],o=0;r.connections.length>o;o++)i=r.connections[o],i.sourceConnector==r?a.push(i):i.targetConnector==r&&s.push(i);for(n=0;a.length>n;n++)a[n].source(null,t);for(n=0;s.length>n;n++)s[n].target(null,t)},_removeConnection:function(e,t){e.sourceConnector&&K.remove(e.sourceConnector.connections,e),e.targetConnector&&K.remove(e.targetConnector.connections,e),t?this.undoRedoService.addCompositeItem(new L(e)):K.remove(this.connections,e)},_removeDataItems:function(e,t){var n,i,r,o;for(e=at(e)?e:[e];e.length;)if(n=e.shift(),r=this._dataMap[n.uid],r&&(this._removeShapeConnections(r),this._removeItem(r,!1),delete this._dataMap[n.uid],t&&n.hasChildren&&n.loaded()))for(i=n.children.data(),o=0;i.length>o;o++)e.push(i[o])},_removeShapeConnections:function(e){var t,n=e.connections();if(n)for(t=0;n.length>t;t++)this._removeItem(n[t],!1)},_addDataItem:function(e,t){if(ot(e)){var n=this._dataMap[e.id];return n?n:(t=D({},this.options.shapeDefaults,t),t.dataItem=e,n=new f(t,this),this.addShape(n),this._dataMap[e.id]=n,n)}},_addDataItemByUid:function(e){var t,n;if(ot(e))return(t=this._dataMap[e.uid])?t:(n=D({},this.options.shapeDefaults),n.dataItem=e,t=new f(n,this),this.addShape(t),this._dataMap[e.uid]=t,t)},_addDataItems:function(e,t){var n,i,r,o,a;for(i=0;e.length>i;i++)n=e[i],r=this._addDataItemByUid(n),o=this._addDataItemByUid(t),o&&!this.connected(o,r)&&(a=this.connect(o,r),a.type(ht))},_refreshSource:function(e){var t,n=this,i=e.node,r=e.action,o=e.items,a=n.options;if(!e.field){if("remove"==r)this._removeDataItems(e.items,!0);else for(r||i||n.clear(),this._addDataItems(o,i),t=0;o.length>t;t++)o[t].load();a.layout&&n.layout(a.layout)}},_mouseDown:function(e){var t=this._calculatePosition(e);1==e.which&&this.toolService.start(t,this._meta(e))&&(this._destroyToolBar(),e.preventDefault())},_addItem:function(e){e instanceof f?this.addShape(e):e instanceof g&&this.addConnection(e)},_mouseUp:function(e){var t=this._calculatePosition(e);1==e.which&&this.toolService.end(t,this._meta(e))&&(this._createToolBar(),e.preventDefault())},_createToolBar:function(){var e,t,n,i,r,o,a,s,l,c=this.toolService.diagram;this.singleToolBar||1!==c.select().length||(e=c.select()[0],e&&(t=e.options.editable.tools,this._isEditable&&0===t.length&&(e instanceof f?t=["edit","rotateClockwise","rotateAnticlockwise","delete"]:e instanceof g&&(t=["edit","delete"])),t&&t.length&&(n=20,this.singleToolBar=new v(c,{tools:t,click:S(this._toolBarClick,this),modal:!0}),r=this.singleToolBar.element,o=this.singleToolBar._popup.element.outerWidth(),a=this.singleToolBar._popup.element.outerHeight(),e instanceof f?(s=this.modelToView(e.bounds(jt)),i=V(s.x,s.y).minus(V((o-s.width)/2,a+n))):e instanceof g&&(l=this.modelToView(e.bounds()),i=V(l.x,l.y).minus(V((o-l.width-20)/2,a+n))),i?(this.canvas.translate||(i=i.minus(V(this.scroller.scrollLeft,this.scroller.scrollTop))),i=this.viewToDocument(i),i=V(dt.max(i.x,0),dt.max(i.y,0)),this.singleToolBar.showAt(i)):this._destroyToolBar())))},_toolBarClick:function(e){this.trigger("toolBarClick",e),this._destroyToolBar()},_mouseMove:function(e){if(!this.pauseMouseHandlers){var t=this._calculatePosition(e);0!==e.which&&1!=e.which||!this.toolService.move(t,this._meta(e))||e.preventDefault()}},_keydown:function(e){this.toolService.keyDown(e.keyCode,this._meta(e))&&e.preventDefault()},_wheel:function(e){var t=n(e),i=this._calculatePosition(e),r=D(this._meta(e),{delta:t});this.toolService.wheel(i,r)&&e.preventDefault()},_meta:function(e){return{ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,shiftKey:e.shiftKey}},_calculatePosition:function(e){var n=e.pageX===t?e.originalEvent:e,i=new V(n.pageX,n.pageY),r=this.documentToModel(i);return r},_normalizePointZoom:function(e){return e.times(1/this.zoom())},_initialize:function(){this.shapes=[],this._selectedItems=[],this.connections=[],this._dataMap={},this._connectionsDataMap={},this._inactiveShapeItems=[],this._inactiveConnectionItems=[],this.undoRedoService=new j,this.id=x.randomId()},_fetchFreshData:function(){var t,n=this;n._dataSource(),n._isEditable&&n._connectionDataSource(),n.options.autoBind&&(n._isEditable?(n._preventRefresh=!0,n._preventConnectionsRefresh=!0,t=e.map([n.dataSource,n.connectionsDataSource],function(e){return e.fetch()}),e.when.apply(null,t).done(function(){n._preventRefresh=!1,n._preventConnectionsRefresh=!1,n.refresh()})):n.dataSource.fetch())},_dataSource:function(){var e,t;ot(this.options.connectionsDataSource)?(this._isEditable=!0,e=this.options.dataSource||{},t=at(e)?{data:e}:e,this.dataSource&&this._shapesRefreshHandler?this.dataSource.unbind("change",this._shapesRefreshHandler).unbind("error",this._shapesErrorHandler):(this._shapesRefreshHandler=S(this._refreshShapes,this),this._shapesErrorHandler=S(this._error,this)),this.dataSource=kendo.data.DataSource.create(t).bind("change",this._shapesRefreshHandler).bind("error",this._shapesErrorHandler)):(this._treeDataSource(),this._isEditable=!1)},_connectionDataSource:function(){var e,t=this.options.connectionsDataSource;t&&(e=at(t)?{data:t}:t,this.connectionsDataSource&&this._connectionsRefreshHandler?this.connectionsDataSource.unbind("change",this._connectionsRefreshHandler).unbind("error",this._connectionsErrorHandler):(this._connectionsRefreshHandler=S(this._refreshConnections,this),this._connectionsErrorHandler=S(this._error,this)),this.connectionsDataSource=kendo.data.DataSource.create(e).bind("change",this._connectionsRefreshHandler).bind("error",this._connectionsErrorHandler))},_refreshShapes:function(e){"remove"===e.action?this._removeShapes(e.items):"itemchange"===e.action?this._updateShapes(e.items,e.field):"add"===e.action?this._inactiveShapeItems=this._inactiveShapeItems.concat(e.items):"sync"===e.action?this._syncShapes(e.items):this.refresh()},refresh:function(){this._preventRefresh||(this.trigger("dataBound"),this.clear(),this._addShapes(this.dataSource.view()),this.connectionsDataSource&&this._addConnections(this.connectionsDataSource.view()),this.options.layout&&this.layout(this.options.layout))},refreshConnections:function(){this._preventConnectionsRefresh||(this.trigger("dataBound"),this._addConnections(this.connectionsDataSource.view()),this.options.layout&&this.layout(this.options.layout))},_removeShapes:function(e){for(var t=0;e.length>t;t++)this.remove(this._dataMap[e[t].id],!1),this._dataMap[e[t].id]=null},_syncShapes:function(e){var t,n,i,r,o=[];for(n=0;this._inactiveShapeItems.length>n;n++)for(r=this._inactiveShapeItems[n],t=0;e.length>t;t++)if(i=e[t],r.uid===i.uid){this._addDataItem(i),o.push(r);break}this._inactiveShapeItems=o},_updateShapes:function(e,t){var n,i,r;for(n=0;e.length>n;n++)i=e[n],r=this._dataMap[i.id],r.updateOptionsFromModel(i,t)},_addShapes:function(e){for(var t=0;e.length>t;t++)this._addDataItem(e[t])},_refreshConnections:function(e){"remove"===e.action?this._removeConnections(e.items):"add"===e.action?(this._inactiveConnectionItems=this._inactiveConnectionItems.concat(e.items),this._addConnections(e.items)):"sync"===e.action?this._syncConnections(e.items):"itemchange"===e.action?this._shouldRefresh&&this._updateConnections(e.items):this.refreshConnections()},_removeConnections:function(e){for(var t=0;e.length>t;t++)this.remove(this._connectionsDataMap[e[t].uid],!1),this._connectionsDataMap[e[t].uid]=null
},_syncConnections:function(e){var t,n,i,r,o=[];for(n=0;this._inactiveConnectionItems.length>n;n++)for(r=this._inactiveConnectionItems[n],t=0;e.length>t;t++)if(i=e[t],r.uid===i.uid){this._addConnectionDataItem(i),o.push(r);break}this._inactiveConnectionDataMaps=o},_updateConnections:function(e){var t,n,i,r,o;for(t=0;e.length>t;t++)n=e[t],i=this._connectionsDataMap[n.uid],i.updateOptionsFromModel(n),r=this._validateConnector(n.from),r&&i.source(r),o=this._validateConnector(n.to),o&&i.target(o)},_addConnections:function(e){var t,n,i=e.length;for(t=0;i>t;t++)n=e[t],this._addConnectionDataItem(n)},_addConnectionDataItem:function(e){var t,n,i,r;this._connectionsDataMap[e.uid]||(t=this._validateConnector(e.from),ot(t)&&null!==t||(t=new V(e.fromX,e.fromY)),n=this._validateConnector(e.to),ot(n)&&null!==n||(n=new V(e.toX,e.toY)),ot(t)&&ot(n)&&(i=D({},this.options.connectionDefaults),i.dataItem=e,r=new g(t,n,i),r.type(i.type||ht),this._connectionsDataMap[e.uid]=r,this.addConnection(r)))},_validateConnector:function(e){var t;return ot(e)&&null!==e&&(t=this._dataMap[e]),t},_treeDataSource:function(){var e=this,t=e.options,n=t.dataSource;n=at(n)?{data:n}:n,n.fields||(n.fields=[{field:"text"},{field:"url"},{field:"spriteCssClass"},{field:"imageUrl"}]),e.dataSource&&e._refreshHandler&&e._unbindDataSource(),e._refreshHandler=S(e._refreshSource,e),e._errorHandler=S(e._error,e),e.dataSource=E.create(n).bind(ft,e._refreshHandler).bind(_t,e._errorHandler)},_unbindDataSource:function(){var e=this;e.dataSource.unbind(ft,e._refreshHandler).unbind(_t,e._errorHandler)},_error:function(){},_adorn:function(e,n){n!==t&&e&&(n?(this._adorners.push(e),this.adornerLayer.append(e.visual)):(K.remove(this._adorners,e),this.adornerLayer.remove(e.visual)))},_showConnectors:function(e,t){t?this._connectorsAdorner.show(e):this._connectorsAdorner.destroy()},_updateAdorners:function(){var e,t,n=this._adorners;for(e=0;n.length>e;e++)t=n[e],t.refreshBounds&&t.refreshBounds(),t.refresh()},_refresh:function(){for(var e=0;this.connections.length>e;e++)this.connections[e].refresh()},_destroyToolBar:function(){this.singleToolBar&&(this.singleToolBar.hide(),this.singleToolBar.destroy(),this.singleToolBar=null)},_destroyGlobalToolBar:function(){this.toolBar&&(this.toolBar.hide(),this.toolBar.destroy(),this.toolBar=null)},exportDOMVisual:function(){var e=this.canvas._viewBox,t=k.transform().translate(-e.x,-e.y),n=new k.Rect([0,0],[e.width,e.height]),i=b.Path.fromRect(n),r=new b.Group({transform:t,clip:i}),o=this.canvas.drawingElement.children[0];return r.children.push(o),r},exportVisual:function(){var e=k.transform().scale(1/this._zoom),t=new b.Group({transform:e}),n=this.canvas.drawingElement.children[0];return t.children.push(n),t}}),y.ExportMixin.extend(m.fn,!0),kendo.PDFMixin&&kendo.PDFMixin.extend(m.fn),v=kendo.Observable.extend({init:function(e,t){kendo.Observable.fn.init.call(this),this.diagram=e,this.options=D({},this.options,t),this._tools=[],this.createToolBar(),this.createTools(),this.appendTools(),this.options.modal&&this.createPopup(),this.bind(this.events,t)},events:["click"],createPopup:function(){this.container=e("<div/>").append(this.element),this._popup=this.container.kendoPopup({}).getKendoPopup()},appendTools:function(){var e,t;for(e=0;this._tools.length>e;e++)t=this._tools[e],(t.buttons&&t.buttons.length||!ot(t.buttons))&&this._toolBar.add(t)},createToolBar:function(){this.element=e("<div/>"),this._toolBar=this.element.kendoToolBar({click:S(this.click,this),resizable:!1}).getKendoToolBar(),this.element.css("border","none")},createTools:function(){for(var e=0;this.options.tools.length>e;e++)this.createTool(this.options.tools[e])},createTool:function(e){var t;ct(e)?e.name?(t=e.name+"Tool",this[t]&&this[t](e)):e.template&&this._toolBar.add({template:e.template}):(t=e+"Tool",this[t]&&this[t]({}))},showAt:function(e){this._popup&&this._popup.open(e.x,e.y)},hide:function(){this._popup&&this._popup.close()},newGroup:function(){return{type:"buttonGroup",buttons:[]}},editTool:function(){this._tools.push({spriteCssClass:"k-icon k-i-pencil",showText:"overflow",type:"button",text:"Edit",attributes:this._setAttributes({action:"edit"})})},deleteTool:function(){this._tools.push({spriteCssClass:"k-icon k-i-close",showText:"overflow",type:"button",text:"Delete",attributes:this._setAttributes({action:"delete"})})},rotateAnticlockwiseTool:function(e){this._appendGroup("rotate"),this._rotateGroup.buttons.push({spriteCssClass:"k-icon k-i-rotateccw",showText:"overflow",text:"RotateAnticlockwise",group:"rotate",attributes:this._setAttributes({action:"rotateAnticlockwise",step:e.step})})},rotateClockwiseTool:function(e){this._appendGroup("rotate"),this._rotateGroup.buttons.push({spriteCssClass:"k-icon k-i-rotatecw",attributes:this._setAttributes({action:"rotateClockwise",step:e.step}),showText:"overflow",text:"RotateClockwise",group:"rotate"})},createShapeTool:function(){this._appendGroup("create"),this._createGroup.buttons.push({spriteCssClass:"k-icon k-i-shape",showText:"overflow",text:"CreateShape",group:"create",attributes:this._setAttributes({action:"createShape"})})},createConnectionTool:function(){this._appendGroup("create"),this._createGroup.buttons.push({spriteCssClass:"k-icon k-i-connector",showText:"overflow",text:"CreateConnection",group:"create",attributes:this._setAttributes({action:"createConnection"})})},undoTool:function(){this._appendGroup("history"),this._historyGroup.buttons.push({spriteCssClass:"k-icon k-i-undo",showText:"overflow",text:"Undo",group:"history",attributes:this._setAttributes({action:"undo"})})},redoTool:function(){this._appendGroup("history"),this._historyGroup.buttons.push({spriteCssClass:"k-icon k-i-redo",showText:"overflow",text:"Redo",group:"history",attributes:this._setAttributes({action:"redo"})})},_appendGroup:function(e){var t="_"+e+"Group";this[t]||(this[t]=this.newGroup(),this._tools.push(this[t]))},_setAttributes:function(e){var t={};return e.action&&(t[kendo.attr("action")]=e.action),e.step&&(t[kendo.attr("step")]=e.step),t},_getAttributes:function(e){var t,n={},i=e.attr(kendo.attr("action"));return i&&(n.action=i),t=e.attr(kendo.attr("step")),t&&(n.step=t),n},click:function(t){var n=this._getAttributes(e(t.target)),i=n.action;i&&this[i](n),this.trigger("click",this.eventData(i))},eventData:function(e){var t=this.selectedElements(),n=[],i=[];return t instanceof f?n.push(t):i.push(t),{shapes:n,connections:i,action:e}},"delete":function(){this.diagram.remove(this.selectedElements(),!0)},edit:function(){this.diagram.edit(this.selectedElements()[0])},rotateClockwise:function(e){var t=(this.selectedElements(),parseFloat(e.step||90));this._rotate(t)},rotateAnticlockwise:function(e){var t=(this.selectedElements(),parseFloat(e.step||90));this._rotate(-t)},_rotate:function(e){var t=this.diagram._resizingAdorner;t.angle(t.angle()+e),t.rotate()},selectedElements:function(){return this.diagram.select()},createShape:function(){this.diagram.createShape()},createConnection:function(){this.diagram.createConnection()},undo:function(){this.diagram.undo()},redo:function(){this.diagram.redo()},destroy:function(){this.diagram=null,this.element=null,this.options=null,this._toolBar&&this._toolBar.destroy(),this._popup&&this._popup.destroy()}}),_=kendo.Observable.extend({init:function(e,t){kendo.Observable.fn.init.call(this),this.options=A(!0,{},this.options,t),this.element=e,this.model=this.options.model,this.fields=this._getFields(),this._initContainer(),this.createEditable()},options:{editors:{}},_initContainer:function(){this.wrapper=this.element},createEditable:function(){var e=this.options;this.editable=new kendo.ui.Editable(this.wrapper,{fields:this.fields,target:e.target,clearContainer:!1,model:this.model})},_isEditable:function(e){return this.model.editable&&this.model.editable(e)},_getFields:function(){var e,t,n,i=[],r=this.model.fields;for(e in r)t={},this._isEditable(e)&&(n=this.options.editors[e],n&&(t.editor=n),t.field=e,i.push(t));return i},end:function(){return this.editable.end()},destroy:function(){this.editable.destroy(),this.editable.element.find("["+kendo.attr("container-for")+"]").empty(),this.model=this.wrapper=this.element=this.columns=this.editable=null}}),w=_.extend({init:function(e,t){_.fn.init.call(this,e,t),this.bind(this.events,this.options),this.open()},events:["update","cancel"],options:{window:{modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1}},_initContainer:function(){var t,n=this;this.wrapper=e('<div class="k-popup-edit-form"/>').attr(kendo.attr("uid"),this.model.uid),t="",this.options.template?(t+=this._renderTemplate(),this.fields=[]):t+=this._renderFields(),t+=this._renderButtons(),this.wrapper.append(e('<div class="k-edit-form-container"/>').append(t)),this.window=new kendo.ui.Window(this.wrapper,this.options.window),this.window.bind("close",function(e){e.userTriggered&&(e.sender.element.focus(),n._cancelClick(e))}),this._attachButtonEvents()},_renderTemplate:function(){var e=this.options.template;return"string"==typeof e&&(e=window.unescape(e)),e=kendo.template(e)(this.model)},_renderFields:function(){var e,t,n="";for(e=0;this.fields.length>e;e++)t=this.fields[e],n+='<div class="k-edit-label"><label for="'+t.field+'">'+(t.field||"")+"</label></div>",this._isEditable(t.field)&&(n+="<div "+kendo.attr("container-for")+'="'+t.field+'" class="k-edit-field"></div>');return n},_renderButtons:function(){var e='<div class="k-edit-buttons k-state-default">';return e+=this._createButton("update"),e+=this._createButton("cancel"),e+="</div>"},_createButton:function(e){return kendo.template(Jt)(u[e])},_attachButtonEvents:function(){this._cancelClickHandler=S(this._cancelClick,this),this.window.element.on(gt+ut,"a.k-diagram-cancel",this._cancelClickHandler),this._updateClickHandler=S(this._updateClick,this),this.window.element.on(gt+ut,"a.k-diagram-update",this._updateClickHandler)},_updateClick:function(e){e.preventDefault(),this.trigger("update")},_cancelClick:function(e){e.preventDefault(),this.trigger("cancel")},open:function(){this.window.center().open()},close:function(){this.window.bind("deactivate",S(this.destroy,this)).close()},destroy:function(){this.window.close().destroy(),this.window.element.off(gt+ut,"a.k-diagram-cancel",this._cancelClickHandler),this.window.element.off(gt+ut,"a.k-diagram-update",this._updateClickHandler),this._cancelClickHandler=null,this._editUpdateClickHandler=null,this.window=null,_.fn.destroy.call(this)}}),y.ui.plugin(m),D(x,{Shape:f,Connection:g,Connector:p,DiagramToolBar:v})}(window.kendo.jQuery),function(e,t){function n(e,t){if(null===t)return t;var n=b(e,!0);return n(t)}function i(e){return typeof e!==I}function r(e,t,n){var i,r,l=s(e),c=s(t),d=u(e)-u(t)<0,h=[];for(h.push(e),i=0;n>i;i++)r={r:o(l.r,c.r,i,n,d),g:o(l.g,c.g,i,n,d),b:o(l.b,c.b,i,n,d)},h.push(a(r));return h.push(t),h}function o(e,t,n,i,r){var o,a=p.min(p.abs(e),p.abs(t)),s=p.max(p.abs(e),p.abs(t)),l=(s-a)/(i+1),c=l*(n+1);return o=r?a+c:s-c}function a(e){return"#"+l(e.r)+l(e.g)+l(e.b)}function s(e){e=e.replace("#","");var t=c(e);return{r:d(t.r),g:d(t.g),b:d(t.b)}}function l(e){var t=p.round(e).toString(16).toUpperCase();return 1===t.length&&(t="0"+t),t}function c(e){var t=e.length,n={};return 3===t?(n.r=e[0],n.g=e[1],n.b=e[2]):(n.r=e.substring(0,2),n.g=e.substring(2,4),n.b=e.substring(4,6)),n}function d(e){return parseInt(e.toString(16),16)}function u(e){var t=0;return e&&(e=s(e),t=p.sqrt(.241*e.r*e.r+.691*e.g*e.g+.068*e.b*e.b)),t}function h(e){var t=p.pow(10,4);return p.round(e*t)/t}var p=Math,f=e.proxy,g=window.kendo,m=g.Class,v=g.ui.Widget,_=g.template,w=g.deepExtend,y=g.data.HierarchicalDataSource,b=g.getter,k=g.dataviz,x=".kendoTreeMap",C="change",T="dataBound",S="itemCreated",D=Number.MAX_VALUE,A="mouseover"+x,E="mouseleave"+x,I="undefined",P=v.extend({init:function(t,n){g.destroy(t),e(t).empty(),v.fn.init.call(this,t,n),this._initTheme(this.options),this.element.addClass("k-widget k-treemap"),this._setLayout(),this._originalOptions=w({},this.options),this._initDataSource(),this._attachEvents(),g.notify(this,k.ui)},options:{name:"TreeMap",theme:"default",autoBind:!0,textField:"text",valueField:"value",colorField:"color"},events:[T,S],_initTheme:function(e){var t=this,n=k.ui.themes||{},i=((e||{}).theme||"").toLowerCase(),r=(n[i]||{}).treeMap;t.options=w({},r,e)},_attachEvents:function(){this.element.on(A,f(this._mouseover,this)).on(E,f(this._mouseleave,this))},_setLayout:function(){"horizontal"===this.options.type?(this._layout=new z(!1),this._view=new R(this,this.options)):"vertical"===this.options.type?(this._layout=new z(!0),this._view=new R(this,this.options)):(this._layout=new M,this._view=new F(this,this.options))},_initDataSource:function(){var e=this,t=e.options,n=t.dataSource;e._dataChangeHandler=f(e._onDataChange,e),e.dataSource=y.create(n).bind(C,e._dataChangeHandler),n&&e.options.autoBind&&e.dataSource.fetch()},setDataSource:function(e){var t=this;t.dataSource.unbind(C,t._dataChangeHandler),t.dataSource=e.bind(C,t._dataChangeHandler),e&&t.options.autoBind&&t.dataSource.fetch()},_onDataChange:function(e){var t,n,o,a,s,l,c=e.node,d=e.items,u=this.options;if(c){if(d.length){for(a=this._getByUid(c.uid),a.children=[],o=i(a.minColor)||i(a.maxColor)?r(a.minColor,a.maxColor,d.length)||[]:u.colors||[],n=0;d.length>n;n++)t=d[n],a.children.push(this._wrapItem(t));for(s=this._view.htmlSize(a),this._layout.compute(a.children,a.coord,s),n=0;a.children.length>n;n++)t=a.children[n],i(t.color)||("string"==typeof o[0]?t.color=o[n%o.length]:(l=o[n%o.length],l&&(t.color=l[0],t.minColor=l[0],t.maxColor=l[1])));this._view.render(a)}}else this.element.empty(),t=this._wrapItem(d[0]),this._layout.createRoot(t,this.element.outerWidth(),this.element.outerHeight(),"vertical"===this.options.type),this._view.createRoot(t),this._root=t;for(n=0;d.length>n;n++)d[n].load();c&&this.trigger(T,{node:c})},_contentSize:function(e){this.view.renderHeight(e)},_wrapItem:function(e){var t={};return i(this.options.valueField)&&(t.value=n(this.options.valueField,e)),i(this.options.colorField)&&(t.color=n(this.options.colorField,e)),i(this.options.textField)&&(t.text=n(this.options.textField,e)),t.level=e.level(),t.dataItem=e,t},_getByUid:function(e){for(var t,n=[this._root];n.length;){if(t=n.pop(),t.dataItem.uid===e)return t;t.children&&(n=n.concat(t.children))}},dataItem:function(t){var n=e(t).attr(g.attr("uid")),i=this.dataSource;return i&&i.getByUid(n)},findByUid:function(e){return this.element.find(".k-treemap-tile["+g.attr("uid")+"='"+e+"']")},_mouseover:function(t){var n=e(t.target);n.hasClass("k-leaf")&&(this._removeActiveState(),n.removeClass("k-state-hover").addClass("k-state-hover"))},_removeActiveState:function(){this.element.find(".k-state-hover").removeClass("k-state-hover")},_mouseleave:function(){this._removeActiveState()},destroy:function(){v.fn.destroy.call(this),this.element.off(x),this.dataSource&&this.dataSource.unbind(C,this._dataChangeHandler),this._root=null,g.destroy(this.element)},items:function(){return e()},getSize:function(){return g.dimensions(this.element)},_resize:function(){this.dataSource.fetch()},setOptions:function(e){var n=e.dataSource;e.dataSource=t,this._originalOptions=w(this._originalOptions,e),this.options=w({},this._originalOptions),this._setLayout(),this._initTheme(this.options),v.fn._setEvents.call(this,e),n&&this.setDataSource(y.create(n)),this.options.autoBind&&this.dataSource.fetch()}}),M=m.extend({createRoot:function(e,t,n){e.coord={width:t,height:n,top:0,left:0}},leaf:function(e){return!e.children},layoutChildren:function(e,t){var n,i,r,o,a=t.width*t.height,s=0,l=[];for(n=0;e.length>n;n++)l[n]=parseFloat(e[n].value),s+=l[n];for(n=0;l.length>n;n++)e[n].area=a*l[n]/s;i=this.layoutHorizontal()?t.height:t.width,e=new g.data.Query(e)._sortForGrouping("value","desc"),r=[e[0]],o=e.slice(1),this.squarify(o,r,i,t)},squarify:function(e,t,n,i){this.computeDim(e,t,n,i)},computeDim:function(e,n,i,r){var o,a,s;return e.length+n.length==1?(o=1==e.length?e:n,this.layoutLast(o,i,r),t):(e.length>=2&&0===n.length&&(n=[e[0]],e=e.slice(1)),0===e.length?(n.length>0&&this.layoutRow(n,i,r),t):(a=e[0],this.worstAspectRatio(n,i)>=this.worstAspectRatio([a].concat(n),i)?this.computeDim(e.slice(1),n.concat([a]),i,r):(s=this.layoutRow(n,i,r),this.computeDim(e,[],s.dim,s)),t))},layoutLast:function(e,t,n){e[0].coord=n},layoutRow:function(e,t,n){return this.layoutHorizontal()?this.layoutV(e,t,n):this.layoutH(e,t,n)},orientation:"h",layoutVertical:function(){return"v"===this.orientation},layoutHorizontal:function(){return"h"===this.orientation},layoutChange:function(){this.orientation=this.layoutVertical()?"h":"v"},worstAspectRatio:function(e,t){var n,i,r,o,a;if(!e||0===e.length)return D;for(n=0,i=0,r=D,o=0;e.length>o;o++)a=e[o].area,n+=a,r=a>r?r:a,i=i>a?i:a;return p.max(t*t*i/(n*n),n*n/(t*t*r))},compute:function(e,t,n){if(t.width>=t.height&&this.layoutHorizontal()||this.layoutChange(),e&&e.length>0){var i={width:t.width,height:t.height-n.text,top:0,left:0};this.layoutChildren(e,i)}},layoutV:function(e,t,n){var i,r,o,a=this._totalArea(e),s=0;for(t=h(a/t),i=0;e.length>i;i++)r=h(e[i].area/t),e[i].coord={height:r,width:t,top:n.top+s,left:n.left},s+=r;return o={height:n.height,width:n.width-t,top:n.top,left:n.left+t},o.dim=p.min(o.width,o.height),o.dim!=o.height&&this.layoutChange(),o},layoutH:function(e,t,n){var i,r,o=this._totalArea(e),a=h(o/t),s=n.top,l=0;for(i=0;e.length>i;i++)e[i].coord={height:a,width:h(e[i].area/a),top:s,left:n.left+l},l+=e[i].coord.width;return r={height:n.height-a,width:n.width,top:n.top+a,left:n.left},r.dim=p.min(r.width,r.height),r.dim!=r.width&&this.layoutChange(),r},_totalArea:function(e){var t,n=0;for(t=0;e.length>t;t++)n+=e[t].area;return n}}),F=m.extend({init:function(t,n){this.options=w({},this.options,n),this.treeMap=t,this.element=e(t.element),this.offset=0},htmlSize:function(e){var t,n,i=this._getByUid(e.dataItem.uid),r={text:0};return e.children&&(this._clean(i),t=this._getText(e),t&&(n=this._createTitle(e),i.append(n),r.text=n.height()),i.append(this._createWrap()),this.offset=(i.outerWidth()-i.innerWidth())/2),r},_getByUid:function(e){return this.element.find(".k-treemap-tile["+g.attr("uid")+"='"+e+"']")},render:function(e){var t,n,i,r,o=this._getByUid(e.dataItem.uid),a=e.children;if(a)for(t=o.find(".k-treemap-wrap"),n=0;a.length>n;n++)i=a[n],r=this._createLeaf(i),t.append(r),this.treeMap.trigger(S,{element:r})},createRoot:function(e){var t=this._createLeaf(e);this.element.append(t),this.treeMap.trigger(S,{element:t})},_clean:function(e){e.css("background-color",""),e.removeClass("k-leaf"),e.removeClass("k-inverse"),e.empty()},_createLeaf:function(t){return this._createTile(t).css("background-color",t.color).addClass("k-leaf").toggleClass("k-inverse",this._tileColorBrightness(t)>180).append(e("<div></div>").html(this._getText(t)))},_createTile:function(t){var n,r={width:t.coord.width,height:t.coord.height,left:t.coord.left,top:t.coord.top};return r.width+=r.left&&this.offset?2*this.offset:this.offset,r.height+=r.top?2*this.offset:this.offset,n=e("<div class='k-treemap-tile'></div>").css({width:r.width,height:r.height,left:r.left,top:r.top}),i(t.dataItem)&&i(t.dataItem.uid)&&n.attr(g.attr("uid"),t.dataItem.uid),n},_getText:function(e){var t=e.text;return this.options.template&&(t=this._renderTemplate(e)),t},_renderTemplate:function(e){var t=_(this.options.template);return t({dataItem:e.dataItem,text:e.text})},_createTitle:function(t){return e("<div class='k-treemap-title'></div>").append(e("<div></div>").html(this._getText(t)))},_createWrap:function(){return e("<div class='k-treemap-wrap'></div>")},_tileColorBrightness:function(e){return u(e.color)}}),z=m.extend({createRoot:function(e,t,n,i){e.coord={width:t,height:n,top:0,left:0},e.vertical=i},init:function(e){this.vertical=e,this.quotient=e?1:0},compute:function(e,t,n){var i,r,o;e.length>0&&(i=t.width,r=t.height,this.vertical?r-=n.text:i-=n.text,o={width:i,height:r,top:0,left:0},this.layoutChildren(e,o))},layoutChildren:function(e,t){var n,i,r=t.width*t.height,o=0,a=[];for(n=0;e.length>n;n++)i=e[n],a[n]=parseFloat(e[n].value),o+=a[n],i.vertical=this.vertical;for(n=0;a.length>n;n++)e[n].area=r*a[n]/o;e=new g.data.Query(e)._sortForGrouping("value","desc"),this.sliceAndDice(e,t)},sliceAndDice:function(e,t){var n=this._totalArea(e);e[0].level%2===this.quotient?this.layoutHorizontal(e,t,n):this.layoutVertical(e,t,n)},layoutHorizontal:function(e,t,n){var i,r,o,a=0;for(i=0;e.length>i;i++)r=e[i],o=r.area/(n/t.width),r.coord={height:t.height,width:o,top:t.top,left:t.left+a},a+=o},layoutVertical:function(e,t,n){var i,r,o,a=0;for(i=0;e.length>i;i++)r=e[i],o=r.area/(n/t.height),r.coord={height:o,width:t.width,top:t.top+a,left:t.left},a+=o},_totalArea:function(e){var t,n=0;for(t=0;e.length>t;t++)n+=e[t].area;return n}}),R=F.extend({htmlSize:function(e){var t,n,i=this._getByUid(e.dataItem.uid),r={text:0,offset:0};return e.children&&(this._clean(i),t=this._getText(e),t&&(n=this._createTitle(e),i.append(n),r.text=e.vertical?n.height():n.width()),i.append(this._createWrap()),this.offset=(i.outerWidth()-i.innerWidth())/2),r},_createTitle:function(t){var n;return n=e(t.vertical?"<div class='k-treemap-title'></div>":"<div class='k-treemap-title-vertical'></div>"),n.append(e("<div></div>").html(this._getText(t)))}});k.ui.plugin(P)}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.mobile.ui,i=n.Shim,r=n.Widget,o="beforeOpen",a="open",s="close",l="init",c='<div class="km-modalview-wrapper" />',d=n.View.extend({init:function(e,t){var n=this;r.fn.init.call(n,e,t),n._id(),n._wrap(),n._shim(),this.options.$angular||(n._layout(),n._scroller(),n._model()),n.element.css("display",""),n.trigger(l)},events:[l,o,a,s],options:{name:"ModalView",modal:!0,width:null,height:null},destroy:function(){r.fn.destroy.call(this),this.shim.destroy()},open:function(t){var n=this;n.target=e(t),n.shim.show(),n._invokeNgController(),n.trigger("show",{view:n})},openFor:function(e){this.trigger(o,{target:e})||(this.open(e),this.trigger(a,{target:e}))},close:function(){this.element.is(":visible")&&!this.trigger(s)&&this.shim.hide()},_wrap:function(){var e,t,n=this,i=n.element,r=n.options;e=i[0].style.width||"auto",t=i[0].style.height||"auto",i.addClass("km-modalview").wrap(c),n.wrapper=i.parent().css({width:r.width||e||300,height:r.height||t||300}).addClass("auto"==t?" km-auto-height":""),i.css({width:"",height:""})},_shim:function(){var e=this;e.shim=new i(e.wrapper,{modal:e.options.modal,position:"center center",align:"center center",effect:"fade:in",className:"km-modalview-root",hide:function(t){e.trigger(s)&&t.preventDefault()}})}});n.plugin(d)}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.mobile,r=n.support.mobileOS,o=n.effects.Transition,a=n.roleSelector,s="x",l=i.ui,c=!(r.ios&&7==r.majorVersion&&!r.appMode),d="beforeShow",u="init",h="show",p="hide",f="afterHide",g={enable:e.noop},m=l.View.extend({init:function(t,r){var o,s,l,d,h;if(e(t).parent().prepend(t),i.ui.Widget.fn.init.call(this,t,r),this.options.$angular||(this._layout(),this._scroller()),this._model(),o=this.element.closest(a("pane")).data("kendoMobilePane"))this.pane=o,this.pane.bind("viewShow",function(e){d._viewShow(e)}),this.pane.bind("sameViewRequested",function(){d.hide()}),s=this.userEvents=new n.UserEvents(o.element,{filter:a("view splitview"),allowSelection:!0});else{if(this.currentView=g,l=e(this.options.container),!l)throw Error("The drawer needs a container configuration option set.");s=this.userEvents=new n.UserEvents(l,{allowSelection:!0}),this._attachTransition(l)}d=this,h=function(e){d.visible&&(d.hide(),e.preventDefault())},this.options.swipeToOpen&&c?(s.bind("press",function(){d.transition.cancel()}),s.bind("start",function(e){d._start(e)}),s.bind("move",function(e){d._update(e)}),s.bind("end",function(e){d._end(e)}),s.bind("tap",h)):s.bind("press",h),this.leftPositioned="left"===this.options.position,this.visible=!1,this.element.hide().addClass("km-drawer").addClass(this.leftPositioned?"km-left-drawer":"km-right-drawer"),this.trigger(u)},options:{name:"Drawer",position:"left",views:[],swipeToOpenViews:[],swipeToOpen:!0,title:"",container:null},events:[d,p,f,u,h],show:function(){this._activate()&&this._show()},hide:function(){this.currentView&&(this.currentView.enable(),m.current=null,this._moveViewTo(0),this.trigger(p,{view:this}))},openFor:function(){this.visible?this.hide():this.show()},destroy:function(){l.View.fn.destroy.call(this),this.userEvents.destroy()},_activate:function(){if(this.visible)return!0;var e=this._currentViewIncludedIn(this.options.views);return!e||this.trigger(d,{view:this})?!1:(this._setAsCurrent(),this.element.show(),this.trigger(h,{view:this}),this._invokeNgController(),!0)},_currentViewIncludedIn:function(t){if(!this.pane||!t.length)return!0;var n=this.pane.view();return e.inArray(n.id.replace("#",""),t)>-1||e.inArray(n.element.attr("id"),t)>-1},_show:function(){this.currentView.enable(!1),this.visible=!0;var e=this.element.width();this.leftPositioned||(e=-e),this._moveViewTo(e)},_setAsCurrent:function(){m.last!==this&&(m.last&&m.last.element.hide(),this.element.show()),m.last=this,m.current=this},_moveViewTo:function(e){this.userEvents.cancel(),this.transition.moveTo({location:e,duration:400,ease:o.easeOutExpo})},_viewShow:function(e){return this.currentView&&this.currentView.enable(),this.currentView===e.view?(this.hide(),t):(this.currentView=e.view,this._attachTransition(e.view.element),t)},_attachTransition:function(e){var t=this,i=this.movable,r=i&&i.x;this.transition&&(this.transition.cancel(),this.movable.moveAxis("x",0)),i=this.movable=new n.ui.Movable(e),this.transition=new o({axis:s,movable:this.movable,onEnd:function(){0===i[s]&&(e[0].style.cssText="",t.element.hide(),t.trigger(f),t.visible=!1)}}),r&&(e.addClass("k-fx-hidden"),n.animationFrame(function(){e.removeClass("k-fx-hidden"),t.movable.moveAxis(s,r),t.hide()}))},_start:function(e){var i,r,o,a,s,l=e.sender;return Math.abs(e.x.velocity)<Math.abs(e.y.velocity)||n.triggeredByInput(e.event)||!this._currentViewIncludedIn(this.options.swipeToOpenViews)?(l.cancel(),t):(i=this.leftPositioned,r=this.visible,o=i&&r||!i&&!m.current,a=!i&&r||i&&!m.current,s=0>e.x.velocity,(o&&s||a&&!s)&&this._activate()?(l.capture(),t):(l.cancel(),t))},_update:function(e){var t,n=this.movable,i=n.x+e.x.delta;t=this.leftPositioned?Math.min(Math.max(0,i),this.element.width()):Math.max(Math.min(0,i),-this.element.width()),this.movable.moveAxis(s,t),e.event.preventDefault(),e.event.stopPropagation()},_end:function(e){var t,n=e.x.velocity,i=Math.abs(this.movable.x)>this.element.width()/2,r=.8;t=this.leftPositioned?n>-r&&(n>r||i):r>n&&(-r>n||i),t?this._show():this.hide()}});l.plugin(m)}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.mobile.ui,i=n.Widget,r="<div class='km-expanded-pane-shim' />",o=n.View,a=o.extend({init:function(o,a){var s,l,c=this;i.fn.init.call(c,o,a),o=c.element,e.extend(c,a),c._id(),c.options.$angular?c._overlay():(c._layout(),c._overlay()),c._style(),l=o.children(c._locate("modalview")),c.options.$angular?l.each(function(n,i){t.compileMobileDirective(e(i))}):t.mobile.init(l),c.panes=[],c._paramsHistory=[],c.options.$angular?c.element.children(t.directiveSelector("pane")).each(function(){s=t.compileMobileDirective(e(this)),c.panes.push(s)}):c.content.children(t.roleSelector("pane")).each(function(){s=t.initWidget(this,{},n.roles),c.panes.push(s)}),c.expandedPaneShim=e(r).appendTo(c.element),c._shimUserEvents=new t.UserEvents(c.expandedPaneShim,{tap:function(){c.collapsePanes()}})},_locate:function(e){return this.options.$angular?t.directiveSelector(e):t.roleSelector(e)},options:{name:"SplitView",style:"horizontal"},expandPanes:function(){this.element.addClass("km-expanded-splitview")},collapsePanes:function(){this.element.removeClass("km-expanded-splitview")},_layout:function(){var e=this,n=e.element;e.transition=t.attrValue(n,"transition"),t.mobile.ui.View.prototype._layout.call(this),t.mobile.init(this.header.add(this.footer)),e.element.addClass("km-splitview"),e.content.addClass("km-split-content")},_style:function(){var t,n=this.options.style,i=this.element;n&&(t=n.split(" "),e.each(t,function(){i.addClass("km-split-"+this)}))},showStart:function(){var t=this;t.element.css("display",""),t.inited||(t.inited=!0,e.each(t.panes,function(){this.options.initial?this.navigateToInitial():this.navigate("")}),t.trigger("init",{view:t})),t.trigger("show",{view:t})}});n.plugin(a)}(window.kendo.jQuery),function(e,t){function n(e,t){var n=[];return f&&n.push("km-on-"+f.name),n.push(e.skin?"km-"+e.skin:"ios"==e.name&&e.majorVersion>6?"km-ios7":"km-"+e.name),("ios"==e.name&&7>e.majorVersion||"ios"!=e.name)&&n.push("km-"+e.name+e.majorVersion),n.push("km-"+e.majorVersion),n.push("km-m"+(e.minorVersion?e.minorVersion[0]:0)),e.variant&&(e.skin&&e.skin===e.name||!e.skin||e.setDefaultPlatform===!1)&&n.push("km-"+(e.skin?e.skin:e.name)+"-"+e.variant),e.cordova&&n.push("km-cordova"),n.push(e.appMode?"km-app":"km-web"),t&&t.statusBarStyle&&n.push("km-"+t.statusBarStyle+"-status-bar"),n.join(" ")}function i(t){return"km-wp-"+(t.noVariantSet?0===parseInt(e("<div style='background: Background' />").css("background-color").split(",")[1],10)?"dark":"light":t.variant+" km-wp-"+t.variant+"-force")}function r(e){return f.wp?"-kendo-landscape"==e.css("animation-name"):Math.abs(window.orientation)/90==1}function o(e){return r(e)?y:m}function a(e){e.parent().addBack().css("min-height",window.innerHeight)}function s(){e("meta[name=viewport]").remove(),R.append(k({height:", width=device-width"+(r()?", height="+window.innerHeight+"px":d.mobileOS.flatVersion>=600&&700>d.mobileOS.flatVersion?", height="+window.innerWidth+"px":", height=device-height")}))}var l=window.kendo,c=l.mobile,d=l.support,u=c.ui.Widget,h=c.ui.Pane,p="ios7",f=d.mobileOS,g="blackberry"==f.device&&f.flatVersion>=600&&1e3>f.flatVersion&&f.appMode,m="km-vertical",v="chrome"===f.browser,_=f.ios&&f.flatVersion>=700&&800>f.flatVersion&&(f.appMode||v),w=Math.abs(window.orientation)/90==1,y="km-horizontal",b={ios7:{ios:!0,browser:"default",device:"iphone",flatVersion:"700",majorVersion:"7",minorVersion:"0.0",name:"ios",tablet:!1},ios:{ios:!0,browser:"default",device:"iphone",flatVersion:"612",majorVersion:"6",minorVersion:"1.2",name:"ios",tablet:!1},android:{android:!0,browser:"default",device:"android",flatVersion:"442",majorVersion:"4",minorVersion:"4.2",name:"android",tablet:!1},blackberry:{blackberry:!0,browser:"default",device:"blackberry",flatVersion:"710",majorVersion:"7",minorVersion:"1.0",name:"blackberry",tablet:!1},meego:{meego:!0,browser:"default",device:"meego",flatVersion:"850",majorVersion:"8",minorVersion:"5.0",name:"meego",tablet:!1},wp:{wp:!0,browser:"default",device:"wp",flatVersion:"800",majorVersion:"8",minorVersion:"0.0",name:"wp",tablet:!1}},k=l.template('<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no#=data.height#" name="viewport" />',{usedWithBlock:!1}),x=l.template('<meta name="apple-mobile-web-app-capable" content="#= data.webAppCapable === false ? \'no\' : \'yes\' #" /> <meta name="apple-mobile-web-app-status-bar-style" content="#=data.statusBarStyle#" /> <meta name="msapplication-tap-highlight" content="no" /> ',{usedWithBlock:!1}),C=l.template("<style>.km-view { clip: rect(0 #= data.width #px #= data.height #px 0); }</style>",{usedWithBlock:!1}),T=f.android&&"chrome"!=f.browser||f.blackberry,S=k({height:""}),D=l.template('<link rel="apple-touch-icon'+(f.android?"-precomposed":"")+'" # if(data.size) { # sizes="#=data.size#" #}# href="#=data.icon#" />',{usedWithBlock:!1}),A=("iphone"==f.device||"ipod"==f.device)&&7>f.majorVersion,E=("iphone"==f.device||"ipod"==f.device)&&f.majorVersion>=7,I=E?"none":null,P="mobilesafari"==f.browser?60:0,M=20,F=e(window),z=window.screen,R=e("head"),B="init",H=e.proxy,L=u.extend({init:function(t,n){c.application=this,e(e.proxy(this,"bootstrap",t,n))},bootstrap:function(t,n){var i,r,o;t=e(t),t[0]||(t=e(document.body)),u.fn.init.call(this,t,n),this.element.removeAttr("data-"+l.ns+"role"),this._setupPlatform(),this._attachMeta(),this._setupElementClass(),this._attachHideBarHandlers(),i=e.extend({},this.options),delete i.name,r=this,o=function(){r.pane=new h(r.element,i),r.pane.navigateToInitial(),r.options.updateDocumentTitle&&r._setupDocumentTitle(),r._startHistory(),r.trigger(B)
},this.options.$angular?setTimeout(o):o()},options:{name:"Application",hideAddressBar:!0,browserHistory:!0,historyTransition:I,modelScope:window,statusBarStyle:"black",transition:"",platform:null,skin:null,updateDocumentTitle:!0,useNativeScrolling:!1},events:[B],navigate:function(e,t){this.pane.navigate(e,t)},replace:function(e,t){this.pane.replace(e,t)},scroller:function(){return this.view().scroller},hideLoading:function(){if(!this.pane)throw Error("The mobile application instance is not fully instantiated. Please consider activating loading in the application init event handler.");this.pane.hideLoading()},showLoading:function(){if(!this.pane)throw Error("The mobile application instance is not fully instantiated. Please consider activating loading in the application init event handler.");this.pane.showLoading()},changeLoadingMessage:function(e){if(!this.pane)throw Error("The mobile application instance is not fully instantiated. Please consider changing the message in the application init event handler.");this.pane.changeLoadingMessage(e)},view:function(){return this.pane.view()},skin:function(e){var t=this;return arguments.length?(t.options.skin=e||"",t.element[0].className="km-pane",t._setupPlatform(),t._setupElementClass(),t.options.skin):t.options.skin},destroy:function(){u.fn.destroy.call(this),this.pane.destroy(),this.router.destroy()},_setupPlatform:function(){var t=this,r=t.options.platform,o=t.options.skin,a=[],s=f||b[p];r&&(s.setDefaultPlatform=!0,"string"==typeof r?(a=r.split("-"),s=e.extend({variant:a[1]},s,b[a[0]])):s=r),o&&(a=o.split("-"),f||(s.setDefaultPlatform=!1),s=e.extend({},s,{skin:a[0],variant:a[1]})),s.variant||(s.noVariantSet=!0,s.variant="dark"),t.os=s,t.osCssClass=n(t.os,t.options),"wp"==s.name&&(t.refreshBackgroundColorProxy||(t.refreshBackgroundColorProxy=e.proxy(function(){(t.os.variant&&t.os.skin&&t.os.skin===t.os.name||!t.os.skin)&&t.element.removeClass("km-wp-dark km-wp-light km-wp-dark-force km-wp-light-force").addClass(i(t.os))},t)),e(document).off("visibilitychange",t.refreshBackgroundColorProxy),e(document).off("resume",t.refreshBackgroundColorProxy),s.skin||(t.element.parent().css("overflow","hidden"),e(document).on("visibilitychange",t.refreshBackgroundColorProxy),e(document).on("resume",t.refreshBackgroundColorProxy),t.refreshBackgroundColorProxy()))},_startHistory:function(){this.options.browserHistory?(this.router=new l.Router({pushState:this.options.pushState,root:this.options.root,hashBang:this.options.hashBang}),this.pane.bindToRouter(this.router),this.router.start()):this.options.initial||this.pane.navigate("")},_resizeToScreenHeight:function(){var t,n=e("meta[name=apple-mobile-web-app-status-bar-style]").attr("content").match(/black-translucent|hidden/),i=this.element;t=v?window.innerHeight:r(i)?n?w?z.availWidth+M:z.availWidth:w?z.availWidth:z.availWidth-M:n?w?z.availHeight:z.availHeight+M:w?z.availHeight-M:z.availHeight,i.height(t)},_setupElementClass:function(){var t,n=this,i=n.element;i.parent().addClass("km-root km-"+(n.os.tablet?"tablet":"phone")),i.addClass(n.osCssClass+" "+o(i)),this.options.useNativeScrolling&&i.parent().addClass("km-native-scrolling"),v&&i.addClass("km-ios-chrome"),d.wpDevicePixelRatio&&i.parent().css("font-size",d.wpDevicePixelRatio+"em"),g&&s(),n.options.useNativeScrolling?i.parent().addClass("km-native-scrolling"):T&&(t=(screen.availWidth>screen.availHeight?screen.availWidth:screen.availHeight)+200,e(C({width:t,height:t})).appendTo(R)),_&&n._resizeToScreenHeight(),l.onResize(function(){i.removeClass("km-horizontal km-vertical").addClass(o(i)),n.options.useNativeScrolling&&a(i),_&&n._resizeToScreenHeight(),g&&s(),l.resize(i)})},_clearExistingMeta:function(){R.find("meta").filter("[name|='apple-mobile-web-app'],[name|='msapplication-tap'],[name='viewport']").remove()},_attachMeta:function(){var e,t=this.options,n=t.icon;if(this._clearExistingMeta(),g||R.prepend(S),R.prepend(x(t)),n){"string"==typeof n&&(n={"":n});for(e in n)R.prepend(D({icon:n[e],size:e}))}t.useNativeScrolling&&a(this.element)},_attachHideBarHandlers:function(){var e=this,t=H(e,"_hideBar");!d.mobileOS.appMode&&e.options.hideAddressBar&&A&&!e.options.useNativeScrolling&&(e._initialHeight={},F.on("load",t),l.onResize(function(){setTimeout(window.scrollTo,0,0,1)}))},_setupDocumentTitle:function(){var e=this,n=document.title;e.pane.bind("viewShow",function(e){var i=e.view.title;document.title=i!==t?i:n})},_hideBar:function(){var t=this,n=t.element;n.height(l.support.transforms.css+"calc(100% + "+P+"px)"),e(window).trigger(l.support.resize)}});l.mobile.Application=L,l.ui.plugin(L,l.mobile,"Mobile")}(window.kendo.jQuery),function(e,t){function n(t,n,i){e(n.target).closest(".km-button,.km-detail").toggleClass("km-state-active",i),d&&t.deactivateTimeoutID&&(clearTimeout(t.deactivateTimeoutID),t.deactivateTimeoutID=0)}function i(t){return e('<span class="km-badge">'+t+"</span>")}var r=window.kendo,o=r.mobile,a=o.ui,s=a.Widget,l=r.support,c=l.mobileOS,d=c.android&&c.flatVersion>=300,u="click",h="disabled",p="km-state-disabled",f=s.extend({init:function(e,t){var i=this;s.fn.init.call(i,e,t),i._wrap(),i._style(),i.options.enable=i.options.enable&&!i.element.attr(h),i.enable(i.options.enable),i._userEvents=new r.UserEvents(i.element,{press:function(e){i._activate(e)},tap:function(e){i._release(e)},release:function(e){n(i,e,!1)}}),d&&i.element.on("move",function(e){i._timeoutDeactivate(e)})},destroy:function(){s.fn.destroy.call(this),this._userEvents.destroy()},events:[u],options:{name:"Button",icon:"",style:"",badge:"",enable:!0},badge:function(e){var t=this.badgeElement=this.badgeElement||i(e).appendTo(this.element);return e||0===e?(t.html(e),this):e===!1?(t.empty().remove(),this.badgeElement=!1,this):t.html()},enable:function(e){var n=this.element;t===e&&(e=!0),this.options.enable=e,e?n.removeAttr(h):n.attr(h,h),n.toggleClass(p,!e)},_timeoutDeactivate:function(e){this.deactivateTimeoutID||(this.deactivateTimeoutID=setTimeout(n,500,this,e,!1))},_activate:function(e){var t=document.activeElement,i=t?t.nodeName:"";this.options.enable&&(n(this,e,!0),("INPUT"==i||"TEXTAREA"==i)&&t.blur())},_release:function(n){var i=this;if(!(n.which>1))return i.options.enable?(i.trigger(u,{target:e(n.target),button:i.element})&&n.preventDefault(),t):(n.preventDefault(),t)},_style:function(){var t,n=this.options.style,i=this.element;n&&(t=n.split(" "),e.each(t,function(){i.addClass("km-"+this)}))},_wrap:function(){var t=this,n=t.options.icon,r=t.options.badge,o='<span class="km-icon km-'+n,a=t.element.addClass("km-button"),s=a.children("span:not(.km-icon)").addClass("km-text"),l=a.find("img").addClass("km-image");!s[0]&&a.html()&&(s=a.wrapInner('<span class="km-text" />').children("span.km-text")),!l[0]&&n&&(s[0]||(o+=" km-notext"),t.iconElement=a.prepend(e(o+'" />'))),(r||0===r)&&(t.badgeElement=i(r).appendTo(a))}}),g=f.extend({options:{name:"BackButton",style:"back"},init:function(e,n){var i=this;f.fn.init.call(i,e,n),t===i.element.attr("href")&&i.element.attr("href","#:back")}}),m=f.extend({options:{name:"DetailButton",style:""},init:function(e,t){f.fn.init.call(this,e,t)},_style:function(){var t,n=this.options.style+" detail",i=this.element;n&&(t=n.split(" "),e.each(t,function(){i.addClass("km-"+this)}))},_wrap:function(){var t=this,n=t.options.icon,i='<span class="km-icon km-'+n,r=t.element,o=r.children("span"),a=r.find("img").addClass("km-image");!a[0]&&n&&(o[0]||(i+=" km-notext"),r.prepend(e(i+'" />')))}});a.plugin(f),a.plugin(g),a.plugin(m)}(window.kendo.jQuery),function(e,t){function n(t){return e('<span class="km-badge">'+t+"</span>")}var i=window.kendo,r=i.mobile.ui,o=r.Widget,a="km-state-active",s="km-state-disabled",l="select",c="li:not(."+a+")",d=o.extend({init:function(e,t){var n=this;o.fn.init.call(n,e,t),n.element.addClass("km-buttongroup").find("li").each(n._button),n.element.on(n.options.selectOn,c,"_select"),n._enable=!0,n.select(n.options.index),n.options.enable||(n._enable=!1,n.wrapper.addClass(s))},events:[l],options:{name:"ButtonGroup",selectOn:"down",index:-1,enable:!0},current:function(){return this.element.find("."+a)},select:function(n){var i=this,r=-1;n!==t&&-1!==n&&i._enable&&!e(n).is("."+s)&&(i.current().removeClass(a),"number"==typeof n?(r=n,n=e(i.element[0].children[n])):n.nodeType&&(n=e(n),r=n.index()),n.addClass(a),i.selectedIndex=r)},badge:function(t,i){var r,o=this.element;return isNaN(t)||(t=o.children().get(t)),t=o.find(t),r=e(t.children(".km-badge")[0]||n(i).appendTo(t)),i||0===i?(r.html(i),this):i===!1?(r.empty().remove(),this):r.html()},enable:function(e){var n=this.wrapper;t===e&&(e=!0),e?n.removeClass(s):n.addClass(s),this._enable=this.options.enable=e},_button:function(){var t=e(this).addClass("km-button"),r=i.attrValue(t,"icon"),o=i.attrValue(t,"badge"),a=t.children("span"),s=t.find("img").addClass("km-image");a[0]||(a=t.wrapInner("<span/>").children("span")),a.addClass("km-text"),!s[0]&&r&&t.prepend(e('<span class="km-icon km-'+r+'"/>')),(o||0===o)&&n(o).appendTo(t)},_select:function(e){e.which>1||e.isDefaultPrevented()||!this._enable||(this.select(e.currentTarget),this.trigger(l,{index:this.selectedIndex}))}});r.plugin(d)}(window.kendo.jQuery),function(e,t){function n(){return this.nodeType===v.TEXT_NODE&&this.nodeValue.match(U)}function i(e,t){t&&!e[0].querySelector(".km-icon")&&e.prepend('<span class="km-icon km-'+t+'"/>')}function r(e){i(e,S(e,"icon")),i(e,S(e.children(C),"icon"))}function o(e){var t=e.parent(),r=e.add(t.children(m.roleSelector("detailbutton"))),o=t.contents().not(r).not(n);o.length||(e.addClass("km-listview-link").attr(m.attr("role"),"listview-link"),i(e,S(t,"icon")),i(e,S(e,"icon")))}function a(e){if(e[0].querySelector("input[type=checkbox],input[type=radio]")){var t=e.parent();t.contents().not(e).not(function(){return 3==this.nodeType})[0]||(e.addClass("km-listview-label"),e.children("[type=checkbox],[type=radio]").addClass("km-widget km-icon km-check"))}}function s(t,n){e(t).css("transform","translate3d(0px, "+n+"px, 0px)")}var l,c,d,u,h,p,f,g,m=window.kendo,v=window.Node,_=m.mobile,w=_.ui,y=m.data.DataSource,b=w.DataBoundWidget,k=".km-list > li, > li:not(.km-group-container)",x=".km-listview-link, .km-listview-label",C="["+m.attr("icon")+"]",T=e.proxy,S=m.attrValue,D="km-group-title",A="km-state-active",E='<div class="'+D+'"><div class="km-text"></div></div>',I=m.template('<li><div class="'+D+'"><div class="km-text">#= this.headerTemplate(data) #</div></div><ul>#= kendo.render(this.template, data.items)#</ul></li>'),P='<div class="km-listview-wrapper" />',M=m.template('<form class="km-filter-form"><div class="km-filter-wrap"><input type="search" placeholder="#=placeholder#"/><a href="\\#" class="km-filter-reset" title="Clear"><span class="km-icon km-clear"></span><span class="km-text">Clear</span></a></div></form>'),F=".kendoMobileListView",z="styled",R="dataBound",B="dataBinding",H="itemChange",L="click",N="change",O="progress",V="function",U=/^\s+$/,W=/button/,j=m.Class.extend({init:function(e){var t,n,i=e.scroller();i&&(this.options=e.options,this.element=e.element,this.scroller=e.scroller(),this._shouldFixHeaders(),t=this,n=function(){t._cacheHeaders()},e.bind("resize",n),e.bind(z,n),e.bind(R,n),i.bind("scroll",function(e){t._fixHeader(e)}))},_fixHeader:function(t){if(this.fixedHeaders){var n,i,r,o=0,a=this.scroller,s=this.headers,l=t.scrollTop;do{if(n=s[o++],!n){r=e("<div />");break}i=n.offset,r=n.header}while(i+1>l);this.currentHeader!=o&&(a.fixedContainer.html(r.clone()),this.currentHeader=o)}},_shouldFixHeaders:function(){this.fixedHeaders="group"===this.options.type&&this.options.fixedHeaders},_cacheHeaders:function(){if(this._shouldFixHeaders(),this.fixedHeaders){var t=[],n=this.scroller.scrollTop;this.element.find("."+D).each(function(i,r){r=e(r),t.unshift({offset:r.position().top+n,header:r})}),this.headers=t,this._fixHeader({scrollTop:n})}}}),q=function(){return{page:1}},G=m.Class.extend({init:function(e){var t=this,n=e.options,i=e.scroller(),r=n.pullParameters||q;this.listView=e,this.scroller=i,e.bind("_dataSource",function(e){t.setDataSource(e.dataSource)}),i.setOptions({pullToRefresh:!0,pull:function(){t._pulled||(t._pulled=!0,t.dataSource.read(r.call(e,t._first)))},messages:{pullTemplate:n.messages.pullTemplate,releaseTemplate:n.messages.releaseTemplate,refreshTemplate:n.messages.refreshTemplate}})},setDataSource:function(e){var t=this;this._first=e.view()[0],this.dataSource=e,e.bind("change",function(){t._change()}),e.bind("error",function(){t._change()})},_change:function(){var e,t=this.scroller,n=this.dataSource;this._pulled&&t.pullHandled(),(this._pulled||!this._first)&&(e=n.view(),e[0]&&(this._first=e[0])),this._pulled=!1}}),$=m.Observable.extend({init:function(e){var t=this;m.Observable.fn.init.call(t),t.buffer=e.buffer,t.height=e.height,t.item=e.item,t.items=[],t.footer=e.footer,t.buffer.bind("reset",function(){t.refresh()})},refresh:function(){for(var e,t,n,i,r=this.buffer,o=this.items,a=!1;o.length;)o.pop().destroy();for(this.offset=r.offset,e=this.item,i=0;r.viewSize>i;i++){if(i===r.total()){a=!0;break}n=e(this.content(this.offset+o.length)),n.below(t),t=n,o.push(n)}this.itemCount=o.length,this.trigger("reset"),this._resize(),a&&this.trigger("endReached")},totalHeight:function(){if(!this.items[0])return 0;var e=this,t=e.items,n=t[0].top,i=t[t.length-1].bottom,r=(i-n)/e.itemCount,o=e.buffer.length-e.offset-e.itemCount;return(this.footer?this.footer.height:0)+i+o*r},batchUpdate:function(e){var t,n,i=this.height(),r=this.items,o=this.offset;if(r[0]){if(this.lastDirection)for(;r[r.length-1].bottom>e+2*i&&0!==this.offset;)this.offset--,t=r.pop(),t.update(this.content(this.offset)),t.above(r[0]),r.unshift(t);else for(;e-i>r[0].top;){if(n=this.offset+this.itemCount,n===this.buffer.total()){this.trigger("endReached");break}if(n===this.buffer.length)break;t=r.shift(),t.update(this.content(this.offset+this.itemCount)),t.below(r[r.length-1]),r.push(t),this.offset++}o!==this.offset&&this._resize()}},update:function(e){var t,n,i,r,o=this,a=this.items,s=this.height(),l=this.itemCount,c=s/2,d=(this.lastTop||0)>e,u=e-c,h=e+s+c;a[0]&&(this.lastTop=e,this.lastDirection=d,d?a[0].top>u&&a[a.length-1].bottom>h+c&&this.offset>0&&(this.offset--,t=a.pop(),n=a[0],t.update(this.content(this.offset)),a.unshift(t),t.above(n),o._resize()):h>a[a.length-1].bottom&&u-c>a[0].top&&(r=this.offset+l,r===this.buffer.total()?this.trigger("endReached"):r!==this.buffer.length&&(t=a.shift(),i=a[a.length-1],a.push(t),t.update(this.content(this.offset+this.itemCount)),o.offset++,t.below(i),o._resize())))},content:function(e){return this.buffer.at(e)},destroy:function(){this.unbind()},_resize:function(){var e=this.items,t=0,n=0,i=e[0],r=e[e.length-1];i&&(t=i.top,n=r.bottom),this.trigger("resize",{top:t,bottom:n}),this.footer&&this.footer.below(r)}});m.mobile.ui.VirtualList=$,l=m.Class.extend({init:function(t,n){var i=t.append([n],!0)[0],r=i.offsetHeight;e.extend(this,{top:0,element:i,listView:t,height:r,bottom:r})},update:function(e){this.element=this.listView.setDataItem(this.element,e)},above:function(e){e&&(this.height=this.element.offsetHeight,this.top=e.top-this.height,this.bottom=e.top,s(this.element,this.top))},below:function(e){e&&(this.height=this.element.offsetHeight,this.top=e.bottom,this.bottom=this.top+this.height,s(this.element,this.top))},destroy:function(){m.destroy(this.element),e(this.element).remove()}}),c='<div><span class="km-icon"></span><span class="km-loading-left"></span><span class="km-loading-right"></span></div>',d=m.Class.extend({init:function(t){this.element=e('<li class="km-load-more km-scroller-refresh" style="display: none"></li>').appendTo(t.element),this._loadIcon=e(c).appendTo(this.element)},enable:function(){this.element.show(),this.height=this.element.outerHeight(!0)},disable:function(){this.element.hide(),this.height=0},below:function(e){e&&(this.top=e.bottom,this.bottom=this.height+this.top,s(this.element,this.top))}}),u=d.extend({init:function(t,n){this._loadIcon=e(c).hide(),this._loadButton=e('<a class="km-load">'+t.options.messages.loadMoreText+"</a>").hide(),this.element=e('<li class="km-load-more" style="display: none"></li>').append(this._loadIcon).append(this._loadButton).appendTo(t.element);var i=this;this._loadButton.kendoMobileButton().data("kendoMobileButton").bind("click",function(){i._hideShowButton(),n.next()}),n.bind("resize",function(){i._showLoadButton()}),this.height=this.element.outerHeight(!0),this.disable()},_hideShowButton:function(){this._loadButton.hide(),this.element.addClass("km-scroller-refresh"),this._loadIcon.css("display","block")},_showLoadButton:function(){this._loadButton.show(),this.element.removeClass("km-scroller-refresh"),this._loadIcon.hide()}}),h=m.Class.extend({init:function(e){var t=this;this.chromeHeight=e.wrapper.children().not(e.element).outerHeight()||0,this.listView=e,this.scroller=e.scroller(),this.options=e.options,e.bind("_dataSource",function(e){t.setDataSource(e.dataSource,e.empty)}),e.bind("resize",function(){t.list.items.length&&(t.scroller.reset(),t.buffer.range(0),t.list.refresh())}),this.scroller.makeVirtual(),this.scroller.bind("scroll",function(e){t.list.update(e.scrollTop)}),this.scroller.bind("scrollEnd",function(e){t.list.batchUpdate(e.scrollTop)})},destroy:function(){this.list.unbind(),this.buffer.unbind()},setDataSource:function(t,n){var i,r,o,a,s=this,c=this.options,h=this.listView,p=h.scroller(),f=c.loadMore;if(this.dataSource=t,i=t.pageSize()||c.virtualViewSize,!i&&!n)throw Error("the DataSource does not have page size configured. Page Size setting is mandatory for the mobile listview virtual scrolling to work as expected.");this.buffer&&this.buffer.destroy(),r=new m.data.Buffer(t,Math.floor(i/2),f),o=f?new u(h,r):new d(h),this.list&&this.list.destroy(),a=new $({buffer:r,footer:o,item:function(e){return new l(h,e)},height:function(){return p.height()}}),a.bind("resize",function(){s.updateScrollerSize(),h.updateSize()}),a.bind("reset",function(){s.footer.enable()}),a.bind("endReached",function(){o.disable(),s.updateScrollerSize()}),r.bind("expand",function(){a.lastDirection=!1,a.batchUpdate(p.scrollTop)}),e.extend(this,{buffer:r,scroller:p,list:a,footer:o})},updateScrollerSize:function(){this.scroller.virtualSize(0,this.list.totalHeight()+this.chromeHeight)},refresh:function(){this.list.refresh()},reset:function(){this.buffer.range(0),this.list.refresh()}}),p=m.Class.extend({init:function(e){var t,n=this;this.listView=e,this.options=e.options,t=this,this._refreshHandler=function(e){t.refresh(e)},this._progressHandler=function(){e.showLoading()},e.bind("_dataSource",function(e){n.setDataSource(e.dataSource)})},destroy:function(){this._unbindDataSource()},reset:function(){},refresh:function(e){var n,i,r,o,a,s,l,c=e&&e.action,d=e&&e.items,u=this.listView,h=this.dataSource,p=this.options.appendOnRefresh,f=h.view(),g=h.group(),m=g&&g[0];return"itemchange"===c?(n=u.findByDataItem(d)[0],n&&u.setDataItem(n,d[0]),t):(a="add"===c&&!m||p&&!u._filter,s="remove"===c&&!m,a?i=[]:s&&(i=u.findByDataItem(d)),u.trigger(B,{action:c||"rebind",items:d,removedItems:i,index:e&&e.index})?(this._shouldShowLoading()&&u.hideLoading(),t):("add"!==c||m?"remove"!==c||m?m?u.replaceGrouped(f):p&&!u._filter?(r=u.prepend(f),o=f):u.replace(f):(r=[],u.remove(d)):(l=f.indexOf(d[0]),l>-1&&(r=u.insertAt(d,l),o=d)),this._shouldShowLoading()&&u.hideLoading(),u.trigger(R,{ns:w,addedItems:r,addedDataItems:o}),t))},setDataSource:function(e){this.dataSource&&this._unbindDataSource(),this.dataSource=e,e.bind(N,this._refreshHandler),this._shouldShowLoading()&&this.dataSource.bind(O,this._progressHandler)},_unbindDataSource:function(){this.dataSource.unbind(N,this._refreshHandler).unbind(O,this._progressHandler)},_shouldShowLoading:function(){var e=this.options;return!e.pullToRefresh&&!e.loadMore&&!e.endlessScroll}}),f=m.Class.extend({init:function(e){var t=this,n=e.options.filterable,i="change paste";this.listView=e,this.options=n,e.element.before(M({placeholder:n.placeholder||"Search..."})),n.autoFilter!==!1&&(i+=" keyup"),this.element=e.wrapper.find(".km-search-form"),this.searchInput=e.wrapper.find("input[type=search]").closest("form").on("submit"+F,function(e){e.preventDefault()}).end().on("focus"+F,function(){t._oldFilter=t.searchInput.val()}).on(i.split(" ").join(F+" ")+F,T(this._filterChange,this)),this.clearButton=e.wrapper.find(".km-filter-reset").on(L,T(this,"_clearFilter")).hide()},_search:function(e){this._filter=!0,this.clearButton[e?"show":"hide"](),this.listView.dataSource.filter(e)},_filterChange:function(e){var t=this;"paste"==e.type&&this.options.autoFilter!==!1?setTimeout(function(){t._applyFilter()},1):this._applyFilter()},_applyFilter:function(){var e=this.options,t=this.searchInput.val(),n=t.length?{field:e.field,operator:e.operator||"startsWith",ignoreCase:e.ignoreCase,value:t}:null;t!==this._oldFilter&&(this._oldFilter=t,this._search(n))},_clearFilter:function(e){this.searchInput.val(""),this._search(null),e.preventDefault()}}),g=b.extend({init:function(e,t){var n=this;b.fn.init.call(this,e,t),e=this.element,t=this.options,t.scrollTreshold&&(t.scrollThreshold=t.scrollTreshold),e.on("down",x,"_highlight").on("move up cancel",x,"_dim"),this._userEvents=new m.UserEvents(e,{filter:k,allowSelection:!0,tap:function(e){n._click(e)}}),e.css("-ms-touch-action","auto"),e.wrap(P),this.wrapper=this.element.parent(),this._headerFixer=new j(this),this._itemsCache={},this._templates(),this.virtual=t.endlessScroll||t.loadMore,this._style(),this.options.filterable&&(this._filter=new f(this)),this._itemBinder=this.virtual?new h(this):new p(this),this.options.pullToRefresh&&(this._pullToRefreshHandler=new G(this)),this.setDataSource(t.dataSource),this._enhanceItems(this.items()),m.notify(this,w)},events:[L,B,R,H],options:{name:"ListView",style:"",type:"flat",autoBind:!0,fixedHeaders:!1,template:"#:data#",headerTemplate:'<span class="km-text">#:value#</span>',appendOnRefresh:!1,loadMore:!1,endlessScroll:!1,scrollThreshold:30,pullToRefresh:!1,messages:{loadMoreText:"Press to load more",pullTemplate:"Pull to refresh",releaseTemplate:"Release to refresh",refreshTemplate:"Refreshing"},pullOffset:140,filterable:!1,virtualViewSize:null},refresh:function(){this._itemBinder.refresh()},reset:function(){this._itemBinder.reset()},setDataSource:function(e){var t=!e;this.dataSource=y.create(e),this.trigger("_dataSource",{dataSource:this.dataSource,empty:t}),this.options.autoBind&&!t&&(this.items().remove(),this.dataSource.fetch())},destroy:function(){b.fn.destroy.call(this),m.destroy(this.element),this._userEvents.destroy(),this._itemBinder&&this._itemBinder.destroy(),this.element.unwrap(),delete this.element,delete this.wrapper,delete this._userEvents},items:function(){return"group"===this.options.type?this.element.find(".km-list").children():this.element.children().not(".km-load-more")},scroller:function(){return this._scrollerInstance||(this._scrollerInstance=this.element.closest(".km-scroll-wrapper").data("kendoMobileScroller")),this._scrollerInstance},showLoading:function(){var e=this.view();e&&e.loader&&e.loader.show()},hideLoading:function(){var e=this.view();e&&e.loader&&e.loader.hide()},insertAt:function(e,t,n){var i=this;return i._renderItems(e,function(r){if(0===t?i.element.prepend(r):-1===t?i.element.append(r):i.items().eq(t-1).after(r),n)for(var o=0;r.length>o;o++)i.trigger(H,{item:r.eq(o),data:e[o],ns:w})})},append:function(e,t){return this.insertAt(e,-1,t)},prepend:function(e,t){return this.insertAt(e,0,t)},replace:function(e){return this.options.type="flat",this._angularItems("cleanup"),this.element.empty(),this._style(),this.insertAt(e,0)},replaceGrouped:function(t){this.options.type="group",this._angularItems("cleanup"),this.element.empty();var n=e(m.render(this.groupTemplate,t));this._enhanceItems(n.children("ul").children("li")),this.element.append(n),_.init(n),this._style(),this._angularItems("compile")},remove:function(e){var t=this.findByDataItem(e);this.angular("cleanup",function(){return{elements:t}}),m.destroy(t),t.remove()},findByDataItem:function(e){var t,n,i=[];for(t=0,n=e.length;n>t;t++)i[t]="[data-"+m.ns+"uid="+e[t].uid+"]";return this.element.find(i.join(","))},setDataItem:function(t,n){var i=this,r=function(r){var o=e(r[0]);m.destroy(t),e(t).replaceWith(o),i.trigger(H,{item:o,data:n,ns:w})};return this._renderItems([n],r)[0]},updateSize:function(){this._size=this.getSize()},_renderItems:function(t,n){var i=e(m.render(this.template,t));return this.angular("compile",function(){return{elements:i,data:t.map(function(e){return{dataItem:e}})}}),n(i),_.init(i),this._enhanceItems(i),i},_dim:function(e){this._toggle(e,!1)},_highlight:function(e){this._toggle(e,!0)},_toggle:function(t,n){if(!(t.which>1)){var i=e(t.currentTarget),r=i.parent(),o=S(i,"role")||"",a=!o.match(W),s=t.isDefaultPrevented();a&&r.toggleClass(A,n&&!s)}},_templates:function(){var e=this.options.template,t=this.options.headerTemplate,n=' data-uid="#=arguments[0].uid || ""#"',i={},r={};typeof e===V&&(i.template=e,e="#=this.template(data)#"),this.template=T(m.template("<li"+n+">"+e+"</li>"),i),r.template=this.template,typeof t===V&&(r._headerTemplate=t,t="#=this._headerTemplate(data)#"),r.headerTemplate=m.template(t),this.groupTemplate=T(I,r)},_click:function(t){if(!(t.event.which>1||t.event.isDefaultPrevented())){var n,i=t.target,r=e(t.event.target),o=r.closest(m.roleSelector("button","detailbutton","backbutton")),a=m.widgetInstance(o,w),s=i.attr(m.attr("uid"));s&&(n=this.dataSource.getByUid(s)),this.trigger(L,{target:r,item:i,dataItem:n,button:a})&&t.preventDefault()}},_styleGroups:function(){var t=this.element.children();t.children("ul").addClass("km-list"),t.each(function(){var t=e(this),n=t.contents().first();t.addClass("km-group-container"),n.is("ul")||n.is("div."+D)||n.wrap(E)})},_style:function(){var e=this.options,t="group"===e.type,n=this.element,i="inset"===e.style;n.addClass("km-listview").toggleClass("km-list",!t).toggleClass("km-virtual-list",this.virtual).toggleClass("km-listinset",!t&&i).toggleClass("km-listgroup",t&&!i).toggleClass("km-listgroupinset",t&&i),n.parents(".km-listview")[0]||n.closest(".km-content").toggleClass("km-insetcontent",i),t&&this._styleGroups(),this.trigger(z)},_enhanceItems:function(t){t.each(function(){var t,n=e(this),i=!1;n.children().each(function(){t=e(this),t.is("a")?(o(t),i=!0):t.is("label")&&(a(t),i=!0)}),i||r(n)})}}),w.plugin(g)}(window.kendo.jQuery),function(e,t){function n(n,i){var o=i.find("["+r.attr("align")+"="+n+"]");return o[0]?e('<div class="km-'+n+'item" />').append(o).prependTo(i):t}function i(t){var n=t.siblings(),i=!!t.children("ul")[0],o=!!n[0]&&""===e.trim(t.text()),a=r.mobile.application&&r.mobile.application.element.is(".km-android");t.prevAll().toggleClass("km-absolute",i),t.toggleClass("km-show-title",o),t.toggleClass("km-fill-title",o&&!e.trim(t.html())),t.toggleClass("km-no-title",i),t.toggleClass("km-hide-title",a&&!n.children().is(":visible"))}var r=window.kendo,o=r.mobile,a=o.ui,s=a.Widget,l=s.extend({init:function(t,i){var r=this;s.fn.init.call(r,t,i),t=r.element,r.container().bind("show",e.proxy(this,"refresh")),t.addClass("km-navbar").wrapInner(e('<div class="km-view-title km-show-title" />')),r.leftElement=n("left",t),r.rightElement=n("right",t),r.centerElement=t.find(".km-view-title")},options:{name:"NavBar"},title:function(e){this.element.find(r.roleSelector("view-title")).text(e),i(this.centerElement)},refresh:function(e){var t=e.view;t.options.title?this.title(t.options.title):i(this.centerElement)},destroy:function(){s.fn.destroy.call(this),r.destroy(this.element)}});a.plugin(l)}(window.kendo.jQuery),function(e,t){var n,i,r,o,a,s,l,c,d=window.kendo,u=d.mobile,h=u.ui,p=e.proxy,f=d.effects.Transition,g=d.ui.Pane,m=d.ui.PaneDimensions,v=h.DataBoundWidget,_=d.data.DataSource,w=d.data.Buffer,y=d.data.BatchBuffer,b=Math,k=b.abs,x=b.ceil,C=b.round,T=b.max,S=b.min,D=b.floor,A="change",E="changing",I="refresh",P="km-current-page",M="km-virtual-page",F="function",z="itemChange",R="cleanup",B=3,H=-1,L=0,N=1,O=-1,V=0,U=1,W=d.Class.extend({init:function(t){var n=this,i=e("<ol class='km-pages'/>");t.element.append(i),this._changeProxy=p(n,"_change"),this._refreshProxy=p(n,"_refresh"),t.bind(A,this._changeProxy),t.bind(I,this._refreshProxy),e.extend(n,{element:i,scrollView:t})},items:function(){return this.element.children()},_refresh:function(e){var t,n="";for(t=0;e.pageCount>t;t++)n+="<li/>";this.element.html(n),this.items().eq(e.page).addClass(P)},_change:function(e){this.items().removeClass(P).eq(e.page).addClass(P)},destroy:function(){this.scrollView.unbind(A,this._changeProxy),this.scrollView.unbind(I,this._refreshProxy),this.element.remove()}});d.mobile.ui.ScrollViewPager=W,n="transitionEnd",i="dragStart",r="dragEnd",o=d.Observable.extend({init:function(t,o){var a,s,l,c,u,h,p=this;d.Observable.fn.init.call(this),this.element=t,this.container=t.parent(),a=new d.ui.Movable(p.element),s=new f({axis:"x",movable:a,onEnd:function(){p.trigger(n)}}),l=new d.UserEvents(t,{start:function(e){2*k(e.x.velocity)>=k(e.y.velocity)?l.capture():l.cancel(),p.trigger(i,e),s.cancel()},allowSelection:!0,end:function(e){p.trigger(r,e)}}),c=new m({element:p.element,container:p.container}),u=c.x,u.bind(A,function(){p.trigger(A)}),h=new g({dimensions:c,userEvents:l,movable:a,elastic:!0}),e.extend(p,{duration:o&&o.duration||1,movable:a,transition:s,userEvents:l,dimensions:c,dimension:u,pane:h}),this.bind([n,i,r,A],o)},size:function(){return{width:this.dimensions.x.getSize(),height:this.dimensions.y.getSize()}},total:function(){return this.dimension.getTotal()},offset:function(){return-this.movable.x},updateDimension:function(){this.dimension.update(!0)},refresh:function(){this.dimensions.refresh()},moveTo:function(e){this.movable.moveAxis("x",-e)},transitionTo:function(e,t,n){n?this.moveTo(-e):this.transition.moveTo({location:e,duration:this.duration,ease:t})}}),d.mobile.ui.ScrollViewElasticPane=o,a=d.Observable.extend({init:function(e,t,n){var i=this;d.Observable.fn.init.call(this),i.element=e,i.pane=t,i._getPages(),this.page=0,this.pageSize=n.pageSize||1,this.contentHeight=n.contentHeight,this.enablePager=n.enablePager},scrollTo:function(e,t){this.page=e,this.pane.transitionTo(-e*this.pane.size().width,f.easeOutExpo,t)},paneMoved:function(e,t,n,i){var r,o,a=this,s=a.pane,l=s.size().width*a.pageSize,c=C,d=t?f.easeOutBack:f.easeOutExpo;e===O?c=x:e===U&&(c=D),o=c(s.offset()/l),r=T(a.minSnap,S(-o*l,a.maxSnap)),o!=a.page&&n&&n({currentPage:a.page,nextPage:o})&&(r=-a.page*s.size().width),s.transitionTo(r,d,i)},updatePage:function(){var e=this.pane,t=C(e.offset()/e.size().width);return t!=this.page?(this.page=t,!0):!1},forcePageUpdate:function(){return this.updatePage()},resizeTo:function(e){var t,n,i=this.pane,r=e.width;this.pageElements.width(r),"100%"===this.contentHeight&&(t=this.element.parent().height(),this.enablePager===!0&&(n=this.element.parent().find("ol.km-pages"),n.length&&(t-=n.outerHeight(!0))),this.element.css("height",t),this.pageElements.css("height",t)),i.updateDimension(),this._paged||(this.page=D(i.offset()/r)),this.scrollTo(this.page,!0),this.pageCount=x(i.total()/r),this.minSnap=-(this.pageCount-1)*r,this.maxSnap=0},_getPages:function(){this.pageElements=this.element.find(d.roleSelector("page")),this._paged=this.pageElements.length>0}}),d.mobile.ui.ScrollViewContent=a,s=d.Observable.extend({init:function(e,t,n){var i=this;d.Observable.fn.init.call(this),i.element=e,i.pane=t,i.options=n,i._templates(),i.page=n.page||0,i.pages=[],i._initPages(),i.resizeTo(i.pane.size()),i.pane.dimension.forceEnabled()},setDataSource:function(e){this.dataSource=_.create(e),this._buffer(),this._pendingPageRefresh=!1,this._pendingWidgetRefresh=!1},_viewShow:function(){var e=this;e._pendingWidgetRefresh&&(setTimeout(function(){e._resetPages()},0),e._pendingWidgetRefresh=!1)},_buffer:function(){var e=this.options.itemsPerPage;this.buffer&&this.buffer.destroy(),this.buffer=e>1?new y(this.dataSource,e):new w(this.dataSource,3*e),this._resizeProxy=p(this,"_onResize"),this._resetProxy=p(this,"_onReset"),this._endReachedProxy=p(this,"_onEndReached"),this.buffer.bind({resize:this._resizeProxy,reset:this._resetProxy,endreached:this._endReachedProxy})
},_templates:function(){var e=this.options.template,t=this.options.emptyTemplate,n={},i={};typeof e===F&&(n.template=e,e="#=this.template(data)#"),this.template=p(d.template(e),n),typeof t===F&&(i.emptyTemplate=t,t="#=this.emptyTemplate(data)#"),this.emptyTemplate=p(d.template(t),i)},_initPages:function(){var e,t,n=this.pages,i=this.element;for(t=0;B>t;t++)e=new l(i),n.push(e);this.pane.updateDimension()},resizeTo:function(e){var t,n,i,r=this.pages,o=this.pane;for(t=0;r.length>t;t++)r[t].setWidth(e.width);"auto"===this.options.contentHeight?this.element.css("height",this.pages[1].element.height()):"100%"===this.options.contentHeight&&(n=this.element.parent().height(),this.options.enablePager===!0&&(i=this.element.parent().find("ol.km-pages"),i.length&&(n-=i.outerHeight(!0))),this.element.css("height",n),r[0].element.css("height",n),r[1].element.css("height",n),r[2].element.css("height",n)),o.updateDimension(),this._repositionPages(),this.width=e.width},scrollTo:function(e){var t,n=this.buffer;n.syncDataSource(),t=n.at(e),t&&(this._updatePagesContent(e),this.page=e)},paneMoved:function(e,t,n,i){var r,o=this,a=o.pane,s=a.size().width,l=a.offset(),c=Math.abs(l)>=s/3,u=t?d.effects.Transition.easeOutBack:d.effects.Transition.easeOutExpo,h=o.page+2>o.buffer.total(),p=0;e===U?0!==o.page&&(p=-1):e!==O||h?l>0&&c&&!h?p=1:0>l&&c&&0!==o.page&&(p=-1):p=1,r=o.page,p&&(r=p>0?r+1:r-1),n&&n({currentPage:o.page,nextPage:r})&&(p=0),0===p?o._cancelMove(u,i):-1===p?o._moveBackward(i):1===p&&o._moveForward(i)},updatePage:function(){var e=this.pages;return 0===this.pane.offset()?!1:(this.pane.offset()>0?(e.push(this.pages.shift()),this.page++,this.setPageContent(e[2],this.page+1)):(e.unshift(this.pages.pop()),this.page--,this.setPageContent(e[0],this.page-1)),this._repositionPages(),this._resetMovable(),!0)},forcePageUpdate:function(){var e=this.pane.offset(),t=3*this.pane.size().width/4;return k(e)>t?this.updatePage():!1},_resetMovable:function(){this.pane.moveTo(0)},_moveForward:function(e){this.pane.transitionTo(-this.width,d.effects.Transition.easeOutExpo,e)},_moveBackward:function(e){this.pane.transitionTo(this.width,d.effects.Transition.easeOutExpo,e)},_cancelMove:function(e,t){this.pane.transitionTo(0,e,t)},_resetPages:function(){this.page=this.options.page||0,this._updatePagesContent(this.page),this._repositionPages(),this.trigger("reset")},_onResize:function(){this.pageCount=x(this.dataSource.total()/this.options.itemsPerPage),this._pendingPageRefresh&&(this._updatePagesContent(this.page),this._pendingPageRefresh=!1),this.trigger("resize")},_onReset:function(){this.pageCount=x(this.dataSource.total()/this.options.itemsPerPage),this._resetPages()},_onEndReached:function(){this._pendingPageRefresh=!0},_repositionPages:function(){var e=this.pages;e[0].position(H),e[1].position(L),e[2].position(N)},_updatePagesContent:function(e){var t=this.pages,n=e||0;this.setPageContent(t[0],n-1),this.setPageContent(t[1],n),this.setPageContent(t[2],n+1)},setPageContent:function(t,n){var i=this.buffer,r=this.template,o=this.emptyTemplate,a=null;n>=0&&(a=i.at(n),e.isArray(a)&&!a.length&&(a=null)),this.trigger(R,{item:t.element}),t.content(null!==a?r(a):o({})),d.mobile.init(t.element),this.trigger(z,{item:t.element,data:a,ns:d.mobile.ui})}}),d.mobile.ui.VirtualScrollViewContent=s,l=d.Class.extend({init:function(t){this.element=e("<div class='"+M+"'></div>"),this.width=t.width(),this.element.width(this.width),t.append(this.element)},content:function(e){this.element.html(e)},position:function(e){this.element.css("transform","translate3d("+this.width*e+"px, 0, 0)")},setWidth:function(e){this.width=e,this.element.width(e)}}),d.mobile.ui.VirtualPage=l,c=v.extend({init:function(e,t){var n,i,r,l=this;v.fn.init.call(l,e,t),t=l.options,e=l.element,d.stripWhitespace(e[0]),e.wrapInner("<div/>").addClass("km-scrollview"),this.options.enablePager&&(this.pager=new W(this)),l.inner=e.children().first(),l.page=0,l.inner.css("height",t.contentHeight),l.pane=new o(l.inner,{duration:this.options.duration,transitionEnd:p(this,"_transitionEnd"),dragStart:p(this,"_dragStart"),dragEnd:p(this,"_dragEnd"),change:p(this,I)}),l.bind("resize",function(){l.pane.refresh()}),l.page=t.page,n=0===this.inner.children().length,i=n?new s(l.inner,l.pane,t):new a(l.inner,l.pane,t),i.page=l.page,i.bind("reset",function(){l._syncWithContent(),l.trigger(I,{pageCount:i.pageCount,page:i.page})}),i.bind("resize",function(){l.trigger(I,{pageCount:i.pageCount,page:i.page})}),i.bind(z,function(e){l.trigger(z,e),l.angular("compile",function(){return{elements:e.item,data:[{dataItem:e.data}]}})}),i.bind(R,function(e){l.angular("cleanup",function(){return{elements:e.item}})}),l._content=i,l.setDataSource(t.dataSource),r=l.container(),r.nullObject?(l.viewInit(),l.viewShow()):r.bind("show",p(this,"viewShow")).bind("init",p(this,"viewInit"))},options:{name:"ScrollView",page:0,duration:400,velocityThreshold:.8,contentHeight:"auto",pageSize:1,itemsPerPage:1,bounceVelocityThreshold:1.6,enablePager:!0,autoBind:!0,template:"",emptyTemplate:""},events:[E,A,I],destroy:function(){v.fn.destroy.call(this),d.destroy(this.element)},viewInit:function(){this.options.autoBind&&this._content.scrollTo(this._content.page,!0)},viewShow:function(){this.pane.refresh()},refresh:function(){var e=this._content;e.resizeTo(this.pane.size()),this.page=e.page,this.trigger(I,{pageCount:e.pageCount,page:e.page})},content:function(e){this.element.children().first().html(e),this._content._getPages(),this.pane.refresh()},value:function(e){var n=this.dataSource;return e?(this.scrollTo(n.indexOf(e),!0),t):n.at(this.page)},scrollTo:function(e,t){this._content.scrollTo(e,t),this._syncWithContent()},prev:function(){var e=this,n=e.page-1;e._content instanceof s?e._content.paneMoved(U,t,function(t){return e.trigger(E,t)}):n>-1&&e.scrollTo(n)},next:function(){var e=this,n=e.page+1;e._content instanceof s?e._content.paneMoved(O,t,function(t){return e.trigger(E,t)}):e._content.pageCount>n&&e.scrollTo(n)},setDataSource:function(e){if(this._content instanceof s){var t=!e;this.dataSource=_.create(e),this._content.setDataSource(this.dataSource),this.options.autoBind&&!t&&this.dataSource.fetch()}},items:function(){return this.element.find("."+M)},_syncWithContent:function(){var e,n,i=this._content.pages,r=this._content.buffer;this.page=this._content.page,e=r?r.at(this.page):t,e instanceof Array||(e=[e]),n=i?i[1].element:t,this.trigger(A,{page:this.page,element:n,data:e})},_dragStart:function(){this._content.forcePageUpdate()&&this._syncWithContent()},_dragEnd:function(e){var t=this,n=e.x.velocity,i=this.options.velocityThreshold,r=V,o=k(n)>this.options.bounceVelocityThreshold;n>i?r=U:-i>n&&(r=O),this._content.paneMoved(r,o,function(e){return t.trigger(E,e)})},_transitionEnd:function(){this._content.updatePage()&&this._syncWithContent()}}),h.plugin(c)}(window.kendo.jQuery),function(e,t){function n(e,t,n){return Math.max(t,Math.min(n,e))}var i=window.kendo,r=i.mobile.ui,o=r.Widget,a=i.support,s="change",l="km-switch-on",c="km-switch-off",d="margin-left",u="km-state-active",h="km-state-disabled",p="disabled",f=a.transitions.css+"transform",g=e.proxy,m='<span class="km-switch km-widget">        <span class="km-switch-wrapper"><span class="km-switch-background"></span></span>         <span class="km-switch-container"><span class="km-switch-handle" >             <span class="km-switch-label-on">{0}</span>             <span class="km-switch-label-off">{1}</span>         </span>     </span>',v=o.extend({init:function(t,n){var r,a=this;o.fn.init.call(a,t,n),n=a.options,a.wrapper=e(i.format(m,n.onLabel,n.offLabel)),a.handle=a.wrapper.find(".km-switch-handle"),a.background=a.wrapper.find(".km-switch-background"),a.wrapper.insertBefore(a.element).prepend(a.element),a._drag(),a.origin=parseInt(a.background.css(d),10),a.constrain=0,a.snapPoint=0,t=a.element[0],t.type="checkbox",a._animateBackground=!0,r=a.options.checked,null===r&&(r=t.checked),a.check(r),a.options.enable=a.options.enable&&!a.element.attr(p),a.enable(a.options.enable),a.refresh(),i.notify(a,i.mobile.ui)},refresh:function(){var e=this,t=e.handle.outerWidth(!0);e.width=e.wrapper.width(),e.constrain=e.width-t,e.snapPoint=e.constrain/2,"number"!=typeof e.origin&&(e.origin=parseInt(e.background.css(d),10)),e.background.data("origin",e.origin),e.check(e.element[0].checked)},events:[s],options:{name:"Switch",onLabel:"on",offLabel:"off",checked:null,enable:!0},check:function(e){var n=this,i=n.element[0];return e===t?i.checked:(n._position(e?n.constrain:0),i.checked=e,n.wrapper.toggleClass(l,e).toggleClass(c,!e),t)},value:function(){return this.check.apply(this,arguments)},destroy:function(){o.fn.destroy.call(this),this.userEvents.destroy()},toggle:function(){var e=this;e.check(!e.element[0].checked)},enable:function(e){var n=this.element,i=this.wrapper;t===e&&(e=!0),this.options.enable=e,e?n.removeAttr(p):n.attr(p,p),i.toggleClass(h,!e)},_resize:function(){this.refresh()},_move:function(e){var t=this;e.preventDefault(),t._position(n(t.position+e.x.delta,0,t.width-t.handle.outerWidth(!0)))},_position:function(e){var t=this;t.position=e,t.handle.css(f,"translatex("+e+"px)"),t._animateBackground&&t.background.css(d,t.origin+e)},_start:function(){this.options.enable?(this.userEvents.capture(),this.handle.addClass(u)):this.userEvents.cancel()},_stop:function(){var e=this;e.handle.removeClass(u),e._toggle(e.position>e.snapPoint)},_toggle:function(e){var t,n=this,r=n.handle,o=n.element[0],a=o.checked,d=i.mobile.application&&i.mobile.application.os.wp?100:200;n.wrapper.toggleClass(l,e).toggleClass(c,!e),n.position=t=e*n.constrain,n._animateBackground&&n.background.kendoStop(!0,!0).kendoAnimate({effects:"slideMargin",offset:t,reset:!0,reverse:!e,axis:"left",duration:d}),r.kendoStop(!0,!0).kendoAnimate({effects:"slideTo",duration:d,offset:t+"px,0",reset:!0,complete:function(){a!==e&&(o.checked=e,n.trigger(s,{checked:e}))}})},_drag:function(){var e=this;e.userEvents=new i.UserEvents(e.wrapper,{tap:function(){e.options.enable&&e._toggle(!e.element[0].checked)},start:g(e._start,e),move:g(e._move,e),end:g(e._stop,e)})}});r.plugin(v)}(window.kendo.jQuery),function(e){function t(t){return e('<span class="km-badge">'+t+"</span>")}var n=window.kendo,i=n.mobile.ui,r=i.Widget,o="km-state-active",a="select",s=r.extend({init:function(t,n){var i=this;r.fn.init.call(i,t,n),i.container().bind("show",e.proxy(this,"refresh")),i.element.addClass("km-tabstrip").find("a").each(i._buildButton).eq(i.options.selectedIndex).addClass(o),i.element.on("down","a","_release")},events:[a],switchTo:function(t){var n,i,r=this.element.find("a"),o=0,a=r.length;if(!isNaN(t))return this._setActiveItem(r.eq(t)),!0;for(;a>o;o++)if(n=r[o],i=n.href.replace(/(\#.+)(\?.+)$/,"$1"),-1!==i.indexOf(t,i.length-t.length))return this._setActiveItem(e(n)),!0;return!1},switchByFullUrl:function(e){var t;t=this.element.find("a[href$='"+e+"']"),this._setActiveItem(t)},clear:function(){this.currentItem().removeClass(o)},currentItem:function(){return this.element.children("."+o)},badge:function(n,i){var r,o=this.element;return isNaN(n)||(n=o.children().get(n)),n=o.find(n),r=e(n.find(".km-badge")[0]||t(i).insertAfter(n.children(".km-icon"))),i||0===i?(r.html(i),this):i===!1?(r.empty().remove(),this):r.html()},_release:function(t){if(!(t.which>1)){var n=this,i=e(t.currentTarget);i[0]!==n.currentItem()[0]&&(n.trigger(a,{item:i})?t.preventDefault():n._setActiveItem(i))}},_setActiveItem:function(e){e[0]&&(this.clear(),e.addClass(o))},_buildButton:function(){var i=e(this),r=n.attrValue(i,"icon"),o=n.attrValue(i,"badge"),a=i.find("img"),s=e('<span class="km-icon"/>');i.addClass("km-button").attr(n.attr("role"),"tab").contents().not(a).wrapAll('<span class="km-text"/>'),a[0]?a.addClass("km-image").prependTo(i):(i.prepend(s),r&&(s.addClass("km-"+r),(o||0===o)&&t(o).insertAfter(s)))},refresh:function(e){var t=e.view.element.attr(n.attr("url"));!this.switchTo(e.view.id)&&t&&this.switchTo(t)},options:{name:"TabStrip",selectedIndex:0,enable:!0}});i.plugin(s)}(window.kendo.jQuery);return window.kendo},typeof define=="function"&&define.amd?define:function(_,f){f()});
/**!
 * Sortable
 * @author	RubaXa   <trash@rubaxa.org>
 * @license MIT
 */


(function (factory) {
	"use strict";

	if (typeof define === "function" && define.amd) {
		define(factory);
	}
	else if (typeof module != "undefined" && typeof module.exports != "undefined") {
		module.exports = factory();
	}
	else if (typeof Package !== "undefined") {
		Sortable = factory();  // export for Meteor.js
	}
	else {
		/* jshint sub:true */
		window["Sortable"] = factory();
	}
})(function () {
	"use strict";

	var dragEl,
		parentEl,
		ghostEl,
		cloneEl,
		rootEl,
		nextEl,

		scrollEl,
		scrollParentEl,

		lastEl,
		lastCSS,
		lastParentCSS,

		oldIndex,
		newIndex,

		activeGroup,
		autoScroll = {},

		tapEvt,
		touchEvt,

		moved,

		/** @const */
		RSPACE = /\s+/g,

		expando = 'Sortable' + (new Date).getTime(),

		win = window,
		document = win.document,
		parseInt = win.parseInt,

		supportDraggable = !!('draggable' in document.createElement('div')),
		supportCssPointerEvents = (function (el) {
			el = document.createElement('x');
			el.style.cssText = 'pointer-events:auto';
			return el.style.pointerEvents === 'auto';
		})(),

		_silent = false,

		abs = Math.abs,
		slice = [].slice,

		touchDragOverListeners = [],

		_autoScroll = _throttle(function (/**Event*/evt, /**Object*/options, /**HTMLElement*/rootEl) {
			// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
			if (rootEl && options.scroll) {
				var el,
					rect,
					sens = options.scrollSensitivity,
					speed = options.scrollSpeed,

					x = evt.clientX,
					y = evt.clientY,

					winWidth = window.innerWidth,
					winHeight = window.innerHeight,

					vx,
					vy
				;

				// Delect scrollEl
				if (scrollParentEl !== rootEl) {
					scrollEl = options.scroll;
					scrollParentEl = rootEl;

					if (scrollEl === true) {
						scrollEl = rootEl;

						do {
							if ((scrollEl.offsetWidth < scrollEl.scrollWidth) ||
								(scrollEl.offsetHeight < scrollEl.scrollHeight)
							) {
								break;
							}
							/* jshint boss:true */
						} while (scrollEl = scrollEl.parentNode);
					}
				}

				if (scrollEl) {
					el = scrollEl;
					rect = scrollEl.getBoundingClientRect();
					vx = (abs(rect.right - x) <= sens) - (abs(rect.left - x) <= sens);
					vy = (abs(rect.bottom - y) <= sens) - (abs(rect.top - y) <= sens);
				}


				if (!(vx || vy)) {
					vx = (winWidth - x <= sens) - (x <= sens);
					vy = (winHeight - y <= sens) - (y <= sens);

					/* jshint expr:true */
					(vx || vy) && (el = win);
				}


				if (autoScroll.vx !== vx || autoScroll.vy !== vy || autoScroll.el !== el) {
					autoScroll.el = el;
					autoScroll.vx = vx;
					autoScroll.vy = vy;

					clearInterval(autoScroll.pid);

					if (el) {
						autoScroll.pid = setInterval(function () {
							if (el === win) {
								win.scrollTo(win.pageXOffset + vx * speed, win.pageYOffset + vy * speed);
							} else {
								vy && (el.scrollTop += vy * speed);
								vx && (el.scrollLeft += vx * speed);
							}
						}, 24);
					}
				}
			}
		}, 30),

		_prepareGroup = function (options) {
			var group = options.group;

			if (!group || typeof group != 'object') {
				group = options.group = {name: group};
			}

			['pull', 'put'].forEach(function (key) {
				if (!(key in group)) {
					group[key] = true;
				}
			});

			options.groups = ' ' + group.name + (group.put.join ? ' ' + group.put.join(' ') : '') + ' ';
		}
	;



	/**
	 * @class  Sortable
	 * @param  {HTMLElement}  el
	 * @param  {Object}       [options]
	 */
	function Sortable(el, options) {
		if (!(el && el.nodeType && el.nodeType === 1)) {
			throw 'Sortable: `el` must be HTMLElement, and not ' + {}.toString.call(el);
		}

		this.el = el; // root element
		this.options = options = _extend({}, options);


		// Export instance
		el[expando] = this;


		// Default options
		var defaults = {
			group: Math.random(),
			sort: true,
			disabled: false,
			store: null,
			handle: null,
			scroll: true,
			scrollSensitivity: 30,
			scrollSpeed: 10,
			draggable: /[uo]l/i.test(el.nodeName) ? 'li' : '>*',
			ghostClass: 'sortable-ghost',
			chosenClass: 'sortable-chosen',
			ignore: 'a, img',
			filter: null,
			animation: 0,
			setData: function (dataTransfer, dragEl) {
				dataTransfer.setData('Text', dragEl.textContent);
			},
			dropBubble: false,
			dragoverBubble: false,
			dataIdAttr: 'data-id',
			delay: 0,
			forceFallback: false,
			fallbackClass: 'sortable-fallback',
			fallbackOnBody: false
		};


		// Set default options
		for (var name in defaults) {
			!(name in options) && (options[name] = defaults[name]);
		}

		_prepareGroup(options);

		// Bind all private methods
		for (var fn in this) {
			if (fn.charAt(0) === '_') {
				this[fn] = this[fn].bind(this);
			}
		}

		// Setup drag mode
		this.nativeDraggable = options.forceFallback ? false : supportDraggable;

		// Bind events
		_on(el, 'mousedown', this._onTapStart);
		_on(el, 'touchstart', this._onTapStart);

		if (this.nativeDraggable) {
			_on(el, 'dragover', this);
			_on(el, 'dragenter', this);
		}

		touchDragOverListeners.push(this._onDragOver);

		// Restore sorting
		options.store && this.sort(options.store.get(this));
	}


	Sortable.prototype = /** @lends Sortable.prototype */ {
		constructor: Sortable,

		_onTapStart: function (/** Event|TouchEvent */evt) {
			var _this = this,
				el = this.el,
				options = this.options,
				type = evt.type,
				touch = evt.touches && evt.touches[0],
				target = (touch || evt).target,
				originalTarget = target,
				filter = options.filter;


			if (type === 'mousedown' && evt.button !== 0 || options.disabled) {
				return; // only left button or enabled
			}

			target = _closest(target, options.draggable, el);

			if (!target) {
				return;
			}

			// get the index of the dragged element within its parent
			oldIndex = _index(target);

			// Check filter
			if (typeof filter === 'function') {
				if (filter.call(this, evt, target, this)) {
					_dispatchEvent(_this, originalTarget, 'filter', target, el, oldIndex);
					evt.preventDefault();
					return; // cancel dnd
				}
			}
			else if (filter) {
				filter = filter.split(',').some(function (criteria) {
					criteria = _closest(originalTarget, criteria.trim(), el);

					if (criteria) {
						_dispatchEvent(_this, criteria, 'filter', target, el, oldIndex);
						return true;
					}
				});

				if (filter) {
					evt.preventDefault();
					return; // cancel dnd
				}
			}


			if (options.handle && !_closest(originalTarget, options.handle, el)) {
				return;
			}


			// Prepare `dragstart`
			this._prepareDragStart(evt, touch, target);
		},

		_prepareDragStart: function (/** Event */evt, /** Touch */touch, /** HTMLElement */target) {
			var _this = this,
				el = _this.el,
				options = _this.options,
				ownerDocument = el.ownerDocument,
				dragStartFn;

			if (target && !dragEl && (target.parentNode === el)) {
				tapEvt = evt;

				rootEl = el;
				dragEl = target;
				parentEl = dragEl.parentNode;
				nextEl = dragEl.nextSibling;
				activeGroup = options.group;

				dragStartFn = function () {
					// Delayed drag has been triggered
					// we can re-enable the events: touchmove/mousemove
					_this._disableDelayedDrag();

					// Make the element draggable
					dragEl.draggable = true;

					// Chosen item
					_toggleClass(dragEl, _this.options.chosenClass, true);

					// Bind the events: dragstart/dragend
					_this._triggerDragStart(touch);
				};

				// Disable "draggable"
				options.ignore.split(',').forEach(function (criteria) {
					_find(dragEl, criteria.trim(), _disableDraggable);
				});

				_on(ownerDocument, 'mouseup', _this._onDrop);
				_on(ownerDocument, 'touchend', _this._onDrop);
				_on(ownerDocument, 'touchcancel', _this._onDrop);

				if (options.delay) {
					// If the user moves the pointer or let go the click or touch
					// before the delay has been reached:
					// disable the delayed drag
					_on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
					_on(ownerDocument, 'touchend', _this._disableDelayedDrag);
					_on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
					_on(ownerDocument, 'mousemove', _this._disableDelayedDrag);
					_on(ownerDocument, 'touchmove', _this._disableDelayedDrag);

					_this._dragStartTimer = setTimeout(dragStartFn, options.delay);
				} else {
					dragStartFn();
				}
			}
		},

		_disableDelayedDrag: function () {
			var ownerDocument = this.el.ownerDocument;

			clearTimeout(this._dragStartTimer);
			_off(ownerDocument, 'mouseup', this._disableDelayedDrag);
			_off(ownerDocument, 'touchend', this._disableDelayedDrag);
			_off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
			_off(ownerDocument, 'mousemove', this._disableDelayedDrag);
			_off(ownerDocument, 'touchmove', this._disableDelayedDrag);
		},

		_triggerDragStart: function (/** Touch */touch) {
			if (touch) {
				// Touch device support
				tapEvt = {
					target: dragEl,
					clientX: touch.clientX,
					clientY: touch.clientY
				};

				this._onDragStart(tapEvt, 'touch');
			}
			else if (!this.nativeDraggable) {
				this._onDragStart(tapEvt, true);
			}
			else {
				_on(dragEl, 'dragend', this);
				_on(rootEl, 'dragstart', this._onDragStart);
			}

			try {
				if (document.selection) {
					document.selection.empty();
				} else {
					window.getSelection().removeAllRanges();
				}
			} catch (err) {
			}
		},

		_dragStarted: function () {
			if (rootEl && dragEl) {
				// Apply effect
				_toggleClass(dragEl, this.options.ghostClass, true);

				Sortable.active = this;

				// Drag start event
				_dispatchEvent(this, rootEl, 'start', dragEl, rootEl, oldIndex);
			}
		},

		_emulateDragOver: function () {
			if (touchEvt) {
				if (this._lastX === touchEvt.clientX && this._lastY === touchEvt.clientY) {
					return;
				}

				this._lastX = touchEvt.clientX;
				this._lastY = touchEvt.clientY;

				if (!supportCssPointerEvents) {
					_css(ghostEl, 'display', 'none');
				}

				var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY),
					parent = target,
					groupName = ' ' + this.options.group.name + '',
					i = touchDragOverListeners.length;

				if (parent) {
					do {
						if (parent[expando] && parent[expando].options.groups.indexOf(groupName) > -1) {
							while (i--) {
								touchDragOverListeners[i]({
									clientX: touchEvt.clientX,
									clientY: touchEvt.clientY,
									target: target,
									rootEl: parent
								});
							}

							break;
						}

						target = parent; // store last element
					}
					/* jshint boss:true */
					while (parent = parent.parentNode);
				}

				if (!supportCssPointerEvents) {
					_css(ghostEl, 'display', '');
				}
			}
		},


		_onTouchMove: function (/**TouchEvent*/evt) {
			if (tapEvt) {
				// only set the status to dragging, when we are actually dragging
				if (!Sortable.active) {
					this._dragStarted();
				}

				// as well as creating the ghost element on the document body
				this._appendGhost();

				var touch = evt.touches ? evt.touches[0] : evt,
					dx = touch.clientX - tapEvt.clientX,
					dy = touch.clientY - tapEvt.clientY,
					translate3d = evt.touches ? 'translate3d(' + dx + 'px,' + dy + 'px,0)' : 'translate(' + dx + 'px,' + dy + 'px)';

				moved = true;
				touchEvt = touch;

				_css(ghostEl, 'webkitTransform', translate3d);
				_css(ghostEl, 'mozTransform', translate3d);
				_css(ghostEl, 'msTransform', translate3d);
				_css(ghostEl, 'transform', translate3d);

				evt.preventDefault();
			}
		},

		_appendGhost: function () {
			if (!ghostEl) {
				var rect = dragEl.getBoundingClientRect(),
					css = _css(dragEl),
					options = this.options,
					ghostRect;

				ghostEl = dragEl.cloneNode(true);

				_toggleClass(ghostEl, options.ghostClass, false);
				_toggleClass(ghostEl, options.fallbackClass, true);

				_css(ghostEl, 'top', rect.top - parseInt(css.marginTop, 10));
				_css(ghostEl, 'left', rect.left - parseInt(css.marginLeft, 10));
				_css(ghostEl, 'width', rect.width);
				_css(ghostEl, 'height', rect.height);
				_css(ghostEl, 'opacity', '0.8');
				_css(ghostEl, 'position', 'fixed');
				_css(ghostEl, 'zIndex', '100000');
				_css(ghostEl, 'pointerEvents', 'none');

				options.fallbackOnBody && document.body.appendChild(ghostEl) || rootEl.appendChild(ghostEl);

				// Fixing dimensions.
				ghostRect = ghostEl.getBoundingClientRect();
				_css(ghostEl, 'width', rect.width * 2 - ghostRect.width);
				_css(ghostEl, 'height', rect.height * 2 - ghostRect.height);
			}
		},

		_onDragStart: function (/**Event*/evt, /**boolean*/useFallback) {
			var dataTransfer = evt.dataTransfer,
				options = this.options;

			this._offUpEvents();

			if (activeGroup.pull == 'clone') {
				cloneEl = dragEl.cloneNode(true);
				_css(cloneEl, 'display', 'none');
				rootEl.insertBefore(cloneEl, dragEl);
			}

			if (useFallback) {

				if (useFallback === 'touch') {
					// Bind touch events
					_on(document, 'touchmove', this._onTouchMove);
					_on(document, 'touchend', this._onDrop);
					_on(document, 'touchcancel', this._onDrop);
				} else {
					// Old brwoser
					_on(document, 'mousemove', this._onTouchMove);
					_on(document, 'mouseup', this._onDrop);
				}

				this._loopId = setInterval(this._emulateDragOver, 50);
			}
			else {
				if (dataTransfer) {
					dataTransfer.effectAllowed = 'move';
					options.setData && options.setData.call(this, dataTransfer, dragEl);
				}

				_on(document, 'drop', this);
				setTimeout(this._dragStarted, 0);
			}
		},

		_onDragOver: function (/**Event*/evt) {
			var el = this.el,
				target,
				dragRect,
				revert,
				options = this.options,
				group = options.group,
				groupPut = group.put,
				isOwner = (activeGroup === group),
				canSort = options.sort;

			if (evt.preventDefault !== void 0) {
				evt.preventDefault();
				!options.dragoverBubble && evt.stopPropagation();
			}

			moved = true;

			if (activeGroup && !options.disabled &&
				(isOwner
					? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list
					: activeGroup.pull && groupPut && (
						(activeGroup.name === group.name) || // by Name
						(groupPut.indexOf && ~groupPut.indexOf(activeGroup.name)) // by Array
					)
				) &&
				(evt.rootEl === void 0 || evt.rootEl === this.el) // touch fallback
			) {
				// Smart auto-scrolling
				_autoScroll(evt, options, this.el);

				if (_silent) {
					return;
				}

				target = _closest(evt.target, options.draggable, el);
				dragRect = dragEl.getBoundingClientRect();

				if (revert) {
					_cloneHide(true);

					if (cloneEl || nextEl) {
						rootEl.insertBefore(dragEl, cloneEl || nextEl);
					}
					else if (!canSort) {
						rootEl.appendChild(dragEl);
					}

					return;
				}


				if ((el.children.length === 0) || (el.children[0] === ghostEl) ||
					(el === evt.target) && (target = _ghostIsLast(el, evt))
				) {

					if (target) {
						if (target.animated) {
							return;
						}

						targetRect = target.getBoundingClientRect();
					}

					_cloneHide(isOwner);

					if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect) !== false) {
						if (!dragEl.contains(el)) {
							el.appendChild(dragEl);
							parentEl = el; // actualization
						}

						this._animate(dragRect, dragEl);
						target && this._animate(targetRect, target);
					}
				}
				else if (target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0)) {
					if (lastEl !== target) {
						lastEl = target;
						lastCSS = _css(target);
						lastParentCSS = _css(target.parentNode);
					}


					var targetRect = target.getBoundingClientRect(),
						width = targetRect.right - targetRect.left,
						height = targetRect.bottom - targetRect.top,
						floating = /left|right|inline/.test(lastCSS.cssFloat + lastCSS.display)
							|| (lastParentCSS.display == 'flex' && lastParentCSS['flex-direction'].indexOf('row') === 0),
						isWide = (target.offsetWidth > dragEl.offsetWidth),
						isLong = (target.offsetHeight > dragEl.offsetHeight),
						halfway = (floating ? (evt.clientX - targetRect.left) / width : (evt.clientY - targetRect.top) / height) > 0.5,
						nextSibling = target.nextElementSibling,
						moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect),
						after
					;

					if (moveVector !== false) {
						_silent = true;
						setTimeout(_unsilent, 30);

						_cloneHide(isOwner);

						if (moveVector === 1 || moveVector === -1) {
							after = (moveVector === 1);
						}
						else if (floating) {
							var elTop = dragEl.offsetTop,
								tgTop = target.offsetTop;

							if (elTop === tgTop) {
								after = (target.previousElementSibling === dragEl) && !isWide || halfway && isWide;
							} else {
								after = tgTop > elTop;
							}
						} else {
							after = (nextSibling !== dragEl) && !isLong || halfway && isLong;
						}

						if (!dragEl.contains(el)) {
							if (after && !nextSibling) {
								el.appendChild(dragEl);
							} else {
								target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
							}
						}

						parentEl = dragEl.parentNode; // actualization

						this._animate(dragRect, dragEl);
						this._animate(targetRect, target);
					}
				}
			}
		},

		_animate: function (prevRect, target) {
			var ms = this.options.animation;

			if (ms) {
				var currentRect = target.getBoundingClientRect();

				_css(target, 'transition', 'none');
				_css(target, 'transform', 'translate3d('
					+ (prevRect.left - currentRect.left) + 'px,'
					+ (prevRect.top - currentRect.top) + 'px,0)'
				);

				target.offsetWidth; // repaint

				_css(target, 'transition', 'all ' + ms + 'ms');
				_css(target, 'transform', 'translate3d(0,0,0)');

				clearTimeout(target.animated);
				target.animated = setTimeout(function () {
					_css(target, 'transition', '');
					_css(target, 'transform', '');
					target.animated = false;
				}, ms);
			}
		},

		_offUpEvents: function () {
			var ownerDocument = this.el.ownerDocument;

			_off(document, 'touchmove', this._onTouchMove);
			_off(ownerDocument, 'mouseup', this._onDrop);
			_off(ownerDocument, 'touchend', this._onDrop);
			_off(ownerDocument, 'touchcancel', this._onDrop);
		},

		_onDrop: function (/**Event*/evt) {
			var el = this.el,
				options = this.options;

			clearInterval(this._loopId);
			clearInterval(autoScroll.pid);
			clearTimeout(this._dragStartTimer);

			// Unbind events
			_off(document, 'mousemove', this._onTouchMove);

			if (this.nativeDraggable) {
				_off(document, 'drop', this);
				_off(el, 'dragstart', this._onDragStart);
			}

			this._offUpEvents();

			if (evt) {
				if (moved) {
					evt.preventDefault();
					!options.dropBubble && evt.stopPropagation();
				}

				ghostEl && ghostEl.parentNode.removeChild(ghostEl);

				if (dragEl) {
					if (this.nativeDraggable) {
						_off(dragEl, 'dragend', this);
					}

					_disableDraggable(dragEl);

					// Remove class's
					_toggleClass(dragEl, this.options.ghostClass, false);
					_toggleClass(dragEl, this.options.chosenClass, false);

					if (rootEl !== parentEl) {
						newIndex = _index(dragEl);

						if (newIndex >= 0) {
							// drag from one list and drop into another
							_dispatchEvent(null, parentEl, 'sort', dragEl, rootEl, oldIndex, newIndex);
							_dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex);

							// Add event
							_dispatchEvent(null, parentEl, 'add', dragEl, rootEl, oldIndex, newIndex);

							// Remove event
							_dispatchEvent(this, rootEl, 'remove', dragEl, rootEl, oldIndex, newIndex);
						}
					}
					else {
						// Remove clone
						cloneEl && cloneEl.parentNode.removeChild(cloneEl);

						if (dragEl.nextSibling !== nextEl) {
							// Get the index of the dragged element within its parent
							newIndex = _index(dragEl);

							if (newIndex >= 0) {
								// drag & drop within the same list
								_dispatchEvent(this, rootEl, 'update', dragEl, rootEl, oldIndex, newIndex);
								_dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex);
							}
						}
					}

					if (Sortable.active) {
						if (newIndex === null || newIndex === -1) {
							newIndex = oldIndex;
						}

						_dispatchEvent(this, rootEl, 'end', dragEl, rootEl, oldIndex, newIndex);

						// Save sorting
						this.save();
					}
				}

				// Nulling
				rootEl =
				dragEl =
				parentEl =
				ghostEl =
				nextEl =
				cloneEl =

				scrollEl =
				scrollParentEl =

				tapEvt =
				touchEvt =

				moved =
				newIndex =

				lastEl =
				lastCSS =

				activeGroup =
				Sortable.active = null;
			}
		},


		handleEvent: function (/**Event*/evt) {
			var type = evt.type;

			if (type === 'dragover' || type === 'dragenter') {
				if (dragEl) {
					this._onDragOver(evt);
					_globalDragOver(evt);
				}
			}
			else if (type === 'drop' || type === 'dragend') {
				this._onDrop(evt);
			}
		},


		/**
		 * Serializes the item into an array of string.
		 * @returns {String[]}
		 */
		toArray: function () {
			var order = [],
				el,
				children = this.el.children,
				i = 0,
				n = children.length,
				options = this.options;

			for (; i < n; i++) {
				el = children[i];
				if (_closest(el, options.draggable, this.el)) {
					order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
				}
			}

			return order;
		},


		/**
		 * Sorts the elements according to the array.
		 * @param  {String[]}  order  order of the items
		 */
		sort: function (order) {
			var items = {}, rootEl = this.el;

			this.toArray().forEach(function (id, i) {
				var el = rootEl.children[i];

				if (_closest(el, this.options.draggable, rootEl)) {
					items[id] = el;
				}
			}, this);

			order.forEach(function (id) {
				if (items[id]) {
					rootEl.removeChild(items[id]);
					rootEl.appendChild(items[id]);
				}
			});
		},


		/**
		 * Save the current sorting
		 */
		save: function () {
			var store = this.options.store;
			store && store.set(this);
		},


		/**
		 * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
		 * @param   {HTMLElement}  el
		 * @param   {String}       [selector]  default: `options.draggable`
		 * @returns {HTMLElement|null}
		 */
		closest: function (el, selector) {
			return _closest(el, selector || this.options.draggable, this.el);
		},


		/**
		 * Set/get option
		 * @param   {string} name
		 * @param   {*}      [value]
		 * @returns {*}
		 */
		option: function (name, value) {
			var options = this.options;

			if (value === void 0) {
				return options[name];
			} else {
				options[name] = value;

				if (name === 'group') {
					_prepareGroup(options);
				}
			}
		},


		/**
		 * Destroy
		 */
		destroy: function () {
			var el = this.el;

			el[expando] = null;

			_off(el, 'mousedown', this._onTapStart);
			_off(el, 'touchstart', this._onTapStart);

			if (this.nativeDraggable) {
				_off(el, 'dragover', this);
				_off(el, 'dragenter', this);
			}

			// Remove draggable attributes
			Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
				el.removeAttribute('draggable');
			});

			touchDragOverListeners.splice(touchDragOverListeners.indexOf(this._onDragOver), 1);

			this._onDrop();

			this.el = el = null;
		}
	};


	function _cloneHide(state) {
		if (cloneEl && (cloneEl.state !== state)) {
			_css(cloneEl, 'display', state ? 'none' : '');
			!state && cloneEl.state && rootEl.insertBefore(cloneEl, dragEl);
			cloneEl.state = state;
		}
	}


	function _closest(/**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx) {
		if (el) {
			ctx = ctx || document;
			selector = selector.split('.');

			var tag = selector.shift().toUpperCase(),
				re = new RegExp('\\s(' + selector.join('|') + ')(?=\\s)', 'g');

			do {
				if (
					(tag === '>*' && el.parentNode === ctx) || (
						(tag === '' || el.nodeName.toUpperCase() == tag) &&
						(!selector.length || ((' ' + el.className + ' ').match(re) || []).length == selector.length)
					)
				) {
					return el;
				}
			}
			while (el !== ctx && (el = el.parentNode));
		}

		return null;
	}


	function _globalDragOver(/**Event*/evt) {
		if (evt.dataTransfer) {
			evt.dataTransfer.dropEffect = 'move';
		}
		evt.preventDefault();
	}


	function _on(el, event, fn) {
		el.addEventListener(event, fn, false);
	}


	function _off(el, event, fn) {
		el.removeEventListener(event, fn, false);
	}


	function _toggleClass(el, name, state) {
		if (el) {
			if (el.classList) {
				el.classList[state ? 'add' : 'remove'](name);
			}
			else {
				var className = (' ' + el.className + ' ').replace(RSPACE, ' ').replace(' ' + name + ' ', ' ');
				el.className = (className + (state ? ' ' + name : '')).replace(RSPACE, ' ');
			}
		}
	}


	function _css(el, prop, val) {
		var style = el && el.style;

		if (style) {
			if (val === void 0) {
				if (document.defaultView && document.defaultView.getComputedStyle) {
					val = document.defaultView.getComputedStyle(el, '');
				}
				else if (el.currentStyle) {
					val = el.currentStyle;
				}

				return prop === void 0 ? val : val[prop];
			}
			else {
				if (!(prop in style)) {
					prop = '-webkit-' + prop;
				}

				style[prop] = val + (typeof val === 'string' ? '' : 'px');
			}
		}
	}


	function _find(ctx, tagName, iterator) {
		if (ctx) {
			var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;

			if (iterator) {
				for (; i < n; i++) {
					iterator(list[i], i);
				}
			}

			return list;
		}

		return [];
	}



	function _dispatchEvent(sortable, rootEl, name, targetEl, fromEl, startIndex, newIndex) {
		var evt = document.createEvent('Event'),
			options = (sortable || rootEl[expando]).options,
			onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);

		evt.initEvent(name, true, true);

		evt.to = rootEl;
		evt.from = fromEl || rootEl;
		evt.item = targetEl || rootEl;
		evt.clone = cloneEl;

		evt.oldIndex = startIndex;
		evt.newIndex = newIndex;

		rootEl.dispatchEvent(evt);

		if (options[onName]) {
			options[onName].call(sortable, evt);
		}
	}


	function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect) {
		var evt,
			sortable = fromEl[expando],
			onMoveFn = sortable.options.onMove,
			retVal;

		evt = document.createEvent('Event');
		evt.initEvent('move', true, true);

		evt.to = toEl;
		evt.from = fromEl;
		evt.dragged = dragEl;
		evt.draggedRect = dragRect;
		evt.related = targetEl || toEl;
		evt.relatedRect = targetRect || toEl.getBoundingClientRect();

		fromEl.dispatchEvent(evt);

		if (onMoveFn) {
			retVal = onMoveFn.call(sortable, evt);
		}

		return retVal;
	}


	function _disableDraggable(el) {
		el.draggable = false;
	}


	function _unsilent() {
		_silent = false;
	}


	/** @returns {HTMLElement|false} */
	function _ghostIsLast(el, evt) {
		var lastEl = el.lastElementChild,
				rect = lastEl.getBoundingClientRect();

		return ((evt.clientY - (rect.top + rect.height) > 5) || (evt.clientX - (rect.right + rect.width) > 5)) && lastEl; // min delta
	}


	/**
	 * Generate id
	 * @param   {HTMLElement} el
	 * @returns {String}
	 * @private
	 */
	function _generateId(el) {
		var str = el.tagName + el.className + el.src + el.href + el.textContent,
			i = str.length,
			sum = 0;

		while (i--) {
			sum += str.charCodeAt(i);
		}

		return sum.toString(36);
	}

	/**
	 * Returns the index of an element within its parent
	 * @param  {HTMLElement} el
	 * @return {number}
	 */
	function _index(el) {
		var index = 0;

		if (!el || !el.parentNode) {
			return -1;
		}

		while (el && (el = el.previousElementSibling)) {
			if (el.nodeName.toUpperCase() !== 'TEMPLATE') {
				index++;
			}
		}

		return index;
	}

	function _throttle(callback, ms) {
		var args, _this;

		return function () {
			if (args === void 0) {
				args = arguments;
				_this = this;

				setTimeout(function () {
					if (args.length === 1) {
						callback.call(_this, args[0]);
					} else {
						callback.apply(_this, args);
					}

					args = void 0;
				}, ms);
			}
		};
	}

	function _extend(dst, src) {
		if (dst && src) {
			for (var key in src) {
				if (src.hasOwnProperty(key)) {
					dst[key] = src[key];
				}
			}
		}

		return dst;
	}


	// Export utils
	Sortable.utils = {
		on: _on,
		off: _off,
		css: _css,
		find: _find,
		is: function (el, selector) {
			return !!_closest(el, selector, el);
		},
		extend: _extend,
		throttle: _throttle,
		closest: _closest,
		toggleClass: _toggleClass,
		index: _index
	};


	/**
	 * Create sortable instance
	 * @param {HTMLElement}  el
	 * @param {Object}      [options]
	 */
	Sortable.create = function (el, options) {
		return new Sortable(el, options);
	};


	// Export
	Sortable.version = '1.4.2';
	return Sortable;
});

/**
 * @author RubaXa <trash@rubaxa.org>
 * @licence MIT
 */
(function (factory) {
    'use strict';

    if (typeof define === 'function' && define.amd) {
        define(['angular', './Sortable'], factory);
    }
    else if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {
        require('angular');
        factory(angular, require('./Sortable'));
        module.exports = 'ng-sortable';
    }
    else if (window.angular && window.Sortable) {
        factory(angular, Sortable);
    }
})(function (angular, Sortable) {
    'use strict';


    /**
	 * @typedef   {Object}        ngSortEvent
	 * @property  {*}             model      List item
	 * @property  {Object|Array}  models     List of items
	 * @property  {number}        oldIndex   before sort
	 * @property  {number}        newIndex   after sort
	 */

    var expando = 'Sortable:ng-sortable';

    angular.module('ng-sortable', [])
		.constant('ngSortableVersion', '0.4.0')
		.constant('ngSortableConfig', {})
		.directive('ngSortable', ['$parse', 'ngSortableConfig', function ($parse, ngSortableConfig) {
		    var removed,
				nextSibling,
				getSourceFactory = function getSourceFactory(el, scope) {
				    var ngRepeat = [].filter.call(el.childNodes, function (node) {
				        return (
								(node.nodeType === 8) &&
								(node.nodeValue.indexOf('ngRepeat:') !== -1)
							);
				    })[0];

				    if (!ngRepeat) {
				        // Without ng-repeat
				        return function () {
				            return null;
				        };
				    }

				    // tests: http://jsbin.com/kosubutilo/1/edit?js,output
				    ngRepeat = ngRepeat.nodeValue.match(/ngRepeat:\s*(?:\(.*?,\s*)?([^\s)]+)[\s)]+in\s+([^\s|]+)/);

				    var itemsExpr = $parse(ngRepeat[2]);

				    return function () {
				        return itemsExpr(scope.$parent) || [];
				    };
				};


		    // Export
		    return {
		        restrict: 'AC',
		        scope: { ngSortable: "=?" },
		        link: function (scope, $el) {
		            var el = $el[0],
						options = angular.extend(scope.ngSortable || {}, ngSortableConfig),
						watchers = [],
						getSource = getSourceFactory(el, scope),
						sortable
		            ;

		            el[expando] = getSource;

		            function _emitEvent(/**Event*/evt, /*Mixed*/item) {
		                var name = 'on' + evt.type.charAt(0).toUpperCase() + evt.type.substr(1);
		                var source = getSource();

		                /* jshint expr:true */
		                options[name] && options[name]({
		                    model: item || source[evt.newIndex],
		                    models: source,
		                    oldIndex: evt.oldIndex,
		                    newIndex: evt.newIndex
		                });
		            }


		            function _sync(/**Event*/evt) {
		                var items = getSource();

		                if (!items) {
		                    // Without ng-repeat
		                    return;
		                }

		                var oldIndex = evt.oldIndex,
							newIndex = evt.newIndex;

		                if (el !== evt.from) {
		                    var prevItems = evt.from[expando]();

		                    removed = prevItems[oldIndex];

		                    if (evt.clone) {
		                        removed = angular.copy(removed);
		                        prevItems.splice(Sortable.utils.index(evt.clone), 0, prevItems.splice(oldIndex, 1)[0]);
		                        evt.from.removeChild(evt.clone);
		                    }
		                    else {
		                        prevItems.splice(oldIndex, 1);
		                    }

		                    items.splice(newIndex, 0, removed);

		                    evt.from.insertBefore(evt.item, nextSibling); // revert element
		                }
		                else {
		                    items.splice(newIndex, 0, items.splice(oldIndex, 1)[0]);
		                }

		                scope.$apply();
		            }


		            sortable = Sortable.create(el, Object.keys(options).reduce(function (opts, name) {
		                opts[name] = opts[name] || options[name];
		                return opts;
		            }, {
		                onStart: function (/**Event*/evt) {
		                    nextSibling = evt.from === evt.item.parentNode ? evt.item.nextSibling : evt.clone.nextSibling;
		                    _emitEvent(evt);
		                    scope.$apply();
		                },
		                onEnd: function (/**Event*/evt) {
		                    _emitEvent(evt, removed);
		                    scope.$apply();
		                },
		                onAdd: function (/**Event*/evt) {
		                    _sync(evt);
		                    _emitEvent(evt, removed);
		                    scope.$apply();
		                },
		                onUpdate: function (/**Event*/evt) {
		                    _sync(evt);
		                    _emitEvent(evt);
		                },
		                onRemove: function (/**Event*/evt) {
		                    _emitEvent(evt, removed);
		                },
		                onSort: function (/**Event*/evt) {
		                    _emitEvent(evt);
		                }
		            }));

		            $el.on('$destroy', function () {
		                angular.forEach(watchers, function (/** Function */unwatch) {
		                    unwatch();
		                });

		                sortable.destroy();

		                el[expando] = null;
		                el = null;
		                watchers = null;
		                sortable = null;
		                nextSibling = null;
		            });

		            angular.forEach([
						'sort', 'disabled', 'draggable', 'handle', 'animation', 'group', 'ghostClass', 'filter',
						'onStart', 'onEnd', 'onAdd', 'onUpdate', 'onRemove', 'onSort'
		            ], function (name) {
		                watchers.push(scope.$watch('ngSortable.' + name, function (value) {
		                    if (value !== void 0) {
		                        options[name] = value;

		                        if (!/^on[A-Z]/.test(name)) {
		                            sortable.option(name, value);
		                        }
		                    }
		                }));
		            });
		        }
		    };
		}]);
});
/*!
 * jQuery blockUI plugin
 * Version 2.70.0-2014.11.23
 * Requires jQuery v1.7 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2013 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */

;(function() {
/*jshint eqeqeq:false curly:false latedef:false */
"use strict";

	function setup($) {
		$.fn._fadeIn = $.fn.fadeIn;

		var noOp = $.noop || function() {};

		// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
		// confusing userAgent strings on Vista)
		var msie = /MSIE/.test(navigator.userAgent);
		var ie6  = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
		var mode = document.documentMode || 0;
		var setExpr = $.isFunction( document.createElement('div').style.setExpression );

		// global $ methods for blocking/unblocking the entire page
		$.blockUI   = function(opts) { install(window, opts); };
		$.unblockUI = function(opts) { remove(window, opts); };

		// convenience method for quick growl-like notifications  (http://www.google.com/search?q=growl)
		$.growlUI = function(title, message, timeout, onClose) {
			var $m = $('<div class="growlUI"></div>');
			if (title) $m.append('<h1>'+title+'</h1>');
			if (message) $m.append('<h2>'+message+'</h2>');
			if (timeout === undefined) timeout = 3000;

			// Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
			var callBlock = function(opts) {
				opts = opts || {};

				$.blockUI({
					message: $m,
					fadeIn : typeof opts.fadeIn  !== 'undefined' ? opts.fadeIn  : 700,
					fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
					timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
					centerY: false,
					showOverlay: false,
					onUnblock: onClose,
					css: $.blockUI.defaults.growlCSS
				});
			};

			callBlock();
			var nonmousedOpacity = $m.css('opacity');
			$m.mouseover(function() {
				callBlock({
					fadeIn: 0,
					timeout: 30000
				});

				var displayBlock = $('.blockMsg');
				displayBlock.stop(); // cancel fadeout if it has started
				displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
			}).mouseout(function() {
				$('.blockMsg').fadeOut(1000);
			});
			// End konapun additions
		};

		// plugin method for blocking element content
		$.fn.block = function(opts) {
			if ( this[0] === window ) {
				$.blockUI( opts );
				return this;
			}
			var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
			this.each(function() {
				var $el = $(this);
				if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
					return;
				$el.unblock({ fadeOut: 0 });
			});

			return this.each(function() {
				if ($.css(this,'position') == 'static') {
					this.style.position = 'relative';
					$(this).data('blockUI.static', true);
				}
				this.style.zoom = 1; // force 'hasLayout' in ie
				install(this, opts);
			});
		};

		// plugin method for unblocking element content
		$.fn.unblock = function(opts) {
			if ( this[0] === window ) {
				$.unblockUI( opts );
				return this;
			}
			return this.each(function() {
				remove(this, opts);
			});
		};

		$.blockUI.version = 2.70; // 2nd generation blocking at no extra cost!

		// override these in your code to change the default behavior and style
		$.blockUI.defaults = {
			// message displayed when blocking (use null for no message)
			message:  '<h1>Please wait...</h1>',

			title: null,		// title string; only used when theme == true
			draggable: true,	// only used when theme == true (requires jquery-ui.js to be loaded)

			theme: false, // set to true to use with jQuery UI themes

			// styles for the message when blocking; if you wish to disable
			// these and use an external stylesheet then do this in your code:
			// $.blockUI.defaults.css = {};
			css: {
				padding:	0,
				margin:		0,
				width:		'30%',
				top:		'40%',
				left:		'35%',
				textAlign:	'center',
				color:		'#000',
				border:		'3px solid #aaa',
				backgroundColor:'#fff',
				cursor:		'wait'
			},

			// minimal style set used when themes are used
			themedCSS: {
				width:	'30%',
				top:	'40%',
				left:	'35%'
			},

			// styles for the overlay
			overlayCSS:  {
				backgroundColor:	'#000',
				opacity:			0.6,
				cursor:				'wait'
			},

			// style to replace wait cursor before unblocking to correct issue
			// of lingering wait cursor
			cursorReset: 'default',

			// styles applied when using $.growlUI
			growlCSS: {
				width:		'350px',
				top:		'10px',
				left:		'',
				right:		'10px',
				border:		'none',
				padding:	'5px',
				opacity:	0.6,
				cursor:		'default',
				color:		'#fff',
				backgroundColor: '#000',
				'-webkit-border-radius':'10px',
				'-moz-border-radius':	'10px',
				'border-radius':		'10px'
			},

			// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
			// (hat tip to Jorge H. N. de Vasconcelos)
			/*jshint scripturl:true */
			iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',

			// force usage of iframe in non-IE browsers (handy for blocking applets)
			forceIframe: false,

			// z-index for the blocking overlay
			baseZ: 1000,

			// set these to true to have the message automatically centered
			centerX: true, // <-- only effects element blocking (page block controlled via css above)
			centerY: true,

			// allow body element to be stetched in ie6; this makes blocking look better
			// on "short" pages.  disable if you wish to prevent changes to the body height
			allowBodyStretch: true,

			// enable if you want key and mouse events to be disabled for content that is blocked
			bindEvents: true,

			// be default blockUI will supress tab navigation from leaving blocking content
			// (if bindEvents is true)
			constrainTabKey: true,

			// fadeIn time in millis; set to 0 to disable fadeIn on block
			fadeIn:  200,

			// fadeOut time in millis; set to 0 to disable fadeOut on unblock
			fadeOut:  400,

			// time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
			timeout: 0,

			// disable if you don't want to show the overlay
			showOverlay: true,

			// if true, focus will be placed in the first available input field when
			// page blocking
			focusInput: true,

            // elements that can receive focus
            focusableElements: ':input:enabled:visible',

			// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
			// no longer needed in 2012
			// applyPlatformOpacityRules: true,

			// callback method invoked when fadeIn has completed and blocking message is visible
			onBlock: null,

			// callback method invoked when unblocking has completed; the callback is
			// passed the element that has been unblocked (which is the window object for page
			// blocks) and the options that were passed to the unblock call:
			//	onUnblock(element, options)
			onUnblock: null,

			// callback method invoked when the overlay area is clicked.
			// setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
			onOverlayClick: null,

			// don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
			quirksmodeOffsetHack: 4,

			// class name of the message block
			blockMsgClass: 'blockMsg',

			// if it is already blocked, then ignore it (don't unblock and reblock)
			ignoreIfBlocked: false
		};

		// private data and functions follow...

		var pageBlock = null;
		var pageBlockEls = [];

		function install(el, opts) {
			var css, themedCSS;
			var full = (el == window);
			var msg = (opts && opts.message !== undefined ? opts.message : undefined);
			opts = $.extend({}, $.blockUI.defaults, opts || {});

			if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
				return;

			opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
			css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
			if (opts.onOverlayClick)
				opts.overlayCSS.cursor = 'pointer';

			themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
			msg = msg === undefined ? opts.message : msg;

			// remove the current block (if there is one)
			if (full && pageBlock)
				remove(window, {fadeOut:0});

			// if an existing element is being used as the blocking content then we capture
			// its current place in the DOM (and current display style) so we can restore
			// it when we unblock
			if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
				var node = msg.jquery ? msg[0] : msg;
				var data = {};
				$(el).data('blockUI.history', data);
				data.el = node;
				data.parent = node.parentNode;
				data.display = node.style.display;
				data.position = node.style.position;
				if (data.parent)
					data.parent.removeChild(node);
			}

			$(el).data('blockUI.onUnblock', opts.onUnblock);
			var z = opts.baseZ;

			// blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
			// layer1 is the iframe layer which is used to supress bleed through of underlying content
			// layer2 is the overlay layer which has opacity and a wait cursor (by default)
			// layer3 is the message content that is displayed while blocking
			var lyr1, lyr2, lyr3, s;
			if (msie || opts.forceIframe)
				lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
			else
				lyr1 = $('<div class="blockUI" style="display:none"></div>');

			if (opts.theme)
				lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
			else
				lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');

			if (opts.theme && full) {
				s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
				if ( opts.title ) {
					s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
				}
				s += '<div class="ui-widget-content ui-dialog-content"></div>';
				s += '</div>';
			}
			else if (opts.theme) {
				s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
				if ( opts.title ) {
					s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
				}
				s += '<div class="ui-widget-content ui-dialog-content"></div>';
				s += '</div>';
			}
			else if (full) {
				s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
			}
			else {
				s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
			}
			lyr3 = $(s);

			// if we have a message, style it
			if (msg) {
				if (opts.theme) {
					lyr3.css(themedCSS);
					lyr3.addClass('ui-widget-content');
				}
				else
					lyr3.css(css);
			}

			// style the overlay
			if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
				lyr2.css(opts.overlayCSS);
			lyr2.css('position', full ? 'fixed' : 'absolute');

			// make iframe layer transparent in IE
			if (msie || opts.forceIframe)
				lyr1.css('opacity',0.0);

			//$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
			var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
			$.each(layers, function() {
				this.appendTo($par);
			});

			if (opts.theme && opts.draggable && $.fn.draggable) {
				lyr3.draggable({
					handle: '.ui-dialog-titlebar',
					cancel: 'li'
				});
			}

			// ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
			var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
			if (ie6 || expr) {
				// give body 100% height
				if (full && opts.allowBodyStretch && $.support.boxModel)
					$('html,body').css('height','100%');

				// fix ie6 issue when blocked element has a border width
				if ((ie6 || !$.support.boxModel) && !full) {
					var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
					var fixT = t ? '(0 - '+t+')' : 0;
					var fixL = l ? '(0 - '+l+')' : 0;
				}

				// simulate fixed position
				$.each(layers, function(i,o) {
					var s = o[0].style;
					s.position = 'absolute';
					if (i < 2) {
						if (full)
							s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
						else
							s.setExpression('height','this.parentNode.offsetHeight + "px"');
						if (full)
							s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
						else
							s.setExpression('width','this.parentNode.offsetWidth + "px"');
						if (fixL) s.setExpression('left', fixL);
						if (fixT) s.setExpression('top', fixT);
					}
					else if (opts.centerY) {
						if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
						s.marginTop = 0;
					}
					else if (!opts.centerY && full) {
						var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
						var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
						s.setExpression('top',expression);
					}
				});
			}

			// show the message
			if (msg) {
				if (opts.theme)
					lyr3.find('.ui-widget-content').append(msg);
				else
					lyr3.append(msg);
				if (msg.jquery || msg.nodeType)
					$(msg).show();
			}

			if ((msie || opts.forceIframe) && opts.showOverlay)
				lyr1.show(); // opacity is zero
			if (opts.fadeIn) {
				var cb = opts.onBlock ? opts.onBlock : noOp;
				var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
				var cb2 = msg ? cb : noOp;
				if (opts.showOverlay)
					lyr2._fadeIn(opts.fadeIn, cb1);
				if (msg)
					lyr3._fadeIn(opts.fadeIn, cb2);
			}
			else {
				if (opts.showOverlay)
					lyr2.show();
				if (msg)
					lyr3.show();
				if (opts.onBlock)
					opts.onBlock.bind(lyr3)();
			}

			// bind key and mouse events
			bind(1, el, opts);

			if (full) {
				pageBlock = lyr3[0];
				pageBlockEls = $(opts.focusableElements,pageBlock);
				if (opts.focusInput)
					setTimeout(focus, 20);
			}
			else
				center(lyr3[0], opts.centerX, opts.centerY);

			if (opts.timeout) {
				// auto-unblock
				var to = setTimeout(function() {
					if (full)
						$.unblockUI(opts);
					else
						$(el).unblock(opts);
				}, opts.timeout);
				$(el).data('blockUI.timeout', to);
			}
		}

		// remove the block
		function remove(el, opts) {
			var count;
			var full = (el == window);
			var $el = $(el);
			var data = $el.data('blockUI.history');
			var to = $el.data('blockUI.timeout');
			if (to) {
				clearTimeout(to);
				$el.removeData('blockUI.timeout');
			}
			opts = $.extend({}, $.blockUI.defaults, opts || {});
			bind(0, el, opts); // unbind events

			if (opts.onUnblock === null) {
				opts.onUnblock = $el.data('blockUI.onUnblock');
				$el.removeData('blockUI.onUnblock');
			}

			var els;
			if (full) // crazy selector to handle odd field errors in ie6/7
				els = $('body').children().filter('.blockUI').add('body > .blockUI');
			else
				els = $el.find('>.blockUI');

			// fix cursor issue
			if ( opts.cursorReset ) {
				if ( els.length > 1 )
					els[1].style.cursor = opts.cursorReset;
				if ( els.length > 2 )
					els[2].style.cursor = opts.cursorReset;
			}

			if (full)
				pageBlock = pageBlockEls = null;

			if (opts.fadeOut) {
				count = els.length;
				els.stop().fadeOut(opts.fadeOut, function() {
					if ( --count === 0)
						reset(els,data,opts,el);
				});
			}
			else
				reset(els, data, opts, el);
		}

		// move blocking element back into the DOM where it started
		function reset(els,data,opts,el) {
			var $el = $(el);
			if ( $el.data('blockUI.isBlocked') )
				return;

			els.each(function(i,o) {
				// remove via DOM calls so we don't lose event handlers
				if (this.parentNode)
					this.parentNode.removeChild(this);
			});

			if (data && data.el) {
				data.el.style.display = data.display;
				data.el.style.position = data.position;
				data.el.style.cursor = 'default'; // #59
				if (data.parent)
					data.parent.appendChild(data.el);
				$el.removeData('blockUI.history');
			}

			if ($el.data('blockUI.static')) {
				$el.css('position', 'static'); // #22
			}

			if (typeof opts.onUnblock == 'function')
				opts.onUnblock(el,opts);

			// fix issue in Safari 6 where block artifacts remain until reflow
			var body = $(document.body), w = body.width(), cssW = body[0].style.width;
			body.width(w-1).width(w);
			body[0].style.width = cssW;
		}

		// bind/unbind the handler
		function bind(b, el, opts) {
			var full = el == window, $el = $(el);

			// don't bother unbinding if there is nothing to unbind
			if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
				return;

			$el.data('blockUI.isBlocked', b);

			// don't bind events when overlay is not in use or if bindEvents is false
			if (!full || !opts.bindEvents || (b && !opts.showOverlay))
				return;

			// bind anchors and inputs for mouse and key events
			var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
			if (b)
				$(document).bind(events, opts, handler);
			else
				$(document).unbind(events, handler);

		// former impl...
		//		var $e = $('a,:input');
		//		b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
		}

		// event handler to suppress keyboard/mouse events when blocking
		function handler(e) {
			// allow tab navigation (conditionally)
			if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {
				if (pageBlock && e.data.constrainTabKey) {
					var els = pageBlockEls;
					var fwd = !e.shiftKey && e.target === els[els.length-1];
					var back = e.shiftKey && e.target === els[0];
					if (fwd || back) {
						setTimeout(function(){focus(back);},10);
						return false;
					}
				}
			}
			var opts = e.data;
			var target = $(e.target);
			if (target.hasClass('blockOverlay') && opts.onOverlayClick)
				opts.onOverlayClick(e);

			// allow events within the message content
			if (target.parents('div.' + opts.blockMsgClass).length > 0)
				return true;

			// allow events for content that is not being blocked
			return target.parents().children().filter('div.blockUI').length === 0;
		}

		function focus(back) {
			if (!pageBlockEls)
				return;
			var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
			if (e)
				e.focus();
		}

		function center(el, x, y) {
			var p = el.parentNode, s = el.style;
			var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
			var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
			if (x) s.left = l > 0 ? (l+'px') : '0';
			if (y) s.top  = t > 0 ? (t+'px') : '0';
		}

		function sz(el, p) {
			return parseInt($.css(el,p),10)||0;
		}

	}


	/*global define:true */
	if (typeof define === 'function' && define.amd && define.amd.jQuery) {
		define(['jquery'], setup);
	} else {
		setup(jQuery);
	}

})();

/**
 * Copyright (c) 2011-2014 Felix Gnass
 * Licensed under the MIT license
 * http://spin.js.org/
 *
 * Example:
    var opts = {
      lines: 12             // The number of lines to draw
    , length: 7             // The length of each line
    , width: 5              // The line thickness
    , radius: 10            // The radius of the inner circle
    , scale: 1.0            // Scales overall size of the spinner
    , corners: 1            // Roundness (0..1)
    , color: '#000'         // #rgb or #rrggbb
    , opacity: 1/4          // Opacity of the lines
    , rotate: 0             // Rotation offset
    , direction: 1          // 1: clockwise, -1: counterclockwise
    , speed: 1              // Rounds per second
    , trail: 100            // Afterglow percentage
    , fps: 20               // Frames per second when using setTimeout()
    , zIndex: 2e9           // Use a high z-index by default
    , className: 'spinner'  // CSS class to assign to the element
    , top: '50%'            // center vertically
    , left: '50%'           // center horizontally
    , shadow: false         // Whether to render a shadow
    , hwaccel: false        // Whether to use hardware acceleration (might be buggy)
    , position: 'absolute'  // Element positioning
    }
    var target = document.getElementById('foo')
    var spinner = new Spinner(opts).spin(target)
 */
;(function (root, factory) {

  /* CommonJS */
  if (typeof module == 'object' && module.exports) module.exports = factory()

  /* AMD module */
  else if (typeof define == 'function' && define.amd) define(factory)

  /* Browser global */
  else root.Spinner = factory()
}(this, function () {
  "use strict"

  var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
    , animations = {} /* Animation rules keyed by their name */
    , useCssAnimations /* Whether to use CSS animations or setTimeout */
    , sheet /* A stylesheet to hold the @keyframe or VML rules. */

  /**
   * Utility function to create elements. If no tag name is given,
   * a DIV is created. Optionally properties can be passed.
   */
  function createEl (tag, prop) {
    var el = document.createElement(tag || 'div')
      , n

    for (n in prop) el[n] = prop[n]
    return el
  }

  /**
   * Appends children and returns the parent.
   */
  function ins (parent /* child1, child2, ...*/) {
    for (var i = 1, n = arguments.length; i < n; i++) {
      parent.appendChild(arguments[i])
    }

    return parent
  }

  /**
   * Creates an opacity keyframe animation rule and returns its name.
   * Since most mobile Webkits have timing issues with animation-delay,
   * we create separate rules for each line/segment.
   */
  function addAnimation (alpha, trail, i, lines) {
    var name = ['opacity', trail, ~~(alpha * 100), i, lines].join('-')
      , start = 0.01 + i/lines * 100
      , z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)
      , prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
      , pre = prefix && '-' + prefix + '-' || ''

    if (!animations[name]) {
      sheet.insertRule(
        '@' + pre + 'keyframes ' + name + '{' +
        '0%{opacity:' + z + '}' +
        start + '%{opacity:' + alpha + '}' +
        (start+0.01) + '%{opacity:1}' +
        (start+trail) % 100 + '%{opacity:' + alpha + '}' +
        '100%{opacity:' + z + '}' +
        '}', sheet.cssRules.length)

      animations[name] = 1
    }

    return name
  }

  /**
   * Tries various vendor prefixes and returns the first supported property.
   */
  function vendor (el, prop) {
    var s = el.style
      , pp
      , i

    prop = prop.charAt(0).toUpperCase() + prop.slice(1)
    if (s[prop] !== undefined) return prop
    for (i = 0; i < prefixes.length; i++) {
      pp = prefixes[i]+prop
      if (s[pp] !== undefined) return pp
    }
  }

  /**
   * Sets multiple style properties at once.
   */
  function css (el, prop) {
    for (var n in prop) {
      el.style[vendor(el, n) || n] = prop[n]
    }

    return el
  }

  /**
   * Fills in default values.
   */
  function merge (obj) {
    for (var i = 1; i < arguments.length; i++) {
      var def = arguments[i]
      for (var n in def) {
        if (obj[n] === undefined) obj[n] = def[n]
      }
    }
    return obj
  }

  /**
   * Returns the line color from the given string or array.
   */
  function getColor (color, idx) {
    return typeof color == 'string' ? color : color[idx % color.length]
  }

  // Built-in defaults

  var defaults = {
    lines: 12             // The number of lines to draw
  , length: 7             // The length of each line
  , width: 5              // The line thickness
  , radius: 10            // The radius of the inner circle
  , scale: 1.0            // Scales overall size of the spinner
  , corners: 1            // Roundness (0..1)
  , color: '#000'         // #rgb or #rrggbb
  , opacity: 1/4          // Opacity of the lines
  , rotate: 0             // Rotation offset
  , direction: 1          // 1: clockwise, -1: counterclockwise
  , speed: 1              // Rounds per second
  , trail: 100            // Afterglow percentage
  , fps: 20               // Frames per second when using setTimeout()
  , zIndex: 2e9           // Use a high z-index by default
  , className: 'spinner'  // CSS class to assign to the element
  , top: '50%'            // center vertically
  , left: '50%'           // center horizontally
  , shadow: false         // Whether to render a shadow
  , hwaccel: false        // Whether to use hardware acceleration (might be buggy)
  , position: 'absolute'  // Element positioning
  }

  /** The constructor */
  function Spinner (o) {
    this.opts = merge(o || {}, Spinner.defaults, defaults)
  }

  // Global defaults that override the built-ins:
  Spinner.defaults = {}

  merge(Spinner.prototype, {
    /**
     * Adds the spinner to the given target element. If this instance is already
     * spinning, it is automatically removed from its previous target b calling
     * stop() internally.
     */
    spin: function (target) {
      this.stop()

      var self = this
        , o = self.opts
        , el = self.el = createEl(null, {className: o.className})

      css(el, {
        position: o.position
      , width: 0
      , zIndex: o.zIndex
      , left: o.left
      , top: o.top
      })

      if (target) {
        target.insertBefore(el, target.firstChild || null)
      }

      el.setAttribute('role', 'progressbar')
      self.lines(el, self.opts)

      if (!useCssAnimations) {
        // No CSS animation support, use setTimeout() instead
        var i = 0
          , start = (o.lines - 1) * (1 - o.direction) / 2
          , alpha
          , fps = o.fps
          , f = fps / o.speed
          , ostep = (1 - o.opacity) / (f * o.trail / 100)
          , astep = f / o.lines

        ;(function anim () {
          i++
          for (var j = 0; j < o.lines; j++) {
            alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity)

            self.opacity(el, j * o.direction + start, alpha, o)
          }
          self.timeout = self.el && setTimeout(anim, ~~(1000 / fps))
        })()
      }
      return self
    }

    /**
     * Stops and removes the Spinner.
     */
  , stop: function () {
      var el = this.el
      if (el) {
        clearTimeout(this.timeout)
        if (el.parentNode) el.parentNode.removeChild(el)
        this.el = undefined
      }
      return this
    }

    /**
     * Internal method that draws the individual lines. Will be overwritten
     * in VML fallback mode below.
     */
  , lines: function (el, o) {
      var i = 0
        , start = (o.lines - 1) * (1 - o.direction) / 2
        , seg

      function fill (color, shadow) {
        return css(createEl(), {
          position: 'absolute'
        , width: o.scale * (o.length + o.width) + 'px'
        , height: o.scale * o.width + 'px'
        , background: color
        , boxShadow: shadow
        , transformOrigin: 'left'
        , transform: 'rotate(' + ~~(360/o.lines*i + o.rotate) + 'deg) translate(' + o.scale*o.radius + 'px' + ',0)'
        , borderRadius: (o.corners * o.scale * o.width >> 1) + 'px'
        })
      }

      for (; i < o.lines; i++) {
        seg = css(createEl(), {
          position: 'absolute'
        , top: 1 + ~(o.scale * o.width / 2) + 'px'
        , transform: o.hwaccel ? 'translate3d(0,0,0)' : ''
        , opacity: o.opacity
        , animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1 / o.speed + 's linear infinite'
        })

        if (o.shadow) ins(seg, css(fill('#000', '0 0 4px #000'), {top: '2px'}))
        ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')))
      }
      return el
    }

    /**
     * Internal method that adjusts the opacity of a single line.
     * Will be overwritten in VML fallback mode below.
     */
  , opacity: function (el, i, val) {
      if (i < el.childNodes.length) el.childNodes[i].style.opacity = val
    }

  })


  function initVML () {

    /* Utility function to create a VML tag */
    function vml (tag, attr) {
      return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
    }

    // No CSS transforms but VML support, add a CSS rule for VML elements:
    sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')

    Spinner.prototype.lines = function (el, o) {
      var r = o.scale * (o.length + o.width)
        , s = o.scale * 2 * r

      function grp () {
        return css(
          vml('group', {
            coordsize: s + ' ' + s
          , coordorigin: -r + ' ' + -r
          })
        , { width: s, height: s }
        )
      }

      var margin = -(o.width + o.length) * o.scale * 2 + 'px'
        , g = css(grp(), {position: 'absolute', top: margin, left: margin})
        , i

      function seg (i, dx, filter) {
        ins(
          g
        , ins(
            css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx})
          , ins(
              css(
                vml('roundrect', {arcsize: o.corners})
              , { width: r
                , height: o.scale * o.width
                , left: o.scale * o.radius
                , top: -o.scale * o.width >> 1
                , filter: filter
                }
              )
            , vml('fill', {color: getColor(o.color, i), opacity: o.opacity})
            , vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
            )
          )
        )
      }

      if (o.shadow)
        for (i = 1; i <= o.lines; i++) {
          seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
        }

      for (i = 1; i <= o.lines; i++) seg(i)
      return ins(el, g)
    }

    Spinner.prototype.opacity = function (el, i, val, o) {
      var c = el.firstChild
      o = o.shadow && o.lines || 0
      if (c && i + o < c.childNodes.length) {
        c = c.childNodes[i + o]; c = c && c.firstChild; c = c && c.firstChild
        if (c) c.opacity = val
      }
    }
  }

  if (typeof document !== 'undefined') {
    sheet = (function () {
      var el = createEl('style', {type : 'text/css'})
      ins(document.getElementsByTagName('head')[0], el)
      return el.sheet || el.styleSheet
    }())

    var probe = css(createEl('group'), {behavior: 'url(#default#VML)'})

    if (!vendor(probe, 'transform') && probe.adj) initVML()
    else useCssAnimations = vendor(probe, 'animation')
  }

  return Spinner

}));

