!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(jQuery){"use strict";function keyHandler(t){if("string"==typeof t.data&&(t.data={keys:t.data}),t.data&&t.data.keys&&"string"==typeof t.data.keys){var e=t.handler,n=t.data.keys.toLowerCase().split(" ");t.handler=function(t){if(this===t.target||!($.hotkeys.options.filterInputAcceptingElements&&$.hotkeys.textInputTypes.test(t.target.nodeName)||$.hotkeys.options.filterContentEditable&&$(t.target).attr("contenteditable")||$.hotkeys.options.filterTextInputs&&$.inArray(t.target.type,$.hotkeys.textAcceptingInputTypes)>-1)){var o="keypress"!==t.type&&$.hotkeys.specialKeys[t.which],i=String.fromCharCode(t.which).toLowerCase(),a="",s={};$.each(["alt","ctrl","shift"],function(e,n){t[n+"Key"]&&o!==n&&(a+=n+"+")}),t.metaKey&&!t.ctrlKey&&"meta"!==o&&(a+="meta+"),t.metaKey&&"meta"!==o&&a.indexOf("alt+ctrl+shift+")>-1&&(a=a.replace("alt+ctrl+shift+","hyper+")),o?s[a+o]=!0:(s[a+i]=!0,s[a+$.hotkeys.shiftNums[i]]=!0,"shift+"===a&&(s[$.hotkeys.shiftNums[i]]=!0));for(var r=0,l=n.length;l>r;r++)if(s[n[r]])return e.apply(this,arguments)}}}}function handler(t){var e,n=t||window.event,o=[].slice.call(arguments,1),i=0,a=0,s=0,r=0,l=0;return t=$.event.fix(n),t.type="mousewheel",n.wheelDelta&&(i=n.wheelDelta),n.detail&&(i=-1*n.detail),n.deltaY&&(s=-1*n.deltaY,i=s),n.deltaX&&(a=n.deltaX,i=-1*a),void 0!==n.wheelDeltaY&&(s=n.wheelDeltaY),void 0!==n.wheelDeltaX&&(a=-1*n.wheelDeltaX),r=Math.abs(i),(!lowestDelta||lowestDelta>r)&&(lowestDelta=r),l=Math.max(Math.abs(s),Math.abs(a)),(!lowestDeltaXY||lowestDeltaXY>l)&&(lowestDeltaXY=l),e=i>0?"floor":"ceil",i=Math[e](i/lowestDelta),a=Math[e](a/lowestDeltaXY),s=Math[e](s/lowestDeltaXY),o.unshift(t,i,a,s),($.event.dispatch||$.event.handle).apply(this,o)}function preCode(t){var e=Array.prototype.slice.call(document.querySelectorAll(t),0);e.forEach(function(t,e,n){var o=t.textContent.replace(/^[\r\n]+/,"").replace(/\s+$/g,"");if(/^\S/gm.test(o))return void(t.textContent=o);for(var i,a,s,r=/^[\t ]+/gm,l=1e3;i=r.exec(o);)s=i[0].length,l>s&&(l=s,a=i[0]);1e3!=l&&(t.textContent=o.replace(new RegExp("^"+a,"gm"),""))})}function touch2Mouse(t){var e,n=t.changedTouches[0];switch(t.type){case"touchstart":e="mousedown";break;case"touchend":e="mouseup";break;case"touchmove":e="mousemove";break;default:return}"mousedown"==e&&(eventTimer=(new Date).getTime(),startX=n.clientX,startY=n.clientY,mouseDown=!0),"mouseup"==e&&((new Date).getTime()-eventTimer<=500?e="click":(new Date).getTime()-eventTimer>1e3&&(e="longclick"),eventTimer=0,mouseDown=!1),"mousemove"==e&&mouseDown&&(deltaX=n.clientX-startX,deltaY=n.clientY-startY,moveDirection=deltaX>deltaY?"horizontal":"vertical");var o=document.createEvent("MouseEvent");o.initMouseEvent(e,!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o),t.preventDefault()}var $=jQuery;if(window.METRO_VERSION="3.0.15","undefined"==typeof jQuery)throw new Error("Metro's JavaScript requires jQuery");void 0===window.METRO_AUTO_REINIT&&(window.METRO_AUTO_REINIT=!0),void 0===window.METRO_LANGUAGE&&(window.METRO_LANGUAGE="en"),void 0===window.METRO_LOCALE&&(window.METRO_LOCALE="EN_en"),void 0===window.METRO_CURRENT_LOCALE&&(window.METRO_CURRENT_LOCALE="en"),void 0===window.METRO_SHOW_TYPE&&(window.METRO_SHOW_TYPE="slide"),void 0===window.METRO_DEBUG&&(window.METRO_DEBUG=!0),void 0===window.METRO_CALENDAR_WEEK_START&&(window.METRO_CALENDAR_WEEK_START=0),window.canObserveMutation="MutationObserver"in window,Number.prototype.format=function(t,e,n,o){var i="\\d(?=(\\d{"+(e||3)+"})+"+(t>0?"\\D":"$")+")",a=this.toFixed(Math.max(0,~~t));return(o?a.replace(".",o):a).replace(new RegExp(i,"g"),"$&"+(n||","))},String.prototype.isUrl=function(){var t=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(this)},String.prototype.isColor=function(){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(this)},window.secondsToFormattedString=function(t){var e,n,o;return e=parseInt(t/3600)%24,n=parseInt(t/60)%60,o=t%60,(e?e+":":"")+(10>n?"0"+n:n)+":"+(10>o?"0"+o:o)},Array.prototype.shuffle=function(){for(var t,e,n=this.length;0!==n;)e=Math.floor(Math.random()*n),n-=1,t=this[n],this[n]=this[e],this[e]=t;return this},Array.prototype.clone=function(){return this.slice(0)},Array.prototype.unique=function(){for(var t=this.concat(),e=0;e<t.length;++e)for(var n=e+1;n<t.length;++n)t[e]===t[n]&&t.splice(n--,1);return t},window.uniqueId=function(t){var e=(new Date).getTime(),n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)});return n},window.isTouchDevice=function(){return"ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0},window.METRO_LOCALES={en:{months:["January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Su","Mo","Tu","We","Th","Fr","Sa"],buttons:["Today","Clear","Cancel","Help","Prior","Next","Finish"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre","Jan","Fév","Mars","Avr","Mai","Juin","Juil","Août","Sept","Oct","Nov","Déc"],days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Di","Lu","Ma","Me","Je","Ve","Sa"],buttons:["Aujourd'hui","Effacer","Annuler","Aide","Précedent","Suivant","Fin"]},nl:{months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December","Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zo","Ma","Di","Wo","Do","Vr","Za"],buttons:["Vandaag","Verwijderen","Annuleren","Hulp","Vorige","Volgende","Einde"]},ua:{months:["??????","?????","????????","???????","???????","???????","??????","???????","????????","???????","????????","???????","???","???","???","???","???","???","???","???","???","???","???","???"],days:["??????","?????????","????????","??????","??????","????????","??????","??","??","??","??","??","??","??"],buttons:["????????","????????","?????????","????????","?????","??????","??????"]},ru:{months:["??????","???????","????","??????","???","????","????","??????","????????","???????","??????","???????","???","???","???","???","???","???","???","???","???","???","???","???"],days:["???????????","???????????","???????","?????","???????","???????","???????","??","??","??","??","??","??","??"],buttons:["???????","????????","????????","??????","?????","??????","??????"]},zhCN:{months:["??","??","??","??","??","??","??","??","??","??","???","???","??","??","??","??","??","??","??","??","??","??","???","???"],days:["???","???","???","???","???","???","???","?","?","?","?","?","?","?"],buttons:["??","??","Cancel","Help","Prior","Next","Finish"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre","Gen"," Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Dom","Lun","Mar","Mer","Gio","Ven","Sab"],buttons:["Oggi","Cancella","Cancel","Help","Prior","Next","Finish"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember","Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","So","Mo","Di","Mi","Do","Fr","Sa"],buttons:["Heute","Zurücksetzen","Abbrechen","Hilfe","Früher","Später","Fertig"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre","Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sept","Oct","Nov","Dic"],days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Do","Lu","Mar","Mié","Jue","Vi","Sáb"],buttons:["Hoy","Limpiar","Cancel","Help","Prior","Next","Finish"]},pt:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro","Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],days:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sabado","Dom","Seg","Ter","Qua","Qui","Sex","Sab"],buttons:["Hoje","Limpar","Cancelar","Ajuda","Anterior","Seguinte","Terminar"]},pl:{months:["Stycze?","Luty","Marzec","Kwiecie?","Maj","Czerwiec","Lipiec","Sierpie?","Wrzesie?","Pa?dziernik","Listopad","Grudzie?","Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Pa?","Lis","Gru"],days:["Niedziela","Poniedzia?ek","Wtorek","?roda","Czwartek","Pi?tek","Sobota","Nd","Pon","Wt","?r","Czw","Pt","Sob"],buttons:["Dzisiaj","Wyczy??","Anuluj","Pomoc","Poprzedni","Nast?pny","Koniec"]},cs:{months:["Leden","Únor","B?ezen","Duben","Kv?ten","?erven","?ervenec","Srpen","Zá?í","?íjen","Listopad","Prosinec","Led","Ún","B?","Dub","Kv?","?e","?er","Srp","Zá","?í","Li","Pro"],days:["Ned?le","Pond?lí","Úterý","St?eda","?tvrtek","Pátek","Sobota","Ne","Po","Út","St","?t","Pá","So"],buttons:["Dnes","Vy?istit","Zru?it","Pomoc","P?ede?lý","Dal?í","Dokon?it"]},th:{months:["??????","??????????","??????","??????","???????","????????","???????","???????","???????","??????","?????????","???????","?.?.","?.?.","??.?.","??.?.","?.?.","??.?.","?.?.","?.?.","?.?.","?.?.","?.?.","?.?."],days:["???????","??????","??????","???","????????","?????","?????","??.","?.","?.","?.","??.","?.","?."],buttons:["??????","????","??????","?????????","????","?????","?????"]}};var dateFormat=function(){var t=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,e=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g,o=function(t,e){for(t=String(t),e=e||2;t.length<e;)t="0"+t;return t};return function(i,a,s){var r=dateFormat;1!==arguments.length||"[object String]"!==Object.prototype.toString.call(i)||/\d/.test(i)||(a=i,i=void 0),i=i?new Date(i):new Date,a=String(r.masks[a]||a||r.masks["default"]),"UTC:"===a.slice(0,4)&&(a=a.slice(4),s=!0);var l=window.METRO_CURRENT_LOCALE||"en",d=s?"getUTC":"get",c=i[d+"Date"](),u=i[d+"Day"](),h=i[d+"Month"](),p=i[d+"FullYear"](),f=i[d+"Hours"](),m=i[d+"Minutes"](),v=i[d+"Seconds"](),g=i[d+"Milliseconds"](),_=s?0:i.getTimezoneOffset(),w={d:c,dd:o(c),ddd:window.METRO_LOCALES[l].days[u],dddd:window.METRO_LOCALES[l].days[u+7],m:h+1,mm:o(h+1),mmm:window.METRO_LOCALES[l].months[h],mmmm:window.METRO_LOCALES[l].months[h+12],yy:String(p).slice(2),yyyy:p,h:f%12||12,hh:o(f%12||12),H:f,HH:o(f),M:m,MM:o(m),s:v,ss:o(v),l:o(g,3),L:o(g>99?Math.round(g/10):g),t:12>f?"a":"p",tt:12>f?"am":"pm",T:12>f?"A":"P",TT:12>f?"AM":"PM",Z:s?"UTC":(String(i).match(e)||[""]).pop().replace(n,""),o:(_>0?"-":"+")+o(100*Math.floor(Math.abs(_)/60)+Math.abs(_)%60,4),S:["th","st","nd","rd"][c%10>3?0:(c%100-c%10!==10)*c%10]};return a.replace(t,function(t){return t in w?w[t]:t.slice(1,t.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"},Date.prototype.format=function(t,e){return dateFormat(this,t,e)};var widget_uuid=0,widget_slice=Array.prototype.slice;$.cleanData=function(t){return function(e){var n,o,i;for(i=0;null!=(o=e[i]);i++)try{n=$._data(o,"events"),n&&n.remove&&$(o).triggerHandler("remove")}catch(a){}t(e)}}($.cleanData),$.widget=function(t,e,n){var o,i,a,s,r={},l=t.split(".")[0];return t=t.split(".")[1],o=l+"-"+t,n||(n=e,e=$.Widget),$.expr[":"][o.toLowerCase()]=function(t){return!!$.data(t,o)},$[l]=$[l]||{},i=$[l][t],a=$[l][t]=function(t,e){return this._createWidget?void(arguments.length&&this._createWidget(t,e)):new a(t,e)},$.extend(a,i,{version:n.version,_proto:$.extend({},n),_childConstructors:[]}),s=new e,s.options=$.widget.extend({},s.options),$.each(n,function(t,n){return $.isFunction(n)?void(r[t]=function(){var o=function(){return e.prototype[t].apply(this,arguments)},i=function(n){return e.prototype[t].apply(this,n)};return function(){var t,e=this._super,a=this._superApply;return this._super=o,this._superApply=i,t=n.apply(this,arguments),this._super=e,this._superApply=a,t}}()):void(r[t]=n)}),a.prototype=$.widget.extend(s,{widgetEventPrefix:i?s.widgetEventPrefix||t:t},r,{constructor:a,namespace:l,widgetName:t,widgetFullName:o}),i?($.each(i._childConstructors,function(t,e){var n=e.prototype;$.widget(n.namespace+"."+n.widgetName,a,e._proto)}),delete i._childConstructors):e._childConstructors.push(a),$.widget.bridge(t,a),a},$.widget.extend=function(t){for(var e,n,o=widget_slice.call(arguments,1),i=0,a=o.length;a>i;i++)for(e in o[i])n=o[i][e],o[i].hasOwnProperty(e)&&void 0!==n&&($.isPlainObject(n)?t[e]=$.isPlainObject(t[e])?$.widget.extend({},t[e],n):$.widget.extend({},n):t[e]=n);return t},$.widget.bridge=function(t,e){var n=e.prototype.widgetFullName||t;$.fn[t]=function(o){var i="string"==typeof o,a=widget_slice.call(arguments,1),s=this;return i?this.each(function(){var e,i=$.data(this,n);return"instance"===o?(s=i,!1):i?$.isFunction(i[o])&&"_"!==o.charAt(0)?(e=i[o].apply(i,a),e!==i&&void 0!==e?(s=e&&e.jquery?s.pushStack(e.get()):e,!1):void 0):$.error("no such method '"+o+"' for "+t+" widget instance"):$.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+o+"'")}):(a.length&&(o=$.widget.extend.apply(null,[o].concat(a))),this.each(function(){var t=$.data(this,n);t?(t.option(o||{}),t._init&&t._init()):$.data(this,n,new e(o,this))})),s}},$.Widget=function(){},$.Widget._childConstructors=[],$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,e){e=$(e||this.defaultElement||this)[0],this.element=$(e),this.uuid=widget_uuid++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=$(),this.hoverable=$(),this.focusable=$(),e!==this&&($.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=$(e.style?e.ownerDocument:e.document||e),this.window=$(this.document[0].defaultView||this.document[0].parentWindow)),this.options=$.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:$.noop,widget:function(){return this.element},option:function(t,e){var n,o,i,a=t;if(0===arguments.length)return $.widget.extend({},this.options);if("string"==typeof t)if(a={},n=t.split("."),t=n.shift(),n.length){for(o=a[t]=$.widget.extend({},this.options[t]),i=0;i<n.length-1;i++)o[n[i]]=o[n[i]]||{},o=o[n[i]];if(t=n.pop(),1===arguments.length)return void 0===o[t]?null:o[t];o[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];a[t]=e}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!e),e&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,e,n){var o,i=this;"boolean"!=typeof t&&(n=e,e=t,t=!1),n?(e=o=$(e),this.bindings=this.bindings.add(e)):(n=e,e=this.element,o=this.widget()),$.each(n,function(n,a){function s(){return t||i.options.disabled!==!0&&!$(this).hasClass("ui-state-disabled")?("string"==typeof a?i[a]:a).apply(i,arguments):void 0}"string"!=typeof a&&(s.guid=a.guid=a.guid||s.guid||$.guid++);var r=n.match(/^([\w:-]*)\s*(.*)$/),l=r[1]+i.eventNamespace,d=r[2];d?o.delegate(d,l,s):e.bind(l,s)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e),this.bindings=$(this.bindings.not(t).get()),this.focusable=$(this.focusable.not(t).get()),this.hoverable=$(this.hoverable.not(t).get())},_delay:function(t,e){function n(){return("string"==typeof t?o[t]:t).apply(o,arguments)}var o=this;return setTimeout(n,e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){$(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){$(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){$(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){$(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,e,n){var o,i,a=this.options[t];if(n=n||{},e=$.Event(e),e.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],i=e.originalEvent)for(o in i)o in e||(e[o]=i[o]);return this.element.trigger(e,n),!($.isFunction(a)&&a.apply(this.element[0],[e].concat(n))===!1||e.isDefaultPrevented())}},$.each({show:"fadeIn",hide:"fadeOut"},function(t,e){$.Widget.prototype["_"+t]=function(n,o,i){"string"==typeof o&&(o={effect:o});var a,s=o?o===!0||"number"==typeof o?e:o.effect||e:t;o=o||{},"number"==typeof o&&(o={duration:o}),a=!$.isEmptyObject(o),o.complete=i,o.delay&&n.delay(o.delay),a&&$.effects&&$.effects.effect[s]?n[t](o):s!==t&&n[s]?n[s](o.duration,o.easing,i):n.queue(function(e){$(this)[t](),i&&i.call(n[0]),e()})}});var widget=$.widget;$.fn.reverse=Array.prototype.reverse,$.Metro={initWidgets:function(t){$.each(t,function(){var t=$(this),e=t.data("role").split(/\s*,\s*/);e.map(function(e){try{void 0!==$.fn[e]&&t.data(e+"-initiated")!==!0&&($.fn[e].call(t),t.data(e+"-initiated",!0))}catch(n){window.METRO_DEBUG&&console.log(n.message,n.stack)}})})},initHotkeys:function(t){$.each(t,function(){var t=$(this),e=t.data("hotkey").toLowerCase();t.data("hotKeyBonded")!==!0&&($.Metro.hotkeys.push(e),$(document).on("keyup",null,e,function(e){return void 0!==t?("A"===t[0].tagName&&void 0!==t.attr("href")&&""!==t.attr("href").trim()&&"#"!==t.attr("href").trim()?document.location.href=t.attr("href"):t.click(),!1):void 0}),t.data("hotKeyBonded",!0))})},init:function(){var t=$("[data-role]"),e=$("[data-hotkey]");$.Metro.initHotkeys(e),$.Metro.initWidgets(t);var n,o,i;o={childList:!0,subtree:!0},i=function(t){t.map(function(t){if(t.addedNodes)for(var e,n,o,i,a=0,s=t.addedNodes.length;s>a;a++)e=$(t.addedNodes[a]),o=e.find("[data-role]"),i=e.find("[data-hotkey]"),$.Metro.initHotkeys(i),n=void 0!==e.data("role")?$.merge(o,e):o,n.length&&$.Metro.initWidgets(n)})},n=new MutationObserver(i),n.observe(document,o)}},$.easing.jswing=$.easing.swing,$.extend($.easing,{def:"easeOutQuad",swing:function(t,e,n,o,i){return $.easing[$.easing.def](t,e,n,o,i)},easeInQuad:function(t,e,n,o,i){return o*(e/=i)*e+n},easeOutQuad:function(t,e,n,o,i){return-o*(e/=i)*(e-2)+n},easeInOutQuad:function(t,e,n,o,i){return(e/=i/2)<1?o/2*e*e+n:-o/2*(--e*(e-2)-1)+n},easeInCubic:function(t,e,n,o,i){return o*(e/=i)*e*e+n},easeOutCubic:function(t,e,n,o,i){return o*((e=e/i-1)*e*e+1)+n},easeInOutCubic:function(t,e,n,o,i){return(e/=i/2)<1?o/2*e*e*e+n:o/2*((e-=2)*e*e+2)+n},easeInQuart:function(t,e,n,o,i){return o*(e/=i)*e*e*e+n},easeOutQuart:function(t,e,n,o,i){return-o*((e=e/i-1)*e*e*e-1)+n},easeInOutQuart:function(t,e,n,o,i){return(e/=i/2)<1?o/2*e*e*e*e+n:-o/2*((e-=2)*e*e*e-2)+n},easeInQuint:function(t,e,n,o,i){return o*(e/=i)*e*e*e*e+n},easeOutQuint:function(t,e,n,o,i){return o*((e=e/i-1)*e*e*e*e+1)+n},easeInOutQuint:function(t,e,n,o,i){return(e/=i/2)<1?o/2*e*e*e*e*e+n:o/2*((e-=2)*e*e*e*e+2)+n},easeInSine:function(t,e,n,o,i){return-o*Math.cos(e/i*(Math.PI/2))+o+n},easeOutSine:function(t,e,n,o,i){return o*Math.sin(e/i*(Math.PI/2))+n},easeInOutSine:function(t,e,n,o,i){return-o/2*(Math.cos(Math.PI*e/i)-1)+n},easeInExpo:function(t,e,n,o,i){return 0==e?n:o*Math.pow(2,10*(e/i-1))+n},easeOutExpo:function(t,e,n,o,i){return e==i?n+o:o*(-Math.pow(2,-10*e/i)+1)+n},easeInOutExpo:function(t,e,n,o,i){return 0==e?n:e==i?n+o:(e/=i/2)<1?o/2*Math.pow(2,10*(e-1))+n:o/2*(-Math.pow(2,-10*--e)+2)+n},easeInCirc:function(t,e,n,o,i){return-o*(Math.sqrt(1-(e/=i)*e)-1)+n},easeOutCirc:function(t,e,n,o,i){return o*Math.sqrt(1-(e=e/i-1)*e)+n},easeInOutCirc:function(t,e,n,o,i){return(e/=i/2)<1?-o/2*(Math.sqrt(1-e*e)-1)+n:o/2*(Math.sqrt(1-(e-=2)*e)+1)+n},easeInElastic:function(t,e,n,o,i){var a=1.70158,s=0,r=o;return 0==e?n:1==(e/=i)?n+o:(s||(s=.3*i),r<Math.abs(o)?(r=o,a=s/4):a=s/(2*Math.PI)*Math.asin(o/r),-(r*Math.pow(2,10*(e-=1))*Math.sin((e*i-a)*(2*Math.PI)/s))+n)},easeOutElastic:function(t,e,n,o,i){var a=1.70158,s=0,r=o;return 0==e?n:1==(e/=i)?n+o:(s||(s=.3*i),r<Math.abs(o)?(r=o,a=s/4):a=s/(2*Math.PI)*Math.asin(o/r),r*Math.pow(2,-10*e)*Math.sin((e*i-a)*(2*Math.PI)/s)+o+n)},easeInOutElastic:function(t,e,n,o,i){var a=1.70158,s=0,r=o;return 0==e?n:2==(e/=i/2)?n+o:(s||(s=i*(.3*1.5)),r<Math.abs(o)?(r=o,a=s/4):a=s/(2*Math.PI)*Math.asin(o/r),1>e?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e*i-a)*(2*Math.PI)/s))+n:r*Math.pow(2,-10*(e-=1))*Math.sin((e*i-a)*(2*Math.PI)/s)*.5+o+n)},easeInBack:function(t,e,n,o,i,a){return void 0==a&&(a=1.70158),o*(e/=i)*e*((a+1)*e-a)+n},easeOutBack:function(t,e,n,o,i,a){return void 0==a&&(a=1.70158),o*((e=e/i-1)*e*((a+1)*e+a)+1)+n},easeInOutBack:function(t,e,n,o,i,a){return void 0==a&&(a=1.70158),(e/=i/2)<1?o/2*(e*e*(((a*=1.525)+1)*e-a))+n:o/2*((e-=2)*e*(((a*=1.525)+1)*e+a)+2)+n},easeInBounce:function(t,e,n,o,i){return o-$.easing.easeOutBounce(t,i-e,0,o,i)+n},easeOutBounce:function(t,e,n,o,i){return(e/=i)<1/2.75?o*(7.5625*e*e)+n:2/2.75>e?o*(7.5625*(e-=1.5/2.75)*e+.75)+n:2.5/2.75>e?o*(7.5625*(e-=2.25/2.75)*e+.9375)+n:o*(7.5625*(e-=2.625/2.75)*e+.984375)+n},easeInOutBounce:function(t,e,n,o,i){return i/2>e?.5*$.easing.easeInBounce(t,2*e,0,o,i)+n:.5*$.easing.easeOutBounce(t,2*e-i,0,o,i)+.5*o+n}}),$.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},$.each(["keydown","keyup","keypress"],function(){$.event.special[this]={add:keyHandler}});var toFix=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],toBind="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],lowestDelta,lowestDeltaXY;if($.event.fixHooks)for(var i=toFix.length;i;)$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;$.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var t=toBind.length;t;)this.addEventListener(toBind[--t],handler,!1);else this.onmousewheel=handler},teardown:function(){if(this.removeEventListener)for(var t=toBind.length;t;)this.removeEventListener(toBind[--t],handler,!1);else this.onmousewheel=null}},$.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}}),document.addEventListener("DOMContentLoaded",function(){preCode("pre code, textarea")},!1);var hasTouch="ontouchend"in window,eventTimer,moveDirection="undefined",startX,startY,deltaX,deltaY,mouseDown=!1,addTouchEvents=function(t){hasTouch&&(t.addEventListener("touchstart",touch2Mouse,!0),t.addEventListener("touchmove",touch2Mouse,!0),t.addEventListener("touchend",touch2Mouse,!0))};$.widget("metro.accordion",{version:"3.0.0",options:{closeAny:!1,speed:"fast",onFrameOpen:function(t){return!0},onFrameOpened:function(t){},onFrameClose:function(t){return!0},onFrameClosed:function(t){}},init:function(){var t=this,e=this.element;e.on("click",".heading",function(e){var n=$(this).parent();return n.hasClass("disabled")?!1:(n.hasClass("active")?t._closeFrame(n):t._openFrame(n),e.preventDefault(),void e.stopPropagation())})},_closeAllFrames:function(){var t=this,e=this.element.children(".frame.active");$.each(e,function(){t._closeFrame($(this))})},_openFrame:function(frame){var o=this.options,content=frame.children(".content"),result;if("function"==typeof o.onFrameOpen){if(!o.onFrameOpen(frame))return!1}else if("function"==typeof window[o.onFrameOpen]){if(!window[o.onFrameOpen](frame))return!1}else if(result=eval("(function(){"+o.onFrameOpen+"})"),!result.call(frame))return!1;o.closeAny&&this._closeAllFrames(),content.slideDown(o.speed),frame.addClass("active"),"function"==typeof o.onFrameOpened?o.onFrameOpened(frame):"function"==typeof window[o.onFrameOpened]?window[o.onFrameOpened](frame):(result=eval("(function(){"+o.onFrameOpened+"})"),result.call(frame))},_closeFrame:function(frame){var o=this.options,content=frame.children(".content"),result;if("function"==typeof o.onFrameClose){if(!o.onFrameClose(frame))return!1}else if("function"==typeof window[o.onFrameClose]){if(!window[o.onFrameClose](frame))return!1}else if(result=eval("(function(){"+o.onFrameClose+"})"),!result.call(frame))return!1;content.slideUp(o.speed,function(){frame.removeClass("active")}),"function"==typeof o.onFrameClosed?o.onFrameClosed(frame):"function"==typeof window[o.onFrameClosed]?window[o.onFrameClosed](frame):(result=eval("(function(){"+o.onFrameClosed+"})"),result.call(frame))},_create:function(){var t=this,e=this.options,n=this.element;$.each(this.element.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),t.init(),n.data("accordion",this)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.appbar",{version:"3.0.0",options:{flexstyle:"app-bar-menu",flexclean:!1,flextolerance:3},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),this._initBar(),t.data("appbar",this)},_calculateFreeSpace:function(){var t,e,n=this,o=(this.element,this.options,0),i=0;o=$(n.menusParent).width(),t=$(n.menusParent).children(":visible").not(".app-bar-pullmenu");for(var a,s=[],r=[],l=[],d=0,c=t.length;c>d;d++)switch(a=$(t[d]).css("float")){case"left":s.push(t[d]);break;case"right":r.push(t[d]);break;default:l.push(t[d])}r.reverse(),t=new Array,t=s.concat(l,r),t=$(t),i+=parseInt($(t).first().css("margin-left"));for(var d=0,c=t.length-1;c>=d;d++)i+=$(t[d]).outerWidth(),d!==c&&(i+=Math.max(parseInt($(t[d]).css("margin-right")),parseInt($(t[d+1]).css("margin-left"))));return i+=parseInt($(t[c]).css("margin-right")),e=o-i,n.freeSpace=e,n.childrenWidth=i,n.menusParentWidth=o,e},_originIndexMove:function(t,e){var n=$(t).children().filter(function(){return parseInt($(this).attr("data-flexorderorigin"))<parseInt($(e).attr("data-flexorderorigin"))});n.length>0?$(n).last().after(e):(n=$(t).children().filter(function(){return parseInt($(this).attr("data-flexorderorigin"))>parseInt($(e).attr("data-flexorderorigin"))}),n.length>0?$(n).first().before(e):$(t).append(e))},_moveMenuEntry:function(t){var e=this;this.element,this.options;if(t=t||"toPullMenu","toPullMenu"===t){var n=$(e.allMenuEntries).not(".app-bar-pullmenu-entry").last();if(0===n.length)return!1;var o=$(n).parent(),i=$(e.flexVisibles).index($(n).parent()),a=$(e.pullMenu).find(".app-bar-pullmenubar").eq(i);return e._originIndexMove(a,n),$(n).addClass("app-bar-pullmenu-entry"),$(a).removeClass("hidden").show(),0===$(o).children().length&&$(o).addClass("hidden"),$(e.pullButton).show(),n}if("fromPullMenu"===t){var s=$(e.allMenuEntries).filter(".app-bar-pullmenu-entry").first(),a=$(s).parent(),i=$(a).index(),o=$(e.flexVisibles).eq(i);return $(o).removeClass("hidden"),$(s).removeClass("app-bar-pullmenu-entry"),e._originIndexMove(o,s),0===$(a).children().length&&$(a).addClass("hidden").hide(),0===$(e.pullMenu).children(".app-bar-pullmenubar").not(".hidden").length&&($(e.pullMenu).hide().addClass("hidden"),$(e.pullButton).hide()),0===s.length?!1:s}},_checkMenuEntries:function(){for(var t=this,e=(this.element,this.options),n=!1,o=0,i=t.allMenuEntries.length;i>o;o++){t._calculateFreeSpace();var a=t.freeSpace;if(!(a<e.flextolerance||e.flexclean)){if(t._moveMenuEntry("fromPullMenu")){n=!0;continue}break}if(!t._moveMenuEntry("toPullMenu"))break;if(n)break}},resize:function(){var t=this;this.element,this.options;t.initiatedAsFlex&&this._checkMenuEntries()},_initBar:function(){var t=this,e=this.element,n=this.options;t.lastFlexAction=void 0,t.pullButton=$(e).find(".app-bar-pullbutton");var o=$(e).find(".app-bar-menu");t.initiatedAsFlex=!1,n.flexclean=$(e).is("[data-flexclean='true']")||n.flexclean,n.flexstyle=$(e).attr("data-flexstyle")||n.flexstyle;var i,a;t.flexVisibles=$(),t.allMenuEntries=$(),t.menusParent=$(),t.pullMenu=$(),o.length>0&&$(e).is(":not('.no-flexible')")&&(t.flexVisibles=$(o).not(".no-flexible"),t.flexVisibles.length>0&&(t.initiatedAsFlex=!0,t.flexVisibles.sort(function(t,e){var n=parseInt($(t).data("flexorder"))||$(t).index()+1,o=parseInt($(e).data("flexorder"))||$(e).index()+1;return n-o}),$(t.flexVisibles).each(function(){i=this,a=$(i).children(),$(a).each(function(){$(this).attr("data-flexorderorigin",$(this).index()),$(this).is("[data-flexorder]")||$(this).attr("data-flexorder",$(this).index()+1)}),a.sort(function(t,e){var n=parseInt($(t).data("flexorder")),o=parseInt($(e).data("flexorder"));return n-o}),$(i).is("[data-flexdirection='reverse']")&&a.reverse(),$.merge(t.allMenuEntries,$(a).not(".no-flexible"))}),t.menusParent=$(e).find(".app-bar-menu").first().parent(),t.pullButton.length>0||(t.pullButton=$('<div class="app-bar-pullbutton automatic"></div>'),$(t.menusParent).append(t.pullButton)),t.pullMenu=$('<nav class="app-bar-pullmenu hidden" />'),t.flexVisibles.each(function(){$(t.pullMenu).append($('<ul class="app-bar-pullmenubar hidden '+n.flexstyle+'" />'))}),$(t.menusParent).append($('<div class="clearfix" style="width: 0;">')),$(t.pullMenu).addClass("flexstyle-"+n.flexstyle),$(t.menusParent).append(t.pullMenu),t._checkMenuEntries(),$(t.pullButton).on("click",function(){t=$(this).closest("[data-role=appbar]").data("appbar"),$(t.pullMenu).is(":hidden")?($(t.pullMenu).show(),$(t.pullMenu).find(".app-bar-pullmenubar").hide().not(".hidden").slideDown("fast")):$(t.pullMenu).find(".app-bar-pullmenubar").not(".hidden").show().slideUp("fast",function(){$(t.pullMenu).hide()})}),$(window).resize(function(){$("[data-role=appbar]:not(.no-flexible)").each(function(){$(this).data("appbar").resize()})}),$(window).load(function(){$("[data-role=appbar]:not(.no-flexible)").each(function(){$(this).data("appbar").resize();
})}),$("[data-role=appbar]:not(.no-flexible) [src]").on("load",function(){var t=$(this).closest("[data-role=appbar]").data("appbar");t.resize()})))},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.audio",{version:"3.0.14",options:{src:!1,volume:.5,muted:!1,loop:!1,preload:!1,autoplay:!1,playList:!1,mode:"full",loopButton:"<span class='mif-loop'></span>",stopButton:"<span class='mif-stop'></span>",playButton:"<span class='mif-play'></span>",pauseButton:"<span class='mif-pause'></span>",muteButton:"<span class='mif-volume-mute2'></span>",shuffleButton:"<span class='mif-shuffle'></span>",nextButton:"<span class='mif-forward'></span>",prevButton:"<span class='mif-backward'></span>",randomButton:"<span class='mif-dice'></span>",playListButton:"<span class='mif-list2'></span>",volumeLowButton:"<span class='mif-volume-low'></span>",volumeMediumButton:"<span class='mif-volume-medium'></span>",volumeHighButton:"<span class='mif-volume-high'></span>"},_create:function(){var t=this.element;this.options;this._setOptionsFromDOM(),this._createPlayer(),this._addControls(),this._addEvents(),this._addPlayList(),this._setControlsVisibility(),t.data("audio",this)},_setControlsVisibility:function(){var t=this.element;this.options;0==t.find(".play-list").length&&(t.find(".controls .plist").hide(),t.find(".controls .next").hide(),t.find(".controls .prev").hide(),t.find(".controls .random").hide())},_addPlayList:function(){var t,e,n,o,i,a,s=this,r=this.element,l=this.options;r.find("audio");if(l.playList&&void 0!=window[l.playList]&&"function"==typeof window[l.playList]&&(t=window[l.playList](),e=t.items,n=$("<div>").addClass("play-list-wrapper").insertBefore(r.find("audio")),void 0!=t.title&&(i=$("<h1>").addClass("album-title").html(t.title).appendTo(n)),void 0!=t.poster&&(o=$("<div>").addClass("poster").html($("<img>").attr("src",t.poster)).appendTo(n)),void 0!=t.desc&&$("<div>").addClass("album-desc").html(t.desc).appendTo(o),a=$("<ul>").addClass("play-list").appendTo(n),void 0!=e&&$.each(t.items,function(){var t,e=this;t=$("<li>").appendTo(a),t.data("src",e.file),void 0!=e.type&&t.data("type",e.type),void 0!=e.title?t.html(e.title):t.html(e.file.replace(/^.*[\\\/]/,""))})),a=r.find("ul"),0==a.length)return this;a.addClass("play-list");var d=a.find("li");return 0==d.length?this:($.each(d,function(){var t=$(this);$("<div>").addClass("progress-bar small no-margin-top").data("role","progress").appendTo(t).hide();t.on("click",function(){d.removeClass("current"),d.find(".progress-bar").hide();var e=t.data("src"),n=t.data("type");t.addClass("current"),t.find(".progress-bar").show(),r.data("current",t),s.play(e,n)})}),$(d[0]).click(),this._stop(),void r.data("current",$(d[0])))},_createPlayer:function(){var t=this.element,e=this.options,n=t.find("audio");t.addClass("audio-player"),t.addClass(e.mode),0==n.length&&(n=$("<audio>").appendTo(t)),$.each(["autoplay","controls","muted","loop","preload"],function(){n.removeAttr(this)}),e.src&&n.attr(src,e.src),e.loop&&n.attr("loop","loop"),e.preload&&n.attr("preload","auto"),e.autoplay&&n.attr("autoplay","autoplay"),n[0].volume=e.volume,n[0].muted=e.muted,t.data("muted",!1),t.data("duration",0),t.data("played",!1),t.data("volume",n[0].volume),t.data("current",!1)},_addControls:function(){var t,e,n,o,i,a,s,r,l,d,c,u,h,p,f=this,m=this.element,v=this.options,g=m.find("audio"),_=g[0];t=$("<div>").addClass("controls").appendTo(m),v.playListButton!==!1&&(p=$("<button/>").addClass("square-button control-element plist").html(v.playListButton).appendTo(t),p.on("click",function(){var t=m.find(".play-list-wrapper");return 0==t.length?f:void t.toggleClass("not-visible")})),v.loopButton!==!1&&(n=$("<button/>").addClass("square-button control-element loop").html(v.loopButton).appendTo(t),n.on("click",function(){n.toggleClass("active"),n.hasClass("active")?g.attr("loop","loop"):g.removeAttr("loop")})),v.playButton!==!1&&(e=$("<button/>").addClass("square-button control-element play").html(v.playButton).appendTo(t),e.on("click",function(){f._play()})),v.prevButton!==!1&&(u=$("<button/>").addClass("square-button control-element prev").html(v.prevButton).appendTo(t),u.on("click",function(){f._playPrev()})),v.nextButton!==!1&&(c=$("<button/>").addClass("square-button control-element next").html(v.nextButton).appendTo(t),c.on("click",function(){f._playNext()})),v.randomButton!==!1&&(h=$("<button/>").addClass("square-button control-element random").html(v.randomButton).appendTo(t),h.on("click",function(){f._playRandom()})),v.stopButton!==!1&&(o=$("<button/>").addClass("square-button control-element stop").html(v.stopButton).appendTo(t),o.attr("disabled",!0),o.on("click",function(){f._stop()})),l=$("<div/>").addClass("control-element stream-wrapper").appendTo(t),s=$("<div/>").addClass("slider stream-slider").appendTo(l),s.slider({showHint:!0,animate:!1,markerColor:"bg-red",completeColor:"bg-cyan",onStartChange:function(){_.pause()},onChanged:function(t,e){_.seekable.length>0&&(_.currentTime=(m.data("duration")*t/100).toFixed(0)),m.data("played")&&_.currentTime>=0&&_.play()}}),s.data("slider").value(0),r=$("<div/>").addClass("control-element info-box").appendTo(t),r.html("00:00 / 00:00");var w=$("<div/>").addClass("place-right").appendTo(t);i=$("<button/>").addClass("square-button control-element volume").html(v.volumeLowButton).appendTo(w),i.on("click",function(){var t=m.find(".volume-slider").data("slider");m.data("muted",!m.data("muted")),m.data("muted")?(m.data("volume",_.volume),i.html(v.muteButton),t.value(0)):(_.volume=m.data("volume"),t.value(100*m.data("volume")),f._setupVolumeButton()),_.muted=m.data("muted")}),this._setupVolumeButton(),d=$("<div/>").addClass("control-element volume-wrapper").appendTo(w),a=$("<div/>").addClass("slider volume-slider").appendTo(d),a.slider({showHint:!0,animate:!1,markerColor:"bg-red",completeColor:"bg-green",onChange:function(t,e){_.volume=t/100,f._setupVolumeButton()}}),a.data("slider").value(100*_.volume)},_setupVolumeButton:function(){var t=this.element,e=this.options,n=t.find("audio"),o=n[0],i=t.find(".controls"),a=i.find(".volume"),s=o.volume;s>0&&.3>s?a.html(e.volumeLowButton):s>=.3&&.6>s?a.html(e.volumeMediumButton):s>=.6&&1>=s?a.html(e.volumeHighButton):a.html(e.muteButton)},_addEvents:function(){var t=this,e=this.element,n=(this.options,e.find("audio")),o=n[0],i=(e.find(".controls"),e.find(".info-box"));n.on("loadedmetadata",function(){e.data("duration",o.duration.toFixed(0)),i.html("00:00 / "+secondsToFormattedString(e.data("duration")))}),n.on("canplay",function(){var e=o.buffered.length?Math.round(Math.floor(o.buffered.end(0))/Math.floor(o.duration)*100):0;t._setBufferSize(e)}),n.on("progress",function(){var e=o.buffered.length?Math.round(Math.floor(o.buffered.end(0))/Math.floor(o.duration)*100):0;t._setBufferSize(e)}),n.on("timeupdate",function(){if(t._setInfoData(),t._setStreamSliderPosition(),e.data("current")){var n=e.data("current").find(".progress-bar").data("progress"),i=Math.round(100*o.currentTime/e.data("duration"));n.value(i)}}),n.on("waiting",function(){}),n.on("loadeddata",function(){}),n.on("ended",function(){t._stop(),e.find(".play-list li").length>0&&t._playNext()})},_setInfoData:function(){var t=this.element,e=(t[0],this.options,t.find("audio")),n=e[0],o=t.find(".controls .info-box"),i=Math.round(n.currentTime);o.html(secondsToFormattedString(i)+" / "+secondsToFormattedString(t.data("duration")))},_setStreamSliderPosition:function(){var t=this.element,e=(t[0],this.options,t.find("audio")),n=e[0],o=t.find(".stream-slider").data("slider"),i=Math.round(100*n.currentTime/t.data("duration"));o.value(i)},_setBufferSize:function(t){var e=this.element,n=(e[0],this.options,e.find("audio")),o=(n[0],e.find(".stream-slider").data("slider"));o.buffer(Math.round(t))},_play:function(){var t=this.element,e=(t[0],this.options),n=t.find("audio"),o=n[0],i=t.find(".controls .play"),a=t.find(".controls .stop");o.paused?(i.html(e.pauseButton),o.play(),a.removeAttr("disabled"),t.data("played",!0),t.trigger("play")):(i.html(e.playButton),o.pause(),t.data("played",!1),t.trigger("pause"))},_playRandom:function(){var t=this.element,e=(t[0],this.options,t.find("audio")),n=(e[0],t.find(".play-list")),o=t.find(".play-list li");if(0==o.length)return this;var i=Math.floor(Math.random()*o.length)+1,a=n.find("li:nth-child("+i+")");a.click()},_playNext:function(){var t=this.element,e=(t[0],this.options,t.find("audio")),n=(e[0],t.find(".play-list")),o=t.find(".play-list li");if(0==o.length)return this;var i=n.find(".current").next();0==i.length&&(i=n.find("li:nth-child(1)")),i.click()},_playPrev:function(){var t=this.element,e=(t[0],this.options,t.find("audio")),n=(e[0],t.find(".play-list")),o=t.find(".play-list li");if(0==o.length)return this;var i=n.find(".current").prev();0==i.length&&(i=n.find("li:last-child")),i.click()},_stop:function(){var t=this.element,e=(t[0],this.options),n=t.find("audio"),o=n[0],i=t.find(".controls .stop"),a=t.find(".controls .play");o.pause(),o.currentTime=0,a.html(e.playButton),i.attr("disabled","disabled"),t.data("played",!1),t.find(".stream-slider").data("slider").value(0),t.trigger("stop")},play:function(t,e){var n,o=this.element,i=(o[0],this.options,o.find("audio")),a=i[0];this._stop(),i.find("source").remove(),i.removeAttr("src"),n=$("<source>").attr("src",t),void 0!=e&&n.attr("type",e),a.load(),n.appendTo(i),this._play()},pause:function(){var t=this.element,e=(t[0],this.options),n=t.find("audio"),o=n[0],i=t.find(".play");i.html(e.playButton),o.pause(),t.data("played",!1),t.trigger("pause")},resume:function(){var t=this.element,e=(t[0],this.options),n=t.find("audio"),o=n[0],i=t.find(".play"),a=t.find(".stop");i.html(e.pauseButton),o.play(),a.removeAttr("disabled"),t.data("played",!0),t.trigger("play")},stop:function(){this._stop()},_setOptionsFromDOM:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}})},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.group",{version:"3.0.0",options:{groupType:"one-state",buttonStyle:!1,onChange:function(t,e){return!0},onChanged:function(t,e){}},_create:function(){var that=this,element=this.element,o=this.options,result;$.each(element.data(),function(t,e){if(t in o)try{o[t]=$.parseJSON(e)}catch(n){o[t]=e}}),element.hasClass("group-of-buttons")||element.addClass("group-of-buttons");for(var buttons=element.find(".button, .toolbar-button"),i=0;i<buttons.length;i++)$(buttons[i]).data("index",i);o.buttonStyle!==!1&&buttons.addClass(o.buttonStyle),element.on("click",".button, .toolbar-button",function(){var button=$(this),index=button.data("index");if("function"==typeof o.onChange){if(!o.onChange(index,button))return!1}else if("function"==typeof window[o.onChange]){if(!window[o.onChange](index,button))return!1}else if(result=eval("(function(){"+o.onChange+"})"),!result.call(index,button))return!1;"one-state"===o.groupType?(buttons.removeClass("active"),$(this).addClass("active")):$(this).toggleClass("active"),"function"==typeof o.onChanged?o.onChanged(index,button):"function"==typeof window[o.onChanged]?window[o.onChanged](index,button):(result=eval("(function(){"+o.onChanged+"})"),result.call(index,button))}),element.data("group",this)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.calendar",{version:"3.0.0",options:{format:"yyyy-mm-dd",multiSelect:!1,startMode:"day",weekStart:window.METRO_CALENDAR_WEEK_START,otherDays:!0,date:new Date,minDate:!1,maxDate:!1,preset:!1,exclude:!1,stored:!1,buttons:!0,buttonToday:!0,buttonClear:!0,syncCalenderToDateField:!0,locale:window.METRO_CURRENT_LOCALE,actions:!0,condensedGrid:!1,scheme:"default",getDates:function(t){},dayClick:function(t,e){}},_year:0,_month:0,_day:0,_today:new Date,_event:"",_mode:"day",_distance:0,_events:[],_create:function(){var t=this,e=this.element,n=this.options;$.each(e.data(),function(t,e){if(t in n)try{n[t]=$.parseJSON(e)}catch(o){n[t]=e}}),"string"==typeof n.date&&(n.date=new Date(n.date)),n.minDate!==!1&&"string"==typeof n.minDate&&(n.minDate=new Date(n.minDate+"T00:00:00Z")-864e5),n.maxDate!==!1&&"string"==typeof n.maxDate&&(n.maxDate=new Date(n.maxDate+"T00:00:00Z")),this.locales=window.METRO_LOCALES,this._year=n.date.getFullYear(),this._distance=n.date.getFullYear()-4,this._month=n.date.getMonth(),this._day=n.date.getDate(),this._mode=n.startMode,e.data("_storage",[]),e.data("_exclude",[]),e.data("_stored",[]),e.hasClass("calendar")||e.addClass("calendar");var o,i;n.preset&&(o=/\s*,\s*/,i=n.preset.split(o),$.each(i,function(){void 0!==new Date(this)&&t.setDate(this)})),n.exclude&&(o=/\s*,\s*/,i=n.exclude.split(o),$.each(i,function(){void 0!==new Date(this)&&t.setDateExclude(this)})),n.stored&&(o=/\s*,\s*/,i=n.stored.split(o),$.each(i,function(){void 0!==new Date(this)&&t.setDateStored(this)})),"default"!==n.scheme&&e.addClass(n.scheme),this._renderCalendar(),e.data("calendar",this)},_renderButtons:function(t){var e,n,o=this.options;if(this.options.buttons){var i=o.buttonToday?"<button class='button calendar-btn-today small-button success'>"+this.locales[o.locale].buttons[0]+"</button>":"",a=o.buttonClear?"<button class='button calendar-btn-clear small-button warning'>"+this.locales[o.locale].buttons[1]+"</button>":"";e=$("<div/>").addClass("calendar-row calendar-actions"),n=$("<div/>").addClass("align-center").html(i+a),n.appendTo(e),e.appendTo(t)}},_renderMonth:function(){var t=this.options,e=this._year,n=this._month,o=(this._day,this._event,28);1===n&&(e%100!==0&&e%4===0||e%400===0)&&(o=29);var i,a,s,r,l,d=["31",""+o,"31","30","31","30","31","31","30","31","30","31"],c=d[n],u=this._dateFromNumbers(e,n+1,1).getDay();this.element.html(""),i=$("<div/>").addClass("calendar-grid"),t.condensedGrid&&i.addClass("condensed no-border"),a=$("<div/>").addClass("calendar-row no-margin"),$("<div/>").addClass("calendar-cell align-center").html("<a class='btn-previous-year' href='#'>-</a>").appendTo(a),$("<div/>").addClass("calendar-cell align-center").html("<a class='btn-previous-month' href='#'>〈</a>").appendTo(a),$("<div/>").addClass("calendar-cell sel-month align-center").html("<a class='btn-select-month' href='#'>"+this.locales[t.locale].months[n]+" "+e+"</a>").appendTo(a),$("<div/>").addClass("calendar-cell align-center").html("<a class='btn-next-month' href='#'>〉</a>").appendTo(a),$("<div/>").addClass("calendar-cell align-center").html("<a class='btn-next-year' href='#'>+</a>").appendTo(a),a.addClass("calendar-header").appendTo(i);var h;for(a=$("<div/>").addClass("calendar-row week-days"),r=0;7>r;r++)t.weekStart?(h=r+1,7===h&&(h=0),s=$("<div/>").addClass("calendar-cell align-center day-of-week").appendTo(a),l=$("<div/>").html(this.locales[t.locale].days[h+7]).appendTo(s)):(s=$("<div/>").addClass("calendar-cell align-center day-of-week").appendTo(a),l=$("<div/>").html(this.locales[t.locale].days[r+7]).appendTo(s));a.addClass("calendar-subheader").appendTo(i);var p=this._month-1;0>p&&(p=11);var f=d[p],m=(t.weekStart?u+6:u)%7,v="";for(a=$("<div/>").addClass("calendar-row"),r=0;m>r;r++)t.otherDays&&(v=f-(m-r-1)),s=$("<div/>").addClass("calendar-cell empty").appendTo(a),l=$("<div/>").addClass("other-day").html(v).appendTo(s),t.otherDays||l.css("visibility","hidden");var g,_,w,y=(t.weekStart?u+6:u)%7;for(r=1;c>=r;r++)y%=7,0===y&&(a.appendTo(i),a=$("<div/>").addClass("calendar-row")),s=$("<div/>").addClass("calendar-cell align-center day"),l=$("<div/>").appendTo(s),t.minDate!==!1&&this._dateFromNumbers(e,n+1,r)<t.minDate||t.maxDate!==!1&&this._dateFromNumbers(e,n+1,r)>t.maxDate?(s.removeClass("day"),l.addClass("other-day"),w=r):w="<a href='#'>"+r+"</a>",l.html(w),e===this._today.getFullYear()&&n===this._today.getMonth()&&this._today.getDate()===r&&s.addClass("today"),g=this._dateNumberStringyFy(this._year,this._month+1,r),this.element.data("_storage").indexOf(g)>=0&&(_=s.find("a"),_.parent().parent().addClass("selected")),this.element.data("_exclude").indexOf(g)>=0&&(_=s.find("a"),_.parent().parent().addClass("exclude")),this.element.data("_stored").indexOf(g)>=0&&(_=s.find("a"),_.parent().parent().addClass("stored")),s.appendTo(a),y++;var b="";for(r=y+1;7>=r;r++)t.otherDays&&(b=r-y),s=$("<div/>").addClass("calendar-cell empty").appendTo(a),l=$("<div/>").addClass("other-day").html(b).appendTo(s),t.otherDays||l.css("visibility","hidden");a.appendTo(i),this._renderButtons(i),i.appendTo(this.element)},_renderMonths:function(){var t,e,n,o,i;for(this.element.html(""),t=$("<div/>").addClass("calendar-grid"),this.options.condensedGrid&&t.addClass("condensed no-border"),e=$("<div/>").addClass("calendar-row"),$("<div/>").addClass("calendar-cell sel-minus align-center").html("<a class='btn-previous-year' href='#'>-</a>").appendTo(e),$("<div/>").addClass("calendar-cell sel-year align-center").html("<a class='btn-select-year' href='#'>"+this._year+"</a>").appendTo(e),$("<div/>").addClass("calendar-cell sel-plus align-center").html("<a class='btn-next-year' href='#'>+</a>").appendTo(e),e.addClass("calendar-header").appendTo(t),e=$("<div/>").addClass("calendar-row"),i=0,o=0;12>o;o++)n=$("<div/>").addClass("calendar-cell month-cell align-center month").html("<a href='#' data-month='"+o+"'>"+this.locales[this.options.locale].months[o+12]+"</a>"),this._month===o&&(new Date).getFullYear()===this._year&&n.addClass("today"),n.appendTo(e),(i+1)%4===0&&(e.appendTo(t),e=$("<div/>").addClass("calendar-row")),i+=1;this._renderButtons(t),t.appendTo(this.element)},_renderYears:function(){var t,e,n,o,i;for(this.element.html(""),t=$("<div/>").addClass("calendar-grid"),this.options.condensedGrid&&t.addClass("condensed no-border"),e=$("<div/>").addClass("calendar-row cells4"),$("<div/>").addClass("calendar-cell sel-minus align-center").html("<a class='btn-previous-year' href='#'>-</a>").appendTo(e),$("<div/>").addClass("calendar-cell sel-year align-center").html("<a class='btn-none-btn'>"+this._distance+"-"+(this._distance+11)+"</a>").appendTo(e),$("<div/>").addClass("calendar-cell sel-plus align-center").html("<a class='btn-next-year' href='#'>+</a>").appendTo(e),e.addClass("calendar-header").appendTo(t),e=$("<div/>").addClass("calendar-row"),i=0,o=this._distance;o<this._distance+12;o++)n=$("<div/>").addClass("calendar-cell year-cell align-center year").html("<a href='#' data-year='"+o+"'>"+o+"</a>"),(new Date).getFullYear()===o&&n.addClass("today"),n.appendTo(e),(i+1)%4===0&&(e.appendTo(t),e=$("<div/>").addClass("calendar-row")),i+=1;this._renderButtons(t),t.appendTo(this.element)},_renderCalendar:function(){switch(this._mode){case"year":this._renderYears();break;case"month":this._renderMonths();break;default:this._renderMonth()}this._initButtons()},_initButtons:function(){var that=this,o=this.options,table=this.element.find(".calendar-grid");"day"===this._mode?(table.find(".btn-select-month").on("click",function(t){t.preventDefault(),t.stopPropagation(),that._mode="month",that._renderCalendar()}),table.find(".btn-previous-month").on("click",function(t){that._event="eventPrevious",t.preventDefault(),t.stopPropagation(),that._month-=1,that._month<0&&(that._year-=1,that._month=11),that._renderCalendar()}),table.find(".btn-next-month").on("click",function(t){that._event="eventNext",t.preventDefault(),t.stopPropagation(),that._month+=1,12===that._month&&(that._year+=1,that._month=0),that._renderCalendar()}),table.find(".btn-previous-year").on("click",function(t){that._event="eventPrevious",t.preventDefault(),t.stopPropagation(),that._year-=1,that._renderCalendar()}),table.find(".btn-next-year").on("click",function(t){that._event="eventNext",t.preventDefault(),t.stopPropagation(),that._year+=1,that._renderCalendar()}),table.find(".day a").on("click",function(e){if(e.preventDefault(),e.stopPropagation(),$(this).parent().parent().hasClass("exclude"))return!1;var d=new Date(that._paddy(that._year,4),that._paddy(that._month,2),that._paddy(parseInt($(this).html()),2)).format(that.options.format,null),d0=new Date(that._paddy(that._year,4),that._paddy(that._month,2),that._paddy(parseInt($(this).html()),2));if(that.options.multiSelect?($(this).parent().parent().toggleClass("selected"),$(this).parent().parent().hasClass("selected")?that._addDate(that._dateStringyFy(d0)):that._removeDate(that._dateStringyFy(d0))):(table.find(".day a").parent().parent().removeClass("selected"),$(this).parent().parent().addClass("selected"),that.element.data("_storage",[]),that._addDate(that._dateStringyFy(d0))),"function"==typeof o.dayClick)o.dayClick(d,d0);else if("function"==typeof window[o.dayClick])window[o.dayClick](d,d0);else{var result=eval("(function(){"+o.dayClick+"})");result.call(d,d0)}})):"month"===this._mode?(table.find(".month a").on("click",function(t){that._event="eventNext",t.preventDefault(),t.stopPropagation(),that._month=parseInt($(this).data("month")),that._mode="day",that._renderCalendar()}),table.find(".btn-previous-year").on("click",function(t){that._event="eventPrevious",t.preventDefault(),t.stopPropagation(),that._year-=1,that._renderCalendar()}),table.find(".btn-next-year").on("click",function(t){that._event="eventNext",t.preventDefault(),t.stopPropagation(),that._year+=1,that._renderCalendar()}),table.find(".btn-select-year").on("click",function(t){that._event="eventNext",t.preventDefault(),t.stopPropagation(),that._mode="year",that._renderCalendar()})):(table.find(".year a").on("click",function(t){that._event="eventNext",t.preventDefault(),t.stopPropagation(),that._year=parseInt($(this).data("year")),that._mode="month",that._renderCalendar()}),table.find(".btn-previous-year").on("click",function(t){that._event="eventPrevious",t.preventDefault(),t.stopPropagation(),that._distance-=10,that._renderCalendar()}),table.find(".btn-next-year").on("click",function(t){that._event="eventNext",t.preventDefault(),t.stopPropagation(),that._distance+=10,that._renderCalendar()})),table.find(".calendar-btn-today").on("click",function(t){t.preventDefault(),t.stopPropagation(),that._mode=that.options.startMode,that.options.date=new Date,that._year=that.options.date.getFullYear(),that._month=that.options.date.getMonth(),that._day=that.options.date.getDate(),that._renderCalendar()}),table.find(".calendar-btn-clear").on("click",function(t){t.preventDefault(),t.stopPropagation(),that.options.date=new Date,that._year=that.options.date.getFullYear(),that._month=that.options.date.getMonth(),that._day=that.options.date.getDate(),that.element.data("_storage",[]),that._renderCalendar()})},_addDate:function(t){var e=this.element.data("_storage").indexOf(t);0>e&&this.element.data("_storage").push(t)},_removeDate:function(t){var e=this.element.data("_storage").indexOf(t);this.element.data("_storage").splice(e,1)},_addDateExclude:function(t){var e=this.element.data("_exclude").indexOf(t);0>e&&this.element.data("_exclude").push(t)},_addDateStored:function(t){var e=this.element.data("_stored").indexOf(t);0>e&&this.element.data("_stored").push(t)},_removeDateExclude:function(t){var e=this.element.data("_exclude").indexOf(t);this.element.data("_exclude").splice(e,1)},_removeDateStored:function(t){var e=this.element.data("_stored").indexOf(t);this.element.data("_stored").splice(e,1)},_paddy:function(t,e,n){var o="undefined"!=typeof n?n:"0",i=new Array(1+e).join(o);return(i+t).slice(-i.length)},_dateFromNumbers:function(t,e,n){return new Date(this._paddy(t,4)+"/"+this._paddy(e,2)+"/"+this._paddy(n,2))},_dateNumberStringyFy:function(t,e,n){return this._dateFromNumbers(t,e,n).format("yyyy-mm-dd")},_dateStringyFy:function(t){return this._dateNumberStringyFy(t.getFullYear(),t.getMonth()+1,t.getDate())},setDate:function(t){var e;t=new Date(t),e=this._dateNumberStringyFy(t.getFullYear(),t.getMonth()+1,t.getDate()),this._addDate(e),this.options.syncCalenderToDateField&&(this._year=t.getFullYear(),this._month=t.getMonth(),this._day=t.getDate()),this._renderCalendar()},setDateExclude:function(t){var e;t=new Date(t),e=this._dateNumberStringyFy(t.getFullYear(),t.getMonth()+1,t.getDate()),this._addDateExclude(e),this._renderCalendar()},setDateStored:function(t){var e;t=new Date(t),e=this._dateNumberStringyFy(t.getFullYear(),t.getMonth()+1,t.getDate()),this._addDateStored(e),this._renderCalendar()},getDate:function(t){return new Date(void 0!==t?this.element.data("_storage")[t]:this.element.data("_storage")[0]).format(this.options.format)},getDates:function(){var t;return t=$.merge($.merge([],this.element.data("_storage")),this.element.data("_stored")),t.unique()},unsetDate:function(t){var e;t=new Date(t),e=this._dateNumberStringyFy(t.getFullYear(),t.getMonth()+1,t.getDate()),this._removeDate(e),this._renderCalendar()},unsetDateExclude:function(t){var e;t=new Date(t),e=this._dateNumberStringyFy(t.getFullYear(),t.getMonth()+1,t.getDate()),this._removeDateExclude(e),this._renderCalendar()},unsetDateStored:function(t){var e;t=new Date(t),e=this._dateNumberStringyFy(t.getFullYear(),t.getMonth()+1,t.getDate()),this._removeDateStored(e),this._renderCalendar()},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.carousel",{version:"3.0.0",options:{auto:!0,period:5e3,duration:1e3,effect:"slide",effectFunc:"linear",direction:"left",controls:!0,controlNext:!1,controlPrev:!1,markers:!0,stop:!0,width:"100%",height:!1,_slides:{},_currentIndex:0,_interval:0,_outPosition:0,_animating:!1},_create:function(){var t=this,e=this.options,n=this.element;$.each(n.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),e._slides=n.find(".slide");var o=0;$.each(e._slides,function(){var t,e=$(this);t=e.outerHeight(),t>o&&(o=t)}),n.css({width:e.width,height:e.height?e.height:o}),e._slides.length<=1||(e.markers&&this._markers(),e.controls&&this._controls(),e.stop&&n.on("mouseenter",function(){clearInterval(e._interval)}).on("mouseleave",function(){t.options.auto&&t._autoStart()}),n.find(".slide").hide(),n.find(".slide:nth-child(1)").show(),e.auto&&this._autoStart(),n.data("carousel",this))},_autoStart:function(){var t=this,e=this.options;e._interval=setInterval(function(){"left"===e.direction?t._slideTo("next"):t._slideTo("prior")},e.period)},_slideTo:function(t){var e,n=this.element,o=this.options,i=o._slides[o._currentIndex];switch(void 0===t&&(t="next"),"prior"===t?(o._currentIndex-=1,o._currentIndex<0&&(o._currentIndex=o._slides.length-1),o._outPosition=this.element.width()):"next"===t&&(o._currentIndex+=1,o._currentIndex>=o._slides.length&&(o._currentIndex=0),o._outPosition=-this.element.width()),e=o._slides[o._currentIndex],this.options.effect){case"switch":this._effectSwitch(i,e);break;case"slowdown":this._effectSlowdown(i,e,this.options.duration);break;case"fade":this._effectFade(i,e,this.options.duration);break;default:this._effectSlide(i,e,this.options.duration)}n.find(".carousel-bullets a").each(function(){var t=$(this).data("num");t===o._currentIndex?$(this).addClass("bullet-on"):$(this).removeClass("bullet-on")})},_slideToSlide:function(t){var e=this.options,n=e._slides[e._currentIndex],o=e._slides[t];if(e._currentIndex===t)return!1;switch(t>e._currentIndex?e._outPosition=-this.element.width():e._outPosition=this.element.width(),this.options.effect){case"switch":this._effectSwitch(n,o);break;case"slowdown":this._effectSlowdown(n,o);break;case"fade":this._effectFade(n,o);break;default:this._effectSlide(n,o)}e._currentIndex=t},_controls:function(){var t,e,n=this,o=this.element,i=this.options;t=$("<span/>").addClass("carousel-switch-next").html(">"),e=$("<span/>").addClass("carousel-switch-prev").html("<"),i.controlNext&&t.html(i.controlNext),i.controlPrev&&e.html(i.controlPrev),t.appendTo(o),e.appendTo(o),i._slides.length>1?(e.on("click",function(){i._animating===!1&&(n._slideTo("prior"),i._animating=!0,setTimeout(function(){i._animating=!1},i.duration))}),t.on("click",function(){i._animating===!1&&(n._slideTo("next"),i._animating=!0,setTimeout(function(){i._animating=!1},i.duration))})):(t.hide(),e.hide())},_markers:function(){var t,e,n,o=this,i=this.options;for(t=$('<div class="carousel-bullets" />'),n=0;n<i._slides.length;n++)e=$('<a class="carousel-bullet" href="javascript:void(0)" data-num="'+n+'"></a>'),0===n&&e.addClass("bullet-on"),e.appendTo(t);t.find("a").on("click",function(e){var n=$(this),a=n.data("num");return t.find("a").removeClass("bullet-on"),n.addClass("bullet-on"),a===i._currentIndex?!1:(o._slideToSlide(a),e.preventDefault(),void e.stopPropagation())}),t.appendTo(this.element)},_effectSwitch:function(t,e){$(t).hide(),$(e).css({left:0}).show(),this.element.css({height:$(e).outerHeight()})},_effectSlide:function(t,e){var n=this.options;$(t).animate({left:n._outPosition},n.duration,n.effectFunc),$(e).css("left",-1*n._outPosition).show(),this.element.css({height:$(e).outerHeight()}),$(e).animate({left:0},n.duration,n.effectFunc)},_effectSlowdown:function(t,e){var n=this.options,o={duration:n.duration,easing:"doubleSqrt"};$.easing.doubleSqrt=function(t){return Math.sqrt(Math.sqrt(t))},$(t).animate({left:n._outPosition},o),$(e).css("left",-1*n._outPosition).show(),this.element.css({height:$(e).outerHeight()}),$(e).animate({left:0},o)},_effectFade:function(t,e){var n=this.options;$(t).fadeOut(n.duration),$(e).css({left:0}).fadeIn(n.duration),this.element.css({height:$(e).outerHeight()})},slideTo:function(t){this._slideToSlide(t)},nextSlide:function(){this._slideTo("next")},priorSlide:function(){this._slideTo("prior")},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.charm",{version:"3.0.0",options:{position:"right",opacity:1,outside:!1,timeout:0,duration:400},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),this._createCharm(),t.data("charm",this)},_createCharm:function(){var t=this,e=this.element,n=this.options;e.addClass("charm").addClass(n.position+"-side").css({opacity:n.opacity}).hide();var o=$("<span/>").addClass("charm-closer").appendTo(e);o.on("click",function(){t.close()}),n.outside===!0&&e.on("mouseleave",function(e){t.close()})},_showCharm:function(){var t,e=this,n=this.element,o=this.options;"left"===o.position||"right"===o.position?(t=n.outerWidth(),"left"===o.position?n.css({left:-t,right:"auto",top:0,bottom:0}).show().animate({left:0},o.duration,function(){n.data("displayed",!0)}):n.css({right:-t,left:"auto",top:0,bottom:0}).show().animate({right:0},o.duration,function(){n.data("displayed",!0)})):(t=n.outerHeight(),"top"===o.position?n.css({top:-t,bottom:"auto",left:0,right:0}).show().animate({top:0},o.duration,function(){n.data("displayed",!0)}):n.css({bottom:-t,top:"auto",left:0,right:0}).show().animate({bottom:0},o.duration,function(){n.data("displayed",!0)})),o.timeout>0&&(this._timeout_interval=setInterval(function(){n.is(":hover")||(e.close(),clearInterval(e._timeout_interval))},o.timeout))},_hideCharm:function(){var t,e=this.element,n=this.options;"left"===n.position||"right"===n.position?(t=e.outerWidth(),"left"===n.position?e.animate({left:-t},n.duration,function(){e.hide(),e.data("displayed",!1)}):e.animate({right:-t},n.duration,function(){e.hide(),e.data("displayed",!1)})):(t=e.outerHeight(),"top"===n.position?e.animate({top:-t},n.duration,function(){e.hide(),e.data("displayed",!1)}):e.animate({bottom:-t},n.duration,function(){e.hide(),e.data("displayed",!1)})),clearInterval(this._timeout_interval)},open:function(){var t=this.element;this.options;t.data("opened")!==!0&&(t.data("opened",!0),this._showCharm())},close:function(){var t=this.element;this.options;t.data("opened")!==!1&&(t.data("opened",!1),this._hideCharm())},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$(document).on("click",".charm",function(t){t.preventDefault(),t.stopPropagation()}),$(document).on("click",function(t){$("[data-role=charm]").each(function(t,e){$(e).hasClass("keep-open")||$(e).data("displayed")!==!0||$(e).data("charm").close()})}),window.metroCharmIsOpened=function(t){
var e,n=$(t);return 0==n.length?(console.log("Charm "+t+" not found!"),!1):(e=n.data("charm"),void 0==e?(console.log('Element not contain role charm! Please add attribute data-role="charm" to element '+t),!1):e.element.data("opened")===!0)},window.showMetroCharm=function(t,e){var n,o=$(t);return 0==o.length?(console.log("Charm "+t+" not found!"),!1):(n=o.data("charm"),void 0==n?(console.log('Element not contain role charm! Please add attribute data-role="charm" to element '+t),!1):(void 0!=e&&(o.hide(),o.data("displayed",!1),o.data("opened",!1),n.options.position=e),n.open(),!1))},window.hideMetroCharm=function(t){var e,n=$(t);return 0==n.length?(console.log("Charm "+t+" not found!"),!1):(e=n.data("charm"),void 0==e?(console.log('Element not contain role charm! Please add attribute data-role="charm" to element '+t),!1):void e.close())},window.toggleMetroCharm=function(t,e){var n,o=$(t);return 0==o.length?(console.log("Charm "+t+" not found!"),!1):(n=o.data("charm"),void 0==n?(console.log('Element not contain role charm! Please add attribute data-role="charm" to element '+t),!1):void(n.element.data("opened")===!0?n.close():(void 0!=e&&(o.hide(),o.data("displayed",!1),o.data("opened",!1),n.options.position=e),n.open())))},$.widget("metro.clock",{version:"1.0.0",options:{showTime:!0,showDate:!0,timeFormat:"24",dateFormat:"american",divider:" "},_create:function(){var t=this,e=this.element;this.options;this._setOptionsFromDOM(),this._tick(),this._clockInterval=setInterval(function(){t._tick()},500),e.data("clock",this)},_addLeadingZero:function(t){return 10>t&&(t="0"+t),t},_tick:function(){var t=this.element,e=this.options,n=new Date,o=(n.getTime(),""),i=n.getHours(),a=n.getMinutes(),s=n.getSeconds(),r=n.getDate(),l=n.getMonth()+1,d=n.getFullYear(),c="";"12"==e.timeFormat&&(c=" AM",i>11&&(c=" PM"),i>12&&(i-=12),0==i&&(i=12)),i=this._addLeadingZero(i),a=this._addLeadingZero(a),s=this._addLeadingZero(s),l=this._addLeadingZero(l),r=this._addLeadingZero(r),e.showDate&&("american"==e.dateFormat?(o+="<span class='date-month'>"+l+"</span>",o+="<span class='date-divider'>-</span>",o+="<span class='date-day'>"+r+"</span>",o+="<span class='date-divider'>-</span>",o+="<span class='date-year'>"+d+"</span>"):(o+="<span class='date-day'>"+r+"</span>",o+="<span class='date-divider'>-</span>",o+="<span class='date-month'>"+l+"</span>",o+="<span class='date-divider'>-</span>",o+="<span class='date-year'>"+d+"</span>"),o+=e.divider),e.showTime&&(o+="<span class='clock-hour'>"+i+"</span>",o+="<span class='clock-divider'>:</span>",o+="<span class='clock-minute'>"+a+"</span>",o+="<span class='clock-divider'>:</span>",o+="<span class='clock-second'>"+s+"</span>"),t.html(o)},_setOptionsFromDOM:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}})},_destroy:function(){clearInterval(this._clockInterval)},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.countdown",{version:"3.0.0",options:{stop:!1,days:!1,hours:!1,minutes:!1,seconds:!1,backgroundColor:"bg-cyan",digitColor:"fg-white",dividerColor:"fg-dark",labelColor:"fg-grayLight",labels:{days:"days",hours:"hours",minutes:"mins",seconds:"secs"},onTick:function(t,e,n,o){},onStop:function(){}},_interval:0,_interval2:0,_alarmOn:void 0,_create:function(){var t=this,e=this.element,n=this.options;$.each(e.data(),function(t,e){if(t in n)try{n[t]=$.parseJSON(e)}catch(o){n[t]=e}}),this._alarmOn=new Date,n.stop!==!1&&(this._alarmOn=new Date(n.stop));var o=864e5,i=36e5,a=6e4,s=1e3;n.days!==!1&&("object"==typeof this._alarmOn&&(this._alarmOn=this._alarmOn.getTime()),this._alarmOn=this._alarmOn+n.days*o),n.hours!==!1&&("object"==typeof this._alarmOn&&(this._alarmOn=this._alarmOn.getTime()),this._alarmOn=this._alarmOn+n.hours*i),n.minutes!==!1&&("object"==typeof this._alarmOn&&(this._alarmOn=this._alarmOn.getTime()),this._alarmOn=this._alarmOn+n.minutes*a),n.seconds!==!1&&("object"==typeof this._alarmOn&&(this._alarmOn=this._alarmOn.getTime()),this._alarmOn=this._alarmOn+n.seconds*s),this._createDigits(),e.find(".digit").text("0"),t._tick(),e.data("countdown",this)},_createDigits:function(){var t,e,n=this.element,o=this.options,i=["days","hours","minutes","seconds"];i.map(function(i){t=$("<div/>").addClass("part "+i).attr("data-day-text",o.labels[i]).appendTo(n),$("<div/>").addClass("digit").appendTo(t),$("<div/>").addClass("digit").appendTo(t),o.labelColor.isColor()?t.css({color:o.labelColor}):t.addClass(o.labelColor),o.backgroundColor.isColor()?t.find(".digit").css({background:o.backgroundColor}):t.find(".digit").addClass(o.backgroundColor),o.digitColor.isColor()?t.find(".digit").css({color:o.digitColor}):t.find(".digit").addClass(o.digitColor),"seconds"!==i&&(e=$("<div/>").addClass("divider").text(":").appendTo(n),o.dividerColor.isColor()?e.css({color:o.dividerColor}):e.addClass(o.dividerColor))})},_blink:function(){this.element.toggleClass("tick")},_tick:function(){var that=this,o=this.options,element=this.element,days=86400,hours=3600,minutes=60,left,d,h,m,s;this._interval2=setInterval(function(){that._blink()},500),this._interval=setInterval(function(){var result;left=Math.floor((that._alarmOn-new Date)/1e3),0>left&&(left=0),d=Math.floor(left/days),left-=d*days,that._update("days",d),0===d&&element.find(".part.days").addClass("disabled"),h=Math.floor(left/hours),left-=h*hours,that._update("hours",h),0===d&&0===h&&element.find(".part.hours").addClass("disabled"),m=Math.floor(left/minutes),left-=m*minutes,that._update("minutes",m),0===d&&0===h&&0===m&&element.find(".part.minutes").addClass("disabled"),s=left,that._update("seconds",s),"function"==typeof o.onTick?o.onTick(d,h,m,s):"function"==typeof window[o.onTick]?window[o.onTick](d,h,m,s):(result=eval("(function(){"+o.onTick+"})"),result.call(d,h,m,s)),0===d&&0===h&&0===m&&0===s&&(element.find(".part").addClass("disabled"),"function"==typeof o.onStop?o.onStop():"function"==typeof window[o.onStop]?window[o.onStop]():(result=eval("(function(){"+o.onStop+"})"),result.call()),that._stop("all"),that._trigger("alarm"),clearInterval(that._interval))},1e3)},_update:function(t,e){var n,o,i=this.element,a=Math.floor(e/10)%10,s=e%10;n=i.find("."+t+" .digit:eq(0)"),o=i.find("."+t+" .digit:eq(1)"),s!==parseInt(o.text())&&(o.toggleClass("scaleIn"),setTimeout(function(){o.text(s).toggleClass("scaleIn")},500)),a!==parseInt(n.text())&&(n.toggleClass("scaleIn"),setTimeout(function(){n.text(a).toggleClass("scaleIn")},500))},_stop:function(){clearInterval(this._interval),clearInterval(this._interval2)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.datatable",{version:"3.0.0",options:{},_create:function(){var t=this.element,e=this.options;if($.each(t.data(),function(t,n){try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),$().dataTable)try{t.dataTable(e)}catch(n){}else alert("dataTable plugin required");t.data("datatable",this)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.datepicker",{version:"3.0.14",options:{format:"yyyy.mm.dd",preset:!1,minDate:!1,maxDate:!1,effect:"fade",position:"bottom",locale:window.METRO_CURRENT_LOCALE,weekStart:window.METRO_CALENDAR_WEEK_START,otherDays:!1,exclude:!1,stored:!1,buttons:!1,buttonToday:!0,buttonClear:!0,condensedGrid:!1,scheme:"default",onSelect:function(t,e){}},_calendar:void 0,_create:function(){var t=this,e=this.element,n=this.options,o=e.children("input"),i=e.children("button");$.each(e.data(),function(t,e){if(t in n)try{n[t]=$.parseJSON(e)}catch(o){n[t]=e}}),this._createCalendar(),o.attr("readonly",!0),i.attr("type","button"),i.on("click",function(e){e.stopPropagation(),"none"===t._calendar.css("display")?t._show():t._hide()}),e.on("click",function(e){e.stopPropagation(),"none"===t._calendar.css("display")?t._show():t._hide()}),$("html").on("click",function(){$(".calendar-dropdown").hide()}),e.data("datepicker",this)},_createCalendar:function(){var _calendar,that=this,element=this.element,o=this.options;switch(_calendar=$("<div/>").css({position:"absolute",display:"none","max-width":220,"z-index":1e3}).addClass("calendar calendar-dropdown").appendTo(element),_calendar.calendar({multiSelect:!1,format:o.format,buttons:!1,buttonToday:!1,buttonClear:!1,locale:o.locale,otherDays:o.otherDays,weekStart:o.weekStart,condensedGrid:o.condensedGrid,exclude:o.exclude,stored:o.stored,date:o.preset?o.preset:new Date,minDate:o.minDate,maxDate:o.maxDate,scheme:o.scheme,dayClick:function(d,d0){if(_calendar.calendar("setDate",d0),that.element.children("input[type=text]").val(d),that.element.children("input[type=text]").trigger("change",d0),that.element.children("input[type=text]").blur(),that._hide(),"function"==typeof o.onSelect)o.onSelect(d,d0);else if("function"==typeof window[o.onSelect])window[o.onSelect](d,d0);else{var result=eval("(function(){"+o.onSelect+"})");result.call(d,d0)}}}),o.preset!==!1&&(_calendar.calendar("setDate",o.preset),element.find("input, .datepicker-output").val(_calendar.calendar("getDate"))),this.options.position){case"top":_calendar.css({top:0-_calendar.height(),left:0});break;default:_calendar.css({top:"100%",left:0})}this._calendar=_calendar},_show:function(){"slide"===this.options.effect?($(".calendar-dropdown").slideUp("fast"),this._calendar.slideDown("fast")):"fade"===this.options.effect?($(".calendar-dropdown").fadeOut("fast"),this._calendar.fadeIn("fast")):($(".calendar-dropdown").hide(),this._calendar.show())},_hide:function(){"slide"===this.options.effect?this._calendar.slideUp("fast"):"fade"===this.options.effect?this._calendar.fadeOut("fast"):this._calendar.hide()},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)},setDate:function(t){$.isArray(t);var e=this.element.find("input"),n=this._calendar.data("metro-calendar"),o=n.element;o.data("_storage",[]),this._calendar.calendar("setDate",t),t=this._calendar.calendar("getDate"),e.val(t)}}),$.widget("metro.dialog",{version:"3.0.14",options:{modal:!1,overlay:!1,overlayColor:"default",overlayClickClose:!1,type:"default",place:"center",position:"default",content:!1,hide:!1,width:"auto",height:"auto",background:"default",color:"default",closeButton:!1,windowsStyle:!1,show:!1,href:!1,contentType:"default",_interval:void 0,_overlay:void 0,onDialogOpen:function(t){},onDialogClose:function(t){}},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),e.overlay&&this._createOverlay(),this._createDialog(),t.data("dialog",this),e.show&&this.open()},_createOverlay:function(){var t=(this.element,this.options),e=$("body").find(".dialog-overlay");0===e.length&&(e=$("<div/>").addClass("dialog-overlay")),t.overlayColor&&(t.overlayColor.isColor()?e.css({background:t.overlayColor}):e.addClass(t.overlayColor)),t._overlay=e},_createDialog:function(){var t=this,e=this.element,n=this.options;e.addClass("dialog"),"default"!==n.type&&e.addClass(n.type),n.windowsStyle&&(n.width="auto",e.css({left:0,right:0})),"default"!==n.background&&(n.background.isColor()?e.css({background:n.background}):e.addClass(n.background)),"default"!==n.color&&(n.color.isColor()?e.css({color:n.color}):e.addClass(n.color)),e.css({width:n.width,height:n.height}),n.closeButton&&$("<span/>").addClass("dialog-close-button").appendTo(e).on("click",function(){t.close()}),this._hide()},_hide:function(){var t=this.element;t.css({visibility:"hidden"})},_show:function(){var t=this.element;this.options;this._setContent(),t.css({visibility:"visible"})},_setPosition:function(){var t=this.element,e=this.options,n=t.width(),o=t.height();switch(e.place){case"top-left":t.css({left:0,top:0});break;case"top-right":t.css({right:0,top:0});break;case"top-center":t.css({left:($(window).width()-n)/2,top:0});break;case"bottom-left":t.css({left:0,bottom:0});break;case"bottom-right":t.css({right:0,bottom:0});break;case"center-left":t.css({left:0,top:($(window).height()-o)/2});break;case"center-right":t.css({right:0,top:($(window).height()-o)/2});break;case"bottom-center":t.css({left:($(window).width()-n)/2,bottom:0});break;default:t.css({left:e.windowsStyle===!1?($(window).width()-n)/2:0,top:($(window).height()-o)/2})}},_setContent:function(){var t=this,e=this.element,n=this.options,o=$("<div>").addClass("set-dialog-content");return"video"===n.contentType&&o.addClass("video-container"),n.content===!1&&n.href===!1?!1:(e.children(":not(.dialog-close-button)").remove(),o.appendTo(e),n.content&&(n.content instanceof jQuery?n.content.appendTo(o):o.html(n.content),this._setPosition()),void(n.href&&$.get(n.href,function(e){o.html(e),t._setPosition()})))},setContent:function(t){this.options.contentType="default",this.options.href=!1,this.options.content=t,this._setContent()},setContentHref:function(t){this.options.contentType="href",this.options.content=!1,this.options.href=t,this._setContent()},setContentVideo:function(t){this.options.contentType="video",this.options.content=t,this.options.href=!1,this._setContent()},toggle:function(){var t=this.element;t.data("opened")?this.close():this.open()},open:function(){var that=this,element=this.element,o=this.options,overlay;if(this._setPosition(),element.data("opened",!0),o.overlay&&(overlay=o._overlay,overlay.appendTo("body").show(),o.overlayClickClose&&overlay.on("click",function(){that.close()})),this._show(),"function"==typeof o.onDialogOpen)o.onDialogOpen(element);else if("function"==typeof window[o.onDialogOpen])window[o.onDialogOpen](element);else{var result=eval("(function(){"+o.onDialogOpen+"})");result.call(element)}o.hide&&parseInt(o.hide)>0&&(o._interval=setTimeout(function(){that.close()},parseInt(o.hide)))},close:function(){var that=this,element=this.element,o=this.options;if(clearInterval(o._interval),o.overlay&&$("body").find(".dialog-overlay").remove(),element.data("opened",!1),this._hide(),"function"==typeof o.onDialogClose)o.onDialogClose(element);else if("function"==typeof window[o.onDialogClose])window[o.onDialogClose](element);else{var result=eval("(function(){"+o.onDialogClose+"})");result.call(element)}},reset:function(t){void 0!==t&&(this.options.place=t),this._setPosition()},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),window.showMetroDialog=function(t,e,n,o){var i,a=$(t);if(0==a.length)return console.log("Dialog "+t+" not found!"),!1;if(i=a.data("dialog"),void 0==i)return console.log('Element not contain role dialog! Please add attribute data-role="dialog" to element '+t),!1;if(void 0!=n)switch(o){case"href":i.setContentHref(n);break;case"video":i.setContentVideo(n);break;default:i.setContent(n)}void 0!==e&&(i.options.place=e),i.open()},window.hideMetroDialog=function(t){var e,n=$(t);return 0==n.length?(console.log("Dialog "+t+" not found!"),!1):(e=n.data("dialog"),void 0==e?(console.log('Element not contain role dialog! Please add attribute data-role="dialog" to element '+t),!1):void e.close())},window.toggleMetroDialog=function(t,e,n,o){var i,a=$(t);if(0==a.length)return console.log("Dialog "+t+" not found!"),!1;if(i=a.data("dialog"),void 0==i)return console.log('Element not contain role dialog! Please add attribute data-role="dialog" to element '+t),!1;if(void 0!=n)switch(o){case"href":i.setContentHref(n);break;case"video":i.setContentVideo(n);break;default:i.setContent(n)}i.element.data("opened")===!0?i.close():(void 0!==e&&(i.options.place=e),i.open())},$.widget("metro.draggable",{version:"3.0.0",options:{dragElement:null,dragArea:null,zIndex:2e3,onDragStart:function(t){},onDragStop:function(t){},onDragMove:function(t,e){}},drag:!1,oldCursor:null,oldZindex:null,oldPosition:null,_create:function(){var t=this.element;this.options;this._setOptionsFromDOM(),this._createDraggable(),t.data("draggable",this)},_createDraggable:function(){var that=this,element=this.element,o=this.options,dragElement=o.dragElement?element.find(o.dragElement):element;addTouchEvents(element[0]),dragElement.on("mousedown",function(e){var result,el=$(this);that.drag=!0,"function"==typeof o.onDragStart?o.onDragStart(element):"function"==typeof window[o.onDragStart]?window[o.onDragStart](element):(result=eval("(function(){"+o.onDragStart+"})"),result.call(element)),that.oldCursor=el.css("cursor")?el.css("cursor"):"default",that.oldZindex=element.css("z-index"),dragElement.css({cursor:"move"}),element.css({"z-index":o.zIndex});var dragArea=$(o.dragArea?o.dragArea:window),os={left:o.dragArea?dragArea.offset().left:0,top:o.dragArea?dragArea.offset().top:0},drg_h=element.outerHeight(),drg_w=element.outerWidth(),pos_y=element.offset().top+drg_h-e.pageY,pos_x=element.offset().left+drg_w-e.pageX;dragArea.on("mousemove",function(e){var offset,pageX,pageY;if(!that.drag)return!1;pageX=e.pageX-os.left,pageY=e.pageY-os.top;var t=pageY>0?pageY+pos_y-drg_h:0,l=pageX>0?pageX+pos_x-drg_w:0,t_delta=dragArea.innerHeight()+dragArea.scrollTop()-element.outerHeight(),l_delta=dragArea.innerWidth()+dragArea.scrollLeft()-element.outerWidth();t>=0&&t_delta>=t&&element.offset({top:t+os.top}),l>=0&&l_delta>=l&&element.offset({left:l+os.left}),offset={left:l,top:t},"function"==typeof o.onDragMove?o.onDragMove(element,offset):"function"==typeof window[o.onDragMove]?window[o.onDragMove](element,offset):(result=eval("(function(){"+o.onDragMove+"})"),result.call(element,offset))})}),dragElement.on("mouseup",function(e){var result,el=$(this);that.drag=!1,dragElement.css({cursor:that.oldCursor}),element.css({"z-index":that.oldZindex,position:that.oldPosition}),"function"==typeof o.onDragStop?o.onDragStop(element):"function"==typeof window[o.onDragStop]?window[o.onDragStop](element):(result=eval("(function(){"+o.onDragStop+"})"),result.call(element))})},_setOptionsFromDOM:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}})},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.dropdown",{version:"3.0.0",options:{effect:window.METRO_SHOW_TYPE,toggleElement:!1,noClose:!1,onDrop:function(t){},onUp:function(t){}},_create:function(){var t,e=this,n=this.element,o=this.options,i=this.element,a=this.name,s=this.element.parent();$.each(n.data(),function(t,e){if(t in o)try{o[t]=$.parseJSON(e)}catch(n){o[t]=e}}),t=o.toggleElement?$(o.toggleElement):s.children(".dropdown-toggle").length>0?s.children(".dropdown-toggle"):s.children("a:nth-child(1)"),void 0!==METRO_SHOW_TYPE&&(this.options.effect=METRO_SHOW_TYPE),t.on("click."+a,function(t){if(s.siblings(s[0].tagName).removeClass("active-container"),$(".active-container").removeClass("active-container"),"block"!==i.css("display")||i.hasClass("keep-open")){if($("[data-role=dropdown]").each(function(t,n){i.parents("[data-role=dropdown]").is(n)||$(n).hasClass("keep-open")||"block"!==$(n).css("display")||e._close(n)}),i.hasClass("horizontal")){i.css({visibility:"hidden",display:"block"});var n=$(i.children("li")[0]).outerWidth();i.css({visibility:"visible",display:"none"});var o=i.children("li").length*n+(i.children("li").length-1);i.css("width",o)}e._open(i),s.addClass("active-container")}else e._close(i);t.preventDefault(),t.stopPropagation()}),o.noClose===!0&&n.on("click",function(t){t.stopPropagation()}),$(i).find("li.disabled a").on("click",function(t){t.preventDefault()}),n.data("dropdown",this)},_open:function(el){var parent=this.element.parent(),o=this.options,toggle=o.toggleElement?$(o.toggleElement):parent.children(".dropdown-toggle").length>0?parent.children(".dropdown-toggle"):parent.children("a:nth-child(1)");switch(this.options.effect){case"fade":$(el).fadeIn("fast");break;case"slide":$(el).slideDown("fast");break;default:$(el).show()}if(this._trigger("onOpen",null,el),toggle.addClass("active-toggle"),"function"==typeof o.onDrop)o.onDrop(el);else if("function"==typeof window[o.onDrop])window[o.onDrop](el);else{var result=eval("(function(){"+o.onDrop+"})");result.call(el)}},_close:function(el){var parent=$(el).parent(),o=this.options,toggle=o.toggleElement?$(o.toggleElement):parent.children(".dropdown-toggle").length>0?parent.children(".dropdown-toggle"):parent.children("a:nth-child(1)");switch(this.options.effect){case"fade":$(el).fadeOut("fast");break;case"slide":$(el).slideUp("fast");break;default:$(el).hide()}if(this._trigger("onClose",null,el),toggle.removeClass("active-toggle"),"function"==typeof o.onUp)o.onUp(el);else if("function"==typeof window[o.onUp])window[o.onUp](el);else{var result=eval("(function(){"+o.onUp+"})");result.call(el)}},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$(document).on("click",function(t){$("[data-role=dropdown]").each(function(t,e){if(!$(e).hasClass("keep-open")&&"block"===$(e).css("display")){var n=$(e).data("dropdown");n._close(e)}})}),$.widget("metro.fitImage",{version:"3.0.0",options:{shadow:!1,overlay:!1,type:"default",frameColor:"default",format:"hd"},_create:function(){var t,e,n,o,i,a=this.element,s=this.options,r=a.parent(),l=a.attr("src");$.each(a.data(),function(t,e){if(t in s)try{s[t]=$.parseJSON(e)}catch(n){s[t]=e}}),$("<img/>").attr("src",l).load(function(){t=this.width,e=this.height}).remove();var d=$("<div/>").addClass("image-container").css("width","100%").appendTo(r),c=$("<div/>").addClass("frame").appendTo(d);switch(n=c.innerWidth(),o=c.innerHeight(),s.format){case"sd":o=3*n/4;break;case"square":o=n;break;case"cycle":o=n;break;case"fill-h":o="100%",d.css("height","100%");break;case"fill":o="100%",d.css("height","100%");break;default:o=9*n/16}if(i=$("<div/>").css({width:"100%",height:o,"background-image":"url("+l+")","background-size":"cover","background-repeat":"no-repeat","border-radius":"cycle"===s.format?"50%":"0"}),$(window).on("resize",function(){var t=c.innerWidth(),e=c.innerHeight();switch(s.format){case"sd":e=3*t/4;break;case"square":e=t;break;case"cycle":e=t;break;case"fill-h":e="100%",d.css("height","100%");break;case"fill":e="100%",d.css("height","100%");break;default:e=9*t/16}i.css({height:e})}),"default"!==s.frameColor&&(s.frameColor.isUrl()?c.css("background-color",s.frameColor):c.addClass(s.frameColor)),s.overlay!==!1){$("<div/>").addClass("image-overlay").html(s.overlay).appendTo(d)}switch(s.shadow!==!1&&d.addClass("block-shadow"),i.appendTo(c),s.type){case"diamond":d.addClass("diamond"),i.addClass("image-replacer");break;case"bordered":d.addClass("bordered");break;case"polaroid":d.addClass("polaroid");break;case"handing":d.addClass("handing");break;case"handing-ani":d.addClass("handing ani");break;case"handing-ani-hover":d.addClass("handing ani-hover")}d.addClass("image-format-"+s.format),a.remove()},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.fluentmenu",{version:"3.0.0",options:{onSpecialClick:function(t,e){},onTabClick:function(t,e){},onTabChange:function(t,e){}},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),this._createMenu(),t.data("fluentmenu",this)},_createMenu:function(){var that=this,element=this.element,o=this.options,active_tab=$(element.find(".tabs-holder > li.active")[0]);this.openTab(active_tab),element.on("click",".tabs-holder > li > a",function(e){var a=$(this),li=a.parent("li"),result;if(li.hasClass("special"))"function"==typeof o.onSpecialClick?o.onSpecialClick(a,li):"function"==typeof window[o.onSpecialClick]?window[o.onSpecialClick](a,li):(result=eval("(function(){"+o.onSpecialClick+"})"),result.call(a,li));else{var panel=$(a.attr("href"));that._hidePanels(),that._showPanel(panel),element.find(".tabs-holder > li").removeClass("active"),a.parent("li").addClass("active"),"function"==typeof o.onTabClick?o.onTabClick(a,li):"function"==typeof window[o.onTabClick]?window[o.onTabClick](a,li):(result=eval("(function(){"+o.onTabClick+"})"),result.call(a,li)),"function"==typeof o.onTabChange?o.onTabChange(a,li):"function"==typeof window[o.onTabChange]?window[o.onTabChange](a,li):(result=eval("(function(){"+o.onTabChange+"})"),result.call(a,li))}e.preventDefault()})},_hidePanels:function(){this.element.find(".tab-panel").hide()},_showPanel:function(t){void 0==t&&(t=this.element.find(".tabs-holder li.active a").attr("href")),$(t).show()},openTab:function(t){var e=this.element,n=(this.options,$(t.children("a").attr("href")));return 0===n.length?!1:(this._hidePanels(),this._showPanel(n),e.find(".tabs-holder > li").removeClass("active"),void t.addClass("active"))},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.grid",{version:"3.0.0",options:{equalHeight:!0},_create:function(){var t=this,e=this.element,n=this.options;$.each(e.data(),function(t,e){if(t in n)try{n[t]=$.parseJSON(e)}catch(o){n[t]=e}}),n.equalHeight&&(setTimeout(function(){t._setEqualHeight()},50),$(window).on("resize",function(){t._setEqualHeight()})),e.data("grid",this)},_setEqualHeight:function(){var t=this.element,e=(this.options,t.find(".row"));$.each(e,function(){var t=$(this),e=t.children(".cell"),n=0;e.css("min-height","0"),$.each(e,function(){$(this).outerHeight()>n&&(n=$(this).outerHeight())}),e.css("min-height",n)})},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.hint",{version:"3.0.0",options:{hintPosition:"auto",hintBackground:"#FFFCC0",hintColor:"#000000",hintMaxSize:200,hintMode:"default",hintShadow:!1,hintBorder:!0,hintTimeout:0,hintTimeDelay:0,_hint:void 0},_create:function(){var t=this,e=(this.element,this.options);this.element.on("mouseenter",function(n){$(".hint, .hint2").remove(),e.hintTimeDelay>0?setTimeout(function(){t.createHint(),e._hint.show()},e.hintTimeDelay):(t.createHint(),e._hint.show()),n.preventDefault()}),this.element.on("mouseleave",function(t){e._hint.length&&e._hint.hide().remove(),t.preventDefault()})},createHint:function(){var t,e=this.element,n=e.data("hint").split("|"),o=this.options;if($.each(e.data(),function(t,e){if(t in o)try{o[t]=$.parseJSON(e)}catch(n){o[t]=e}}),"TD"===e[0].tagName||"TH"===e[0].tagName){var i=$("<div/>").css("display","inline-block").html(e.html());e.html(i),e=i}var a=n.length>1?n[0]:!1,s=n.length>1?n[1]:n[0];t=$("<div/>").appendTo("body"),2===o.hintMode?t.addClass("hint2"):t.addClass("hint"),o.hintBorder||t.addClass("no-border"),a&&$("<div/>").addClass("hint-title").html(a).appendTo(t),$("<div/>").addClass("hint-text").html(s).appendTo(t),t.addClass(o.position),o.hintShadow&&t.addClass("shadow"),o.hintBackground&&(o.hintBackground.isColor()?t.css("background-color",o.hintBackground):t.addClass(o.hintBackground)),o.hintColor&&(o.hintColor.isColor()?t.css("color",o.hintColor):t.addClass(o.hintColor)),o.hintMaxSize>0&&t.css({"max-width":o.hintMaxSize}),"top"===o.hintPosition?(t.addClass("top"),t.css({top:e.offset().top-$(window).scrollTop()-t.outerHeight()-20,left:2===o.hintMode?e.offset().left+e.outerWidth()/2-t.outerWidth()/2-$(window).scrollLeft():e.offset().left-$(window).scrollLeft()})):"right"===o.hintPosition?(t.addClass("right"),t.css({top:2===o.hintMode?e.offset().top+e.outerHeight()/2-t.outerHeight()/2-$(window).scrollTop()-10:e.offset().top-10-$(window).scrollTop(),left:e.offset().left+e.outerWidth()+15-$(window).scrollLeft()})):"left"===o.hintPosition?(t.addClass("left"),t.css({top:2===o.hintMode?e.offset().top+e.outerHeight()/2-t.outerHeight()/2-$(window).scrollTop()-10:e.offset().top-10-$(window).scrollTop(),left:e.offset().left-t.outerWidth()-10-$(window).scrollLeft()})):(t.addClass("bottom"),t.css({top:e.offset().top-$(window).scrollTop()+e.outerHeight(),left:2===o.hintMode?e.offset().left+e.outerWidth()/2-t.outerWidth()/2-$(window).scrollLeft():e.offset().left-$(window).scrollLeft()})),o._hint=t,o.hintTimeout>0&&setTimeout(function(){o._hint.length&&o._hint.hide().remove()},o.hintTimeout)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.input",{version:"3.0.0",options:{showLabelOnValue:!1,textAutoResize:!1,textMaxHeight:0},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),t.hasClass("file")&&this._createInputFile(),t.hasClass("text")&&this._createInputText(),t.hasClass("password")&&this._createInputText(),t.hasClass("select")&&this._createInputSelect(),t.hasClass("textarea")&&this._createInputTextarea(),t.hasClass("modern")&&this._createInputModern(),t.data("input",this)},_createInputModern:function(){var t=this.element,e=t.find("input"),n=t.find(".placeholder");""!==e.val()&&n.css({display:"none"}),e.on("blur",function(){""!==e.val()?n.css({display:"none"}):n.css({display:"block"})}),e.on("focus",function(){""!==e.val()?n.css({display:"none"}):n.css({display:"block"})})},_createInputFile:function(){var t,e,n,o=this.element;t=$("<input type='text' class='input-file-wrapper' readonly style='z-index: 1; cursor: default;'>"),e=o.children(".button"),n=o.children('input[type="file"]'),n.css("z-index",0),t.insertAfter(n),n.attr("tabindex","-1"),e.attr("type","button"),t.attr("placeholder",n.attr("placeholder")),n.on("change",function(){var e=$(this).val();""!==e&&(t.val(e.replace(/.+[\\\/]/,"")),t.attr("title",e.replace(/.+[\\\/]/,"")))}),o.on("click",".button, .input-file-wrapper",function(){n.trigger("click")})},_createInputText:function(){var t=this.element,e=t.find(".helper-button.clear"),n=t.find(".helper-button.reveal"),o=t.find("input"),i=t.find(".helper-button"),a=t.find(".button"),s=t.find(".input-state-error, .input-state-warning, .input-state-info, .input-state-success, .input-state-required"),r=0,l="rtl"===t.attr("dir")||t.parents("[dir='rtl']").length>0;$.each(a,function(){var t=$(this);r+=t.outerWidth()}),l?(o.css({"padding-left":r+5}),s.css({left:r+8})):(o.css({"padding-right":r+5}),s.css({right:r+8})),i.attr("tabindex",-1).attr("type","button"),e&&e.on("click",function(){o.val("").trigger("change").focus()}),n&&t.hasClass("password")&&n.on("mousedown",function(){o.attr("type","text")}).on("mouseup",function(){o.attr("type","password").focus()})},_createInputSelect:function(){},_createInputTextarea:function(){var t=this.element,e=this.options,n=t.find("textarea");console.log(n);var o=function(){n.css({resize:"none","overflow-y":"hidden"}),n[0].style.height=0;var t=n[0].scrollHeight;e.textMaxHeight>0?e.textMaxHeight>t?n[0].style.height=t+"px":n[0].style.height=e.textMaxHeight+"px":n[0].style.height=t+"px"};e.textAutoResize&&(n.on("keyup",o),n.on("keydown",o),n.on("change",o),n.on("focus",o),n.on("cut",o),n.on("paste",o),n.on("drop",o))},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.keypad",{version:"3.0.0",options:{target:!1,shuffle:!1,length:!1,keys:["1","2","3","4","5","6","7","8","9","0"],size:32,onKey:function(t){},onChange:function(t){}},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),"string"==typeof e.keys&&(e.keys=e.keys.split(",")),e.target!==!1&&(e.target=$(e.target)),this._createKeypad(),t.data("keypad",this)},_shuffleKeys:function(){var t=(this.element,this.options),e=t.keys.slice(0),n=this._keypad,o=e.length+2;t.shuffle&&(e=e.shuffle()),n.html("").css({width:o/4*t.size+2*(o/4+1)+2}),e.map(function(t){$("<div/>").addClass("key").html(t).data("key",t).appendTo(n)}),$("<div/>").addClass("key").html("←").data("key","←").appendTo(n),$("<div/>").addClass("key").html("×").data("key","×").appendTo(n)},_createKeypad:function(){var that=this,element=this.element,o=this.options,keypad;element.hasClass("input-control")?(keypad=$("<div/>").addClass("keypad keypad-dropdown").css({position:"absolute","z-index":1e3,display:"none"}).appendTo(element),o.target=element.find("input"),element.on("click",function(t){"none"===keypad.css("display")?keypad.show():keypad.hide();var e=$(".keypad.keypad-dropdown");$.each(e,function(){$(this).is(keypad)||$(this).hide()}),t.stopPropagation()}),$("html").on("click",function(){$(".keypad.keypad-dropdown").hide();
})):(keypad=element,keypad.addClass("keypad")),o.target!==!1&&$(o.target).attr("readonly",!0),"dropdown"===keypad.parent().data("role")&&keypad.parent().css({top:"100%"}),this._keypad=keypad,this._shuffleKeys(),keypad.on("click",".key",function(e){var key=$(this),result;if(o.target){if("←"!==key.data("key")&&"×"!==key.data("key")){if(o.length&&$(o.target).val().length===o.length)return!1;$(o.target).val($(o.target).val()+""+key.data("key"))}else if("×"===key.data("key")&&$(o.target).val(""),"←"===key.data("key")){var val=$(o.target).val();$(o.target).val(val.substring(0,val.length-1))}o.target.trigger("change")}"function"==typeof o.onKey?o.onKey(key):"function"==typeof window[o.onKey]?window[o.onKey](key):(result=eval("(function(){"+o.onKey+"})"),result.call(key)),"function"==typeof o.onChange?o.onChange(o.target.val()):"function"==typeof window[o.onChange]?window[o.onChange](o.target.val()):(result=eval("(function(){"+o.onChange+"})"),result.call({value:o.target.val()})),o.shuffle&&that._shuffleKeys(),e.preventDefault(),e.stopPropagation()})},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.listview",{version:"3.0.0",options:{onExpand:function(t){},onCollapse:function(t){},onActivate:function(t){},onListClick:function(t){}},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),this._initList(),this._createEvents(),t.data("listview",this)},_initList:function(){var t=this.element,e=(this.options,t.find(".list-group"));$.each(e,function(){var t=$(this);t.hasClass("collapsed")&&t.find(".list-group-content").hide()})},_createEvents:function(){var that=this,element=this.element,o=this.options;element.on("click",".list-group-toggle",function(e){var toggle=$(this),parent=toggle.parent(),result;toggle.parent().hasClass("keep-open")||(parent.toggleClass("collapsed"),parent.hasClass("collapsed")?(toggle.siblings(".list-group-content").slideUp("fast"),"function"==typeof o.onCollapse?o.onCollapse(parent):"function"==typeof window[o.onCollapse]?window[o.onCollapse](parent):(result=eval("(function(){"+o.onCollapse+"})"),result.call(parent))):(toggle.siblings(".list-group-content").slideDown("fast"),"function"==typeof o.onExpand?o.onExpand(parent):"function"==typeof window[o.onExpand]?window[o.onExpand](parent):(result=eval("(function(){"+o.onExpand+"})"),result.call(parent))),e.preventDefault(),e.stopPropagation())}),element.on("click",".list",function(e){var list=$(this),result;element.find(".list").removeClass("active"),list.addClass("active"),"function"==typeof o.onActivate?o.onActivate(list):"function"==typeof window[o.onActivate]?window[o.onActivate](list):(result=eval("(function(){"+o.onActivate+"})"),result.call(list)),"function"==typeof o.onListClick?o.onListClick(list):"function"==typeof window[o.onListClick]?window[o.onListClick](list):(result=eval("(function(){"+o.onListClick+"})"),result.call(list)),e.preventDefault(),e.stopPropagation()})},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}});var _notify_container=!1,_notifies=[],Notify={_container:null,_notify:null,_timer:null,version:"3.0.0",options:{icon:"",caption:"",content:"",shadow:!0,width:"auto",height:"auto",style:!1,position:"right",timeout:3e3,keepOpen:!1,type:"default"},init:function(t){return this.options=$.extend({},this.options,t),this._build(),this},_build:function(){var t=this,e=this.options;if(this._container=_notify_container||$("<div/>").addClass("notify-container").appendTo("body"),_notify_container=this._container,""===e.content||void 0===e.content)return!1;if(this._notify=$("<div/>").addClass("notify"),"default"!==e.type&&this._notify.addClass(e.type),e.shadow&&this._notify.addClass("shadow"),e.style&&void 0!==e.style.background&&this._notify.css("background-color",e.style.background),e.style&&void 0!==e.style.color&&this._notify.css("color",e.style.color),""!==e.icon){$(e.icon).addClass("notify-icon").appendTo(this._notify)}""!==e.caption&&void 0!==e.caption&&$("<div/>").addClass("notify-title").html(e.caption).appendTo(this._notify),""!==e.content&&void 0!==e.content&&$("<div/>").addClass("notify-text").html(e.content).appendTo(this._notify);var n=$("<span/>").addClass("notify-closer").appendTo(this._notify);n.on("click",function(){t.close(0)}),"auto"!==e.width&&this._notify.css("min-width",e.width),"auto"!==e.height&&this._notify.css("min-height",e.height),this._notify.hide().appendTo(this._container).fadeIn("slow"),_notifies.push(this._notify),e.keepOpen||this.close(e.timeout)},close:function(t){var e=this;return void 0===t?this._hide():(setTimeout(function(){e._hide()},t),this)},_hide:function(){var t=this;return void 0!==this._notify?(this._notify.fadeOut("slow",function(){$(this).remove(),_notifies.splice(_notifies.indexOf(t._notify),1)}),this):!1},closeAll:function(){return _notifies.forEach(function(t){t.hide("slow",function(){t.remove(),_notifies.splice(_notifies.indexOf(t),1)})}),this}};return $.Notify=function(t){return Object.create(Notify).init(t)},$.Notify.show=function(t,e,n){return $.Notify({content:t,caption:e,icon:n})},$.widget("metro.panel",{version:"3.0.0",options:{onExpand:function(t){},onCollapse:function(t){}},_create:function(){var element=this.element,o=this.options;if($.each(element.data(),function(t,e){if(t in o)try{o[t]=$.parseJSON(e)}catch(n){o[t]=e}}),element.hasClass("collapsible")||element.addClass("collapsible"),element.hasClass("collapsible")){var toggle=element.children(".heading"),content=element.children(".content");toggle.on("click",function(){var result;element.hasClass("collapsed")?content.slideDown("fast",function(){element.removeClass("collapsed"),"function"==typeof o.onExpand?o.onExpand(element):"function"==typeof window[o.onExpand]?window[o.onExpand](element):(result=eval("(function(){"+o.onExpand+"})"),result.call(element))}):content.slideUp("fast",function(){element.addClass("collapsed"),"function"==typeof o.onCollapse?o.onCollapse(element):"function"==typeof window[o.onCollapse]?window[o.onCollapse](element):(result=eval("(function(){"+o.onCollapse+"})"),result.call(element))})})}element.data("panel",this)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.widget",{version:"1.0.0",options:{someValue:null},_create:function(){var t=this.element;this.options;this._setOptionsFromDOM(),t.data("widget",this)},_setOptionsFromDOM:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}})},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.popover",{version:"3.0.0",options:{popoverText:"",popoverTimeout:3e3,popoverPosition:"top",popoverBackground:"bg-cyan",popoverColor:"fg-white",popoverMode:"none",popoverShadow:!0,onPopup:function(t){}},popover:{},_create:function(){var t=this.element;this.createPopover(),t.data("popover",this)},createPopover:function(){var t,e=this,n=this.options;t=this.element,$.each(t.data(),function(t,e){if(t in n)try{n[t]=$.parseJSON(e)}catch(o){n[t]=e}});var o,i;switch(o=$("<div/>").addClass("popover").appendTo("body").hide(),$("<div/>").appendTo(o),n.popoverShadow&&o.addClass("popover-shadow"),n.popoverBackground&&("#"===n.popoverBackground[0]?o.css("background-color",n.popoverBackground):o.addClass(n.popoverBackground)),n.popoverColor&&("#"===n.popoverColor[0]?o.css("color",n.popoverColor):o.addClass(n.popoverColor)),n.popoverPosition){case"left":i="marker-on-right";break;case"right":i="marker-on-left";break;case"bottom":i="marker-on-top";break;default:i="marker-on-bottom"}o.css({position:"fixed"}),o.addClass(i),this.popover=o,this.setText(n.popoverText),t.on(n.popoverMode,function(t){o.data("visible")||e.show()}),$(window).scroll(function(){e.popover.data("visible")&&e.setPosition()})},setPosition:function(){var t=this.options,e=this.popover,n=this.element;return"top"===t.popoverPosition?e.css({top:n.offset().top-$(window).scrollTop()-e.outerHeight()-10,left:n.offset().left+n.outerWidth()/2-e.outerWidth()/2-$(window).scrollLeft()}):"bottom"===t.popoverPosition?e.css({top:n.offset().top-$(window).scrollTop()+n.outerHeight()+10,left:n.offset().left+n.outerWidth()/2-e.outerWidth()/2-$(window).scrollLeft()}):"right"===t.popoverPosition?e.css({top:n.offset().top+n.outerHeight()/2-e.outerHeight()/2-$(window).scrollTop(),left:n.offset().left+n.outerWidth()-$(window).scrollLeft()+10}):"left"===t.popoverPosition&&e.css({top:n.offset().top+n.outerHeight()/2-e.outerHeight()/2-$(window).scrollTop(),left:n.offset().left-e.outerWidth()-$(window).scrollLeft()-10}),this},setText:function(t){this.popover.children("div").html(t)},show:function(){var o=this.options,popover=this.popover;this.setPosition(),popover.fadeIn(function(){if(popover.data("visible",!0),"function"==typeof o.onPopup)o.onPopup(popover);else if("function"==typeof window[o.onPopup])window[o.onPopup](popover);else{var result=eval("(function(){"+o.onPopup+"})");result.call(popover)}setTimeout(function(){popover.fadeOut(function(){popover.data("visible",!1)})},o.popoverTimeout)})},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.preloader",{version:"3.0.0",options:{type:"ring",style:"light"},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),this._createStructure(),t.data("preloader",this)},_createRing:function(){var t,e,n,o=this.element;this.options;for(t=0;5>t;t++)e=$("<div/>").addClass("wrap").appendTo(o),n=$("<div/>").addClass("circle").appendTo(e)},_createMetro:function(){var t,e,n=this.element;this.options;for(t=0;5>t;t++)e=$("<div/>").addClass("circle").appendTo(n)},_createSquare:function(){var t,e,n=this.element;this.options;for(t=0;4>t;t++)e=$("<div/>").addClass("square").appendTo(n)},_createCycle:function(){var t,e=this.element;this.options;t=$("<div/>").addClass("cycle").appendTo(e)},_createStructure:function(){var t=this.element,e=this.options;switch(t.addClass("preloader-"+e.type),"light"!==e.style&&t.addClass(e.style+"-style"),t.html(""),e.type){case"ring":this._createRing();break;case"metro":this._createMetro();break;case"square":this._createSquare();break;case"cycle":this._createCycle()}},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.presenter",{version:"3.0.0",options:{height:"200",width:"100%",effect:"random",duration:1e3,timeout:2e3,sceneTimeout:2e3,easing:"swing"},_acts:void 0,_currentAct:0,_actDone:!0,_interval:void 0,_effects:["top","bottom","left","right"],_actor_positions:[],_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),this._createPresenter(),this._showScene(),t.data("presenter",this)},_createPresenter:function(){var t=this.element,e=this.options,n=t.find(".act");n.hide(),this._acts=n,t.css({height:e.height,width:e.width})},_showScene:function(){var t=this;this.element,this.options;this._interval=setInterval(function(){t._actDone&&(t._currentAct++,t._currentAct==t._acts.length&&(t._currentAct=0),t._showAct())},500)},_closeAct:function(){var t=this,e=(this.element,this.options),n=this._currentAct;setTimeout(function(){void 0!==t._acts[n]&&$(t._acts[n]).fadeOut(1e3,function(){t._actDone=!0})},e.sceneTimeout)},_showAct:function(){var t,e=this,n=this.element,o=this.options,i=$(this._acts[this._currentAct]),a=i.find(".actor");this._actDone=!1,i.fadeIn(1e3),a.css({opacity:0,position:"absolute",display:"none"}),t=0,$.each(a,function(){var i,s,r,l,d=$(this),c={top:d.data("position").split(",")[0],left:d.data("position").split(",")[1]};i=void 0!==d.data("effect")?d.data("effect"):o.effect,"random"===i&&(i=e._effects[Math.floor(Math.random()*e._effects.length)]),s=void 0!==d.data("duration")?d.data("duration"):o.duration,r=void 0!==d.data("timeout")?d.data("timeout"):o.timeout,l=void 0!==d.data("easing")?d.data("easing"):o.easing,"top"===i?setTimeout(function(){d.css({top:-n.height(),left:c.left,display:"block"}).animate({top:c.top,left:c.left,opacity:1},s,l,function(){d[0]==a[a.length-1]&&e._closeAct()})},t*r):"bottom"===i?setTimeout(function(){d.css({top:n.height(),left:c.left,display:"block"}).animate({top:c.top,left:c.left,opacity:1},s,l,function(){d[0]==a[a.length-1]&&e._closeAct()})},t*r):"left"===i?setTimeout(function(){d.css({left:-n.width(),top:c.top,display:"block"}).animate({top:c.top,left:c.left,opacity:1},s,l,function(){d[0]==a[a.length-1]&&e._closeAct()})},t*r):"right"===i?setTimeout(function(){d.css({left:n.width(),top:c.top,display:"block"}).animate({top:c.top,left:c.left,opacity:1},s,l,function(){d[0]==a[a.length-1]&&e._closeAct()})},t*r):setTimeout(function(){d.css({top:c.top,left:c.left,display:"block"}).animate({top:c.top,left:c.left,opacity:1},s,"swing",function(){d[0]==a[a.length-1]&&e._closeAct()})},t*r),t++})},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.progress",{version:"3.0.0",options:{color:"default",colors:!1,value:0,animate:!1,onProgress:function(t){}},colorsDim:{},_create:function(){var t=this,e=this.element,n=this.options,o=e.children(".bar:last-child");if(e.hasClass("progress")||e.addClass("progress"),$.each(e.data(),function(t,e){if(t in n)try{n[t]=$.parseJSON(e)}catch(o){n[t]=e}}),0===o.length&&(o=$("<div/>").addClass("bar").appendTo(e)),n.colors){var i=0;$.each(n.colors,function(e,n){t.colorsDim[e]=[i,n],i=n+1})}this.set(n.value),this.color(n.color),e.data("progress",this)},color:function(t){var e=this.element,n=this.options,o=e.children(".bar:last-child"),i=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);i?o.css({"background-color":t}):o.removeClass(function(t,e){return(e.match(/(^|\s)bg-\S+/g)||[]).join(" ")}).addClass(t),n.color=t},set:function(value){if(void 0===value)return this.options.value;var element=this.element,o=this.options,colors=this.colorsDim,bar=element.children(".bar:last-child"),that=this,gradient=[];if(!(parseInt(value)<0))if(o.colors&&$.each(colors,function(t,e){return value>=e[0]&&value<=e[1]?(that.color(t),!0):void 0}),o.value=value,o.animate!==!1){var ani_speed=isNaN(o.animate)?500:o.animate;bar.animate({width:o.value+"%"},ani_speed,function(){if("function"==typeof o.onProgress)o.onProgress(value);else if("function"==typeof window[o.onProgress])window[o.onProgress](value);else{var result=eval("(function(){"+o.onProgress+"})");result.call(value)}})}else if(bar.css({width:o.value+"%"}),"function"==typeof o.onProgress)o.onProgress(value);else if("function"==typeof window[o.onProgress])window[o.onProgress](value);else{var result=eval("(function(){"+o.onProgress+"})");result.call(value)}},value:function(t){return this.set(t)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.rating",{version:"3.0.0",options:{stars:5,value:0,half:!0,"static":!1,showScore:!0,scoreTitle:"Current: ",size:"default",colorRate:!1,onRate:function(t,e,n){return!0},onRated:function(t,e,n){}},_value:0,_values:[],_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),this._value=parseFloat(e.value),this._values[0]=Math.ceil(1*e.stars/3),this._values[1]=Math.ceil(2*e.stars/3),this._values[2]=e.stars,this._createRating(),this._createEvents(),this._setValue(this._value),this._setScore(this._value),t.data("rating",this)},_createRating:function(){var t,e,n,o=this.element,i=this.options;switch(o.hasClass("rating")||o.addClass("rating"),i.size){case"small":o.addClass("small");break;case"large":o.addClass("large")}for(i["static"]&&o.addClass("static"),t=0;t<i.stars;t++)e=$("<span/>").addClass("star").appendTo(o).data("star-value",t+1);i.showScore&&(n=$("<span/>").addClass("score").appendTo(o))},_createEvents:function(){var that=this,element=this.element,o=this.options,stars;stars=element.find(".star"),stars.on("click",function(e){if(o["static"]||element.hasClass("static")||element.data("static"))return!1;var result,value=$(this).data("star-value"),star=this,rating=that;if("function"==typeof o.onRate){if(!o.onRate(value,star,rating))return!1}else if("function"==typeof window[o.onRate]){if(!window[o.onRate](value,star,rating))return!1}else if(result=eval("(function(){"+o.onRate+"})"),!result.call(value,star,rating))return!1;"function"==typeof o.onRated?o.onRated(value,star,rating):"function"==typeof window[o.onRated]?window[o.onRated](value,star,rating):(result=eval("(function(){"+o.onRated+"})"),result.call(value,star,rating)),that._value=$(this).data("star-value"),that._setValue(),that._setScore(),e.preventDefault(),e.stopPropagation()})},_setValue:function(){var t,e=this.options,n=this.element;if(e.stars){t=n.find(".star").removeClass("on half");var o=Math.floor(this._value)-1,i=10*(this._value-Math.floor(this._value))>0;$(t[o]).addClass("on"),$(t[o]).prevAll().addClass("on"),i&&$(t[o]).next().addClass("on half")}e.colorRate&&(n.removeClass("poor regular good"),this._value<=this._values[0]?n.addClass("poor"):this._value>this._values[0]&&this._value<=this._values[1]?n.addClass("regular"):this._value>this._values[1]&&n.addClass("good"))},_setScore:function(){var t=this._value,e=this.element,n=this.options;void 0!==t&&e.find(".score").html(n.scoreTitle+t)},value:function(t){return void 0===t?this._value:(this._value=t,this._setValue(),this._setScore(),void 0)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.select",{version:"3.0.0",options:{},_create:function(){var t=this.element,e=this.options,n=["templateResult","templateSelection","matcher","initSelection","query"];if($.each(t.data(),function(t,n){try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),n.map(function(t,n){void 0!==e[t]&&(e[t]=window[e[t]])}),void 0!==e.dropdownParent&&(e.dropdownParent=$(e.dropdownParent)),$().select2)try{t.find("select").select2(e)}catch(o){}else console.log("You are trying to use support for Select2, but the plugin is not found!");t.data("select",this)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.slider",{version:"3.0.14",options:{position:0,buffer:0,accuracy:0,color:"default",completeColor:"default",bufferColor:"default",markerColor:"default",colors:!1,showHint:!1,permanentHint:!1,hintPosition:"top",vertical:!1,min:0,max:100,animate:!1,minValue:0,maxValue:100,currValue:0,returnType:"value",target:!1,onStartChange:function(){},onChange:function(t,e){},onChanged:function(t,e){},onBufferChange:function(t,e){},_slider:{vertical:!1,offset:0,length:0,marker:0,ppp:0,start:0,stop:0}},_create:function(){var that=this,element=this.element,o=this.options,s=o._slider;$.each(element.data(),function(t,e){if(t in o)try{o[t]=$.parseJSON(e)}catch(n){o[t]=e}}),element.data("internal_id",uniqueId()),o.accuracy=o.accuracy<0?0:o.accuracy,o.min=o.min<0?0:o.min,o.min=o.min>o.max?o.max:o.min,o.max=o.max>100?100:o.max,o.max=o.max<o.min?o.min:o.max,o.position=this._correctValue(element.data("position")>o.min?element.data("position")>o.max?o.max:element.data("position"):o.min),o.buffer=this._correctValue(element.data("buffer")>o.min?element.data("buffer")>o.max?o.max:element.data("buffer"):o.min),o.colors=o.colors?o.colors.split(","):!1,s.vertical=o.vertical,o.vertical&&!element.hasClass("vertical")&&element.addClass("vertical"),o.permanentHint&&!element.hasClass("permanent-hint")&&element.addClass("permanent-hint"),o.vertical||"bottom"!==o.hintPosition||element.addClass("hint-bottom"),o.vertical&&"left"===o.hintPosition&&element.addClass("hint-left"),this._createSlider(),this._initPoints(),this._placeMarker(o.position),this._showBuffer(o.buffer);var event_down=isTouchDevice()?"touchstart":"mousedown";o.target&&"INPUT"==$(o.target)[0].tagName&&$(o.target).on("keyup",function(){var t=void 0!==this.value?this.value:0,e=Math.min(t,o.maxValue);that._placeMarker(that._realValueToValue(e))}),element.children(".marker").on(event_down,function(e){if(that._startMoveMarker(e),"function"==typeof o.onStartChange)o.onStartChange();else if("function"==typeof window[o.onStartChange])window[o.onStartChange]();else{var result=eval("(function(){"+o.onStartChange+"})");result.call()}e.preventDefault(),e.stopPropagation()}),element.on(event_down,function(t){t.preventDefault(),that._startMoveMarker(t)}),element.data("slider",this)},_startMoveMarker:function(e){var element=this.element,o=this.options,that=this,hint=element.children(".slider-hint"),returnedValue,event_move=isTouchDevice()?"touchmove":"mousemove",event_up=isTouchDevice()?"touchend":"mouseup mouseleave";$(document).on(event_move,function(t){that._movingMarker(t),element.hasClass("permanent-hint")||hint.css("display","block")}),$(document).on(event_up,function(){if($(document).off(event_move),$(document).off(event_up),element.data("value",o.position),element.trigger("changed",o.position),element.trigger("change",o.position),returnedValue="value"===o.returnType?that._valueToRealValue(o.position):o.position,element.hasClass("permanent-hint")||hint.css("display","none"),"function"==typeof o.onChanged)o.onChanged(returnedValue,element);else if("function"==typeof window[o.onChanged])window[o.onChanged](returnedValue,element);else{var result=eval("(function(){"+o.onChanged+"})");result.call(returnedValue,element)}}),this._initPoints(),this._movingMarker(e)},_movingMarker:function(ev){var element=this.element,o=this.options,cursorPos,percents,valuePix,vertical=o._slider.vertical,sliderOffset=o._slider.offset,sliderStart=o._slider.start,sliderEnd=o._slider.stop,sliderLength=o._slider.length,markerSize=o._slider.marker,event=isTouchDevice()?ev.originalEvent.touches[0]:ev.originalEvent;cursorPos=vertical?event.pageY-sliderOffset:event.pageX-sliderOffset,sliderStart>cursorPos?cursorPos=sliderStart:cursorPos>sliderEnd&&(cursorPos=sliderEnd),valuePix=vertical?sliderLength-cursorPos-markerSize/2:cursorPos-markerSize/2,percents=this._pixToPerc(valuePix),this._placeMarker(percents),o.currValue=this._valueToRealValue(percents),o.position=percents;var returnedValue="value"===o.returnType?this._valueToRealValue(o.position):o.position;if(o.target&&("INPUT"==$(o.target)[0].tagName?$(o.target).val(returnedValue):$(o.target).html(returnedValue),$(o.target).trigger("change",returnedValue)),"function"==typeof o.onChange)o.onChange(returnedValue,element);else if("function"==typeof window[o.onChange])window[o.onChange](returnedValue,element);else{var result=eval("(function(){"+o.onChange+"})");result.call(returnedValue,element)}},_placeMarker:function(t){var e,n,o,i,a,s=this.options,r=0,l=(this.element,this.element.children(".marker")),d=this.element.children(".complete"),c=this.element.children(".slider-hint"),u=this._percToPix(s.position);if(o=s.colors.length,i=s._slider.length/o,s._slider.vertical){var h=this._percToPix(s.position)+s._slider.marker,p=s._slider.length-h;e=this._percToPix(t)+s._slider.marker/2,n=s._slider.length-e,this._animate(l.css("top",p),{top:n}),this._animate(d.css("height",h),{height:e}),o&&(r=Math.round(e/i)-1,d.css("background-color",s.colors[0>r?0:r])),s.showHint&&(a=this._valueToRealValue(t),c.html(a).css("top",n-l.height()/2-c.height()/4))}else e=this._percToPix(t),this._animate(l.css("left",u),{left:e}),this._animate(d.css("width",u),{width:e}),o&&(r=Math.round(e/i)-1,d.css("background-color",s.colors[0>r?0:r])),s.showHint&&(a=this._valueToRealValue(t),c.html(a).css("left",e-l.width()/2))},_valueToRealValue:function(t){var e,n=this.options,o=(n.maxValue-n.minValue)/100;return e=t*o+n.minValue,Math.round(e)},_realValueToValue:function(t){var e,n=this.options,o=(n.maxValue-n.minValue)/100;return e=t/o+n.minValue,Math.round(e)},_animate:function(t,e){var n=this.options;n.animate?t.stop(!0).animate(e):t.css(e)},_pixToPerc:function(t){var e;return e=(0>t?0:t)*this.options._slider.ppp,Math.round(this._correctValue(e))},_percToPix:function(t){return 0===this.options._slider.ppp?0:Math.round(t/this.options._slider.ppp)},_correctValue:function(t){var e=this.options,n=e.accuracy,o=e.max,i=e.min;return 0===n?t:t===o?o:t===i?i:(t=Math.floor(t/n)*n+Math.round(t%n/n)*n,t>o?o:i>t?i:t)},_initPoints:function(){var t=this.options,e=t._slider,n=this.element;e.vertical?(e.offset=n.offset().top,e.length=n.height(),e.marker=n.children(".marker").height()):(e.offset=n.offset().left,e.length=n.width(),e.marker=n.children(".marker").width()),e.ppp=t.max/(e.length-e.marker),e.start=e.marker/2,e.stop=e.length-e.marker/2},_createSlider:function(){var t,e,n,o,i,a=this.element,s=this.options;a.html(""),i=$("<div/>").addClass("slider-backside").appendTo(a),t=$("<div/>").addClass("complete").appendTo(a),o=$("<div/>").addClass("buffer").appendTo(a),e=$("<a/>").addClass("marker").appendTo(a),s.showHint&&(n=$("<span/>").addClass("slider-hint").appendTo(a)),"default"!==s.color&&(s.color.isColor()?i.css("background-color",s.color):i.addClass(s.color)),"default"!==s.completeColor&&(s.completeColor.isColor()?t.css("background-color",s.completeColor):t.addClass(s.completeColor)),"default"!==s.bufferColor&&(s.bufferColor.isColor()?o.css("background-color",s.bufferColor):o.addClass(s.bufferColor)),"default"!==s.markerColor&&(s.markerColor.isColor()?e.css("background-color",s.markerColor):e.addClass(s.markerColor))},value:function(value){var element=this.element,o=this.options,returnedValue;if("undefined"!=typeof value){if(value=value>o.max?o.max:value,value=value<o.min?o.min:value,this._placeMarker(parseInt(value)),o.position=parseInt(value),returnedValue="value"===o.returnType?this._valueToRealValue(o.position):o.position,o.target&&("INPUT"==$(o.target)[0].tagName?$(o.target).val(returnedValue):$(o.target).html(returnedValue),$(o.target).trigger("change",returnedValue)),"function"==typeof o.onChange)o.onChange(returnedValue,element);else if("function"==typeof window[o.onChange])window[o.onChange](returnedValue,element);else{var result=eval("(function(){"+o.onChange+"})");result.call(returnedValue,element)}return this}return returnedValue="value"===o.returnType?this._valueToRealValue(o.position):o.position},_showBuffer:function(t){var e,n,o=this.options,i=(this.element,this.element.children(".buffer"));n=o.buffer,e=100==t?99.9:t,o._slider.vertical?this._animate(i.css("height",n+"%"),{height:e+"%"}):this._animate(i.css("width",n+"%"),{width:e+"%"})},buffer:function(value){var element=this.element,o=this.options,returnedValue;if("undefined"!=typeof value){if(value=value>100?100:value,value=0>value?0:value,this._showBuffer(parseInt(value)),o.buffer=parseInt(value),returnedValue=o.buffer,"function"==typeof o.onBufferChange)o.onBufferChange(returnedValue,element);else if("function"==typeof window[o.onBufferChange])window[o.onBufferChange](returnedValue,element);else{var result=eval("(function(){"+o.onBufferChange+"})");result.call(returnedValue,element)}return this}return returnedValue=o.buffer},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.stepper",{version:"3.0.0",options:{steps:3,start:1,type:"default",clickable:!0,onStep:function(t,e){},onStepClick:function(t,e){}},_create:function(){var t=this.element,e=this.options,n=t.attr("id");$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),t.hasClass("stepper")||t.addClass("stepper"),void 0===n&&(n=window.uniqueId(this.widgetName+"_"),t.attr("id",n)),this._createStepper(),e.clickable&&this._createEvents(),this._positioningSteps(),this._stepTo(e.start),t.data("stepper",this)},_createEvents:function(){var that=this,element=this.element,o=this.options;element.on("click","li",function(e){var step=$(this).data("step");if("function"==typeof o.onStepClick)o.onStepClick(step-1,step);else if("function"==typeof window[o.onStepClick])window[o.onStepClick](step-1,step);else{var result=eval("(function(){"+o.onStepClick+"})");result.call(step-1,step)}element.trigger("stepclick",step)})},_createStepper:function(){var t,e,n,o=this.element,i=this.options;switch(e=$("<ul/>"),i.type){case"diamond":o.addClass("diamond");break;case"cycle":o.addClass("cycle")}for(t=0;t<i.steps;t++)n=$("<li/>").data("step",t+1).appendTo(e);e.appendTo(o)},_positioningSteps:function(){var t=this.element,e=(this.options,t.find("li")),n=t.width(),o=e.length-1,i=$(e[0]).width();$.each(e,function(t,e){var a=0===t?0:(n-i)/o*t;console.log(n),$(e).animate({left:a})})},_stepTo:function(step){var element=this.element,o=this.options,steps=element.find("li");steps.removeClass("current").removeClass("complete"),$.each(steps,function(i,s){if(step-1>i&&$(s).addClass("complete"),i===step-1)if($(s).addClass("current"),"function"==typeof o.onStep)o.onStep(i+1,s);else if("function"==typeof window[o.onStep])window[o.onStep](i+1,s);else{var result=eval("(function(){"+o.onStep+"})");result.call(i+1,s)}})},stepTo:function(t){this._stepTo(t)},first:function(){var t=this.options;t.start=1,this._stepTo(t.start)},last:function(){var t=this.element,e=this.options,n=t.find("li");e.start=n.length,this._stepTo(e.start)},next:function(){var t=this.element,e=this.options,n=t.find("li");e.start+1>n.length||(e.start++,this._stepTo(e.start))},prior:function(){var t=this.options;t.start-1!==0&&(t.start--,this._stepTo(t.start))},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.streamer",{version:"3.0.0",options:{scrollBar:!1,meterStart:9,meterStop:19,meterInterval:20,slideToTime:"default",slideSleep:1e3,slideSpeed:1e3,onClick:function(t){}},_create:function(){var t=this.element,e=this.options,n=t.find(".stream"),o=t.find(".event"),i=t.find(".events"),a=t.find(".events-area"),s=t.find(".event-group"),r=t.find(".event-stream");$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),t.data("streamSelect",-1);var l,d,c,u=$("<ul/>").addClass("meter"),h=e.meterStart,p=e.meterStop,f=e.meterInterval,m=[];for(l=h;p>l;l++)for(d=0;60>d;d+=f)c=(10>l?"0"+l:l)+":"+(10>d?"0"+d:d),$("<li/>").addClass("js-interval-"+c.replace(":","-")).html("<em>"+c+"</em>").appendTo(u),m.push(c);t.data("intervals",m),u.insertBefore(t.find(".events-grid")),t.find(".event-stream").each(function(t,e){var o=0,i=$(e).find(".event");i.each(function(t,e){o+=$(e).outerWidth()+parseInt($(e).css("margin-left"))}),$(e).css({width:o+2*(i.length-1)+1}),$(e).find(".time").css("background-color",$(n[t]).css("background-color"))}),i.css({"overflow-x":e.scrollBar?"scroll":"hidden"}),t.css({height:t.find(".streams").outerHeight()+(e.scrollBar?20:0)});var v=0;s.each(function(t,e){v+=$(e).outerWidth()}),v+=2*(s.length-1)+10,a.css("width",v),o.each(function(t,e){addTouchEvents(e)}),t.mousewheel(function(t,e){var n=50*e;return i.scrollLeft(i.scrollLeft()-n),!1}),n.each(function(e,n){$(n).mousedown(function(n){t.data("streamSelect")==e?(o.removeClass("event-disable"),t.data("streamSelect",-1)):(t.data("streamSelect",e),o.addClass("event-disable"),$(r[e]).find(".event").removeClass("event-disable"))})}),this._createEvents(),this.slideToTime(e.slideToTime,e.slideSleep,e.slideSpeed),t.data("streamer",this)},_createEvents:function(){var that=this,element=this.element,o=this.options,events=element.find(".event");events.on("click",function(e){var event=$(this);if(e.ctrlKey&&$(this).toggleClass("selected"),"function"==typeof o.onClick)o.onClick(event);else if("function"==typeof window[o.onClick])window[o.onClick](event);else{var result=eval("(function(){"+o.onClick+"})");result.call(event)}e.preventDefault()}),element.find(".js-go-previous-time").on("click",function(t){var e=element.data("intervals").indexOf(element.data("current-time"));if(0!=e){e--;var n=element.data("intervals")[e];that.slideToTime(n,0,o.slideSpeed)}}),element.find(".js-go-next-time").on("click",function(t){var e=element.data("intervals").indexOf(element.data("current-time"));if(e!=element.data("intervals").length-1){e++;var n=element.data("intervals")[e];that.slideToTime(n,0,o.slideSpeed)}}),element.find(".js-show-all-streams").on("click",function(t){
element.find(".event").removeClass("event-disable"),element.data("streamSelect",-1),t.preventDefault()}),element.find(".js-schedule-mode").on("click",function(t){$(this).toggleClass("active"),element.data("schedule-mode",$(this).hasClass("inverse")),t.preventDefault()})},slideToTime:function(t,e,n){var o,i,a=this,s=this.element;"default"===t?(o=s.find(".meter li")[0],t=o.className.replace("js-interval-","").replace("-",":")):(i=t.split(":"),1===i[0].length&&(t="0"+t)),o=s.find(".meter li.js-interval-"+t.replace(":","-"))[0],setTimeout(function(){s.find(".events").animate({scrollLeft:o.offsetLeft-$(".streams").width()},n,function(){a._afterSlide()})},e),s.data("current-time",t)},_afterSlide:function(){},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.tabcontrol",{version:"3.0.0",options:{openTarget:!1,saveState:!1,onTabClick:function(t){return!0},onTabChange:function(t){},_current:{tab:!1,frame:!1}},_create:function(){var t,e,n,o=this.element,i=this.options,a=o.children(".tabs").find("li").children("a");o.children(".frames").children("div");if($.each(o.data(),function(t,e){if(t in i)try{i[t]=$.parseJSON(e)}catch(n){i[t]=e}}),i.saveState&&void 0!==o.attr("id")&&""!==o.attr("id").trim()){var s=window.localStorage.getItem(o.attr("id")+"-stored-tab");s&&"undefined"!==s&&(t=o.find("a[href='"+s+"']"),t&&(e=t.attr("href"),n=e&&e.isUrl()?!1:$(e),i._current.tab=t,i._current.frame=n))}if(i._current.tab||i.openTarget===!1||(t=o.find("a[href='"+i.openTarget+"']"),t&&(e=t.attr("href"),n=e&&e.isUrl()?!1:$(e),i._current.tab=t,i._current.frame=n)),i._current.tab||$.each(a,function(t,e){var n=$(e),o=n.attr("href"),a=o.isUrl()?!1:$(o);n.parent().hasClass("active")&&!n.parent().hasClass("disabled")&&a!==!1&&(i._current.tab=n,i._current.frame=a)}),!i._current.tab)for(var r=0;r<a.length;r++)if(!$(a[r]).attr("href").isUrl()&&!$(a[r]).parent().hasClass("disabled")){i._current.tab=$(a[r]),i._current.frame=$($(a[r]).attr("href"));break}this._createEvents(),this._openTab(),o.data("tabcontrol",this)},_hideTabs:function(){var t=this.element,e=t.outerWidth(),n=t.children(".tabs").find("li:not(.non-visible-tabs)"),o=t.children(".tabs").find(".non-visible-tabs").children(".d-menu");$.each(n,function(){var t=$(this),n=this;if(n.offsetLeft+n.offsetWidth+30>e){var i=t.clone(!0);i.appendTo(o),t.remove()}})},_openTab:function(){var t=this.element,e=this.options,n=t.children(".tabs").find("li").children("a"),o=t.children(".frames").children("div");n.parent().removeClass("active"),o.hide(),e._current.tab.parent().addClass("active"),e._current.frame.show(),e.saveState&&void 0!==t.attr("id")&&""!==t.attr("id").trim()&&window.localStorage.setItem(t.attr("id")+"-stored-tab",e._current.tab.attr("href"))},_createEvents:function(){var that=this,element=this.element,o=this.options,tabs=element.children(".tabs").find("li").children("a"),frames=element.children(".frames").children("div");element.on("click",".tabs > li > a",function(e){var result,tab=$(this),target=tab.attr("href"),frame=$(target);if(tab.parent().hasClass("disabled"))return!1;if("function"==typeof o.onTabClick){if(!o.onTabClick(tab))return!1}else if("function"==typeof window[o.onTabClick]){if(!window[o.onTabClick](tab))return!1}else if(result=eval("(function(){"+o.onTabClick+"})"),!result.call(tab))return!1;return target.isUrl()?(window.location.href=target,!0):(o._current.tab=tab,o._current.frame=frame,that._openTab(),"function"==typeof o.onTabChange?o.onTabChange(tab):"function"==typeof window[o.onTabChange]?window[o.onTabChange](tab):(result=eval("(function(){"+o.onTabChange+"})"),result.call(tab)),e.preventDefault(),void e.stopPropagation())})},hideTab:function(t){},showTab:function(t){},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.tile",{version:"3.0.0",options:{effect:"slideLeft",period:4e3,duration:700,easing:"doubleSqrt",onClick:function(t){}},_frames:{},_currentIndex:0,_interval:0,_outPosition:0,_size:{},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),this._createTransformTile(),this._createLiveTile(),this._createEvents(),t.data("tile",this)},_createEvents:function(){var that=this,element=this.element,o=this.options,event=isTouchDevice()?"touchstart":"click";element.on(event,function(e){if("A"===element[0].tagName);else if("function"==typeof o.onClick)o.onClick(element);else if("function"==typeof window[o.onClick])window[o.onClick](element);else{var result=eval("(function(){"+o.onClick+"})");result.call(element)}})},_createLiveTile:function(){var t=this,e=this.element,n=(this.options,isTouchDevice()?"touchstart":"mouseenter"),o=isTouchDevice()?"touchend":"mouseleave";return this._frames=e.find(".live-slide"),this._frames.length<=1?!1:($.easing.doubleSqrt=function(t){return Math.sqrt(Math.sqrt(t))},this._size={width:e.width(),height:e.height()},e.on(n,function(){t.stop()}),e.on(o,function(){t.start()}),void this.start())},start:function(){var t=this;this._interval=setInterval(function(){t._animate()},this.options.period)},stop:function(){clearInterval(this._interval)},_animate:function(){var t,e=this._frames[this._currentIndex];switch(this._currentIndex+=1,this._currentIndex>=this._frames.length&&(this._currentIndex=0),t=this._frames[this._currentIndex],this.options.effect){case"slideLeft":this._effectSlideLeft(e,t);break;case"slideRight":this._effectSlideRight(e,t);break;case"slideDown":this._effectSlideDown(e,t);break;case"slideUpDown":this._effectSlideUpDown(e,t);break;case"slideLeftRight":this._effectSlideLeftRight(e,t);break;default:this._effectSlideUp(e,t)}},_effectSlideLeftRight:function(t,e){this._currentIndex%2===0?this._effectSlideLeft(t,e):this._effectSlideRight(t,e)},_effectSlideUpDown:function(t,e){this._currentIndex%2===0?this._effectSlideUp(t,e):this._effectSlideDown(t,e)},_effectSlideUp:function(t,e){var n=this._size.height,o={duration:this.options.duration,easing:this.options.easing};$(t).animate({top:-n},o),$(e).css({top:n}).show().animate({top:0},o)},_effectSlideDown:function(t,e){var n=this._size.height,o={duration:this.options.duration,easing:this.options.easing};$(t).animate({top:n},o),$(e).css({top:-n}).show().animate({top:0},o)},_effectSlideLeft:function(t,e){var n=this._size.width,o={duration:this.options.duration,easing:this.options.easing};$(t).animate({left:-1*n},o),$(e).css({left:n}).show().animate({left:0},o)},_effectSlideRight:function(t,e){var n=this._size.width,o={duration:this.options.duration,easing:this.options.easing};$(t).animate({left:n},o),$(e).css({left:-n}).show().animate({left:0},o)},_createTransformTile:function(){var t=this.element,e=(this.options,{w:t.width(),h:t.height()}),n=isTouchDevice()?"touchstart":"mousedown",o=isTouchDevice()?"touchend":"mouseup",i=isTouchDevice()?"touchend":"mouseleave";t.on(n,function(n){var o=n.pageX-$(this).offset().left,i=n.pageY-$(this).offset().top,a="top";o<1*e.w/3&&(i<1*e.h/2||i>1*e.h/2)?a="left":o>2*e.w/3&&(i<1*e.h/2||i>1*e.h/2)?a="right":o>1*e.w/3&&o<2*e.w/3&&i>e.h/2&&(a="bottom"),$(this).addClass("tile-transform-"+a),"A"===t[0].tagName&&t.attr("href")&&setTimeout(function(){document.location.href=t.attr("href")},500)}),t.on(o,function(){$(this).removeClass("tile-transform-left").removeClass("tile-transform-right").removeClass("tile-transform-top").removeClass("tile-transform-bottom")}),t.on(i,function(){$(this).removeClass("tile-transform-left").removeClass("tile-transform-right").removeClass("tile-transform-top").removeClass("tile-transform-bottom")})},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.treeview",{version:"3.0.0",options:{doubleClick:!0,onClick:function(t,e,n,o){},onInputClick:function(t,e,n,o){},onExpand:function(t,e,n,o){},onCollapse:function(t,e,n,o){}},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),this._initTree(),this._createEvents(),t.data("treeview",this)},_createCheckbox:function(t,e){var n,o,i;n=$("<label/>").addClass("input-control checkbox small-check").insertBefore(t),o=$("<input/>").attr("type","checkbox").appendTo(n),i=$("<span/>").addClass("check").appendTo(n),void 0!==e.data("name")&&o.attr("name",e.data("name")),void 0!==e.data("id")&&o.attr("id",e.data("id")),void 0!==e.data("checked")&&o.prop("checked",e.data("checked")),void 0!==e.data("readonly")&&o.prop("disabled",e.data("readonly")),void 0!==e.data("disabled")&&(o.prop("disabled",e.data("disabled")),e.data("disabled")===!0&&e.addClass("disabled")),void 0!==e.data("value")&&o.val(e.data("value"))},_createRadio:function(t,e){var n,o,i;n=$("<label/>").addClass("input-control radio small-check").insertBefore(t),o=$("<input/>").attr("type","radio").appendTo(n),i=$("<span/>").addClass("check").appendTo(n),void 0!==e.data("name")&&o.attr("name",e.data("name")),void 0!==e.data("id")&&o.attr("id",e.data("id")),void 0!==e.data("checked")&&o.prop("checked",e.data("checked")),void 0!==e.data("readonly")&&o.prop("disabled",e.data("readonly")),void 0!==e.data("disabled")&&(o.prop("disabled",e.data("disabled")),e.data("disabled")===!0&&e.addClass("disabled")),void 0!==e.data("value")&&o.val(e.data("value"))},_initTree:function(){var t=this,e=this.element,n=(this.options,e.find(".leaf"));$.each(n,function(){var e=$(this),n=e.parent("li"),o=e.siblings("ul");$(e.parents(".node")[0]);"checkbox"===n.data("mode")&&t._createCheckbox(e,n),"radio"===n.data("mode")&&t._createRadio(e,n),o.length>0&&(n.hasClass("node")||n.addClass("node")),n.hasClass("collapsed")&&o.hide()})},_renderChecks:function(t){var e=this.element,n=(this.options,t.is(":checked")),o=$(t.parent().parent()),i=o.children("ul").find('[type="checkbox"]');i.prop("checked",n).removeClass("indeterminate"),$.each(e.find(".node[data-mode=checkbox]").reverse(),function(){var t=$(this),e=t.children(".input-control").find('[type="checkbox"]'),n=t.children("ul").find('[type="checkbox"]'),o=t.children("ul").find('[type="checkbox"]:checked');e.removeClass("indeterminate"),0===o.length?(e.prop("checked",!1),e.removeClass("indeterminate")):o.length>0&&n.length>o.length&&(e.prop("checked",!0),e.addClass("indeterminate"))})},_createEvents:function(){var that=this,element=this.element,o=this.options;element.on("change","input:checkbox",function(){that._renderChecks($(this))}),element.on("click","input",function(){var leaf=$(this),node=$(leaf.parents(".node")[0]),parent=leaf.parent("li"),check=leaf.siblings(".input-control").find("input:checkbox"),radio=leaf.siblings(".input-control").find("input:radio"),new_check_state,check_disabled;if(check.length>0&&(new_check_state=!check.is(":checked"),check_disabled=check.is(":disabled"),check_disabled||check.prop("checked",new_check_state),that._renderChecks(check)),radio.length>0&&(check_disabled=radio.is(":disabled"),check_disabled||radio.prop("checked",!0)),"function"==typeof o.onInputClick)o.onInputClick(leaf,parent,node,that);else if("function"==typeof window[o.onInputClick])window[o.onInputClick](leaf,parent,node,that);else{var result=eval("(function(){"+o.onInputClick+"})");result.call(leaf,parent,node,that)}}),element.on("click",".leaf",function(){var leaf=$(this),node=$(leaf.parents(".node")[0]),parent=leaf.parent("li");if(element.find(".leaf").parent("li").removeClass("active"),parent.addClass("active"),"function"==typeof o.onClick)o.onClick(leaf,parent,node,that);else if("function"==typeof window[o.onClick])window[o.onClick](leaf,parent,node,that);else{var result=eval("(function(){"+o.onClick+"})");result.call(leaf,parent,node,that)}}),o.doubleClick&&element.on("dblclick",".leaf",function(e){var leaf=$(this),parent=leaf.parent("li"),node=$(leaf.parents(".node")[0]),result;return parent.hasClass("keep-open")?!1:(parent.toggleClass("collapsed"),parent.hasClass("collapsed")?(parent.children("ul").fadeOut("fast"),"function"==typeof o.onCollapse?o.onCollapse(parent,leaf,node,that):"function"==typeof window[o.onCollapse]?window[o.onCollapse](parent,leaf,node,that):(result=eval("(function(){"+o.onCollapse+"})"),result.call(parent,leaf,node,that))):(parent.children("ul").fadeIn("fast"),"function"==typeof o.onExpand?o.onExpand(parent,leaf,node,that):"function"==typeof window[o.onExpand]?window[o.onExpand](parent,leaf,node,that):(result=eval("(function(){"+o.onExpand+"})"),result.call(parent,leaf,node,that))),e.stopPropagation(),void e.preventDefault())}),element.on("click",".node-toggle",function(e){var leaf=$(this).siblings(".leaf"),parent=$(this).parent("li"),node=$(leaf.parents(".node")[0]),result;return parent.hasClass("keep-open")?!1:(parent.toggleClass("collapsed"),parent.hasClass("collapsed")?(parent.children("ul").fadeOut("fast"),"function"==typeof o.onCollapse?o.onCollapse(parent,leaf,node,that):"function"==typeof window[o.onCollapse]?window[o.onCollapse](parent,leaf,node,that):(result=eval("(function(){"+o.onCollapse+"})"),result.call(parent,leaf,node,that))):(parent.children("ul").fadeIn("fast"),"function"==typeof o.onExpand?o.onExpand(parent,leaf,node,that):"function"==typeof window[o.onExpand]?window[o.onExpand](parent,leaf,node,that):(result=eval("(function(){"+o.onExpand+"})"),result.call(parent,leaf,node,that))),e.stopPropagation(),void e.preventDefault())})},addLeaf:function(t,e,n){var o,i,a,s=this.element;if(t&&("LI"===t[0].tagName&&t.addClass("node"),0===t.children(".node-toggle").length&&$("<span/>").addClass("node-toggle").appendTo(t)),a=t?$(t).children("ul"):s.children("ul"),0===a.length&&(a=$("<ul/>").appendTo(t?t:s)),i=$("<li/>").appendTo(a),o=void 0!==n&&void 0!==n.tagName?$("<"+n.tagName+"/>").addClass("leaf").appendTo(i):$("<span/>").addClass("leaf").appendTo(i),o.html(e),void 0!==n&&($.each(n,function(t,e){i.attr("data-"+t,e)}),void 0!==n.mode))switch(n.mode){case"checkbox":this._createCheckbox(o,i);break;case"radio":this._createRadio(o,i)}return i},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.validator",{version:"1.0.0",options:{showErrorState:!0,showErrorHint:!0,showRequiredState:!0,showSuccessState:!0,hintSize:0,hintBackground:"#FFFCC0",hintColor:"#000000",hideError:2e3,hideHint:5e3,hintEasing:"easeInQuad",hintEasingTime:400,hintMode:"hint",hintPosition:"right",focusInput:!0,onBeforeSubmit:function(t,e){return!0},onErrorInput:function(t){},onSubmit:function(t){return!0}},_scroll:0,funcs:{required:function(t){return""!==t.trim()},minlength:function(t,e){return void 0==e||isNaN(e)||0>=e?!1:t.trim().length>=e},maxlength:function(t,e){return void 0==e||isNaN(e)||0>=e?!1:t.trim().length<=e},min:function(t,e){return void 0==e||isNaN(e)?!1:""===t.trim()?!1:isNaN(t)?!1:t>=e},max:function(t,e){return void 0==e||isNaN(e)?!1:""===t.trim()?!1:isNaN(t)?!1:e>=t},email:function(t){return/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i.test(t)},url:function(t){return/^(?:[a-z]+:)?\/\//i.test(t)},date:function(t){return!("Invalid Date"===new Date(t)||isNaN(new Date(t)))},number:function(t){return t-0==t&&(""+t).trim().length>0},digits:function(t){return/^\d+$/.test(t)},hexcolor:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},pattern:function(t,e){if(void 0==e)return!1;var n=new RegExp(e);return n.test(t)}},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),"line"!==e.hintMode&&(e.hintMode="hint2"),this._scroll=$(window).scrollTop(),this._createValidator(),t.data("validator",this)},_createValidator:function(){var t=this,e=this.element,n=this.options,o=e.find("[data-validate-func]");e.attr("novalidate","novalidate"),n.showRequiredState&&$.each(o,function(){var t=$(this);t.parent().hasClass("input-control")?t.parent().addClass("required"):t.addClass("required")}),o.on("focus",function(){}),$(window).scroll(function(t){var e=$(this).scrollTop(),n=isNaN(e-this._scroll)?0:e-this._scroll;$(".validator-hint.hint2").css({top:"-="+n}),this._scroll=e}),e[0].onsubmit?(this._onsubmit=e[0].onsubmit,e[0].onsubmit=null):this._onsubmit=null,e[0].onsubmit=function(){return t._submit()}},_submit:function(){var that=this,element=this.element,o=this.options,inputs=element.find("[data-validate-func]"),submit=element.find(":submit").attr("disabled","disabled").addClass("disabled"),result=0;if($(".validator-hint").hide(),inputs.removeClass("error success"),$.each(inputs,function(t,e){var n=$(e);n.parent().hasClass("input-control")&&n.parent().removeClass("error success")}),$.each(inputs,function(i,v){var this_result=!0,input=$(v),func=void 0!=input.data("validateFunc")?String(input.data("validateFunc")).split(","):[],arg=void 0!=input.data("validateArg")?String(input.data("validateArg")).split(","):[];console.log(input.data("validateArg")),$.each(func,function(t,e){if(this_result){var n=void 0!=arg[t]?arg[t]:!1;this_result=that.funcs[e.trim()](input.val(),n)}}),this_result||("function"==typeof o.onErrorInput?o.onErrorInput(input):"function"==typeof window[o.onErrorInput]?window[o.onErrorInput](input):(result=eval("(function(){"+o.onErrorInput+"})"),result.call(input))),!this_result&&o.showErrorState&&that._showError(input),!this_result&&o.showErrorHint&&setTimeout(function(){that._showErrorHint(input)},100*i),this_result&&o.showSuccessState&&that._showSuccess(input),!this_result&&0==i&&o.focusInput&&input.focus(),result+=this_result?0:1}),"function"==typeof o.onBeforeSubmit)result+=o.onBeforeSubmit(element,result)?0:1;else if("function"==typeof window[o.onBeforeSubmit])result+=window[o.onBeforeSubmit](element,result)?1:0;else{var f0=eval("(function(){"+o.onBeforeSubmit+"})");result+=f0.call(element,result)?1:0}if(0!==result)return submit.removeAttr("disabled").removeClass("disabled"),!1;if("function"==typeof o.onSubmit)result=o.onSubmit(element[0]);else if("function"==typeof window[o.onSubmit])result=window[o.onSubmit](element[0]);else{var f=eval("(function(){"+o.onSubmit+"})");result=f.call(element[0])}return submit.removeAttr("disabled").removeClass("disabled"),result},_showSuccess:function(t){t.parent().hasClass("input-control")?t.parent().addClass("success"):t.addClass("success")},_showError:function(t){var e=this.options;t.parent().hasClass("input-control")?t.parent().addClass("error"):t.addClass("error"),e.hideError&&e.hideError>0&&setTimeout(function(){t.parent().removeClass("error")},e.hideError)},_showErrorHint:function(t){var e,n,o,i=this.options,a=t.data("validateHint"),s=t.data("validateHintPosition")||i.hintPosition,r=t.data("validateHintMode")||i.hintMode,l=t.data("validateHintBackground")||i.hintBackground,d=t.data("validateHintColor")||i.hintColor;return void 0===a?!1:(e=$("<div/>").addClass(r+" validator-hint"),e.html(void 0!==a?this._format(a,t.val()):""),e.css({"min-width":i.hintSize}),l.isColor()?e.css("background-color",l):e.addClass(l),d.isColor()?e.css("color",d):e.addClass(d),void("line"===r?(e.addClass("hint2").addClass("line"),e.css({position:"relative",width:t.parent().hasClass("input-control")?t.parent().width():t.width(),"z-index":100}),e.appendTo(t.parent()),e.fadeIn(i.hintEasingTime,function(){setTimeout(function(){e.hide().remove()},i.hideHint)})):(e.appendTo("body"),"right"===s?(o=t.offset().left+t.outerWidth()+15-$(window).scrollLeft(),n=t.offset().top+t.outerHeight()/2-e.outerHeight()/2-$(window).scrollTop()-10,e.addClass(s),e.css({top:n,left:$(window).width()+100}),e.show().animate({left:o},i.hintEasingTime,i.hintEasing,function(){setTimeout(function(){e.hide().remove()},i.hideHint)})):"left"===s?(o=t.offset().left-e.outerWidth()-10-$(window).scrollLeft(),n=t.offset().top+t.outerHeight()/2-e.outerHeight()/2-$(window).scrollTop()-10,e.addClass(s),e.css({top:n,left:-t.offset().left-e.outerWidth()-10}),e.show().animate({left:o},i.hintEasingTime,i.hintEasing,function(){setTimeout(function(){e.hide().remove()},i.hideHint)})):"top"===s?(o=t.offset().left+t.outerWidth()/2-e.outerWidth()/2-$(window).scrollLeft(),n=t.offset().top-$(window).scrollTop()-e.outerHeight()-20,e.addClass(s),e.css({top:-e.outerHeight(),left:o}).show().animate({top:n},i.hintEasingTime,i.hintEasing,function(){setTimeout(function(){e.hide().remove()},i.hideHint)})):(o=t.offset().left+t.outerWidth()/2-e.outerWidth()/2-$(window).scrollLeft(),n=t.offset().top-$(window).scrollTop()+t.outerHeight(),e.addClass(s),e.css({top:$(window).height(),left:o}).show().animate({top:n},i.hintEasingTime,i.hintEasing,function(){setTimeout(function(){e.hide().remove()},i.hideHint)})))))},_format:function(t,e){return 1===arguments.length?function(){var e=$.makeArray(arguments);return e.unshift(t),$.validator.format.apply(this,e)}:(arguments.length>2&&e.constructor!==Array&&(e=$.makeArray(arguments).slice(1)),e.constructor!==Array&&(e=[e]),$.each(e,function(e,n){t=t.replace(new RegExp("\\{"+e+"\\}","g"),function(){return n})}),t)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.video",{version:"3.0.14",options:{width:"100%",videoSize:"hd",controls:!0,controlsPosition:"bottom",controlsModel:"full",loopButton:"<span class='mif-loop'></span>",stopButton:"<span class='mif-stop'></span>",playButton:"<span class='mif-play'></span>",pauseButton:"<span class='mif-pause'></span>",muteButton:"<span class='mif-volume-mute2'></span>",volumeLowButton:"<span class='mif-volume-low'></span>",volumeMediumButton:"<span class='mif-volume-medium'></span>",volumeHighButton:"<span class='mif-volume-high'></span>",screenMoreButton:"<span class='mif-enlarge'></span>",screenLessButton:"<span class='mif-shrink'></span>",fullScreenMode:"window",poster:!1,src:!1,loop:!1,preload:!1,autoplay:!1,muted:!1,volume:.5,logo:!1,controlsHide:1e3},_create:function(){var t=this.element;this.options;this._setOptionsFromDOM(),this._createPlayer(),this._addControls(),this._addEvents(),t.data("video",this)},_createPlayer:function(){var t,e=this.element,n=this.options,o=e.width(),i=e.find("video");if("HD"==n.videoSize&&"hd"==n.videoSize?t=9*o/16:"SD"==n.videoSize&&"sd"==n.videoSize&&(t=3*o/4),e.addClass("video-player"),e.css({height:t}),0==i.length&&(i=$("<video/>").appendTo(e)),$.each(["muted","autoplay","controls","height","width","loop","poster","preload"],function(){i.removeAttr(this)}),n.poster&&i.attr("poster",n.poster),n.src)if(n.src.indexOf("youtube")>=0){var a=/v=[(\w)]+/gi;a.exec(n.src)[0].substring(2)}else i.attr("src",n.src);n.loop&&i.attr("loop","loop"),n.preload&&i.attr("preload","auto"),n.autoplay&&i.attr("autoplay","autoplay"),i[0].volume=n.volume,e.data("fullScreen",!1),e.data("muted",!1),e.data("duration",0),e.data("timeInterval",void 0),e.data("played",!1),e.data("volume",i[0].volume)},_addEvents:function(){var t=this,e=this.element,n=(e[0],this.options),o=e.find(".controls"),i=e.find(".video-preloader"),a=(o.find(".play"),o.find(".stop"),o.find(".volume"),o.find(".full"),o.find(".volume-slider"),o.find(".stream-slider"),o.find(".info-box")),s=e.find("video"),r=s[0];s.on("loadedmetadata",function(){e.data("duration",r.duration.toFixed(0)),a.html("00:00 / "+secondsToFormattedString(e.data("duration")))}),s.on("canplay",function(){o.fadeIn(),i.hide();var e=r.buffered.length?Math.round(Math.floor(r.buffered.end(0))/Math.floor(r.duration)*100):0;t._setBufferSize(e)}),s.on("progress",function(){var e=r.buffered.length?Math.round(Math.floor(r.buffered.end(0))/Math.floor(r.duration)*100):0;t._setBufferSize(e)}),s.on("timeupdate",function(){t._setInfoData(),t._setStreamSliderPosition()}),s.on("waiting",function(){i.show()}),s.on("loadeddata",function(){i.hide()}),s.on("ended",function(){t._stopVideo()}),e.on("play",function(){isTouchDevice()&&setTimeout(function(){o.fadeOut()},n.controlsHide)}),e.on("pause",function(){}),e.on("stop",function(){o.show()}),e.on("mouseenter",function(){setTimeout(function(){o.fadeIn()},n.controlsHide)}),e.on("mouseleave",function(){r.currentTime>0&&setTimeout(function(){o.fadeOut()},n.controlsHide)}),isTouchDevice()&&e.on("touchstart",function(){r.currentTime>0&&setTimeout(function(){"none"==o.css("display")?o.fadeIn():o.fadeOut()},n.controlsHide)})},_setInfoData:function(){var t=this.element,e=(t[0],this.options,t.find("video")),n=e[0],o=t.find(".controls .info-box"),i=Math.round(n.currentTime);o.html(secondsToFormattedString(i)+" / "+secondsToFormattedString(t.data("duration")))},_setStreamSliderPosition:function(){var t=this.element,e=(t[0],this.options,t.find("video")),n=e[0],o=t.find(".stream-slider").data("slider");o.value(Math.round(100*n.currentTime/t.data("duration")))},_setBufferSize:function(t){var e=this.element,n=(e[0],this.options,e.find("video")),o=(n[0],e.find(".stream-slider").data("slider"));o.buffer(Math.round(t))},_stop:function(){var t=this.element,e=(t[0],this.options),n=t.find("video"),o=n[0],i=t.find(".controls .stop"),a=t.find(".controls .play");o.pause(),o.currentTime=0,a.html(e.playButton),i.attr("disabled","disabled"),t.data("played",!1),t.find(".stream-slider").data("slider").value(0),t.trigger("stop")},_play:function(){var t=this.element,e=(t[0],this.options),n=t.find("video"),o=n[0],i=t.find(".controls .play"),a=t.find(".controls .stop");o.paused?(i.html(e.pauseButton),o.play(),a.removeAttr("disabled"),t.data("played",!0),t.trigger("play")):(i.html(e.playButton),o.pause(),t.data("played",!1),t.trigger("pause"))},_addControls:function(){var t,e,n,o,i,a,s,r,l,d,c,u,h,p=this,f=this.element,m=f[0],v=this.options,g=f.find("video"),_=g[0];v.logo&&(e=$("<img/>").addClass("video-logo").appendTo(f),e.attr("src",v.logo)),t=$("<div/>").addClass("video-preloader").attr("data-role","preloader").attr("data-type","cycle").attr("data-style","color").appendTo(f),n=$("<div/>").addClass("controls").appendTo(f),n.addClass("position-"+v.controlsPosition),h=$("<div/>").addClass("stream-slider-wrapper").appendTo(n),d=$("<div/>").addClass("slider stream-slider").appendTo(h),d.slider({showHint:!0,animate:!1,markerColor:"bg-red",completeColor:"bg-cyan",onStartChange:function(){_.pause()},onChanged:function(t,e){_.seekable.length>0&&(_.currentTime=(f.data("duration")*t/100).toFixed(0)),f.data("played")&&_.currentTime>=0&&_.play()}}),d.data("slider").value(0),v.loopButton!==!1&&(o=$("<button/>").addClass("square-button small-button1 control-button loop no-phone").html(v.loopButton).appendTo(n),o.on("click",function(){o.toggleClass("active"),o.hasClass("active")?g.attr("loop","loop"):g.removeAttr("loop")})),v.playButton!==!1&&(i=$("<button/>").addClass("square-button small-button1 control-button play").html(v.playButton).appendTo(n),i.on("click",function(){p._play()})),v.stopButton!==!1&&(a=$("<button/>").addClass("square-button small-button1 control-button stop no-phone").html(v.stopButton).appendTo(n).attr("disabled","disabled"),a.on("click",function(){p._stop()})),c=$("<div/>").addClass("info-box no-small-phone").appendTo(n),c.html("00:00 / 00:00"),v.screenMoreButton!==!1&&(r=$("<button/>").addClass("square-button small-button1 control-button full").html(v.screenMoreButton).appendTo(n),r.on("click",function(){f.data("fullScreen",!f.data("fullScreen")),f.data("fullScreen")?r.html(v.screenLessButton):r.html(v.screenMoreButton),"window"===v.fullScreenMode?f.toggleClass("full-screen"):f.data("fullScreen")?m.requestFullscreen?m.requestFullscreen():m.msRequestFullscreen?m.msRequestFullscreen():m.mozRequestFullScreen?m.mozRequestFullScreen():m.webkitRequestFullscreen&&m.webkitRequestFullscreen():document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),f.data("fullScreen")?$(document).on("keyup.metro_video_player",function(t){27==t.keyCode&&(r.html(v.screenMoreButton),f.data("fullScreen",!1),f.hasClass("full-screen")&&f.removeClass("full-screen"))}):$(document).off("keyup.metro_video_player")})),u=$("<div/>").addClass("control-slider volume-slider-wrapper place-right").appendTo(n),l=$("<div/>").addClass("slider volume-slider").appendTo(u),l.slider({showHint:!0,animate:!1,markerColor:"bg-red",completeColor:"bg-green",onChange:function(t,e){_.volume=t/100,p._setupVolumeButton()}}),l.data("slider").value(100*_.volume),s=$("<button/>").addClass("square-button small-button1 control-button volume place-right").html(v.volumeLowButton).appendTo(n),s.on("click",function(){var t=f.find(".volume-slider").data("slider");f.data("muted",!f.data("muted")),f.data("muted")?(f.data("volume",_.volume),s.html(v.muteButton),t.value(0)):(_.volume=f.data("volume"),t.value(100*f.data("volume")),p._setupVolumeButton()),_.muted=f.data("muted")}),this._setupVolumeButton(),n.hide()},_setupVolumeButton:function(){var t=this.element,e=this.options,n=t.find("video"),o=n[0],i=t.find(".controls"),a=i.find(".volume"),s=o.volume;s>0&&.3>s?a.html(e.volumeLowButton):s>=.3&&.6>s?a.html(e.volumeMediumButton):s>=.6&&1>=s?a.html(e.volumeHighButton):a.html(e.muteButton)},_setOptionsFromDOM:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}})},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)},play:function(t,e){var n,o=this.element,i=(this.options,o.find("video")),a=i[0];this._stop(),i.find("source").remove(),i.removeAttr("src"),n=$("<source>").attr("src",t),void 0!=e&&n.attr("type",e),a.load(),n.appendTo(i),this._play()},stop:function(){this._stop()},pause:function(){var t=this.element,e=this.options,n=t.find("video"),o=n[0],i=t.find(".play");i.html(e.playButton),o.pause(),t.data("played",!1),t.trigger("pause")},resume:function(){var t=this.element,e=this.options,n=t.find("video"),o=n[0],i=t.find(".play"),a=t.find(".stop");i.html(e.pauseButton),o.play(),a.removeAttr("disabled"),t.data("played",!0),t.trigger("play")}}),$.widget("metro.window",{version:"3.0.0",options:{parent:"default",captionStyle:!1,contentStyle:!1,buttons:{btnMin:!1,btnMax:!1,btnClose:!1},title:!1,content:!1,icon:!1,type:"default",size:!1,onBtnMinClick:function(t){t.preventDefault()},onBtnMaxClick:function(t){t.preventDefault()},onBtnCloseClick:function(t){t.preventDefault()},onShow:function(t){t.preventDefault()},onHide:function(t){t.preventDefault()}},_create:function(){var t=this.element,e=this.options;$.each(t.data(),function(t,n){if(t in e)try{e[t]=$.parseJSON(n)}catch(o){e[t]=n}}),this._createWindow(),t.data("window",this)},_createWindow:function(){var t,e,n=this.element,o=this.options,i=n;i.addClass("window"),t=$("<div/>").addClass("window-caption"),e=$("<div/>").addClass("window-content"),(o.icon||o.title)&&t.appendTo(i),e.appendTo(i),"object"==typeof o.size&&$.each(o.size,function(t,n){e.css(t,n)}),o.captionStyle&&"object"==typeof o.captionStyle&&$.each(o.captionStyle,function(e,n){n.isColor()?t.css(e,n+" !important"):t.addClass(n)}),o.contentStyle&&"object"==typeof o.contentStyle&&$.each(o.contentStyle,function(t,n){n.isColor()?e.css(t,n+" !important"):e.addClass(n)}),i.appendTo("default"!==o.parent?o.parent:n.parent()),this.icon(),this.title(),this.buttons(),this.content()},icon:function(){var t=this.options,e=this.element.children(".window-caption"),n=e.find(".window-caption-icon");t.icon&&(0===n.length?$("<span/>").addClass("window-caption-icon").html(t.icon).appendTo(e):n.html(t.icon))},title:function(){var t=this.options,e=this.element.children(".window-caption"),n=e.find(".window-caption-title");t.title&&(0===n.length?$("<span/>").addClass("window-caption-title").html(t.title).appendTo(e):n.html(t.title))},buttons:function(){var t,n,o,i=this.options,a=this.element.children(".window-caption");if(0!==a.length&&i.buttons){var s=i.buttons.btnMin,r=i.buttons.btnMax,l=i.buttons.btnClose;if(s&&s!==!1)if(t=$("<span/>").addClass("btn-min").appendTo(a),"object"==typeof s&&t.css(s),"string"==typeof i.onBtnMinClick){var d=window[i.onBtnMinClick];t.on("click",d)}else t.on("click",i.onBtnMinClick(e));if(r&&r!==!1)if(n=$("<span/>").addClass("btn-max").appendTo(a),"object"==typeof r&&n.css(r),"string"==typeof i.onBtnMaxClick){var c=window[i.onBtnMaxClick];n.on("click",c);
}else n.on("click",i.onBtnMaxClick(e));if(l&&l!==!1)if(o=$("<span/>").addClass("btn-close").appendTo(a),"object"==typeof l&&o.css(l),"string"==typeof i.onBtnCloseClick){var u=window[i.onBtnCloseClick];o.on("click",u)}else o.on("click",i.onBtnCloseClick(e))}},content:function(){var t=this.options,e=t.content,n=this.element.children(".window-content");if(e)if(e.isUrl()){if(e.indexOf("youtube")>-1){var o=$("<iframe>"),i=$("<div/>").addClass("video-container").appendTo(n);o.attr("src",e).attr("frameborder","0"),o.appendTo(i)}}else n.html(e)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.wizard",{version:"3.0.0",options:{stepper:!0,stepperType:"default",stepperClickable:!1,startPage:"default",finishStep:"default",locale:window.METRO_CURRENT_LOCALE,buttons:{cancel:!0,help:!0,prior:!0,next:!0,finish:!0},onCancel:function(t,e){},onHelp:function(t,e){},onPrior:function(t,e){return!0},onNext:function(t,e){return!0},onFinish:function(t,e){},onPage:function(t,e){},onStepClick:function(t){}},_stepper:void 0,_currentStep:0,_steps:void 0,_create:function(){var that=this,element=this.element,o=this.options,steps=element.find(".step");$.each(element.data(),function(t,e){if(t in o)try{o[t]=$.parseJSON(e)}catch(n){o[t]=e}}),this._steps=steps,o.stepper&&(this._stepper=this._createStepper(steps.length).insertBefore(element.find(".steps")).stepper({clickable:o.stepperClickable}).on("stepclick",function(e,s){if(that.stepTo(s),"function"==typeof o.onStepClick)o.onStepClick(s);else if("function"==typeof window[o.onStepClick])window[o.onStepClick](s);else{var result=eval("(function(){"+o.onStepClick+"})");result.call(s)}})),void 0!==element.data("locale")&&(o.locale=element.data("locale")),this._createEvents();var sp="default"!==o.startPage&&parseInt(o.startPage)>1?o.startPage:1;this.stepTo(sp),"string"==typeof o.onPage?window[o.onPage](this._currentStep+1,element):o.onPage(this._currentStep+1,element),element.data("wizard",this)},_createStepper:function(t){var e,n=this.options;return e=$("<div/>").addClass("stepper").attr("data-role","stepper").attr("data-steps",t),"default"!==n.stepperType&&e.addClass(n.stepperType),e},_createEvents:function(){var that=this,element=this.element,o=this.options;if(o.buttons){var actions=$("<div/>").addClass("actions").appendTo(element),group_left=$("<div/>").addClass("group-left").appendTo(actions),group_right=$("<div/>").addClass("group-right").appendTo(actions),cancel_button,help_button,prior_button,next_button,finish_button;o.buttons.cancel&&(cancel_button=$("<button type='button'/>").addClass("btn-cancel").html(window.METRO_LOCALES[o.locale].buttons[2]),"boolean"==typeof o.buttons.cancel?cancel_button.appendTo(group_left):(o.buttons.cancel.title&&cancel_button.html(o.buttons.cancel.title),o.buttons.cancel.cls&&cancel_button.addClass(o.buttons.cancel.cls),o.buttons.cancel.group&&"left"!==o.buttons.cancel.group?cancel_button.appendTo(group_right):cancel_button.appendTo(group_left)),cancel_button.on("click",function(){if("function"==typeof o.onCancel)o.onCancel(that._currentStep+1,element);else if("function"==typeof window[o.onCancel])window[o.onCancel](that._currentStep+1,element);else{var result=eval("(function(){"+o.onCancel+"})");result.call(that._currentStep+1,element)}})),o.buttons.help&&(help_button=$("<button type='button'/>").addClass("btn-help").html(window.METRO_LOCALES[o.locale].buttons[3]),"boolean"==typeof o.buttons.help?help_button.appendTo(group_right):(o.buttons.help.title&&help_button.html(o.buttons.help.title),o.buttons.help.cls&&help_button.addClass(o.buttons.help.cls),o.buttons.help.group&&"left"!==o.buttons.help.group?help_button.appendTo(group_right):help_button.appendTo(group_left)),help_button.on("click",function(){if("function"==typeof o.onHelp)o.onHelp(that._currentStep+1,element);else if("function"==typeof window[o.onHelp])window[o.onHelp](that._currentStep+1,element);else{var result=eval("(function(){"+o.onHelp+"})");result.call(that._currentStep+1,element)}})),o.buttons.prior&&(prior_button=$("<button type='button'/>").addClass("btn-prior").html(window.METRO_LOCALES[o.locale].buttons[4]),"boolean"==typeof o.buttons.prior?prior_button.appendTo(group_right):(o.buttons.prior.title&&prior_button.html(o.buttons.prior.title),o.buttons.prior.cls&&prior_button.addClass(o.buttons.prior.cls),o.buttons.prior.group&&"left"!==o.buttons.prior.group?prior_button.appendTo(group_right):prior_button.appendTo(group_left)),prior_button.on("click",function(){if("function"==typeof o.onPrior)o.onPrior(that._currentStep+1,element)&&that.prior();else if("function"==typeof window[o.onPrior])window[o.onPrior](that._currentStep+1,element)&&that.prior();else{var result=eval("(function(){"+o.onPrior+"})");result.call(that._currentStep+1,element)&&that.prior()}})),o.buttons.next&&(next_button=$("<button type='button'/>").addClass("btn-next").html(window.METRO_LOCALES[o.locale].buttons[5]),"boolean"==typeof o.buttons.next?next_button.appendTo(group_right):(o.buttons.next.title&&next_button.html(o.buttons.next.title),o.buttons.next.cls&&next_button.addClass(o.buttons.next.cls),o.buttons.next.group&&"left"!==o.buttons.next.group?next_button.appendTo(group_right):next_button.appendTo(group_left)),next_button.on("click",function(){if("function"==typeof o.onNext)o.onNext(that._currentStep+1,element)&&that.next();else if("function"==typeof window[o.onNext])window[o.onNext](that._currentStep+1,element)&&that.next();else{var result=eval("(function(){"+o.onNext+"})");result.call(that._currentStep+1,element)&&that.next()}})),o.buttons.finish&&(finish_button=$("<button type='button'/>").addClass("btn-finish").html(window.METRO_LOCALES[o.locale].buttons[6]),"boolean"==typeof o.buttons.finish?finish_button.appendTo(group_right):(o.buttons.finish.title&&finish_button.html(o.buttons.finish.title),o.buttons.finish.cls&&finish_button.addClass(o.buttons.finish.cls),o.buttons.finish.group&&"left"!==o.buttons.finish.group?finish_button.appendTo(group_right):finish_button.appendTo(group_left)),finish_button.on("click",function(){if("function"==typeof o.onFinish)o.onFinish(that._currentStep+1,element);else if("function"==typeof window[o.onFinish])window[o.onFinish](that._currentStep+1,element);else{var result=eval("(function(){"+o.onFinish+"})");result.call(that._currentStep+1,element)}}))}},next:function(){var element=this.element,that=this,o=this.options,new_step=this._currentStep+1;if(new_step===this._steps.length)return!1;if(this._currentStep=new_step,this._steps.hide(),$(this._steps[new_step]).show(),"function"==typeof o.onPage)o.onPage(that._currentStep+1,element);else if("function"==typeof window[o.onPage])window[o.onPage](that._currentStep+1,element);else{var result=eval("(function(){"+o.onPage+"})");result.call(that._currentStep+1,element)}void 0!==this._stepper&&this._stepper.stepper("stepTo",this._currentStep+1);var finish="default"===o.finishStep?this._steps.length-1:o.finishStep;return new_step===finish?this.element.find(".btn-finish").attr("disabled",!1):this.element.find(".btn-finish").attr("disabled",!0),new_step===this._steps.length-1?this.element.find(".btn-next").attr("disabled",!0):this.element.find(".btn-next").attr("disabled",!1),new_step>0&&this.element.find(".btn-prior").attr("disabled",!1),!0},prior:function(){var element=this.element,that=this,new_step=this._currentStep-1,o=this.options;if(0>new_step)return!1;if(this._currentStep=new_step,this._steps.hide(),$(this._steps[new_step]).show(),"function"==typeof o.onPage)o.onPage(that._currentStep+1,element);else if("function"==typeof window[o.onPage])window[o.onPage](that._currentStep+1,element);else{var result=eval("(function(){"+o.onPage+"})");result.call(that._currentStep+1,element)}void 0!==this._stepper&&this._stepper.stepper("stepTo",this._currentStep+1);var finish="default"===o.finishStep?this._steps.length-1:o.finishStep;return new_step===finish?this.element.find(".btn-finish").attr("disabled",!1):this.element.find(".btn-finish").attr("disabled",!0),0===new_step?this.element.find(".btn-prior").attr("disabled",!0):this.element.find(".btn-prior").attr("disabled",!1),finish>new_step&&this.element.find(".btn-next").attr("disabled",!1),!0},stepTo:function(step){var element=this.element,that=this,new_step=step-1,o=this.options;if(0>new_step)return!1;if(this._currentStep=new_step,this._steps.hide(),$(this._steps[new_step]).show(),"function"==typeof o.onPage)o.onPage(that._currentStep+1,element);else if("function"==typeof window[o.onPage])window[o.onPage](that._currentStep+1,element);else{var result=eval("(function(){"+o.onPage+"})");result.call(that._currentStep+1,element)}void 0!==this._stepper&&this._stepper.stepper("stepTo",step);var finish="default"===o.finishStep?this._steps.length-1:o.finishStep;return new_step===finish?this.element.find(".btn-finish").attr("disabled",!1):this.element.find(".btn-finish").attr("disabled",!0),this.element.find(".btn-next").attr("disabled",new_step>=finish),this.element.find(".btn-prior").attr("disabled",0>=new_step),!0},stepper:function(){return this._stepper},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.widget("metro.wizard2",{version:"3.0.0",options:{start:1,finish:"default",buttonLabels:{prev:"<",next:">",finish:"OK",help:"?"},onPrior:function(t,e){return!0},onNext:function(t,e){return!0},onFinish:function(t,e){},onHelp:function(t,e){},onPage:function(t,e){}},_step:1,_steps:void 0,_create:function(){var t=this,e=this.element,n=this.options;$.each(e.data(),function(t,e){if(t in n)try{n[t]=$.parseJSON(e)}catch(o){n[t]=e}}),this._step=n.start,this._steps=e.children(".step"),this._height=0,this._width=0,"default"===n.finish&&(n.finish=this._steps.length),$.each(this._steps,function(e,n){$(n).outerHeight()>t._height&&(t._height=$(n).outerHeight()),$(n).hasClass("active")&&(t._step=e+1)}),this._width=e.innerWidth()-(24*(this._steps.length-1)+this._steps.length),e.children(".step").css({height:this._height+48}),$(window).resize(function(){t._width=e.innerWidth()-(24*(t._steps.length-1)+t._steps.length),t.step(t._step)}),this._createActionBar(),this.step(n.start),this._placeActionBar(),e.data("wizard2",this)},_createActionBar:function(){var that=this,element=this.element,o=this.options,bar=$("<div/>").addClass("action-bar").appendTo(element),btn_prev,btn_next,btn_help,btn_finish;btn_help=$("<button/>").html(o.buttonLabels.help).addClass("button cycle-button medium-button wiz-btn-help place-left").appendTo(bar),btn_finish=$("<button/>").html(o.buttonLabels.finish).addClass("button cycle-button medium-button wiz-btn-finish place-right").appendTo(bar),btn_next=$("<button/>").html(o.buttonLabels.next).addClass("button cycle-button medium-button wiz-btn-next place-right").appendTo(bar),btn_prev=$("<button/>").html(o.buttonLabels.prev).addClass("button cycle-button medium-button wiz-btn-prev place-right").appendTo(bar),btn_help.on("click",function(){if("function"==typeof o.onHelp)o.onHelp(that._step,that);else if("function"==typeof window[o.onHelp])window[o.onHelp](that._step,that);else{var result=eval("(function(){"+o.onHelp+"})");result.call(that._step,that)}}),btn_finish.on("click",function(){if("function"==typeof o.onFinish)o.onFinish(that._step,that);else if("function"==typeof window[o.onFinish])window[o.onFinish](that._step,that);else{var result=eval("(function(){"+o.onFinish+"})");result.call(that._step,that)}}),btn_prev.on("click",function(){if("function"==typeof o.onPrior)o.onPrior(that._step,element)&&that.prior();else if("function"==typeof window[o.onPrior])window[o.onPrior](that._step,element)&&that.prior();else{var result=eval("(function(){"+o.onPrior+"})");result.call(that._step,element)&&that.prior()}}),btn_next.on("click",function(){if("function"==typeof o.onNext)o.onNext(that._step,element)&&that.next();else if("function"==typeof window[o.onNext])window[o.onNext](that._step,element)&&that.next();else{var result=eval("(function(){"+o.onNext+"})");result.call(that._step,element)&&that.next()}})},_placeActionBar:function(){var t=this.element,e=(this.options,t.find(".action-bar")),n=t.find(".step.active"),o=n.position().left,i=n.innerWidth();e.css({left:o,width:i})},step:function(t){var e=this.options;this.element.children(".step").removeClass("active prev next"),$(this.element.children(".step")[t-1]).addClass("active").css("width",this._width),this.element.children(".step.active").prevAll().addClass("prev").css("width",0),this.element.children(".step.active").nextAll().addClass("next").css("width",0),this._placeActionBar(),1===t?this.element.find(".wiz-btn-prev").hide():this.element.find(".wiz-btn-prev").show(),t===this._steps.length?this.element.find(".wiz-btn-next").hide():this.element.find(".wiz-btn-next").show(),t!==e.finish?this.element.find(".wiz-btn-finish").hide():this.element.find(".wiz-btn-finish").show()},prior:function(){var t=this._step-1;return 0>=t?!1:(this._step=t,this.step(t),!0)},next:function(){var t=this._step+1;return t>this._steps.length?!1:(this._step=t,this.step(t),!0)},_destroy:function(){},_setOption:function(t,e){this._super("_setOption",t,e)}}),$.Metro.init()});
|