text: /*
   * Metro 4 Components Library v4.2.17 build 694 (https://metroui.org.ua)
   * Copyright 2018 Sergey Pimenov
   * Licensed under MIT
   */
  
  !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){"use strict";var t=e;if(void 0===e)throw new Error("Metro 4 requires jQuery!");if("MutationObserver"in window==!1)throw new Error("Metro 4 requires MutationObserver!");var n=t("meta[name='metro4:init']").attr("content"),s=t("meta[name='metro4:locale']").attr("content"),i=t("meta[name='metro4:week_start']").attr("content"),a=t("meta[name='metro4:animation_duration']").attr("content"),o=t("meta[name='metro4:callback_timeout']").attr("content"),r=t("meta[name='metro4:timeout']").attr("content");void 0===window.METRO_INIT&&(window.METRO_INIT=void 0===n||JSON.parse(n)),void 0===window.METRO_DEBUG&&(window.METRO_DEBUG=!0),void 0===window.METRO_WEEK_START&&(window.METRO_WEEK_START=void 0!==i?parseInt(i):1),void 0===window.METRO_LOCALE&&(window.METRO_LOCALE=void 0!==s?s:"en-US"),void 0===window.METRO_ANIMATION_DURATION&&(window.METRO_ANIMATION_DURATION=void 0!==a?parseInt(a):300),void 0===window.METRO_CALLBACK_TIMEOUT&&(window.METRO_CALLBACK_TIMEOUT=void 0!==o?parseInt(o):500),void 0===window.METRO_TIMEOUT&&(window.METRO_TIMEOUT=void 0!==r?parseInt(r):2e3),void 0===window.METRO_HOTKEYS_FILTER_CONTENT_EDITABLE&&(window.METRO_HOTKEYS_FILTER_CONTENT_EDITABLE=!0),void 0===window.METRO_HOTKEYS_FILTER_INPUT_ACCEPTING_ELEMENTS&&(window.METRO_HOTKEYS_FILTER_INPUT_ACCEPTING_ELEMENTS=!0),void 0===window.METRO_HOTKEYS_FILTER_TEXT_INPUTS&&(window.METRO_HOTKEYS_FILTER_TEXT_INPUTS=!0),void 0===window.METRO_HOTKEYS_BUBBLE_UP&&(window.METRO_HOTKEYS_BUBBLE_UP=!1),void 0===window.METRO_THROWS&&(window.METRO_THROWS=!0),window.METRO_MEDIA=[],"function"!=typeof Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),"function"!=typeof Object.values&&(Object.values=function(e){return Object.keys(e).map(function(t){return e[t]})});var l="ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0,c={version:"4.2.17",versionFull:"4.2.17.694 ",isTouchable:l,fullScreenEnabled:document.fullscreenEnabled,sheet:null,controlsPosition:{INSIDE:"inside",OUTSIDE:"outside"},groupMode:{ONE:"one",MULTI:"multi"},aspectRatio:{HD:"hd",SD:"sd",CINEMA:"cinema"},fullScreenMode:{WINDOW:"window",DESKTOP:"desktop"},position:{TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right",TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",LEFT_BOTTOM:"left-bottom",LEFT_TOP:"left-top",RIGHT_TOP:"right-top",RIGHT_BOTTOM:"right-bottom"},popoverEvents:{CLICK:"click",HOVER:"hover",FOCUS:"focus"},stepperView:{SQUARE:"square",CYCLE:"cycle",DIAMOND:"diamond"},listView:{LIST:"list",CONTENT:"content",ICONS:"icons",ICONS_MEDIUM:"icons-medium",ICONS_LARGE:"icons-large",TILES:"tiles",TABLE:"table"},events:{click:"click.metro",start:"touchstart.metro mousedown.metro",stop:"touchend.metro mouseup.metro",move:"touchmove.metro mousemove.metro",enter:"touchstart.metro mouseenter.metro",leave:"touchend.metro mouseleave.metro",focus:"focus.metro",blur:"blur.metro",resize:"resize.metro",keyup:"keyup.metro",keydown:"keydown.metro",dblclick:"dblclick.metro",input:"input.metro",change:"change.metro",cut:"cut.metro",paste:"paste.metro",drop:"drop.metro",scroll:"scroll.metro",scrollStart:"scrollstart.metro",scrollStop:"scrollstop.metro",mousewheel:"mousewheel.metro",inputchange:"change.metro input.metro propertychange.metro cut.metro paste.metro copy.metro"},media_queries:{FS:"(min-width: 0px)",SM:"(min-width: 576px)",MD:"(min-width: 768px)",LG:"(min-width: 992px)",XL:"(min-width: 1200px)",XXL:"(min-width: 1452px)"},media_sizes:{FS:0,SM:576,MD:768,LG:992,XL:1200,XXL:1452},media_mode:{FS:"fs",SM:"sm",MD:"md",LG:"lg",XL:"xl",XXL:"xxl"},actions:{REMOVE:1,HIDE:2},hotkeys:[],about:function(e){console.log("Metro 4 Components Library - v"+(!0===e?this.versionFull:this.version))},aboutDlg:function(e){alert("Metro 4 Components Library - v"+(!0===e?this.versionFull:this.version))},ver:function(e){return!0===e?this.versionFull:this.version},observe:function(){new MutationObserver(function(e){e.map(function(e){if("attributes"===e.type&&"data-role"!==e.attributeName){var n=t(e.target),s=n.data("metroComponent");void 0!==s&&t.each(s,function(){var t=n.data(this);t&&t.changeAttribute(e.attributeName)})}else if("childList"===e.type&&e.addedNodes.length>0){var i,a,o={},r={},l=e.addedNodes;for(i=0;i<l.length;i++){var d=e.addedNodes[i];if("SCRIPT"===d.tagName||"STYLE"===d.tagName)return;r=(a=t(e.addedNodes[i])).find("[data-role]"),(o=void 0!==a.data("role")?t.merge(r,a):r).length&&c.initWidgets(o)}}})}).observe(t("html")[0],{childList:!0,attributes:!0,subtree:!0})},init:function(){var e=t("[data-role]"),n=t("[data-hotkey]"),s=t("html");return!0===l?s.addClass("metro-touch-device"):s.addClass("metro-no-touch-device"),this.sheet=j.newCssSheet(),this.observe(),this.initHotkeys(n),this.initWidgets(e),window.METRO_MEDIA=[],t.each(c.media_queries,function(e,t){j.media(t)&&METRO_MEDIA.push(c.media_mode[e])}),this.about(!0),this},initHotkeys:function(e){t.each(e,function(){var e=t(this),n=!!e.data("hotkey")&&e.data("hotkey").toLowerCase();!1!==n&&!0!==e.data("hotKeyBonded")&&(c.hotkeys.push(n),t(document).on(c.events.keyup,null,n,function(t){if(void 0!==e)return"A"===e[0].tagName&&void 0!==e.attr("href")&&""!==e.attr("href").trim()&&"#"!==e.attr("href").trim()?document.location.href=e.attr("href"):e.click(),METRO_HOTKEYS_BUBBLE_UP}),e.data("hotKeyBonded",!0))})},initWidgets:function(e){t.each(e,function(){var e=t(this);e.data("role").split(/\s*,\s*/).map(function(n){if(void 0!==t.fn[n]&&void 0===e.attr("data-role-"+n)){t.fn[n].call(e),e.attr("data-role-"+n,!0);var s=e.data("metroComponent");void 0===s?s=[n]:s.push(n),e.data("metroComponent",s)}})})},plugin:function(e,n){t.fn[e]=function(s){return this.each(function(){t.data(this,e,Object.create(n).init(s,this))})}},destroyPlugin:function(e,n){var s,i;if(e=j.isJQueryObject(e)?e[0]:e,s=t(e).data(n),!j.isValue(s))throw new Error("Component can not be destroyed: the element is not a Ьуекщ 4 component.");if(!j.isFunc(s.destroy))throw new Error("Component can not be destroyed: method destroy not found.");s.destroy(),i=t(e).data("metroComponent"),j.arrayDelete(i,n),t(e).data("metroComponent",i),t.removeData(e,n),t(e).removeAttr("data-role-"+n)},destroyPluginAll:function(e){e=j.isJQueryObject(e)?e[0]:e;var n=t(e).data("metroComponent");void 0!==n&&n.length>0&&t.each(n,function(){c.destroyPlugin(e,this)})},initPlugin:function(e,n){e=t(e);try{if(void 0!==t.fn[n]&&void 0===e.attr("data-role-"+n)){t.fn[n].call(e),e.attr("data-role-"+n,!0);var s=e.data("metroComponent");void 0===s?s=[n]:s.push(n),e.data("metroComponent",s)}}catch(e){console.log(e.message,e.stack)}},reinitPlugin:function(e,t){this.destroyPlugin(e,t),this.initPlugin(e,t)},reinitPluginAll:function(e){var n=t(e).data("metroComponent");void 0!==n&&n.length>0&&t.each(n,function(){c.reinitPlugin(e,this)})},noop:function(){},noop_true:function(){return!0},noop_false:function(){return!1},stop:function(e){e.stopPropagation(),e.preventDefault()},requestFullScreen:function(e){e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.requestFullscreen()},exitFullScreen:function(){document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():document.exitFullscreen()},inFullScreen:function(){return void 0!==(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}};window.Metro=c,t(window).on(c.events.resize,function(){window.METRO_MEDIA=[],t.each(c.media_queries,function(e,t){j.media(t)&&METRO_MEDIA.push(c.media_mode[e])})});var d={duration:METRO_ANIMATION_DURATION,func:"swing",switch:function(e,t){e.hide(),t.css({top:0,left:0}).show()},slideUp:function(e,t,n,s){var i=e.parent().outerHeight(!0);void 0===n&&(n=this.duration),void 0===s&&(s=this.func),e.css("z-index",1).animate({top:-i},n,s),t.css({top:i,left:0,zIndex:2}).animate({top:0},n,s)},slideDown:function(e,t,n,s){var i=e.parent().outerHeight(!0);void 0===n&&(n=this.duration),void 0===s&&(s=this.func),e.css("z-index",1).animate({top:i},n,s),t.css({left:0,top:-i,zIndex:2}).animate({top:0},n,s)},slideLeft:function(e,t,n,s){var i=e.parent().outerWidth(!0);void 0===n&&(n=this.duration),void 0===s&&(s=this.func),e.css("z-index",1).animate({left:-i},n,s),t.css({left:i,zIndex:2}).animate({left:0},n,s)},slideRight:function(e,t,n,s){var i=e.parent().outerWidth(!0);void 0===n&&(n=this.duration),void 0===s&&(s=this.func),e.css("z-index",1).animate({left:i},n,s),t.css({left:-i,zIndex:2}).animate({left:0},n,s)},fade:function(e,t,n){void 0===n&&(n=this.duration),e.animate({opacity:0},n),t.css({top:0,left:0}).animate({opacity:1},n)}};c.animation=d;var h={TYPES:{HEX:"hex",RGB:"rgb",RGBA:"rgba",HSV:"hsv",HSL:"hsl",CMYK:"cmyk",UNKNOWN:"unknown"},PALETTES:{ALL:"colorList",METRO:"colorListMetro",STANDARD:"colorListStandard"},colorListMetro:{lime:"#a4c400",green:"#60a917",emerald:"#008a00",blue:"#00AFF0",teal:"#00aba9",cyan:"#1ba1e2",cobalt:"#0050ef",indigo:"#6a00ff",violet:"#aa00ff",pink:"#dc4fad",magenta:"#d80073",crimson:"#a20025",red:"#CE352C",orange:"#fa6800",amber:"#f0a30a",yellow:"#fff000",brown:"#825a2c",olive:"#6d8764",steel:"#647687",mauve:"#76608a",taupe:"#87794e"},colorListStandard:{aliceBlue:"#f0f8ff",antiqueWhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedAlmond:"#ffebcd",blue:"#0000ff",blueViolet:"#8a2be2",brown:"#a52a2a",burlyWood:"#deb887",cadetBlue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerBlue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkBlue:"#00008b",darkCyan:"#008b8b",darkGoldenRod:"#b8860b",darkGray:"#a9a9a9",darkGreen:"#006400",darkKhaki:"#bdb76b",darkMagenta:"#8b008b",darkOliveGreen:"#556b2f",darkOrange:"#ff8c00",darkOrchid:"#9932cc",darkRed:"#8b0000",darkSalmon:"#e9967a",darkSeaGreen:"#8fbc8f",darkSlateBlue:"#483d8b",darkSlateGray:"#2f4f4f",darkTurquoise:"#00ced1",darkViolet:"#9400d3",deepPink:"#ff1493",deepSkyBlue:"#00bfff",dimGray:"#696969",dodgerBlue:"#1e90ff",fireBrick:"#b22222",floralWhite:"#fffaf0",forestGreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#DCDCDC",ghostWhite:"#F8F8FF",gold:"#ffd700",goldenRod:"#daa520",gray:"#808080",green:"#008000",greenYellow:"#adff2f",honeyDew:"#f0fff0",hotPink:"#ff69b4",indianRed:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderBlush:"#fff0f5",lawnGreen:"#7cfc00",lemonChiffon:"#fffacd",lightBlue:"#add8e6",lightCoral:"#f08080",lightCyan:"#e0ffff",lightGoldenRodYellow:"#fafad2",lightGray:"#d3d3d3",lightGreen:"#90ee90",lightPink:"#ffb6c1",lightSalmon:"#ffa07a",lightSeaGreen:"#20b2aa",lightSkyBlue:"#87cefa",lightSlateGray:"#778899",lightSteelBlue:"#b0c4de",lightYellow:"#ffffe0",lime:"#00ff00",limeGreen:"#32dc32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumAquaMarine:"#66cdaa",mediumBlue:"#0000cd",mediumOrchid:"#ba55d3",mediumPurple:"#9370db",mediumSeaGreen:"#3cb371",mediumSlateBlue:"#7b68ee",mediumSpringGreen:"#00fa9a",mediumTurquoise:"#48d1cc",mediumVioletRed:"#c71585",midnightBlue:"#191970",mintCream:"#f5fffa",mistyRose:"#ffe4e1",moccasin:"#ffe4b5",navajoWhite:"#ffdead",navy:"#000080",oldLace:"#fdd5e6",olive:"#808000",oliveDrab:"#6b8e23",orange:"#ffa500",orangeRed:"#ff4500",orchid:"#da70d6",paleGoldenRod:"#eee8aa",paleGreen:"#98fb98",paleTurquoise:"#afeeee",paleVioletRed:"#db7093",papayaWhip:"#ffefd5",peachPuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderBlue:"#b0e0e6",purple:"#800080",rebeccaPurple:"#663399",red:"#ff0000",rosyBrown:"#bc8f8f",royalBlue:"#4169e1",saddleBrown:"#8b4513",salmon:"#fa8072",sandyBrown:"#f4a460",seaGreen:"#2e8b57",seaShell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",slyBlue:"#87ceeb",slateBlue:"#6a5acd",slateGray:"#708090",snow:"#fffafa",springGreen:"#00ff7f",steelBlue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whiteSmoke:"#f5f5f5",yellow:"#ffff00",yellowGreen:"#9acd32"},colorList:{},options:{angle:30,algorithm:1,step:.1,distance:5,tint1:.8,tint2:.4,shade1:.6,shade2:.3,alpha:1},init:function(){return this.colorList=t.extend({},this.colorListStandard,this.colorListMetro),this},setup:function(e){this.options=t.extend({},this.options,e)},color:function(e,t){return void 0!==this[t=t||this.PALETTES.ALL][e]&&this[t][e]},palette:function(e){return e=e||this.PALETTES.ALL,Object.keys(this[e])},hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,s){return t+t+n+n+s+s});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},rgb2hex:function(e){return"#"+((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)},rgb2hsv:function(e){var t,n,s,i=new function(e,t,n){this.h=e||0,this.s=t||0,this.v=n||0},a=e.r/255,o=e.g/255,r=e.b/255,l=Math.max(a,o,r),c=Math.min(a,o,r),d=l-c;return s=l,n=0===l?0:1-c/l,t=l===c?0:l===a&&o>=r?(o-r)/d*60:l===a&&o<r?(o-r)/d*60+360:l===o?(r-a)/d*60+120:l===r?(a-o)/d*60+240:0,i.h=t,i.s=n,i.v=s,i},hsv2rgb:function(e){var t,n,s,i=e.h,a=100*e.s,o=100*e.v,r=(100-a)*o/100,l=i%60/60*(o-r),c=r+l,d=o-l;switch(Math.floor(i/60)){case 0:t=o,n=c,s=r;break;case 1:t=d,n=o,s=r;break;case 2:t=r,n=o,s=c;break;case 3:t=r,n=d,s=o;break;case 4:t=c,n=r,s=o;break;case 5:t=o,n=r,s=d}return{r:Math.round(255*t/100),g:Math.round(255*n/100),b:Math.round(255*s/100)}},hsv2hex:function(e){return this.rgb2hex(this.hsv2rgb(e))},hex2hsv:function(e){return this.rgb2hsv(this.hex2rgb(e))},rgb2cmyk:function(e){var t=new function(e,t,n,s){this.c=e||0,this.m=t||0,this.y=n||0,this.k=s||0},n=e.r/255,s=e.g/255,i=e.b/255;return t.k=Math.min(1-n,1-s,1-i),t.c=(1-n-t.k)/(1-t.k),t.m=(1-s-t.k)/(1-t.k),t.y=(1-i-t.k)/(1-t.k),t.c=Math.round(100*t.c),t.m=Math.round(100*t.m),t.y=Math.round(100*t.y),t.k=Math.round(100*t.k),t},cmyk2rgb:function(e){var t=new function(e,t,n){this.r=e||0,this.g=t||0,this.g=n||0},n=e.c/100,s=e.m/100,i=e.y/100,a=e.k/100;return t.r=1-Math.min(1,n*(1-a)+a),t.g=1-Math.min(1,s*(1-a)+a),t.b=1-Math.min(1,i*(1-a)+a),t.r=Math.round(255*t.r),t.g=Math.round(255*t.g),t.b=Math.round(255*t.b),t},hsv2hsl:function(e){var t,n,s;return t=e.h,s=(2-e.s)*e.v,n=e.s*e.v,{h:t,s:n/=s<=1?s:2-s,l:s/=2}},hsl2hsv:function(e){var t,n,s,i;return t=e.h,s=((i=2*e.l)+(n=e.s*(i<=1?i:2-i)))/2,{h:t,s:n=2*n/(i+n),l:s}},rgb2websafe:function(e){return{r:51*Math.round(e.r/51),g:51*Math.round(e.g/51),b:51*Math.round(e.b/51)}},rgba2websafe:function(e){return{r:51*Math.round(e.r/51),g:51*Math.round(e.g/51),b:51*Math.round(e.b/51),a:e.a}},hex2websafe:function(e){return this.rgb2hex(this.rgb2websafe(this.toRGB(e)))},hsv2websafe:function(e){return this.rgb2hsv(this.rgb2websafe(this.toRGB(e)))},hsl2websafe:function(e){return this.hsv2hsl(this.rgb2hsv(this.rgb2websafe(this.toRGB(e))))},cmyk2websafe:function(e){return this.rgb2cmyk(this.rgb2websafe(this.cmyk2rgb(e)))},websafe:function(e){return this.isHEX(e)?this.hex2websafe(e):this.isRGB(e)?this.rgb2websafe(e):this.isRGBA(e)?this.rgba2websafe(e):this.isHSV(e)?this.hsv2websafe(e):this.isHSL(e)?this.hsl2websafe(e):this.isCMYK(e)?this.cmyk2websafe(e):e},is:function(e){return this.isHEX(e)?this.TYPES.HEX:this.isRGB(e)?this.TYPES.RGB:this.isRGBA(e)?this.TYPES.RGBA:this.isHSV(e)?this.TYPES.HSV:this.isHSL(e)?this.TYPES.HSL:this.isCMYK(e)?this.TYPES.CMYK:this.TYPES.UNKNOWN},toRGB:function(e){if(this.isHSV(e))return this.hsv2rgb(e);if(this.isHSL(e))return this.hsv2rgb(this.hsl2hsv(e));if(this.isRGB(e))return e;if(this.isHEX(e))return this.hex2rgb(e);if(this.isCMYK(e))return this.cmyk2rgb(e);throw new Error("Unknown color format!")},toRGBA:function(e,t){var n=this.toRGB(e);return n.a=t||1,n},toHSV:function(e){return this.rgb2hsv(this.toRGB(e))},toHSL:function(e){return this.hsv2hsl(this.rgb2hsv(this.toRGB(e)))},toHSLA:function(e,t){var n;return(n=this.hsv2hsl(this.rgb2hsv(this.toRGB(e)))).a=t||this.options.alpha,n},toHEX:function(e){return this.rgb2hex(this.toRGB(e))},toCMYK:function(e){return this.rgb2cmyk(this.toRGB(e))},toHexString:function(e){return this.toHEX(e)},toHsvString:function(e){var t=this.toHSV(e);return"hsv("+[t.h,t.s,t.v].join(",")+")"},toHslString:function(e){var t=this.toHSL(e);return"hsl("+[Math.round(t.h),Math.round(100*t.s)+"%",Math.round(100*t.l)+"%"].join(",")+")"},toHslaString:function(e){var t=this.toHSLA(e);return"hsl("+[Math.round(t.h),Math.round(100*t.s)+"%",Math.round(100*t.l)+"%",t.a].join(",")+")"},toCmykString:function(e){var t=this.toCMYK(e);return"cmyk("+[t.c,t.m,t.y,t.k].join(",")+")"},toRgbString:function(e){var t=this.toRGB(e);return"rgb("+[t.r,t.g,t.b].join(",")+")"},toRgbaString:function(e){var t=this.toRGBA(e);return"rgba("+[t.r,t.g,t.b,t.a].join(",")+")"},toString:function(e){if(this.isHEX(e))return this.toHexString(e);if(this.isRGB(e))return this.toRgbString(e);if(this.isRGBA(e))return this.toRgbaString(e);if(this.isHSV(e))return this.toHsvString(e);if(this.isHSL(e))return this.toHslString(e);if(this.isHSLA(e))return this.toHslaString(e);if(this.isCMYK(e))return this.toCmykString(e);throw new Error("Unknown color format!")},grayscale:function(e,t){t=t||"hex";var n=this.toRGB(e),s=Math.round(.2125*n.r+.7154*n.g+.0721*n.b),i={r:s,g:s,b:s};return this["rgb2"+t](i)},darken:function(e,t){return void 0===t&&(t=10),this.lighten(e,-1*Math.abs(t))},lighten:function(e,t){var n,s,i,a=1;void 0===t&&(t=10),n=(n=this.toHEX(e)).slice(1),(s=this.is(e))===this.TYPES.RGBA&&(a=e.a);var o=parseInt(n,16),r=(o>>16)+t;r>255?r=255:r<0&&(r=0);var l=(o>>8&255)+t;l>255?l=255:l<0&&(l=0);var c=(255&o)+t;switch(c>255?c=255:c<0&&(c=0),i="#"+(c|l<<8|r<<16).toString(16),s){case"rgb":return this.toRGB(i);case"rgba":return this.toRGBA(i,a);case"hsv":return this.toHSV(i);case"hsl":return this.toHSL(i);case"cmyk":return this.toCMYK(i);default:return i}},isDark:function(e){var t=this.toRGB(e);return(299*t.r+587*t.g+114*t.b)/1e3<128},isLight:function(e){return!this.isDark(e)},isHSV:function(e){return j.isObject(e)&&"h"in e&&"s"in e&&"v"in e},isHSL:function(e){return j.isObject(e)&&"h"in e&&"s"in e&&"l"in e},isHSLA:function(e){return j.isObject(e)&&"h"in e&&"s"in e&&"l"in e&&"a"in e},isRGB:function(e){return j.isObject(e)&&"r"in e&&"g"in e&&"b"in e},isRGBA:function(e){return j.isObject(e)&&"r"in e&&"g"in e&&"b"in e&&"a"in e},isCMYK:function(e){return j.isObject(e)&&"c"in e&&"m"in e&&"y"in e&&"k"in e},isHEX:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},isColor:function(e){return this.isHEX(e)||this.isRGB(e)||this.isRGBA(e)||this.isHSV(e)||this.isHSL(e)||this.isCMYK(e)},hueShift:function(e,t){for(e+=t;e>=360;)e-=360;for(;e<0;)e+=360;return e},getScheme:function(e,n,s,i){var a;this.options=t.extend({},this.options,i);var o,r=[],l=this;if(o=this.toHSV(e),!1===this.isHSV(o))return console.log("The value is a not supported color format!"),!1;function c(e,t,n){return Math.max(t,Math.min(e,n))}function d(e,t,n){return e<t?t:e>n?n:e}var u,p=o.h,f=o.s,m=o.v,v=this.options;switch(n){case"monochromatic":case"mono":if(1===v.algorithm)(u=this.hsv2rgb(o)).r=d(Math.round(u.r+(255-u.r)*v.tint1),0,255),u.g=d(Math.round(u.g+(255-u.g)*v.tint1),0,255),u.b=d(Math.round(u.b+(255-u.b)*v.tint1),0,255),r.push(this.rgb2hsv(u)),(u=this.hsv2rgb(o)).r=d(Math.round(u.r+(255-u.r)*v.tint2),0,255),u.g=d(Math.round(u.g+(255-u.g)*v.tint2),0,255),u.b=d(Math.round(u.b+(255-u.b)*v.tint2),0,255),r.push(this.rgb2hsv(u)),r.push(o),(u=this.hsv2rgb(o)).r=d(Math.round(u.r*v.shade1),0,255),u.g=d(Math.round(u.g*v.shade1),0,255),u.b=d(Math.round(u.b*v.shade1),0,255),r.push(this.rgb2hsv(u)),(u=this.hsv2rgb(o)).r=d(Math.round(u.r*v.shade2),0,255),u.g=d(Math.round(u.g*v.shade2),0,255),u.b=d(Math.round(u.b*v.shade2),0,255),r.push(this.rgb2hsv(u));else if(2===v.algorithm)for(r.push(o),a=1;a<=v.distance;a++)m=c(m-v.step,0,1),f=c(f-v.step,0,1),r.push({h:p,s:f,v:m});else if(3===v.algorithm)for(r.push(o),a=1;a<=v.distance;a++)m=c(m-v.step,0,1),r.push({h:p,s:f,v:m});else m=c(o.v+2*v.step,0,1),r.push({h:p,s:f,v:m}),m=c(o.v+v.step,0,1),r.push({h:p,s:f,v:m}),r.push(o),f=o.s,m=o.v,m=c(o.v-v.step,0,1),r.push({h:p,s:f,v:m}),m=c(o.v-2*v.step,0,1),r.push({h:p,s:f,v:m});break;case"complementary":case"complement":case"comp":r.push(o),p=this.hueShift(o.h,180),r.push({h:p,s:f,v:m});break;case"double-complementary":case"double-complement":case"double":r.push(o),console.log(p),p=this.hueShift(p,180),r.push({h:p,s:f,v:m}),console.log(p),p=this.hueShift(p,v.angle),r.push({h:p,s:f,v:m}),console.log(p),p=this.hueShift(p,180),r.push({h:p,s:f,v:m}),console.log(p);break;case"analogous":case"analog":p=this.hueShift(p,v.angle),r.push({h:p,s:f,v:m}),r.push(o),p=this.hueShift(o.h,0-v.angle),r.push({h:p,s:f,v:m});break;case"triadic":case"triad":for(r.push(o),a=1;a<3;a++)p=this.hueShift(p,120),r.push({h:p,s:f,v:m});break;case"tetradic":case"tetra":r.push(o),p=this.hueShift(o.h,180),r.push({h:p,s:f,v:m}),p=this.hueShift(o.h,-1*v.angle),r.push({h:p,s:f,v:m}),p=this.hueShift(p,180),r.push({h:p,s:f,v:m});break;case"square":for(r.push(o),a=1;a<4;a++)p=this.hueShift(p,90),r.push({h:p,s:f,v:m});break;case"split-complementary":case"split-complement":case"split":p=this.hueShift(p,180-v.angle),r.push({h:p,s:f,v:m}),r.push(o),p=this.hueShift(o.h,180+v.angle),r.push({h:p,s:f,v:m});break;default:console.log("Unknown scheme name")}return function(e,t){var n=[],s=l.options;switch(t){case"hex":n=e.map(function(e){return h.toHEX(e)});break;case"rgb":n=e.map(function(e){return h.toRGB(e)});break;case"rgba":n=e.map(function(e){return h.toRGBA(e,s.alpha)});break;case"hsl":n=e.map(function(e){return h.toHSL(e)});break;case"cmyk":n=e.map(function(e){return h.toCMYK(e)});break;default:n=e}return n}(r,s)}};c.colors=h.init(),t.easing.jswing=t.easing.swing,t.extend(t.easing,{def:"easeOutQuad",swing:function(e,n,s,i,a){return t.easing[t.easing.def](e,n,s,i,a)},easeInQuad:function(e,t,n,s,i){return s*(t/=i)*t+n},easeOutQuad:function(e,t,n,s,i){return-s*(t/=i)*(t-2)+n},easeInOutQuad:function(e,t,n,s,i){return(t/=i/2)<1?s/2*t*t+n:-s/2*(--t*(t-2)-1)+n},easeInCubic:function(e,t,n,s,i){return s*(t/=i)*t*t+n},easeOutCubic:function(e,t,n,s,i){return s*((t=t/i-1)*t*t+1)+n},easeInOutCubic:function(e,t,n,s,i){return(t/=i/2)<1?s/2*t*t*t+n:s/2*((t-=2)*t*t+2)+n},easeInQuart:function(e,t,n,s,i){return s*(t/=i)*t*t*t+n},easeOutQuart:function(e,t,n,s,i){return-s*((t=t/i-1)*t*t*t-1)+n},easeInOutQuart:function(e,t,n,s,i){return(t/=i/2)<1?s/2*t*t*t*t+n:-s/2*((t-=2)*t*t*t-2)+n},easeInQuint:function(e,t,n,s,i){return s*(t/=i)*t*t*t*t+n},easeOutQuint:function(e,t,n,s,i){return s*((t=t/i-1)*t*t*t*t+1)+n},easeInOutQuint:function(e,t,n,s,i){return(t/=i/2)<1?s/2*t*t*t*t*t+n:s/2*((t-=2)*t*t*t*t+2)+n},easeInSine:function(e,t,n,s,i){return-s*Math.cos(t/i*(Math.PI/2))+s+n},easeOutSine:function(e,t,n,s,i){return s*Math.sin(t/i*(Math.PI/2))+n},easeInOutSine:function(e,t,n,s,i){return-s/2*(Math.cos(Math.PI*t/i)-1)+n},easeInExpo:function(e,t,n,s,i){return 0==t?n:s*Math.pow(2,10*(t/i-1))+n},easeOutExpo:function(e,t,n,s,i){return t==i?n+s:s*(1-Math.pow(2,-10*t/i))+n},easeInOutExpo:function(e,t,n,s,i){return 0==t?n:t==i?n+s:(t/=i/2)<1?s/2*Math.pow(2,10*(t-1))+n:s/2*(2-Math.pow(2,-10*--t))+n},easeInCirc:function(e,t,n,s,i){return-s*(Math.sqrt(1-(t/=i)*t)-1)+n},easeOutCirc:function(e,t,n,s,i){return s*Math.sqrt(1-(t=t/i-1)*t)+n},easeInOutCirc:function(e,t,n,s,i){return(t/=i/2)<1?-s/2*(Math.sqrt(1-t*t)-1)+n:s/2*(Math.sqrt(1-(t-=2)*t)+1)+n},easeInElastic:function(e,t,n,s,i){var a=1.70158,o=0,r=s;return 0==t?n:1==(t/=i)?n+s:(o||(o=.3*i),r<Math.abs(s)?(r=s,a=o/4):a=o/(2*Math.PI)*Math.asin(s/r),-r*Math.pow(2,10*(t-=1))*Math.sin((t*i-a)*(2*Math.PI)/o)+n)},easeOutElastic:function(e,t,n,s,i){var a=1.70158,o=0,r=s;return 0==t?n:1==(t/=i)?n+s:(o||(o=.3*i),r<Math.abs(s)?(r=s,a=o/4):a=o/(2*Math.PI)*Math.asin(s/r),r*Math.pow(2,-10*t)*Math.sin((t*i-a)*(2*Math.PI)/o)+s+n)},easeInOutElastic:function(e,t,n,s,i){var a=1.70158,o=0,r=s;return 0==t?n:2==(t/=i/2)?n+s:(o||(o=i*(.3*1.5)),r<Math.abs(s)?(r=s,a=o/4):a=o/(2*Math.PI)*Math.asin(s/r),t<1?r*Math.pow(2,10*(t-=1))*Math.sin((t*i-a)*(2*Math.PI)/o)*-.5+n:r*Math.pow(2,-10*(t-=1))*Math.sin((t*i-a)*(2*Math.PI)/o)*.5+s+n)},easeInBack:function(e,t,n,s,i,a){return null==a&&(a=1.70158),s*(t/=i)*t*((a+1)*t-a)+n},easeOutBack:function(e,t,n,s,i,a){return null==a&&(a=1.70158),s*((t=t/i-1)*t*((a+1)*t+a)+1)+n},easeInOutBack:function(e,t,n,s,i,a){return null==a&&(a=1.70158),(t/=i/2)<1?s/2*(t*t*((1+(a*=1.525))*t-a))+n:s/2*((t-=2)*t*((1+(a*=1.525))*t+a)+2)+n},easeInBounce:function(e,n,s,i,a){return i-t.easing.easeOutBounce(e,a-n,0,i,a)+s},easeOutBounce:function(e,t,n,s,i){return(t/=i)<1/2.75?s*(7.5625*t*t)+n:t<2/2.75?s*(7.5625*(t-=1.5/2.75)*t+.75)+n:t<2.5/2.75?s*(7.5625*(t-=2.25/2.75)*t+.9375)+n:s*(7.5625*(t-=2.625/2.75)*t+.984375)+n},easeInOutBounce:function(e,n,s,i,a){return n<a/2?.5*t.easing.easeInBounce(e,2*n,0,i,a)+s:.5*t.easing.easeOutBounce(e,2*n-a,0,i,a)+.5*i+s}});var u={init:function(){return this},options:{csvDelimiter:"\t",csvNewLine:"\r\n",includeHeader:!0},setup:function(e){return this.options=t.extend({},this.options,e),this},base64:function(e){return window.btoa(unescape(encodeURIComponent(e)))},b64toBlob:function(e,t,n){t=t||"",n=n||512;var s,i=window.atob(e),a=[];for(s=0;s<i.length;s+=n){var o,r=i.slice(s,s+n),l=new Array(r.length);for(o=0;o<r.length;o+=1)l[o]=r.charCodeAt(o);var c=new window.Uint8Array(l);a.push(c)}return new Blob(a,{type:t})},tableToCSV:function(e,n,s){var i,a,o,r,l,c,d=this.options,h="";if(d=t.extend({},d,s),j.isJQueryObject(e)&&(e=e[0]),j.bool(d.includeHeader))for(a=e.querySelectorAll("thead")[0],o=0;o<a.rows.length;o++){for(l=a.rows[o],r=0;r<l.cells.length;r++)c=l.cells[r],h+=(r?d.csvDelimiter:"")+c.textContent.trim();h+=d.csvNewLine}for(i=e.querySelectorAll("tbody")[0],o=0;o<i.rows.length;o++){for(l=i.rows[o],r=0;r<l.cells.length;r++)c=l.cells[r],h+=(r?d.csvDelimiter:"")+c.textContent.trim();h+=d.csvNewLine}return j.isValue(n)?this.createDownload(this.base64("\ufeff"+h),"application/csv",n):h},createDownload:function(e,t,n){var s,i,a;return(i=document.createElement("a")).style.display="none",document.body.appendChild(i),s=this.b64toBlob(e,t),a=window.URL.createObjectURL(s),i.href=a,i.download=n||j.elementId("download"),i.click(),window.URL.revokeObjectURL(a),document.body.removeChild(i),!0}};c.export=u.init(),t.fn.extend({toggleAttr:function(e,n){return this.each(function(){var s=t(this);void 0!==n?s.attr(e,n):void 0!==s.attr(e)?s.removeAttr(e):s.attr(e,""+e)})},clearClasses:function(){return this.each(function(){this.className=""})}}),Array.prototype.shuffle=function(){for(var e,t,n=this.length;0!==n;)t=Math.floor(Math.random()*n),e=this[n-=1],this[n]=this[t],this[t]=e;return this},Array.prototype.clone=function(){return this.slice(0)},Array.prototype.unique=function(){for(var e=this.concat(),t=0;t<e.length;++t)for(var n=t+1;n<e.length;++n)e[t]===e[n]&&e.splice(n--,1);return e},Number.prototype.format=function(e,t,n,s){var i="\\d(?=(\\d{"+(t||3)+"})+"+(e>0?"\\D":"$")+")",a=this.toFixed(Math.max(0,~~e));return(s?a.replace(".",s):a).replace(new RegExp(i,"g"),"$&"+(n||","))},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)},String.prototype.contains=function(){return!!~String.prototype.indexOf.apply(this,arguments)},String.prototype.toDate=function(e){var t=this.replace(/[^a-zA-Z0-9]/g,"-"),n=e.toLowerCase().replace(/[^a-zA-Z0-9]/g,"-").split("-"),s=t.split("-"),i=n.indexOf("mm"),a=n.indexOf("dd"),o=n.indexOf("yyyy"),r=n.indexOf("hh"),l=n.indexOf("ii"),c=n.indexOf("ss"),d=new Date,h=o>-1?s[o]:d.getFullYear(),u=i>-1?s[i]-1:d.getMonth()-1,p=a>-1?s[a]:d.getDate(),f=r>-1?s[r]:d.getHours(),m=l>-1?s[l]:d.getMinutes(),v=c>-1?s[c]:d.getSeconds();return new Date(h,u,p,f,m,v)},Date.prototype.format=function(e,t){void 0===t&&(t="en-US");var n=(void 0!==c.locales[t]?c.locales[t]:c.locales["en-US"]).calendar,s=this,i=s.getDay(),a=s.getDate(),o=s.getMonth(),r=s.getFullYear(),l=s.getHours(),d=n.days,h=n.months,u=[0,31,59,90,120,151,181,212,243,273,304,334],p=function(){var e=new Date(s);return e.setDate(a-(i+6)%7+3),e},f=function(e,t){return(""+(Math.pow(10,t)+e)).slice(1)};return e.replace(/%[a-z]/gi,function(e){return{"%a":d[i].slice(0,3),"%A":d[i],"%b":h[o].slice(0,3),"%B":h[o],"%c":s.toUTCString(),"%C":Math.floor(r/100),"%d":f(a,2),"%e":a,"%F":s.toISOString().slice(0,10),"%G":p().getFullYear(),"%g":(""+p().getFullYear()).slice(2),"%H":f(l,2),"%I":f((l+11)%12+1,2),"%j":f(u[o]+a+(o>1&&(r%4==0&&r%100!=0||r%400==0)?1:0),3),"%k":""+l,"%l":(l+11)%12+1,"%m":f(o+1,2),"%M":f(s.getMinutes(),2),"%p":l<12?"AM":"PM","%P":l<12?"am":"pm","%s":Math.round(s.getTime()/1e3),"%S":f(s.getSeconds(),2),"%u":i||7,"%V":function(){var e=p(),t=e.valueOf();e.setMonth(0,1);var n=e.getDay();return 4!==n&&e.setMonth(0,1+(4-n+7)%7),f(1+Math.ceil((t-e)/6048e5),2)}(),"%w":""+i,"%x":s.toLocaleDateString(),"%X":s.toLocaleTimeString(),"%y":(""+r).slice(2),"%Y":r,"%z":s.toTimeString().replace(/.+GMT([+-]\d+).+/,"$1"),"%Z":s.toTimeString().replace(/.+\((.+?)\)$/,"$1")}[e]||e})},Date.prototype.addHours=function(e){return this.setTime(this.getTime()+60*e*60*1e3),this},Date.prototype.addDays=function(e){return this.setDate(this.getDate()+e),this},Date.prototype.addMonths=function(e){return this.setMonth(this.getMonth()+e),this},Date.prototype.addYears=function(e){return this.setFullYear(this.getFullYear()+e),this};var p={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:METRO_HOTKEYS_FILTER_INPUT_ACCEPTING_ELEMENTS,filterTextInputs:METRO_HOTKEYS_FILTER_TEXT_INPUTS,filterContentEditable:METRO_HOTKEYS_FILTER_CONTENT_EDITABLE},keyHandler:function(e){if("string"==typeof e.data&&(e.data={keys:e.data}),e.data&&e.data.keys&&"string"==typeof e.data.keys){var n=e.handler,s=e.data.keys.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!(p.options.filterInputAcceptingElements&&p.textInputTypes.test(e.target.nodeName)||p.options.filterContentEditable&&t(e.target).attr("contenteditable")||p.options.filterTextInputs&&t.inArray(e.target.type,p.textAcceptingInputTypes)>-1)){var i="keypress"!==e.type&&p.specialKeys[e.which],a=String.fromCharCode(e.which).toLowerCase(),o="",r={};t.each(["alt","ctrl","shift"],function(t,n){e[n+"Key"]&&i!==n&&(o+=n+"+")}),e.metaKey&&!e.ctrlKey&&"meta"!==i&&(o+="meta+"),e.metaKey&&"meta"!==i&&o.indexOf("alt+ctrl+shift+")>-1&&(o=o.replace("alt+ctrl+shift+","hyper+")),i?r[o+i]=!0:(r[o+a]=!0,r[o+p.shiftNums[a]]=!0,"shift+"===o&&(r[p.shiftNums[a]]=!0));for(var l=0,c=s.length;l<c;l++)if(r[s[l]])return n.apply(this,arguments)}}}}};t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:p.keyHandler}});c.locales={"en-US":{calendar:{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","Sun","Mon","Tus","Wen","Thu","Fri","Sat"],time:{days:"DAYS",hours:"HOURS",minutes:"MINS",seconds:"SECS",month:"MON",day:"DAY",year:"YEAR"}},buttons:{ok:"OK",cancel:"Cancel",done:"Done",today:"Today",now:"Now",clear:"Clear",help:"Help",yes:"Yes",no:"No",random:"Random",save:"Save",reset:"Reset"}},"cn-ZH":{calendar:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","日","一","二","三","四","五","六","周日","周一","周二","周三","周四","周五","周六"],time:{days:"天",hours:"时",minutes:"分",seconds:"秒",month:"月",day:"日",year:"年"}},buttons:{ok:"确认",cancel:"取消",done:"完成",today:"今天",now:"现在",clear:"清除",help:"帮助",yes:"是",no:"否",random:"随机",save:"保存",reset:"重啟"}},"de-DE":{calendar:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember","Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sn","Mn","Di","Mi","Do","Fr","Sa","Son","Mon","Die","Mit","Don","Fre","Sam"],time:{days:"TAGE",hours:"UHR",minutes:"MIN",seconds:"SEK"}},buttons:{ok:"OK",cancel:"Abbrechen",done:"Fertig",today:"Heute",now:"Jetzt",clear:"Reinigen",help:"Hilfe",yes:"Ja",no:"Nein",random:"Zufällig",save:"Sparen",reset:"Zurücksetzen"}},"hu-HU":{calendar:{months:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December","Jan","Feb","Már","Ápr","Máj","Jún","Júl","Aug","Szep","Okt","Nov","Dec"],days:["Vasárnap","Hétfő","Kedd","Szerda","Csütörtök","Péntek","Szombat","V","H","K","Sz","Cs","P","Sz","Vas","Hét","Ke","Sze","Csü","Pén","Szom"],time:{days:"NAP",hours:"ÓRA",minutes:"PERC",seconds:"MP"}},buttons:{ok:"OK",cancel:"Mégse",done:"Kész",today:"Ma",now:"Most",clear:"Törlés",help:"Segítség",yes:"Igen",no:"Nem",random:"Véletlen",save:"Mentés",reset:"Visszaállítás"}},"ru-RU":{calendar:{months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь","Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Вс","Пн","Вт","Ср","Чт","Пт","Сб","Вос","Пон","Вто","Сре","Чет","Пят","Суб"],time:{days:"ДНИ",hours:"ЧАСЫ",minutes:"МИН",seconds:"СЕК"}},buttons:{ok:"ОК",cancel:"Отмена",done:"Готово",today:"Сегодня",now:"Сейчас",clear:"Очистить",help:"Помощь",yes:"Да",no:"Нет",random:"Случайно",save:"Сохранить",reset:"Сброс"}},"uk-UA":{calendar:{months:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень","Січ","Лют","Бер","Кві","Тра","Чер","Лип","Сер","Вер","Жов","Лис","Гру"],days:["Неділя","Понеділок","Вівторок","Середа","Четвер","П’ятниця","Субота","Нд","Пн","Вт","Ср","Чт","Пт","Сб","Нед","Пон","Вiв","Сер","Чет","Пят","Суб"],time:{days:"ДНІ",hours:"ГОД",minutes:"ХВИЛ",seconds:"СЕК"}},buttons:{ok:"ОК",cancel:"Відміна",done:"Готово",today:"Сьогодні",now:"Зараз",clear:"Очистити",help:"Допомога",yes:"Так",no:"Ні",random:"Випадково",save:"Зберегти",reset:"Скинути"}},"es-MX":{calendar:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre","Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Do","Lu","Ma","Mi","Ju","Vi","Sa","Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],time:{days:"DÍAS",hours:"HORAS",minutes:"MINS",seconds:"SEGS",month:"MES",day:"DÍA",year:"AÑO"}},buttons:{ok:"Aceptar",cancel:"Cancelar",done:"Hecho",today:"Hoy",now:"Ahora",clear:"Limpiar",help:"Ayuda",yes:"Si",no:"No",random:"Aleatorio",save:"Salvar",reset:"Reiniciar"}},"fr-FR":{calendar:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre","Janv","Févr","Mars","Avr","Mai","Juin","Juil","Août","Sept","Oct","Nov","Déc"],days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","De","Du","Ma","Me","Je","Ve","Sa","Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],time:{days:"JOURS",hours:"HEURES",minutes:"MINS",seconds:"SECS",month:"MOIS",day:"JOUR",year:"ANNEE"}},buttons:{ok:"OK",cancel:"Annulé",done:"Fait",today:"Aujourd'hui",now:"Maintenant",clear:"Effacé",help:"Aide",yes:"Oui",no:"Non",random:"Aléatoire",save:"Sauvegarder",reset:"Réinitialiser"}},"it-IT":{calendar:{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","Do","Lu","Ma","Me","Gi","Ve","Sa","Dom","Lun","Mar","Mer","Gio","Ven","Sab"],time:{days:"GIORNI",hours:"ORE",minutes:"MIN",seconds:"SEC",month:"MESE",day:"GIORNO",year:"ANNO"}},buttons:{ok:"OK",cancel:"Annulla",done:"Fatto",today:"Oggi",now:"Adesso",clear:"Cancella",help:"Aiuto",yes:"Sì",no:"No",random:"Random",save:"Salvare",reset:"Reset"}}};var f=0;function m(e){return b(w(C(e),8*e.length))}function v(e){for(var t,n=f?"0123456789ABCDEF":"0123456789abcdef",s="",i=0;i<e.length;i++)t=e.charCodeAt(i),s+=n.charAt(t>>>4&15)+n.charAt(15&t);return s}function g(e){for(var t,n,s="",i=-1;++i<e.length;)t=e.charCodeAt(i),n=i+1<e.length?e.charCodeAt(i+1):0,55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t=65536+((1023&t)<<10)+(1023&n),i++),t<=127?s+=String.fromCharCode(t):t<=2047?s+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?s+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(s+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return s}function C(e){var t,n=new Array(e.length>>2);for(t=0;t<n.length;t++)n[t]=0;for(t=0;t<8*e.length;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function b(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>n%32&255);return t}function w(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n=1732584193,s=-271733879,i=-1732584194,a=271733878,o=0;o<e.length;o+=16){var r=n,l=s,c=i,d=a;s=k(s=k(s=k(s=k(s=_(s=_(s=_(s=_(s=T(s=T(s=T(s=T(s=x(s=x(s=x(s=x(s,i=x(i,a=x(a,n=x(n,s,i,a,e[o],7,-680876936),s,i,e[o+1],12,-389564586),n,s,e[o+2],17,606105819),a,n,e[o+3],22,-1044525330),i=x(i,a=x(a,n=x(n,s,i,a,e[o+4],7,-176418897),s,i,e[o+5],12,1200080426),n,s,e[o+6],17,-1473231341),a,n,e[o+7],22,-45705983),i=x(i,a=x(a,n=x(n,s,i,a,e[o+8],7,1770035416),s,i,e[o+9],12,-1958414417),n,s,e[o+10],17,-42063),a,n,e[o+11],22,-1990404162),i=x(i,a=x(a,n=x(n,s,i,a,e[o+12],7,1804603682),s,i,e[o+13],12,-40341101),n,s,e[o+14],17,-1502002290),a,n,e[o+15],22,1236535329),i=T(i,a=T(a,n=T(n,s,i,a,e[o+1],5,-165796510),s,i,e[o+6],9,-1069501632),n,s,e[o+11],14,643717713),a,n,e[o],20,-373897302),i=T(i,a=T(a,n=T(n,s,i,a,e[o+5],5,-701558691),s,i,e[o+10],9,38016083),n,s,e[o+15],14,-660478335),a,n,e[o+4],20,-405537848),i=T(i,a=T(a,n=T(n,s,i,a,e[o+9],5,568446438),s,i,e[o+14],9,-1019803690),n,s,e[o+3],14,-187363961),a,n,e[o+8],20,1163531501),i=T(i,a=T(a,n=T(n,s,i,a,e[o+13],5,-1444681467),s,i,e[o+2],9,-51403784),n,s,e[o+7],14,1735328473),a,n,e[o+12],20,-1926607734),i=_(i,a=_(a,n=_(n,s,i,a,e[o+5],4,-378558),s,i,e[o+8],11,-2022574463),n,s,e[o+11],16,1839030562),a,n,e[o+14],23,-35309556),i=_(i,a=_(a,n=_(n,s,i,a,e[o+1],4,-1530992060),s,i,e[o+4],11,1272893353),n,s,e[o+7],16,-155497632),a,n,e[o+10],23,-1094730640),i=_(i,a=_(a,n=_(n,s,i,a,e[o+13],4,681279174),s,i,e[o],11,-358537222),n,s,e[o+3],16,-722521979),a,n,e[o+6],23,76029189),i=_(i,a=_(a,n=_(n,s,i,a,e[o+9],4,-640364487),s,i,e[o+12],11,-421815835),n,s,e[o+15],16,530742520),a,n,e[o+2],23,-995338651),i=k(i,a=k(a,n=k(n,s,i,a,e[o],6,-198630844),s,i,e[o+7],10,1126891415),n,s,e[o+14],15,-1416354905),a,n,e[o+5],21,-57434055),i=k(i,a=k(a,n=k(n,s,i,a,e[o+12],6,1700485571),s,i,e[o+3],10,-1894986606),n,s,e[o+10],15,-1051523),a,n,e[o+1],21,-2054922799),i=k(i,a=k(a,n=k(n,s,i,a,e[o+8],6,1873313359),s,i,e[o+15],10,-30611744),n,s,e[o+6],15,-1560198380),a,n,e[o+13],21,1309151649),i=k(i,a=k(a,n=k(n,s,i,a,e[o+4],6,-145523070),s,i,e[o+11],10,-1120210379),n,s,e[o+2],15,718787259),a,n,e[o+9],21,-343485551),n=S(n,r),s=S(s,l),i=S(i,c),a=S(a,d)}return[n,s,i,a]}function y(e,t,n,s,i,a){return S((o=S(S(t,e),S(s,a)))<<(r=i)|o>>>32-r,n);var o,r}function x(e,t,n,s,i,a,o){return y(t&n|~t&s,e,t,i,a,o)}function T(e,t,n,s,i,a,o){return y(t&s|n&~s,e,t,i,a,o)}function _(e,t,n,s,i,a,o){return y(t^n^s,e,t,i,a,o)}function k(e,t,n,s,i,a,o){return y(n^(t|~s),e,t,i,a,o)}function S(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}var O,I,M=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],D="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],A=Array.prototype.slice;if(t.event.fixHooks)for(var E=M.length;E;)t.event.fixHooks[M[--E]]=t.event.mouseHooks;function P(e){var n,s=e||window.event,i=A.call(arguments,1),a=0,o=0,r=0,l=0,c=0;if((e=t.event.fix(s)).type="mousewheel","detail"in s&&(r=-1*s.detail),"wheelDelta"in s&&(r=s.wheelDelta),"wheelDeltaY"in s&&(r=s.wheelDeltaY),"wheelDeltaX"in s&&(o=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(o=-1*r,r=0),a=0===r?o:r,"deltaY"in s&&(a=r=-1*s.deltaY),"deltaX"in s&&(o=s.deltaX,0===r&&(a=-1*o)),0!==r||0!==o){if(1===s.deltaMode){var d=t.data(this,"mousewheel-line-height");a*=d,r*=d,o*=d}else if(2===s.deltaMode){var h=t.data(this,"mousewheel-page-height");a*=h,r*=h,o*=h}if(n=Math.max(Math.abs(r),Math.abs(o)),(!I||n<I)&&(I=n,F(s,n)&&(I/=40)),F(s,n)&&(a/=40,o/=40,r/=40),a=Math[a>=1?"floor":"ceil"](a/I),o=Math[o>=1?"floor":"ceil"](o/I),r=Math[r>=1?"floor":"ceil"](r/I),t.event.special.mousewheel.settings.normalizeOffset&&this.getBoundingClientRect){var u=this.getBoundingClientRect();l=e.clientX-u.left,c=e.clientY-u.top}return e.deltaX=o,e.deltaY=r,e.deltaFactor=I,e.offsetX=l,e.offsetY=c,e.deltaMode=0,i.unshift(e,a,o,r),O&&clearTimeout(O),O=setTimeout(N,200),(t.event.dispatch||t.event.handle).apply(this,i)}}function N(){I=null}function F(e,n){return t.event.special.mousewheel.settings.adjustOldDeltas&&"mousewheel"===e.type&&n%120==0}t.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=D.length;e;)this.addEventListener(D[--e],P,!1);else this.onmousewheel=P;t.data(this,"mousewheel-line-height",t.event.special.mousewheel.getLineHeight(this)),t.data(this,"mousewheel-page-height",t.event.special.mousewheel.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=D.length;e;)this.removeEventListener(D[--e],P,!1);else this.onmousewheel=null;t.removeData(this,"mousewheel-line-height"),t.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var n=t(e),s=n["offsetParent"in t.fn?"offsetParent":"parent"]();return s.length||(s=t("body")),parseInt(s.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(e){return t(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}},t.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}});var R=t.event.dispatch||t.event.handle,B=e.event.special,H="D"+ +new Date,L="D"+(+new Date+1);B.scrollstart={setup:function(e){var n,s=t.extend({latency:B.scrollstop.latency},e),i=function(e){n?(clearTimeout(n),n=null):(e.type="scrollstart",R.apply(this,arguments)),n=setTimeout(function(){n=null},s.latency)};t(this).on("scroll",i).data(H,i)},teardown:function(){t(this).off("scroll",t(this).data(H))}},B.scrollstop={latency:250,setup:function(e){var n,s=t.extend({latency:B.scrollstop.latency},e),i=function(e){var t=this,i=arguments;n&&(clearTimeout(n),n=null),n=setTimeout(function(){n=null,e.type="scrollstop",R.apply(t,i)},s.latency)};t(this).on("scroll",i).data(L,i)},teardown:function(){t(this).off("scroll",t(this).data(L))}};var z={key:"METRO:APP",init:function(e){return this.options=t.extend({},this.options,e),this},nvl:function(e,t){return null==e?t:e},setKey:function(e){this.key=e},getKey:function(){return this.key},setItem:function(e,t){window.sessionStorage.setItem(this.key+":"+e,JSON.stringify(t))},getItem:function(e,t,n){var s,i;i=this.nvl(window.sessionStorage.getItem(this.key+":"+e),t);try{s=JSON.parse(i,n)}catch(e){s=null}return s},getItemPart:function(e,t,n,s){var i,a=this.getItem(e,n,s);for(t=t.split("->"),i=0;i<t.length;i++)a=a[t[i]];return a},delItem:function(e){window.sessionStorage.removeItem(this.key+":"+e)},size:function(e){var t;switch(e){case"m":case"M":t=1048576;break;case"k":case"K":t=1024;break;default:t=1}return JSON.stringify(window.sessionStorage).length/t}};c.session=z.init();var V={key:"METRO:APP",init:function(e,n){return this.options=t.extend({},this.options,e),this},nvl:function(e,t){return null==e?t:e},setKey:function(e){this.key=e},getKey:function(){return this.key},setItem:function(e,t){window.localStorage.setItem(this.key+":"+e,JSON.stringify(t))},getItem:function(e,t,n){var s,i;i=this.nvl(window.localStorage.getItem(this.key+":"+e),t);try{s=JSON.parse(i,n)}catch(e){s=null}return s},getItemPart:function(e,t,n,s){var i,a=this.getItem(e,n,s);for(t=t.split("->"),i=0;i<t.length;i++)a=a[t[i]];return a},delItem:function(e){window.localStorage.removeItem(this.key+":"+e)},size:function(e){var t;switch(e){case"m":case"M":t=1048576;break;case"k":case"K":t=1024;break;default:t=1}return JSON.stringify(window.localStorage).length/t}};c.storage=V.init();c.template=function(e,t){for(var n,s,i=/<%(.+?)%>/g,a=/(^( )?(var|if|for|else|switch|case|break|{|}|;))(.*)?/g,o="with(obj) { var r=[];\n",r=0,l=function(e,t){return o+=t?e.match(a)?e+"\n":"r.push("+e+");\n":""!==e?'r.push("'+e.replace(/"/g,'\\"')+'");\n':"",l};s=i.exec(e);)l(e.slice(r,s.index))(s[1],!0),r=s.index+s[0].length;l(e.substr(r,e.length-r)),o=(o+'return r.join(""); }').replace(/[\r\t\n]/g," ");try{n=new Function("obj",o).apply(t,[t])}catch(e){console.error("'"+e.message+"'"," in \n\nCode:\n",o,"\n")}return n};var j={isUrl:function(e){return/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@\-\/]))?/.test(e)},isTag:function(e){return/^<\/?[\w\s="/.':;#-\/\?]+>/gi.test(e)},isColor:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},isEmbedObject:function(e){var n=!1;return t.each(["iframe","object","embed","video"],function(){-1!==e.indexOf(this)&&(n=!0)}),n},isVideoUrl:function(e){return/youtu\.be|youtube|vimeo/gi.test(e)},isDate:function(e){return"Invalid Date"!==String(new Date(e))},isInt:function(e){return Number(e)===e&&e%1==0},isFloat:function(e){return Number(e)===e&&e%1!=0},isTouchDevice:function(){return"ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0},isFunc:function(e){return this.isType(e,"function")},isObject:function(e){return this.isType(e,"object")},isArray:function(e){return Array.isArray(e)},isType:function(e,t){if(null==e)return!1;if(typeof e===t)return e;if(this.isTag(e)||this.isUrl(e))return!1;if(typeof window[e]===t)return window[e];if("string"==typeof e&&-1===e.indexOf("."))return!1;if("string"==typeof e&&-1!==e.indexOf(" "))return!1;if("string"==typeof e&&-1!==e.indexOf("("))return!1;if("string"==typeof e&&-1!==e.indexOf("["))return!1;var n,s=e.split("."),i=window;for(n=0;n<s.length;n++)i=i[s[n]];return typeof i===t&&i},isMetroObject:function(e,n){var s=t(e),i=s.data(n);return 0===s.length?(console.log(n+" "+e+" not found!"),!1):void 0!==i||(console.log("Element not contain role "+n+'! Please add attribute data-role="'+n+'" to element '+e),!1)},isJQueryObject:function(t){return"function"==typeof e&&t instanceof e},embedObject:function(e){return"string"!=typeof e&&(e=this.isJQueryObject(e)?e.html():e.innerHTML),"<div class='embed-container'>"+e+"</div>"},embedUrl:function(e){return-1!==e.indexOf("youtu.be")&&(e="https://www.youtube.com/embed/"+e.split("/").pop()),"<div class='embed-container'><iframe src='"+e+"'></iframe></div>"},secondsToTime:function(e){var t=e%3600,n=t%60;return{h:Math.floor(e/3600),m:Math.floor(t/60),s:Math.ceil(n)}},hex2rgba:function(e,t){var n;if(t=isNaN(t)?1:t,/^#([A-Fa-f0-9]{3}){1,2}$/.test(e))return 3===(n=e.substring(1).split("")).length&&(n=[n[0],n[0],n[1],n[1],n[2],n[2]]),"rgba("+[(n="0x"+n.join(""))>>16&255,n>>8&255,255&n].join(",")+","+t+")";throw new Error("Hex2rgba error. Bad Hex value")},random:function(e,t){return Math.floor(Math.random()*(t-e+1)+e)},uniqueId:function(){var e=(new Date).getTime();return"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)})},elementId:function(e){return e+"-"+(new Date).getTime()+j.random(1,1e3)},secondsToFormattedString:function(e){var t=parseInt(e,10),n=Math.floor(t/3600),s=Math.floor((t-3600*n)/60),i=t-3600*n-60*s;return n<10&&(n="0"+n),s<10&&(s="0"+s),i<10&&(i="0"+i),[n,s,i].join(":")},callback:function(e,t,n){return this.exec(e,t,n)},func:function(e){return new Function("a",e)},exec:function(e,t,n){var s;if(null==e)return!1;var i=this.isFunc(e);!1===i&&(i=this.func(e));try{s=i.apply(n,t)}catch(e){if(s=null,!0===METRO_THROWS)throw e}return s},isOutsider:function(e){var n,s=(e=this.isJQueryObject(e)?e:t(e)).clone();return s.removeAttr("data-role").css({visibility:"hidden",position:"absolute",display:"block"}),e.parent().append(s),n=s[0].getBoundingClientRect(),s.remove(),n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth)},inViewport:function(e){var t=this.rect(e);return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},rect:function(t){return"function"==typeof e&&t instanceof e&&(t=t[0]),t.getBoundingClientRect()},objectLength:function(e){return Object.keys(e).length},percent:function(e,t,n){if(0===e)return 0;var s=100*t/e;return!0===n?Math.round(s):Math.round(100*s)/100},camelCase:function(e){return e.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})},dashedName:function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})},objectShift:function(e){var n=0;return t.each(e,function(e){0===n?n=e:n>e&&(n=e)}),delete e[n],e},objectDelete:function(e,t){void 0!==e[t]&&delete e[t]},arrayDelete:function(e,t){e.splice(e.indexOf(t),1)},arrayDeleteByKey:function(e,t){e.splice(t,1)},nvl:function(e,t){return null==e?t:e},objectClone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},github:function(e,n){var s=this;t.ajax({url:"https://api.github.com/repos/"+e,dataType:"jsonp"}).done(function(e){s.callback(n,[e.data])})},detectIE:function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var s=e.indexOf("Edge/");return s>0&&parseInt(e.substring(s+5,e.indexOf(".",s)),10)},detectChrome:function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)},md5:function(e){return v(m(g(e)))},encodeURI:function(e){return encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")},pageHeight:function(){var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)},cleanPreCode:function(e){Array.prototype.slice.call(document.querySelectorAll(e),0).forEach(function(e){var t=e.textContent.replace(/^[\r\n]+/,"").replace(/\s+$/g,"");if(/^\S/gm.test(t))e.textContent=t;else{for(var n,s,i,a=/^[\t ]+/gm,o=1e3;n=a.exec(t);)(i=n[0].length)<o&&(o=i,s=n[0]);1e3!==o&&(e.textContent=t.replace(new RegExp("^"+s,"gm"),""))}})},coords:function(e){this.isJQueryObject(e)&&(e=e[0]);var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},positionXY:function(e,t){switch(t){case"client":return this.clientXY(e);case"screen":return this.screenXY(e);case"page":return this.pageXY(e);default:return{x:0,y:0}}},clientXY:function(e){return{x:e.changedTouches?e.changedTouches[0].clientX:e.clientX,y:e.changedTouches?e.changedTouches[0].clientY:e.clientY}},screenXY:function(e){return{x:e.changedTouches?e.changedTouches[0].screenX:e.screenX,y:e.changedTouches?e.changedTouches[0].screenY:e.screenY}},pageXY:function(e){return{x:e.changedTouches?e.changedTouches[0].pageX:e.pageX,y:e.changedTouches?e.changedTouches[0].pageY:e.pageY}},isRightMouse:function(e){return"which"in e?3===e.which:"button"in e?2===e.button:void 0},hiddenElementSize:function(e,n){var s=t(e).clone();s.removeAttr("data-role").css({visibility:"hidden",position:"absolute",display:"block"}),t("body").append(s),void 0===n&&(n=!1);var i=s.outerWidth(n),a=s.outerHeight(n);return s.remove(),{width:i,height:a}},getStyle:function(e,t){return!0===j.isJQueryObject(e)&&(e=e[0]),window.getComputedStyle(e,t)},getStyleOne:function(e,t){return this.getStyle(e).getPropertyValue(t)},getTransformMatrix:function(e,t){var n=this.getStyleOne(e,"transform").replace("matrix(","").slice(0,-1).split(",");return!0!==t?{a:n[0],b:n[1],c:n[2],d:n[3],tx:n[4],ty:n[5]}:n},computedRgbToHex:function(e){var n=e.replace(/[^\d,]/g,"").split(","),s="#";return t.each(n,function(){var e=parseInt(this).toString(16);s+=1===e.length?"0"+e:e}),s},computedRgbToRgba:function(e,t){var n=e.replace(/[^\d,]/g,"").split(",");return void 0===t&&(t=1),n.push(t),"rgba("+n.join(",")+")"},computedRgbToArray:function(e){return e.replace(/[^\d,]/g,"").split(",")},hexColorToArray:function(e){var t;return/^#([A-Fa-f0-9]{3}){1,2}$/.test(e)?(3===(t=e.substring(1).split("")).length&&(t=[t[0],t[0],t[1],t[1],t[2],t[2]]),[(t="0x"+t.join(""))>>16&255,t>>8&255,255&t]):[0,0,0]},hexColorToRgbA:function(e,t){var n;return/^#([A-Fa-f0-9]{3}){1,2}$/.test(e)?(3===(n=e.substring(1).split("")).length&&(n=[n[0],n[0],n[1],n[1],n[2],n[2]]),"rgba("+[(n="0x"+n.join(""))>>16&255,n>>8&255,255&n,t||1].join(",")+")"):"rgba(0,0,0,1)"},getInlineStyles:function(e){var t={};this.isJQueryObject(e)&&(e=e[0]);for(var n=0,s=e.style.length;n<s;n++){var i=e.style[n];t[i]=e.style[i]}return t},updateURIParameter:function(e,t,n){var s=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(s)?e.replace(s,"$1"+t+"="+n+"$2"):e+i+t+"="+n},getURIParameter:function(e,t){e||(e=window.location.href),t=t.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getLocales:function(){return Object.keys(c.locales)},addLocale:function(e){c.locales=t.extend({},c.locales,e)},strToArray:function(e,t){return this.isValue(t)||(t=","),(""+e).split(t).map(function(e){return e.trim()})},aspectRatioH:function(e,t){return"16/9"===t?9*e/16:"21/9"===t?9*e/21:"4/3"===t?3*e/4:void 0},aspectRatioW:function(e,t){return"16/9"===t?16*e/9:"21/9"===t?21*e/9:"4/3"===t?4*e/3:void 0},valueInObject:function(e,t){return Object.values(e).indexOf(t)>-1},keyInObject:function(){return Object.keys(obj).indexOf(value)>-1},inObject:function(e,t,n){return void 0!==e[t]&&e[t]===n},newCssSheet:function(e){var t=document.createElement("style");return void 0!==e&&t.setAttribute("media",e),t.appendChild(document.createTextNode("")),document.head.appendChild(t),t.sheet},addCssRule:function(e,t,n,s){"insertRule"in e?e.insertRule(t+"{"+n+"}",s):"addRule"in e&&e.addRule(t,n,s)},media:function(e){return window.matchMedia(e).matches},mediaModes:function(){return METRO_MEDIA},mediaExist:function(e){return METRO_MEDIA.indexOf(e)>-1},inMedia:function(e){return METRO_MEDIA.indexOf(e)>-1&&METRO_MEDIA.indexOf(e)===METRO_MEDIA.length-1},isValue:function(e){return null!=e&&""!==e},isNegative:function(e){return parseFloat(e)<0},isPositive:function(e){return parseFloat(e)>0},isZero:function(e){return 0===parseFloat(e.toFixed(2))},between:function(e,t,n,s){return!0===s?e>=t&&e<=n:e>t&&e<n},parseMoney:function(e){return Number(parseFloat(e.replace(/[^0-9-.]/g,"")))},isVisible:function(e){return this.isJQueryObject(e)&&(e=e[0]),"none"!==this.getStyleOne(e,"display")&&"hidden"!==this.getStyleOne(e,"visibility")&&null!==e.offsetParent},parseNumber:function(e,t,n){return e.replace(new RegExp("\\"+t,"g"),"").replace(new RegExp("\\"+n,"g"),".")},nearest:function(e,t,n){return e/=t,e=Math[!0===n?"floor":"ceil"](e)*t},bool:function(e){switch(e){case!0:case"true":case 1:case"1":case"on":case"yes":return!0;default:return!1}},copy:function(e){var t,n,s=document.body;if(this.isJQueryObject(e)&&(e=e[0]),document.createRange&&window.getSelection){t=document.createRange(),(n=window.getSelection()).removeAllRanges();try{t.selectNodeContents(e),n.addRange(t)}catch(s){t.selectNode(e),n.addRange(t)}}else s.createTextRange&&((t=s.createTextRange()).moveToElementText(e),t.select());document.execCommand("Copy"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()}};c.utils=j;var Y={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),j.exec(this.options.onAccordionCreate,[this.element]),this},options:{duration:METRO_ANIMATION_DURATION,oneFrame:!0,showActive:!0,activeFrameClass:"",activeHeadingClass:"",activeContentClass:"",onFrameOpen:c.noop,onFrameBeforeOpen:c.noop_true,onFrameClose:c.noop,onFrameBeforeClose:c.noop_true,onAccordionCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,t=this.element,n=this.options,s=t.children(".frame"),i=t.children(".frame.active");t.addClass("accordion"),e=0===i.length?s[0]:i[0],this._hideAll(),!0!==n.showActive&&!0!==n.oneFrame||this._openFrame(e),this._createEvents()},_createEvents:function(){var e=this,n=this.element,s=this.options,i=n.children(".frame.active");n.on(c.events.click,".heading",function(){var a=t(this),o=a.parent();if(a.closest(".accordion")[0]!==n[0])return!1;o.hasClass("active")?1===i.length&&s.oneFrame||e._closeFrame(o):e._openFrame(o),n.trigger("open",{frame:o})})},_openFrame:function(e){var n=this.element,s=this.options,i=(n.children(".frame"),t(e));if(!1===j.exec(s.onFrameBeforeOpen,[i],n[0]))return!1;!0===s.oneFrame&&this._closeAll(),i.addClass("active "+s.activeFrameClass),i.children(".heading").addClass(s.activeHeadingClass),i.children(".content").addClass(s.activeContentClass).slideDown(s.duration),j.exec(s.onFrameOpen,[i],n[0])},_closeFrame:function(e){var n=this.element,s=this.options,i=t(e);!1!==j.exec(s.onFrameBeforeClose,[i],n[0])&&(i.removeClass("active "+s.activeFrameClass),i.children(".heading").removeClass(s.activeHeadingClass),i.children(".content").removeClass(s.activeContentClass).slideUp(s.duration),j.callback(s.onFrameClose,[i],n[0]))},_closeAll:function(){var e=this,n=this.element,s=(this.options,n.children(".frame"));t.each(s,function(){e._closeFrame(this)})},_hideAll:function(){var e=this.element,n=(this.options,e.children(".frame"));t.each(n,function(){t(this).children(".content").hide(0)})},_openAll:function(){var e=this,n=this.element,s=(this.options,n.children(".frame"));t.each(s,function(){e._openFrame(this)})},changeAttribute:function(e){},destroy:function(){this.element.off(c.events.click,".heading")}};c.plugin("accordion",Y);var J={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),j.exec(this.options.onActivityCreate,[this.element]),this},options:{type:"ring",style:"light",size:64,radius:20,onActivityCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,n,s=this.element,i=this.options;switch(s.html("").addClass(i.style+"-style").addClass("activity-"+i.type),i.type){case"metro":!function(){for(e=0;e<5;e++)t("<div/>").addClass("circle").appendTo(s)}();break;case"square":!function(){for(e=0;e<4;e++)t("<div/>").addClass("square").appendTo(s)}();break;case"cycle":t("<div/>").addClass("cycle").appendTo(s);break;case"simple":t('<svg class="circular"><circle class="path" cx="'+i.size/2+'" cy="'+i.size/2+'" r="'+i.radius+'" fill="none" stroke-width="2" stroke-miterlimit="10"/></svg>').appendTo(s);break;default:!function(){for(e=0;e<5;e++)n=t("<div/>").addClass("wrap").appendTo(s),t("<div/>").addClass("circle").appendTo(n)}()}},changeAttribute:function(e){},destroy:function(){var e=this.element,t=this.options;e.html("").removeClass(t.style+"-style").removeClass("activity-"+t.type)}};c.plugin("activity",J),c.activity={open:function(e){var t='<div data-role="activity" data-type="'+(e.type?e.type:"cycle")+'" data-style="'+(e.style?e.style:"color")+'"></div>',n=e.text?'<div class="text-center">'+e.text+"</div>":"";return c.dialog.create({content:t+n,defaultAction:!1,clsContent:"d-flex flex-column flex-justify-center flex-align-center bg-transparent no-shadow w-auto",clsDialog:"no-border no-shadow bg-transparent global-dialog",autoHide:e.autoHide?e.autoHide:0,overlayClickClose:!0===e.overlayClickClose,overlayColor:e.overlayColor?e.overlayColor:"#000000",overlayAlpha:e.overlayAlpha?e.overlayAlpha:.5,clsOverlay:"global-overlay"})},close:function(e){c.dialog.close(e)}};var U={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),this},options:{duration:100,onAppBarCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this._createStructure(),this._createEvents(),j.exec(t.onAppBarCreate,[e])},_createStructure:function(){var e,n,s=this.element,i=(this.options,j.elementId("app-bar"));if(s.addClass("app-bar"),0===(e=s.find(".hamburger")).length){e=t("<button>").attr("type","button").addClass("hamburger menu-down");for(var a=0;a<3;a++)t("<span>").addClass("line").appendTo(e);!0===h.isLight(j.computedRgbToHex(j.getStyleOne(s,"background-color")))&&e.addClass("dark")}s.prepend(e),0===(n=s.find(".app-bar-menu")).length?e.hide():j.addCssRule(c.sheet,".app-bar-menu li","list-style: none!important;"),!1==!!s.attr("id")&&s.attr("id",i),"block"===e.css("display")?(n.hide().addClass("collapsed"),e.removeClass("hidden")):e.addClass("hidden")},_createEvents:function(){var e=this,n=this.element,s=(this.options,n.find(".app-bar-menu")),i=n.find(".hamburger");n.on(c.events.click,".hamburger",function(){0!==s.length&&(s.hasClass("collapsed")?e.open():e.close())}),t(window).on(c.events.resize+"-"+n.attr("id"),function(){0!==s.length&&("block"!==i.css("display")?(s.show(),i.addClass("hidden")):(i.removeClass("hidden"),i.hasClass("active")?s.show().removeClass("collapsed"):s.hide().addClass("collapsed")))})},close:function(){var e=this.element,t=this.options,n=e.find(".app-bar-menu"),s=e.find(".hamburger");n.slideUp(t.duration,function(){n.addClass("collapsed"),s.removeClass("active")})},open:function(){var e=this.element,t=this.options,n=e.find(".app-bar-menu"),s=e.find(".hamburger");n.slideDown(t.duration,function(){n.removeClass("collapsed"),s.addClass("active")})},changeAttribute:function(e){},destroy:function(){var e=this.element;e.off(c.events.click,".hamburger"),t(window).off(c.events.resize+"-"+e.attr("id"))}};c.plugin("appbar",U);var W={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.preloader=null,this.player=null,this.audio=n,this.stream=null,this.volume=null,this.volumeBackup=0,this.muted=!1,this._setOptionsFromDOM(),this._create(),this},options:{playlist:null,src:null,volume:.5,loop:!1,autoplay:!1,showLoop:!0,showPlay:!0,showStop:!0,showMute:!0,showFull:!0,showStream:!0,showVolume:!0,showInfo:!0,showPlaylist:!0,showNext:!0,showPrev:!0,showFirst:!0,showLast:!0,showForward:!0,showBackward:!0,showShuffle:!0,showRandom:!0,loopIcon:"<span class='default-icon-loop'></span>",stopIcon:"<span class='default-icon-stop'></span>",playIcon:"<span class='default-icon-play'></span>",pauseIcon:"<span class='default-icon-pause'></span>",muteIcon:"<span class='default-icon-mute'></span>",volumeLowIcon:"<span class='default-icon-low-volume'></span>",volumeMediumIcon:"<span class='default-icon-medium-volume'></span>",volumeHighIcon:"<span class='default-icon-high-volume'></span>",playlistIcon:"<span class='default-icon-playlist'></span>",nextIcon:"<span class='default-icon-next'></span>",prevIcon:"<span class='default-icon-prev'></span>",firstIcon:"<span class='default-icon-first'></span>",lastIcon:"<span class='default-icon-last'></span>",forwardIcon:"<span class='default-icon-forward'></span>",backwardIcon:"<span class='default-icon-backward'></span>",shuffleIcon:"<span class='default-icon-shuffle'></span>",randomIcon:"<span class='default-icon-random'></span>",onPlay:c.noop,onPause:c.noop,onStop:c.noop,onEnd:c.noop,onMetadata:c.noop,onTime:c.noop,onAudioCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this.audio;this._createPlayer(),this._createControls(),this._createEvents(),!0===t.autoplay&&this.play(),j.exec(t.onAudioCreate,[e,this.player])},_createPlayer:function(){var e=this.element,n=this.options,s=this.audio,i=e.prev(),a=e.parent(),o=t("<div>").addClass("media-player audio-player "+e[0].className);0===i.length?a.prepend(o):o.insertAfter(i),e.appendTo(o),t.each(["muted","autoplay","controls","height","width","loop","poster","preload"],function(){e.removeAttr(this)}),e.attr("preload","auto"),s.volume=n.volume,null!==n.src&&this._setSource(n.src),e[0].className="",this.player=o},_setSource:function(e){var n=this.element;n.find("source").remove(),n.removeAttr("src"),Array.isArray(e)?t.each(e,function(){void 0!==this.src&&t("<source>").attr("src",this.src).attr("type",void 0!==this.type?this.type:"").appendTo(n)}):n.attr("src",e)},_createControls:function(){var e,n=this,s=this.element,i=this.options,a=this.elem,o=(this.player,t("<div>").addClass("controls").addClass(i.clsControls).insertAfter(s)),r=t("<div>").addClass("stream").appendTo(o),l=t("<input>").addClass("stream-slider ultra-thin cycle-marker").appendTo(r),c=t("<div>").addClass("load-audio").appendTo(r),d=t("<div>").addClass("volume").appendTo(o),h=t("<input>").addClass("volume-slider ultra-thin cycle-marker").appendTo(d),u=t("<div>").addClass("info-box").appendTo(o);!0!==i.showInfo&&u.hide(),c.activity({type:"metro",style:"color"}),c.hide(0),this.preloader=c,l.slider({clsMarker:"bg-red",clsHint:"bg-cyan fg-white",clsComplete:"bg-cyan",hint:!0,onStart:function(){a.paused||a.pause()},onStop:function(e){a.seekable.length>0&&(a.currentTime=(n.duration*e/100).toFixed(0)),a.paused&&a.currentTime>0&&a.play()}}),this.stream=l,!0!==i.showStream&&r.hide(),h.slider({clsMarker:"bg-red",clsHint:"bg-cyan fg-white",hint:!0,value:100*i.volume,onChangeValue:function(e){a.volume=e/100}}),this.volume=h,!0!==i.showVolume&&d.hide(),!0===i.showLoop&&(e=t("<button>").attr("type","button").addClass("button square loop").html(i.loopIcon).appendTo(o)),!0===i.showPlay&&t("<button>").attr("type","button").addClass("button square play").html(i.playIcon).appendTo(o),!0===i.showStop&&t("<button>").attr("type","button").addClass("button square stop").html(i.stopIcon).appendTo(o),!0===i.showMute&&t("<button>").attr("type","button").addClass("button square mute").html(i.muteIcon).appendTo(o),!0===i.loop&&(e.addClass("active"),s.attr("loop","loop")),this._setVolume(),i.muted&&(n.volumeBackup=a.volume,n.volume.data("slider").val(0),a.volume=0),u.html("00:00 / 00:00")},_createEvents:function(){var e=this,t=this.element,n=this.options,s=this.elem,i=this.player;t.on("loadstart",function(){e.preloader.fadeIn()}),t.on("loadedmetadata",function(){e.duration=s.duration.toFixed(0),e._setInfo(0,e.duration),j.exec(n.onMetadata,[s,i])}),t.on("canplay",function(){e._setBuffer(),e.preloader.fadeOut()}),t.on("progress",function(){e._setBuffer()}),t.on("timeupdate",function(){var t=Math.round(100*s.currentTime/e.duration);e._setInfo(s.currentTime,e.duration),e.stream.data("slider").val(t),j.exec(n.onTime,[s.currentTime,e.duration,s,i])}),t.on("waiting",function(){e.preloader.fadeIn()}),t.on("loadeddata",function(){}),t.on("play",function(){i.find(".play").html(n.pauseIcon),j.exec(n.onPlay,[s,i])}),t.on("pause",function(){i.find(".play").html(n.playIcon),j.exec(n.onPause,[s,i])}),t.on("stop",function(){e.stream.data("slider").val(0),j.exec(n.onStop,[s,i])}),t.on("ended",function(){e.stream.data("slider").val(0),j.exec(n.onEnd,[s,i])}),t.on("volumechange",function(){e._setVolume()}),i.on(c.events.click,".play",function(){s.paused?e.play():e.pause()}),i.on(c.events.click,".stop",function(){e.stop()}),i.on(c.events.click,".mute",function(){e._toggleMute()}),i.on(c.events.click,".loop",function(){e._toggleLoop()})},_toggleLoop:function(){var e=this.player.find(".loop");0!==e.length&&(e.toggleClass("active"),e.hasClass("active")?this.element.attr("loop","loop"):this.element.removeAttr("loop"))},_toggleMute:function(){this.muted=!this.muted,!1===this.muted?(this.audio.volume=this.volumeBackup,this.volume.data("slider").val(100*this.volumeBackup)):(this.volumeBackup=this.audio.volume,this.volume.data("slider").val(0),this.audio.volume=0)},_setInfo:function(e,t){this.player.find(".info-box").html(j.secondsToFormattedString(Math.round(e))+" / "+j.secondsToFormattedString(Math.round(t)))},_setBuffer:function(){var e=this.audio.buffered.length?Math.round(Math.floor(this.audio.buffered.end(0))/Math.floor(this.audio.duration)*100):0;this.stream.data("slider").buff(e)},_setVolume:function(){var e=this.audio,t=this.player,n=this.options,s=t.find(".mute"),i=100*e.volume;i>1&&i<30?s.html(n.volumeLowIcon):i>=30&&i<60?s.html(n.volumeMediumIcon):i>=60&&i<=100?s.html(n.volumeHighIcon):s.html(n.muteIcon)},play:function(e){void 0!==e&&this._setSource(e),void 0===this.element.attr("src")&&0===this.element.find("source").length||this.audio.play()},pause:function(){this.audio.pause()},resume:function(){this.audio.paused&&this.play()},stop:function(){this.audio.pause(),this.audio.currentTime=0,this.stream.data("slider").val(0)},volume:function(e){if(void 0===e)return this.audio.volume;e>1&&(e/=100),this.audio.volume=e,this.volume.data("slider").val(100*e)},loop:function(){this._toggleLoop()},mute:function(){this._toggleMute()},changeSource:function(){var e=JSON.parse(this.element.attr("data-src"));this.play(e)},changeVolume:function(){var e=this.element.attr("data-volume");this.volume(e)},changeAttribute:function(e){switch(e){case"data-src":this.changeSource();break;case"data-volume":this.changeVolume()}},destroy:function(){var e=this.element,t=this.player;e.off("loadstart"),e.off("loadedmetadata"),e.off("canplay"),e.off("progress"),e.off("timeupdate"),e.off("waiting"),e.off("loadeddata"),e.off("play"),e.off("pause"),e.off("stop"),e.off("ended"),e.off("volumechange"),t.off(c.events.click,".play"),t.off(c.events.click,".stop"),t.off(c.events.click,".mute"),t.off(c.events.click,".loop"),c.destroyPlugin(this.stream,"slider"),c.destroyPlugin(this.volume,"slider"),e.insertBefore(t),t.html("").remove()}};c.plugin("audio",W);var G={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.active=null,this._setOptionsFromDOM(),this._create(),this},options:{targets:"button",clsActive:"active",requiredButton:!1,mode:c.groupMode.ONE,onButtonClick:c.noop,onButtonsGroupCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this._createGroup(),this._createEvents(),j.exec(t.onButtonsGroupCreate,[e])},_createGroup:function(){var e,n,s=this.element,i=this.options,a=j.elementId("button-group");void 0===s.attr("id")&&s.attr("id",a),s.addClass("button-group"),e=s.find(i.targets),n=s.find("."+i.clsActive),i.mode===c.groupMode.ONE&&0===n.length&&!0===i.requiredButton&&t(e[0]).addClass(i.clsActive),i.mode===c.groupMode.ONE&&n.length>1&&(e.removeClass(i.clsActive),t(e[0]).addClass(i.clsActive)),s.find("."+i.clsActive).addClass("js-active")},_createEvents:function(){var e=this.element,n=this.options;e.on(c.events.click,n.targets,function(){var s=t(this);j.exec(n.onButtonClick,[s],this),n.mode===c.groupMode.ONE&&s.hasClass(n.clsActive)||(n.mode===c.groupMode.ONE?(e.find(n.targets).removeClass(n.clsActive).removeClass("js-active"),s.addClass(n.clsActive).addClass("js-active")):s.toggleClass(n.clsActive).toggleClass("js-active"))})},changeAttribute:function(e){},destroy:function(){var e=this.element,t=this.options;e.off(c.events.click,t.targets),e.find(t.targets).removeClass(t.clsActive).removeClass("js-active")}};c.plugin("buttongroup",G);var K={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.today=new Date,this.today.setHours(0,0,0,0),this.show=new Date,this.show.setHours(0,0,0,0),this.current={year:this.show.getFullYear(),month:this.show.getMonth(),day:this.show.getDate()},this.preset=[],this.selected=[],this.exclude=[],this.special=[],this.min=null,this.max=null,this.locale=null,this.minYear=this.current.year-this.options.yearsBefore,this.maxYear=this.current.year+this.options.yearsAfter,this.offset=(new Date).getTimezoneOffset()/60+1,this._setOptionsFromDOM(),this._create(),this},options:{pickerMode:!1,show:null,locale:METRO_LOCALE,weekStart:METRO_WEEK_START,outside:!0,buttons:"cancel, today, clear, done",yearsBefore:100,yearsAfter:100,headerFormat:"%A, %b %e",showHeader:!0,showFooter:!0,showTimeField:!0,clsCalendar:"",clsCalendarHeader:"",clsCalendarContent:"",clsCalendarFooter:"",clsCalendarMonths:"",clsCalendarYears:"",clsToday:"",clsSelected:"",clsExcluded:"",clsCancelButton:"",clsTodayButton:"",clsClearButton:"",clsDoneButton:"",isDialog:!1,ripple:!1,rippleColor:"#cccccc",exclude:null,preset:null,minDate:null,maxDate:null,weekDayClick:!1,multiSelect:!1,special:null,onCancel:c.noop,onToday:c.noop,onClear:c.noop,onDone:c.noop,onDayClick:c.noop,onWeekDayClick:c.noop,onMonthChange:c.noop,onYearChange:c.noop,onCalendarCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this,n=this.element,s=this.options;n.html("").addClass("calendar").addClass(s.clsCalendar),null!==s.preset&&(!1===Array.isArray(s.preset)&&(s.preset=s.preset.split(",").map(function(e){return e.trim()})),t.each(s.preset,function(){!1!==j.isDate(this)&&e.selected.push(new Date(this).getTime())})),null!==s.exclude&&(!1===Array.isArray(s.exclude)&&(s.exclude=s.exclude.split(",").map(function(e){return e.trim()})),t.each(s.exclude,function(){!1!==j.isDate(this)&&e.exclude.push(new Date(this).getTime())})),null!==s.special&&(!1===Array.isArray(s.special)&&(s.special=s.special.split(",").map(function(e){return e.trim()})),t.each(s.special,function(){!1!==j.isDate(this)&&e.special.push(new Date(this).getTime())})),!1!==s.buttons&&!1===Array.isArray(s.buttons)&&(s.buttons=s.buttons.split(",").map(function(e){return e.trim()})),null!==s.minDate&&j.isDate(s.minDate)&&(this.min=new Date(s.minDate).addHours(this.offset)),null!==s.maxDate&&j.isDate(s.maxDate)&&(this.max=new Date(s.maxDate).addHours(this.offset)),null!==s.show&&j.isDate(s.show)&&(this.show=new Date(s.show).addHours(this.offset),this.current={year:this.show.getFullYear(),month:this.show.getMonth(),day:this.show.getDate()}),this.locale=void 0!==c.locales[s.locale]?c.locales[s.locale]:c.locales["en-US"],this._build()},_build:function(){var e=this.element;this._drawCalendar(),this._bindEvents(),!0===this.options.ripple&&e.ripple({rippleTarget:".button, .prev-month, .next-month, .prev-year, .next-year, .day",rippleColor:this.options.rippleColor}),j.exec(this.options.onCalendarCreate,[this.element])},_bindEvents:function(){var e=this,n=this.element,s=this.options;n.on(c.events.click,".prev-month, .next-month, .prev-year, .next-year",function(i){var a,o=t(this);o.hasClass("prev-month")&&(a=new Date(e.current.year,e.current.month-1,1)).getFullYear()<e.minYear||o.hasClass("next-month")&&(a=new Date(e.current.year,e.current.month+1,1)).getFullYear()>e.maxYear||o.hasClass("prev-year")&&(a=new Date(e.current.year-1,e.current.month,1)).getFullYear()<e.minYear||o.hasClass("next-year")&&(a=new Date(e.current.year+1,e.current.month,1)).getFullYear()>e.maxYear||(e.current={year:a.getFullYear(),month:a.getMonth(),day:a.getDate()},setTimeout(function(){e._drawContent(),(o.hasClass("prev-month")||o.hasClass("next-month"))&&j.exec(s.onMonthChange,[e.current,n],n[0]),(o.hasClass("prev-year")||o.hasClass("next-year"))&&j.exec(s.onYearChange,[e.current,n],n[0])},s.ripple?300:0),i.preventDefault(),i.stopPropagation())}),n.on(c.events.click,".button.today",function(t){e.today=new Date,e.current={year:e.today.getFullYear(),month:e.today.getMonth(),day:e.today.getDate()},e._drawHeader(),e._drawContent(),j.exec(s.onToday,[e.today,n]),t.preventDefault(),t.stopPropagation()}),n.on(c.events.click,".button.clear",function(t){e.selected=[],e._drawContent(),j.exec(s.onClear,[n]),t.preventDefault(),t.stopPropagation()}),n.on(c.events.click,".button.cancel",function(t){e._drawContent(),j.exec(s.onCancel,[n]),t.preventDefault(),t.stopPropagation()}),n.on(c.events.click,".button.done",function(t){e._drawContent(),j.exec(s.onDone,[e.selected,n]),t.preventDefault(),t.stopPropagation()}),n.on(c.events.click,".week-days .day",function(i){if(!1!==s.weekDayClick&&!1!==s.multiSelect){var a=t(this),o=a.index(),r=!0===s.outside?n.find(".days-row .day:nth-child("+(o+1)+")"):n.find(".days-row .day:not(.outside):nth-child("+(o+1)+")");t.each(r,function(){var n=t(this),i=n.data("day");j.arrayDelete(e.selected,i),e.selected.push(i),n.addClass("selected").addClass(s.clsSelected)}),j.exec(s.onWeekDayClick,[e.selected,a,n]),i.preventDefault(),i.stopPropagation()}}),n.on(c.events.click,".days-row .day",function(i){var a,o,r=t(this);if(o=r.data("day"),a=e.selected.indexOf(o),r.hasClass("outside"))return o=new Date(o),e.current={year:o.getFullYear(),month:o.getMonth(),day:o.getDate()},void e._drawContent();!0===s.pickerMode?(e.selected=[o],e.today=new Date(o),e.current.year=e.today.getFullYear(),e.current.month=e.today.getMonth(),e.current.day=e.today.getDate(),e._drawHeader(),e._drawContent()):-1===a?(!1===s.multiSelect&&(n.find(".days-row .day").removeClass("selected").removeClass(s.clsSelected),e.selected=[]),e.selected.push(o),r.addClass("selected").addClass(s.clsSelected)):(r.removeClass("selected").removeClass(s.clsSelected),j.arrayDelete(e.selected,o)),j.exec(s.onDayClick,[e.selected,r,n]),i.preventDefault(),i.stopPropagation()}),n.on(c.events.click,".curr-month",function(t){var s,i=n.find(".months-list");i.find(".active").removeClass("active"),i.scrollTop(0),n.find(".calendar-months").addClass("open"),s=i.find(".js-month-"+e.current.month).addClass("active"),setTimeout(function(){i.animate({scrollTop:s.position().top-(i.height()-s.height())/2},200)},300),t.preventDefault(),t.stopPropagation()}),n.on(c.events.click,".calendar-months li",function(i){e.current.month=t(this).index(),e._drawContent(),j.exec(s.onMonthChange,[e.current,n],n[0]),n.find(".calendar-months").removeClass("open"),i.preventDefault(),i.stopPropagation()}),n.on(c.events.click,".curr-year",function(t){var s,i=n.find(".years-list");i.find(".active").removeClass("active"),i.scrollTop(0),n.find(".calendar-years").addClass("open"),s=i.find(".js-year-"+e.current.year).addClass("active"),setTimeout(function(){i.animate({scrollTop:s.position().top-(i.height()-s.height())/2},200)},300),t.preventDefault(),t.stopPropagation()}),n.on(c.events.click,".calendar-years li",function(i){e.current.year=t(this).text(),e._drawContent(),j.exec(s.onYearChange,[e.current,n],n[0]),n.find(".calendar-years").removeClass("open"),i.preventDefault(),i.stopPropagation()}),n.on(c.events.click,function(e){var t=n.find(".calendar-months"),s=n.find(".calendar-years");t.hasClass("open")&&t.removeClass("open"),s.hasClass("open")&&s.removeClass("open"),e.preventDefault(),e.stopPropagation()})},_drawHeader:function(){var e=this.element,n=this.options,s=e.find(".calendar-header");0===s.length&&(s=t("<div>").addClass("calendar-header").addClass(n.clsCalendarHeader).appendTo(e)),s.html(""),t("<div>").addClass("header-year").html(this.today.getFullYear()).appendTo(s),t("<div>").addClass("header-day").html(this.today.format(n.headerFormat,n.locale)).appendTo(s),!1===n.showHeader&&s.hide()},_drawFooter:function(){var e=this.element,n=this.options,s=this.locale.buttons,i=e.find(".calendar-footer");!1!==n.buttons&&(0===i.length&&(i=t("<div>").addClass("calendar-footer").addClass(n.clsCalendarFooter).appendTo(e)),i.html(""),t.each(n.buttons,function(){var e=t("<button>").attr("type","button").addClass("button "+this+" "+n["cls"+this.capitalize()+"Button"]).html(s[this]).appendTo(i);"cancel"!==this&&"done"!==this||e.addClass("js-dialog-close")}),!1===n.showFooter&&i.hide())},_drawMonths:function(){var e,n=this.element,s=this.options,i=t("<div>").addClass("calendar-months").addClass(s.clsCalendarMonths).appendTo(n),a=t("<ul>").addClass("months-list").appendTo(i),o=this.locale.calendar;for(e=0;e<12;e++)t("<li>").addClass("js-month-"+e).html(o.months[e]).appendTo(a)},_drawYears:function(){var e,n=this.element,s=this.options,i=t("<div>").addClass("calendar-years").addClass(s.clsCalendarYears).appendTo(n),a=t("<ul>").addClass("years-list").appendTo(i);for(e=this.minYear;e<=this.maxYear;e++)t("<li>").addClass("js-year-"+e).html(e).appendTo(a)},_drawContent:function(){var e,n,s,i,a,o,r,l,c=this.element,d=this.options,h=c.find(".calendar-content"),u=this.locale.calendar,p=0,f=new Date(this.current.year,this.current.month,1),m=new Date(this.current.year,this.current.month,0).getDate();0===h.length&&(h=t("<div>").addClass("calendar-content").addClass(d.clsCalendarContent).appendTo(c)),h.html(""),e=t("<div>").addClass("calendar-toolbar").appendTo(h),t("<span>").addClass("prev-month").appendTo(e),t("<span>").addClass("curr-month").html(u.months[this.current.month]).appendTo(e),t("<span>").addClass("next-month").appendTo(e),t("<span>").addClass("prev-year").appendTo(e),t("<span>").addClass("curr-year").html(this.current.year).appendTo(e),t("<span>").addClass("next-year").appendTo(e);var v=t("<div>").addClass("week-days").appendTo(h);for(n=0;n<7;n++)0===d.weekStart?s=n:7===(s=n+1)&&(s=0),t("<span>").addClass("day").html(u.days[s+7]).appendTo(v);var g=t("<div>").addClass("days").appendTo(h),C=t("<div>").addClass("days-row").appendTo(g);for(o=0===d.weekStart?f.getDay():0===f.getDay()?6:f.getDay()-1,this.current.month-1<0?(l=11,r=this.current.year-1):(l=this.current.month-1,r=this.current.year),n=0;n<o;n++){var b=m-o+n+1;i=t("<div>").addClass("day outside").appendTo(C),(a=new Date(r,l,b)).setHours(0,0,0,0),i.data("day",a.getTime()),!0===d.outside&&(i.html(b),0===this.special.length?(-1!==this.selected.indexOf(a.getTime())&&i.addClass("selected").addClass(d.clsSelected),-1!==this.exclude.indexOf(a.getTime())&&i.addClass("disabled excluded").addClass(d.clsExcluded),null!==this.min&&a<this.min&&i.addClass("disabled excluded").addClass(d.clsExcluded),null!==this.max&&a>this.max&&i.addClass("disabled excluded").addClass(d.clsExcluded)):-1===this.special.indexOf(a.getTime())&&i.addClass("disabled excluded").addClass(d.clsExcluded)),p++}for(f.setHours(0,0,0,0);f.getMonth()===this.current.month;)(i=t("<div>").addClass("day").html(f.getDate()).appendTo(C)).data("day",f.getTime()),this.today.getFullYear()===f.getFullYear()&&this.today.getMonth()===f.getMonth()&&this.today.getDate()===f.getDate()&&i.addClass("today").addClass(d.clsToday),0===this.special.length?(-1!==this.selected.indexOf(f.getTime())&&i.addClass("selected").addClass(d.clsSelected),-1!==this.exclude.indexOf(f.getTime())&&i.addClass("disabled excluded").addClass(d.clsExcluded),null!==this.min&&f.getTime()<this.min.getTime()&&i.addClass("disabled excluded").addClass(d.clsExcluded),null!==this.max&&f.getTime()>this.max.getTime()&&i.addClass("disabled excluded").addClass(d.clsExcluded)):-1===this.special.indexOf(f.getTime())&&i.addClass("disabled excluded").addClass(d.clsExcluded),++p%7==0&&(C=t("<div>").addClass("days-row").appendTo(g)),f.setDate(f.getDate()+1),f.setHours(0,0,0,0);if(o=0===d.weekStart?f.getDay():0===f.getDay()?6:f.getDay()-1,this.current.month+1>11?(l=0,r=this.current.year+1):(l=this.current.month+1,r=this.current.year),o>0)for(n=0;n<7-o;n++)i=t("<div>").addClass("day outside").appendTo(C),(a=new Date(r,l,n+1)).setHours(0,0,0,0),i.data("day",a.getTime()),!0===d.outside&&(i.html(n+1),0===this.special.length?(-1!==this.selected.indexOf(a.getTime())&&i.addClass("selected").addClass(d.clsSelected),-1!==this.exclude.indexOf(a.getTime())&&i.addClass("disabled excluded").addClass(d.clsExcluded),null!==this.min&&a.getTime()<this.min.getTime()&&i.addClass("disabled excluded").addClass(d.clsExcluded),null!==this.max&&a.getTime()>this.max.getTime()&&i.addClass("disabled excluded").addClass(d.clsExcluded)):-1===this.special.indexOf(a.getTime())&&i.addClass("disabled excluded").addClass(d.clsExcluded))},_drawCalendar:function(){this.element.html(""),this._drawHeader(),this._drawContent(),this._drawFooter(),this._drawMonths(),this._drawYears()},getPreset:function(){return this.preset},getSelected:function(){return this.selected},getExcluded:function(){return this.exclude},getToday:function(){return this.today},getCurrent:function(){return this.current},setExclude:function(e){var n=this,s=this.element,i=this.options;i.exclude=void 0!==e?e:s.attr("data-exclude"),null!==i.exclude&&(!1===Array.isArray(i.exclude)&&(i.exclude=i.exclude.split(",").map(function(e){return e.trim()})),t.each(i.exclude,function(){!1!==j.isDate(this)&&n.exclude.push(new Date(this).getTime())})),this._drawContent()},setPreset:function(e){var n=this,s=this.element,i=this.options;i.preset=void 0!==e?e:s.attr("data-preset"),null!==i.preset&&(n.selected=[],!1===Array.isArray(i.preset)&&(i.preset=i.preset.split(",").map(function(e){return e.trim()})),t.each(i.preset,function(){!1!==j.isDate(this)&&n.selected.push(new Date(this).getTime())})),this._drawContent()},setSpecial:function(e){var n=this,s=this.element,i=this.options;i.special=void 0!==e?e:s.attr("data-special"),null!==i.special&&(n.special=[],!1===Array.isArray(i.special)&&(i.special=i.special.split(",").map(function(e){return e.trim()})),t.each(i.special,function(){!1!==j.isDate(this)&&n.special.push(new Date(this).getTime())})),this._drawContent()},setShow:function(e){var t=this.element,n=this.options;n.show=null!==e?e:t.attr("data-show"),null!==n.show&&j.isDate(n.show)&&(this.show=new Date(n.show),this.show.setHours(0,0,0,0),this.current={year:this.show.getFullYear(),month:this.show.getMonth(),day:this.show.getDate()}),this._drawContent()},setMinDate:function(e){var t=this.element;this.options.minDate=null!==e?e:t.attr("data-min-date"),this._drawContent()},setMaxDate:function(e){var t=this.element;this.options.maxDate=null!==e?e:t.attr("data-max-date"),this._drawContent()},setToday:function(e){!1!==j.isDate(e)&&(this.today=new Date(e),this.today.setHours(0,0,0,0),this._drawHeader(),this._drawContent())},i18n:function(e){this.element;var t=this.options;return void 0===e?t.locale:void 0!==c.locales[e]&&(t.locale=e,this.locale=c.locales[t.locale],void this._drawCalendar())},changeAttrLocale:function(){var e=this.element;this.options;this.i18n(e.attr("data-locale"))},changeAttribute:function(e){switch(e){case"data-exclude":this.setExclude();break;case"data-preset":this.setPreset();break;case"data-special":this.setSpecial();break;case"data-show":this.setShow();break;case"data-min-date":this.setMinDate();break;case"data-max-date":this.setMaxDate();break;case"data-locale":this.changeAttrLocale()}},destroy:function(){var e=this.element,t=this.options;e.off(c.events.click,".prev-month, .next-month, .prev-year, .next-year"),e.off(c.events.click,".button.today"),e.off(c.events.click,".button.clear"),e.off(c.events.click,".button.cancel"),e.off(c.events.click,".button.done"),e.off(c.events.click,".week-days .day"),e.off(c.events.click,".days-row .day"),e.off(c.events.click,".curr-month"),e.off(c.events.click,".calendar-months li"),e.off(c.events.click,".curr-year"),e.off(c.events.click,".calendar-years li"),e.off(c.events.click),!0===t.ripple&&c.destroyPlugin(e,"ripple"),e.html("")}};t(document).on(c.events.click,function(e){t(".calendar .calendar-years").each(function(){t(this).removeClass("open")}),t(".calendar .calendar-months").each(function(){t(this).removeClass("open")})}),c.plugin("calendar",K);var q={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.value=null,this.value_date=null,this.calendar=null,this._setOptionsFromDOM(),this._create(),j.exec(this.options.onCalendarPickerCreate,[this.element]),this},dependencies:["calendar"],options:{locale:METRO_LOCALE,size:"100%",format:"%Y/%m/%d",headerFormat:"%A, %b %e",clearButton:!1,calendarButtonIcon:"<span class='default-icon-calendar'></span>",clearButtonIcon:"<span class='default-icon-cross'></span>",copyInlineStyles:!1,clsPicker:"",clsInput:"",yearsBefore:100,yearsAfter:100,weekStart:METRO_WEEK_START,outside:!0,clsCalendar:"",clsCalendarHeader:"",clsCalendarContent:"",clsCalendarFooter:"",clsCalendarMonths:"",clsCalendarYears:"",clsToday:"",clsSelected:"",clsExcluded:"",ripple:!1,rippleColor:"#cccccc",exclude:null,preset:null,minDate:null,maxDate:null,special:null,showHeader:!0,showFooter:!0,onDayClick:c.noop,onCalendarPickerCreate:c.noop,onCalendarShow:c.noop,onCalendarHide:c.noop,onChange:c.noop,onMonthChange:c.noop,onYearChange:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,n=this,s=this.element,i=this.options,a=s.prev(),o=s.parent(),r=t("<div>").addClass("input "+s[0].className+" calendar-picker"),l=t("<div>").addClass("button-group"),d=t("<div>").addClass("drop-shadow");void 0===s.attr("type")&&s.attr("type","text"),this.value=s.val(),j.isDate(this.value)&&(this.value_date=new Date(this.value),this.value_date.setHours(0,0,0,0),s.val(this.value_date.format(i.format))),0===a.length?o.prepend(r):r.insertAfter(a),s.appendTo(r),l.appendTo(r),d.appendTo(r),d.calendar({pickerMode:!0,show:i.value,locale:i.locale,weekStart:i.weekStart,outside:i.outside,buttons:!1,headerFormat:i.headerFormat,clsCalendar:i.clsCalendar,clsCalendarHeader:i.clsCalendarHeader,clsCalendarContent:i.clsCalendarContent,clsCalendarFooter:i.clsCalendarFooter,clsCalendarMonths:i.clsCalendarMonths,clsCalendarYears:i.clsCalendarYears,clsToday:i.clsToday,clsSelected:i.clsSelected,clsExcluded:i.clsExcluded,ripple:i.ripple,rippleColor:i.rippleColor,exclude:i.exclude,minDate:i.minDate,maxDate:i.maxDate,yearsBefore:i.yearsBefore,yearsAfter:i.yearsAfter,special:i.special,showHeader:i.showHeader,showFooter:i.showFooter,onDayClick:function(e,t,a){var o=new Date(e[0]);n.value=o.format("%Y/%m/%d"),n.value_date=o,s.val(o.format(i.format,i.locale)),s.trigger("change"),d.removeClass("open open-up"),d.hide(),j.exec(i.onChange,[n.value,n.value_date,s]),j.exec(i.onDayClick,[e,t,a])},onMonthChange:i.onMonthChange,onYearChange:i.onYearChange}),d.hide(),this.calendar=d,t("<button>").addClass("button").attr("tabindex",-1).attr("type","button").html(i.calendarButtonIcon).appendTo(l),r.on(c.events.click,"button, input",function(e){j.isDate(n.value)&&!1===d.hasClass("open")&&!1===d.hasClass("open-up")&&(d.css({visibility:"hidden",display:"block"}),d.data("calendar").setPreset(n.value),d.data("calendar").setShow(n.value),d.data("calendar").setToday(n.value),d.css({visibility:"visible",display:"none"})),!1===d.hasClass("open")&&!1===d.hasClass("open-up")?(t(".calendar-picker .calendar").removeClass("open open-up").hide(),d.addClass("open"),!1===j.isOutsider(d)&&d.addClass("open-up"),d.show(),j.exec(i.onCalendarShow,[s,d])):(d.removeClass("open open-up"),d.hide(),j.exec(i.onCalendarHide,[s,d])),e.preventDefault(),e.stopPropagation()}),!0===i.clearButton&&((e=t("<button>").addClass("button").attr("tabindex",-1).attr("type","button").html(i.clearButtonIcon)).on(c.events.click,function(){s.val("").trigger("change")}),e.appendTo(l)),"rtl"===s.attr("dir")&&r.addClass("rtl"),String(i.size).indexOf("%")>-1?r.css({width:i.size}):r.css({width:parseInt(i.size)+"px"}),s[0].className="",s.attr("readonly",!0),!0===i.copyInlineStyles&&t.each(j.getInlineStyles(s),function(e,t){r.css(e,t)}),r.addClass(i.clsPicker),s.addClass(i.clsInput),s.on(c.events.blur,function(){r.removeClass("focused")}),s.on(c.events.focus,function(){r.addClass("focused")}),s.on(c.events.change,function(){j.exec(i.onChange,[n.value_date,n.value,s])})},val:function(e){var t=this.element,n=this.options;if(void 0===e)return this.value_date;!0===j.isDate(e)&&(this.value_date=new Date(e),this.value=this.value_date.format(n.format),t.val(this.value_date.format(n.format)),t.trigger("change"))},changeValue:function(){var e=this.element;this.options;this.val(e.attr("value"))},disable:function(){this.element.data("disabled",!0),this.element.parent().addClass("disabled")},enable:function(){this.element.data("disabled",!1),this.element.parent().removeClass("disabled")},toggleState:function(){!1===this.element.data("disabled")?this.disable():this.enable()},i18n:function(e){this.element;var t,n=this.options,s=this.calendar;return void 0===e?n.locale:void 0!==c.locales[e]&&((t=s.is(":hidden"))&&s.css({visibility:"hidden",display:"block"}),s.data("calendar").i18n(e),void(t&&s.css({visibility:"visible",display:"none"})))},changeAttrLocale:function(){var e=this.element;this.options;this.i18n(e.attr("data-locale"))},changeAttrSpecial:function(){var e=this.element;this.options;this.calendar.data("calendar").setSpecial(e.attr("data-special"))},changeAttrExclude:function(){var e=this.element;this.options;this.calendar.data("calendar").setExclude(e.attr("data-exclude"))},changeAttrMinDate:function(){var e=this.element;this.options;this.calendar.data("calendar").setMinDate(e.attr("data-min-date"))},changeAttrMaxDate:function(){var e=this.element;this.options;this.calendar.data("calendar").setMaxDate(e.attr("data-max-date"))},changeAttribute:function(e){switch(e){case"value":this.changeValue();break;case"disabled":this.toggleState();break;case"data-locale":this.changeAttrLocale();break;case"data-special":this.changeAttrSpecial();break;case"data-exclude":this.changeAttrExclude();break;case"data-min-date":this.changeAttrMinDate();break;case"data-max-date":this.changeAttrMaxDate()}}};c.plugin("calendarpicker",q),t(document).on(c.events.click,function(e){t(".calendar-picker .calendar").removeClass("open open-up").hide()});var X={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.height=0,this.width=0,this.slides=[],this.current=null,this.currentIndex=null,this.dir=this.options.direction,this.interval=null,this.isAnimate=!1,this._setOptionsFromDOM(),this._create(),this},options:{autoStart:!1,width:"100%",height:"16/9",effect:"slide",effectFunc:"linear",direction:"left",duration:METRO_ANIMATION_DURATION,period:5e3,stopOnMouse:!0,controls:!0,bullets:!0,bulletStyle:"square",controlsOnMouse:!1,controlsOutside:!1,bulletsPosition:"default",controlPrev:"&#x23F4",controlNext:"&#x23F5",clsCarousel:"",clsSlides:"",clsSlide:"",clsControls:"",clsControlNext:"",clsControlPrev:"",clsBullets:"",clsBullet:"",clsBulletOn:"",clsThumbOn:"",onStop:c.noop,onStart:c.noop,onPlay:c.noop,onSlideClick:c.noop,onBulletClick:c.noop,onThumbClick:c.noop,onMouseEnter:c.noop,onMouseLeave:c.noop,onNextClick:c.noop,onPrevClick:c.noop,onCarouselCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,n=this.options,s=e.find(".slide"),i=e.find(".slides"),a=j.elementId("carousel");void 0===e.attr("id")&&e.attr("id",a),e.addClass("carousel").addClass(n.clsCarousel),!0===n.controlsOutside&&e.addClass("controls-outside"),0===i.length&&(i=t("<div>").addClass("slides").appendTo(e),s.appendTo(i)),s.addClass(n.clsSlides),0!==s.length?(this._createSlides(),this._createControls(),this._createBullets(),this._createEvents(),this._resize(),!0===n.controlsOnMouse&&(e.find("[class*=carousel-switch]").hide(),e.find(".carousel-bullets").hide()),!0===n.autoStart&&this._start(),j.exec(this.options.onCarouselCreate,[this.element])):j.exec(this.options.onCarouselCreate,[this.element])},_start:function(){var e=this,t=this.element,n=this.options,s=n.period,i=this.slides[this.currentIndex];void 0!==i.data("period")&&(s=i.data("period")),this.slides.length<=1||(this.interval=setTimeout(function(){var t="left"===n.direction?"next":"prior";e._slideTo(t,!0)},s),j.exec(n.onStart,[t]))},_stop:function(){clearInterval(this.interval),this.interval=!1},_resize:function(){var e,n=this.element,s=this.options,i=n.outerWidth(),a=[];["16/9","21/9","4/3"].indexOf(s.height)>-1?e=j.aspectRatioH(i,s.height):String(s.height).indexOf("@")>-1?(a=j.strToArray(s.height.substr(1),"|"),t.each(a,function(){var t=j.strToArray(this,",");window.matchMedia(t[0]).matches&&(e=["16/9","21/9","4/3"].indexOf(t[1])>-1?j.aspectRatioH(i,t[1]):parseInt(t[1]))})):e=parseInt(s.height),n.css({height:e})},_createSlides:function(){var e=this,n=this.element,s=this.options,i=n.find(".slide");t.each(i,function(n){var i=t(this);if(void 0!==i.data("cover")&&i.css({backgroundImage:"url("+i.data("cover")+")",backgroundSize:"cover",backgroundRepeat:"no-repeat"}),0!==n)switch(s.effect){case"switch":case"slide":i.css("left","100%");break;case"slide-v":i.css("top","100%");break;case"fade":i.css("opacity","0")}i.addClass(s.clsSlide),e.slides.push(i)}),this.currentIndex=0,this.current=this.slides[this.currentIndex]},_createControls:function(){var e,n,s=this.element,i=this.options;!1!==i.controls&&(e=t("<span/>").addClass("carousel-switch-next").addClass(i.clsControls).addClass(i.clsControlNext).html(">"),n=t("<span/>").addClass("carousel-switch-prev").addClass(i.clsControls).addClass(i.clsControlPrev).html("<"),i.controlNext&&e.html(i.controlNext),i.controlPrev&&n.html(i.controlPrev),e.appendTo(s),n.appendTo(s))},_createBullets:function(){var e,n,s=this.element,i=this.options;if(!1!==i.bullets){for(e=t("<div>").addClass("carousel-bullets").addClass("bullet-style-"+i.bulletStyle).addClass(i.clsBullets),"default"===i.bulletsPosition||"center"===i.bulletsPosition?e.addClass("flex-justify-center"):"left"===i.bulletsPosition?e.addClass("flex-justify-start"):e.addClass("flex-justify-end"),n=0;n<this.slides.length;n++){var a=t("<span>").addClass("carousel-bullet").addClass(i.clsBullet).data("slide",n);0===n&&a.addClass("bullet-on").addClass(i.clsBulletOn),a.appendTo(e)}e.appendTo(s)}},_createEvents:function(){var e=this,n=this.element,s=this.options;n.on(c.events.click,".carousel-bullet",function(i){var a=t(this);!1===e.isAnimate&&(e._slideToSlide(a.data("slide")),j.exec(s.onBulletClick,[a,n,i]))}),n.on(c.events.click,".carousel-switch-next",function(t){!1===e.isAnimate&&(e._slideTo("next",!1),j.exec(s.onNextClick,[n,t]))}),n.on(c.events.click,".carousel-switch-prev",function(t){!1===e.isAnimate&&(e._slideTo("prev",!1),j.exec(s.onPrevClick,[n,t]))}),!0===s.stopOnMouse&&!0===s.autoStart&&(n.on(c.events.enter,function(t){!0===s.controlsOnMouse&&(n.find("[class*=carousel-switch]").fadeIn(),n.find(".carousel-bullets").fadeIn()),e._stop(),j.exec(s.onMouseEnter,[n,t])}),n.on(c.events.leave,function(t){!0===s.controlsOnMouse&&(n.find("[class*=carousel-switch]").fadeOut(),n.find(".carousel-bullets").fadeOut()),e._start(),j.exec(s.onMouseLeave,[n,t])})),!0===s.controlsOnMouse&&(n.on(c.events.enter,function(){n.find("[class*=carousel-switch]").fadeIn(),n.find(".carousel-bullets").fadeIn()}),n.on(c.events.leave,function(){n.find("[class*=carousel-switch]").fadeOut(),n.find(".carousel-bullets").fadeOut()})),n.on(c.events.click,".slide",function(e){var i=t(this);j.exec(s.onSlideClick,[i,n,e])}),t(window).on(c.events.resize+"-"+n.attr("id"),function(){e._resize()})},_slideToSlide:function(e){var t,n,s,i=this.element,a=this.options;void 0!==this.slides[e]&&this.currentIndex!==e&&(s=e>this.currentIndex?"next":"prev",t=this.slides[this.currentIndex],n=this.slides[e],this.currentIndex=e,this._effect(t,n,a.effect,s),i.find(".carousel-bullet").removeClass("bullet-on").removeClass(a.clsBulletOn),i.find(".carousel-bullet:nth-child("+(this.currentIndex+1)+")").addClass("bullet-on").addClass(a.clsBulletOn))},_slideTo:function(e,t){var n,s,i=this.element,a=this.options;void 0===e&&(e="next"),n=this.slides[this.currentIndex],"next"===e?(this.currentIndex++,this.currentIndex>=this.slides.length&&(this.currentIndex=0)):(this.currentIndex--,this.currentIndex<0&&(this.currentIndex=this.slides.length-1)),s=this.slides[this.currentIndex],this._effect(n,s,a.effect,e,t),i.find(".carousel-bullet").removeClass("bullet-on").removeClass(a.clsBulletOn),i.find(".carousel-bullet:nth-child("+(this.currentIndex+1)+")").addClass("bullet-on").addClass(a.clsBulletOn)},_effect:function(e,t,n,s,i){var a,o=this,r=(this.element,this.options),l=r.duration,c=r.effectFunc,h=r.period;switch(void 0!==t.data("duration")&&(l=t.data("duration")),void 0!==t.data("effectFunc")&&(c=t.data("effectFunc")),"switch"===n&&(l=0),e.stop(!0,!0),t.stop(!0,!0),this.isAnimate=!0,setTimeout(function(){o.isAnimate=!1},l),"slide"===n&&(a="next"===s?"slideLeft":"slideRight"),"slide-v"===n&&(a="next"===s?"slideUp":"slideDown"),n){case"slide":case"slide-v":d[a](e,t,l,c);break;case"fade":d.fade(e,t,l,c);break;default:d.switch(e,t)}!0===i&&(void 0!==t.data("period")&&(h=t.data("period")),this.interval=setTimeout(function(){var e="left"===r.direction?"next":"prior";o._slideTo(e,!0)},h))},toSlide:function(e){this._slideToSlide(e)},next:function(){this._slideTo("next")},prev:function(){this._slideTo("prev")},stop:function(){clearInterval(this.interval),j.exec(this.options.onStop,[this.element])},play:function(){this._start(),j.exec(this.options.onPlay,[this.element])},changeAttribute:function(e){},destroy:function(){var e=this.element,n=this.options;e.off(c.events.click,".carousel-bullet"),e.off(c.events.click,".carousel-switch-next"),e.off(c.events.click,".carousel-switch-prev"),!0===n.stopOnMouse&&!0===n.autoStart&&(e.off(c.events.enter),e.off(c.events.leave)),!0===n.controlsOnMouse&&(e.off(c.events.enter),e.off(c.events.leave)),e.off(c.events.click,".slide"),t(window).off(c.events.resize+"-"+e.attr("id")),e.removeClass("carousel").removeClass(n.clsCarousel),!0===n.controlsOutside&&e.removeClass("controls-outside")}};c.plugin("carousel",X);var $={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.origin={background:""},this._setOptionsFromDOM(),this._create(),this},options:{position:"right",opacity:1,clsCharms:"",onCharmCreate:c.noop,onOpen:c.noop,onClose:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this._createStructure(),this._createEvents(),j.exec(t.onCharmCreate,[e])},_createStructure:function(){var e=this.element,t=this.options;e.addClass("charms").addClass(t.position+"-side").addClass(t.clsCharms),this.origin.background=e.css("background-color"),e.css({backgroundColor:j.computedRgbToRgba(j.getStyleOne(e,"background-color"),t.opacity)})},_createEvents:function(){var e=this.element;this.options;e.on(c.events.click,function(e){})},open:function(){var e=this.element,t=this.options;e.addClass("open"),j.exec(t.onOpen,[e])},close:function(){var e=this.element,t=this.options;e.removeClass("open"),j.exec(t.onClose,[e])},toggle:function(){var e=this.element,t=this.options;e.toggleClass("open"),!0===e.hasClass("open")?j.exec(t.onOpen,[e]):j.exec(t.onClose,[e])},opacity:function(e){var t=this.element,n=this.options;if(void 0===e)return n.opacity;var s=Math.abs(parseFloat(e));s<0||s>1||(n.opacity=s,t.css({backgroundColor:j.computedRgbToRgba(j.getStyleOne(t,"background-color"),s)}))},changeOpacity:function(){var e=this.element;this.opacity(e.attr("data-opacity"))},changeAttribute:function(e){switch(e){case"data-opacity":this.changeOpacity()}},destroy:function(){var e=this.element,t=this.options;e.off(c.events.click),e.removeClass("charms").removeClass(t.position+"-side").removeClass(t.clsCharms),e.css("background-color",this.origin.background)}};c.plugin("charms",$),c.charms={check:function(e){return!1!==j.isMetroObject(e,"charms")||(console.log("Element is not a charms component"),!1)},isOpen:function(e){if(!1!==this.check(e))return t(e).data("charms").hasClass("open")},open:function(e){!1!==this.check(e)&&t(e).data("charms").open()},close:function(e){!1!==this.check(e)&&t(e).data("charms").close()},toggle:function(e){!1!==this.check(e)&&t(e).data("charms").toggle()},closeAll:function(){t("[data-role*=charms]").each(function(){t(this).data("charms").close()})},opacity:function(e,n){!1!==this.check(e)&&t(e).data("charms").opacity(n)}};var Q={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.origin={className:""},this._setOptionsFromDOM(),this._create(),j.exec(this.options.onCheckboxCreate,[this.element]),this},options:{caption:"",indeterminate:!1,captionPosition:"right",disabled:!1,clsElement:"",clsCheck:"",clsCaption:"",onCheckboxCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,n=this.options,s=e.prev(),i=e.parent(),a=t("<label>").addClass("checkbox "+e[0].className),o=t("<span>").addClass("check"),r=t("<span>").addClass("caption").html(n.caption);void 0===e.attr("id")&&e.attr("id",j.elementId("checkbox")),a.attr("for",e.attr("id")),e.attr("type","checkbox"),e.appendTo(a),0===s.length?i.prepend(a):a.insertAfter(s),o.appendTo(a),r.appendTo(a),"left"===n.captionPosition&&a.addClass("caption-left"),this.origin.className=e[0].className,e[0].className="",a.addClass(n.clsElement),r.addClass(n.clsCaption),o.addClass(n.clsCheck),n.indeterminate&&(e[0].indeterminate=!0),!0===n.disabled&&e.is(":disabled")?this.disable():this.enable()},indeterminate:function(){this.element[0].indeterminate=!0},disable:function(){this.element.data("disabled",!0),this.element.parent().addClass("disabled")},enable:function(){this.element.data("disabled",!1),this.element.parent().removeClass("disabled")},toggleState:function(){!1===this.element.data("disabled")?this.disable():this.enable()},toggleIndeterminate:function(){this.element[0].indeterminate=!0===JSON.parse(this.element.attr("data-indeterminate"))},changeAttribute:function(e){switch(e){case"disabled":this.toggleState();break;case"data-indeterminate":this.toggleIndeterminate()}},destroy:function(){var e=this.element,t=(this.options,e.parent());e[0].className=this.origin.className,e.insertBefore(t),t.remove()}};c.plugin("checkbox",Q);var Z={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._clockInterval=null,this._setOptionsFromDOM(),this._create(),j.exec(this.options.onClockCreate,[this.element]),this},options:{showTime:!0,showDate:!0,timeFormat:"24",dateFormat:"american",divider:"&nbsp;&nbsp;",onClockCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this;this._tick(),this._clockInterval=setInterval(function(){e._tick()},500)},_addLeadingZero:function(e){return e<10&&(e="0"+e),e},_tick:function(){var e=this.element,t=this.options,n=new Date,s=(n.getTime(),""),i=n.getHours(),a=n.getMinutes(),o=n.getSeconds(),r=n.getDate(),l=n.getMonth()+1,c=n.getFullYear();"12"===t.timeFormat&&(" AM",i>11&&" PM",i>12&&(i-=12),0===i&&(i=12)),i=this._addLeadingZero(i),a=this._addLeadingZero(a),o=this._addLeadingZero(o),l=this._addLeadingZero(l),r=this._addLeadingZero(r),t.showDate&&("american"===t.dateFormat?(s+="<span class='date-month'>"+l+"</span>",s+="<span class='date-divider'>-</span>",s+="<span class='date-day'>"+r+"</span>",s+="<span class='date-divider'>-</span>",s+="<span class='date-year'>"+c+"</span>"):(s+="<span class='date-day'>"+r+"</span>",s+="<span class='date-divider'>-</span>",s+="<span class='date-month'>"+l+"</span>",s+="<span class='date-divider'>-</span>",s+="<span class='date-year'>"+c+"</span>"),s+=t.divider),t.showTime&&(s+="<span class='clock-hour'>"+i+"</span>",s+="<span class='clock-divider'>:</span>",s+="<span class='clock-minute'>"+a+"</span>",s+="<span class='clock-divider'>:</span>",s+="<span class='clock-second'>"+o+"</span>"),e.html(s)},changeAttribute:function(e){},destroy:function(){clearInterval(this._clockInterval),this._clockInterval=null,this.element.html("")}};c.plugin("clock",Z);var ee={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.toggle=null,this._setOptionsFromDOM(),this._create(),j.exec(this.options.onCollapseCreate,[this.element]),this},options:{collapsed:!1,toggleElement:!1,duration:METRO_ANIMATION_DURATION,onExpand:c.noop,onCollapse:c.noop,onCollapseCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,n=this,s=this.element,i=this.options;e=!1!==i.toggleElement?t(i.toggleElement):s.siblings(".collapse-toggle").length>0?s.siblings(".collapse-toggle"):s.siblings("a:nth-child(1)"),!0!==i.collapsed&&!0!==s.attr("collapsed")||s.hide(0),e.on(c.events.click,function(e){"block"!==s.css("display")||s.hasClass("keep-open")?n._open(s):n._close(s),console.log(e.target.tagName),-1===["INPUT"].indexOf(e.target.tagName)&&e.preventDefault(),e.stopPropagation()}),this.toggle=e},_close:function(e){!1===j.isJQueryObject(e)&&(e=t(e));var n=e.data("collapse").options;this.toggle.removeClass("active-toggle"),e.slideUp(n.duration,function(){e.trigger("onCollapse",null,e),e.data("collapsed",!0),e.addClass("collapsed"),j.exec(n.onCollapse,[e])})},_open:function(e){!1===j.isJQueryObject(e)&&(e=t(e));var n=e.data("collapse").options;this.toggle.addClass("active-toggle"),e.slideDown(n.duration,function(){e.trigger("onExpand",null,e),e.data("collapsed",!1),e.removeClass("collapsed"),j.exec(n.onExpand,[e])})},collapse:function(){this._close(this.element)},expand:function(){this._open(this.element)},isCollapsed:function(){return this.element.data("collapsed")},toggleState:function(){var e=this.element;!0===e.attr("collapsed")||!0===e.data("collapsed")?this.collapse():this.expand()},changeAttribute:function(e){switch(e){case"collapsed":case"data-collapsed":this.toggleState()}},destroy:function(){this.toggle.off(c.events.click),this.element.show()}};c.plugin("collapse",ee);var te={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.timepoint=(new Date).getTime(),this.breakpoint=null,this.blinkInterval=null,this.tickInterval=null,this.zeroDaysFired=!1,this.zeroHoursFired=!1,this.zeroMinutesFired=!1,this.zeroSecondsFired=!1,this.locale=null,this._setOptionsFromDOM(),this._create(),this},options:{locale:METRO_LOCALE,days:0,hours:0,minutes:0,seconds:0,date:null,start:!0,clsCountdown:"",clsZero:"",clsAlarm:"",clsDays:"",clsHours:"",clsMinutes:"",clsSeconds:"",onCountdownCreate:c.noop,onAlarm:c.noop,onTick:c.noop,onZero:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.options;this.locale=void 0!==c.locales[e.locale]?c.locales[e.locale]:c.locales["en-US"],this._build()},_build:function(){var e,n,s,i=this,a=this.element,o=this.options;a.addClass("countdown").addClass(o.clsCountdown),null!==o.date&&!1!==j.isDate(o.date)&&(this.timepoint=new Date(o.date).getTime()),this.breakpoint=this.timepoint,parseInt(o.days)>0&&(this.breakpoint+=864e5*parseInt(o.days)),parseInt(o.hours)>0&&(this.breakpoint+=36e5*parseInt(o.hours)),parseInt(o.minutes)>0&&(this.breakpoint+=6e4*parseInt(o.minutes)),parseInt(o.seconds)>0&&(this.breakpoint+=1e3*parseInt(o.seconds)),e=Math.round((i.breakpoint-i.timepoint)/864e5),n=Math.round((i.breakpoint-i.timepoint)/36e5),s=Math.round((i.breakpoint-i.timepoint)/6e4),t.each(["days","hours","minutes","seconds"],function(){if(("days"!==this||0!==e)&&!("hours"===this&&0===e&&0===n||"minutes"===this&&0===e&&0===n&&0===s)){var r=t("<div>").addClass("part "+this).attr("data-label",i.locale.calendar.time[this]).appendTo(a);if("days"===this&&r.addClass(o.clsDays),"hours"===this&&r.addClass(o.clsHours),"minutes"===this&&r.addClass(o.clsMinutes),"seconds"===this&&r.addClass(o.clsSeconds),t("<div>").addClass("digit").appendTo(r),t("<div>").addClass("digit").appendTo(r),"days"===this&&e>=100)for(var l=0;l<String(e/100).length;l++)t("<div>").addClass("digit").appendTo(r)}}),a.find(".digit").html("0"),j.exec(this.options.onCountdownCreate,[this.element]),!0===this.options.start&&this.start()},blink:function(){this.element.toggleClass("blink")},tick:function(){var e,t,n,s,i,a=this.element,o=this.options,r=(new Date).getTime();if((e=Math.floor((this.breakpoint-r)/1e3))<=0)return this.stop(),""!==o.clsZero&&a.find(".part").removeClass(o.clsZero),a.addClass(o.clsAlarm),void j.exec(o.onAlarm,[r,a]);e-=86400*(t=Math.floor(e/86400)),this.draw("days",t),0===t&&(""!==o.clsDays&&a.find(".days").removeClass(o.clsDays),!1===this.zeroDaysFired&&(this.zeroDaysFired=!0,a.find(".days").addClass(o.clsZero),j.exec(o.onZero,["days",a]))),e-=3600*(n=Math.floor(e/3600)),this.draw("hours",n),0===t&&0===n&&(""!==o.clsHours&&a.find(".hours").removeClass(o.clsHours),!1===this.zeroHoursFired&&(this.zeroHoursFired=!0,a.find(".hours").addClass(o.clsZero),j.exec(o.onZero,["hours",a]))),e-=60*(s=Math.floor(e/60)),this.draw("minutes",s),0===t&&0===n&&0===s&&(""!==o.clsMinutes&&a.find(".minutes").removeClass(o.clsMinutes),!1===this.zeroMinutesFired&&(this.zeroMinutesFired=!0,a.find(".minutes").addClass(o.clsZero),j.exec(o.onZero,["minutes",a]))),i=Math.floor(e/1),this.draw("seconds",i),0===t&&0===n&&0===s&&0===i&&(""!==o.clsSeconds&&a.find(".seconds").removeClass(o.clsSeconds),!1===this.zeroSecondsFired&&(this.zeroSecondsFired=!0,a.find(".seconds").addClass(o.clsZero),j.exec(o.onZero,["seconds",a]))),j.exec(o.onTick,[{days:t,hours:n,minutes:s,seconds:i},a])},draw:function(e,t){for(var n,s=this.element,i=(this.options,String(t).length),a=s.find("."+e+" .digit").html("0").length,o=0;o<i;o++)n=Math.floor(t/Math.pow(10,o))%10,s.find("."+e+" .digit:eq("+(a-1)+")").html(n),a--},start:function(){var e=this;!1!==this.element.data("paused")&&(clearInterval(this.blinkInterval),clearInterval(this.tickInterval),this.element.data("paused",!1),this.tick(),this.blinkInterval=setInterval(function(){e.blink()},500),this.tickInterval=setInterval(function(){e.tick()},1e3))},stop:function(){var e=this.element;this.options;e.data("paused",!0),e.find(".digit").html("0"),clearInterval(this.blinkInterval),clearInterval(this.tickInterval)},pause:function(){this.element.data("paused",!0),clearInterval(this.blinkInterval),clearInterval(this.tickInterval)},togglePlay:function(){!0===this.element.attr("data-pause")?this.pause():this.start()},isPaused:function(){return this.element.data("paused")},getTimepoint:function(e){return!0===e?new Date(this.timepoint):this.timepoint},getBreakpoint:function(e){return!0===e?new Date(this.breakpoint):this.breakpoint},getLeft:function(){var e=(new Date).getTime(),t=Math.floor(this.breakpoint-e);return{days:Math.round(t/864e5),hours:Math.round(t/36e5),minutes:Math.round(t/6e4),seconds:Math.round(t/1e3)}},i18n:function(e){var n=this,s=this.element,i=this.options;return void 0===e?i.locale:void 0!==c.locales[e]&&(i.locale=e,this.locale=c.locales[i.locale],void t.each(["days","hours","minutes","seconds"],function(){var e=".part."+this;s.find(e).attr("data-label",n.locale.calendar.time[this])}))},changeAttrLocale:function(){var e=this.element.attr("data-locale");this.i18n(e)},changeAttribute:function(e){switch(e){case"data-pause":this.togglePlay();break;case"data-locale":this.changeAttrLocale()}},destroy:function(){clearInterval(this.blinkInterval),clearInterval(this.tickInterval),this.element.html(""),this.element.removeClass("countdown").removeClass(this.options.clsCountdown)}};c.plugin("countdown",te);var ne={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.numbers=[],this.html=this.element.html(),this._setOptionsFromDOM(),this._create(),this},options:{delay:10,step:1,value:0,timeout:null,delimiter:",",onStart:c.noop,onStop:c.noop,onTick:c.noop,onCounterCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this,t=this.element,n=this.options;this._calcArray(),j.exec(n.onCounterCreate,[t],this.elem),null!==n.timeout&&j.isInt(n.timeout)&&setTimeout(function(){e.start()},n.timeout)},_calcArray:function(){var e,t=this.options;for(e=0;e<=t.value;e+=t.step)this.numbers.push(e);this.numbers[this.numbers.length-1]!==t.value&&this.numbers.push(t.value)},start:function(){var e=this,t=this.element,n=this.options,s=function(){if(0!==e.numbers.length){var i=e.numbers.shift();j.exec(n.onTick,[i,t],t[0]),t.html(Number(i).format(0,0,n.delimiter)),e.numbers.length>0?setTimeout(s,n.delay):j.exec(n.onStop,[t],t[0])}else j.exec(n.onStop,[t],t[0])};j.exec(n.onStart,[t],t[0]),setTimeout(s,n.delay)},reset:function(){this._calcArray(),this.element.html(this.html)},setValueAttribute:function(){this.options.value=this.element.attr("data-value"),this._calcArray()},changeAttribute:function(e){switch(e){case"data-value":this.setValueAttribute()}},destroy:function(){}};c.plugin("counter",ne);var se={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.id=null,this.rules=null,this.interval=!1,this.ruleInterval=!1,this.running=!1,this.intervals=[],this._setOptionsFromDOM(),this._create(),this},default_rules:[{on:{top:[16],left:[4],right:[1]},off:{top:[13,4],left:[1,16],right:[13,4]}},{on:{top:[12,15],left:[3,8],right:[2,5]},off:{top:[9,6,3],left:[5,10,15],right:[14,11,8]}},{on:{top:[11],left:[7],right:[6]},off:{top:[1,2,5],left:[9,13,14],right:[15,12,16]}},{on:{top:[8,14],left:[2,12],right:[9,3]},off:{top:[16],left:[4],right:[1]}},{on:{top:[10,7],left:[6,11],right:[10,7]},off:{top:[12,15],left:[3,8],right:[2,5]}},{on:{top:[13,4],left:[1,16],right:[13,4]},off:{top:[11],left:[7],right:[6]}},{on:{top:[9,6,3],left:[5,10,15],right:[14,11,8]},off:{top:[8,14],left:[2,12],right:[9,3]}},{on:{top:[1,2,5],left:[9,13,14],right:[15,12,16]},off:{top:[10,7],left:[6,11],right:[10,7]}}],options:{rules:null,color:null,flashColor:null,flashInterval:1e3,numbers:!1,offBefore:!0,attenuation:.3,stopOnBlur:!1,cells:4,margin:8,showAxis:!1,axisStyle:"arrow",cellClick:!1,autoRestart:5e3,clsCube:"",clsCell:"",clsSide:"",clsSideLeft:"",clsSideRight:"",clsSideTop:"",clsSideLeftCell:"",clsSideRightCell:"",clsSideTopCell:"",clsAxis:"",clsAxisX:"",clsAxisY:"",clsAxisZ:"",custom:c.noop,onTick:c.noop,onCubeCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;null===t.rules?this.rules=this.default_rules:this._parseRules(t.rules),this._createCube(),this._createEvents(),j.exec(t.onCubeCreate,[e])},_parseRules:function(e){if(null==e)return!1;if(j.isObject(e))return this.rules=j.isObject(e),!0;try{return this.rules=JSON.parse(e),!0}catch(e){return console.log("Unknown or empty rules for cell flashing!"),!1}},_createCube:function(){var e=this.element,n=this.options,s=j.elementId("cube"),i=Math.pow(n.cells,2);e.addClass("cube").addClass(n.clsCube),void 0===e.attr("id")&&e.attr("id",s),this.id=e.attr("id"),this._createCssForFlashColor(),this._createCssForCellSize(),t.each(["left","right","top"],function(){var s,a,o;for(s=t("<div>").addClass("side "+this+"-side").addClass(n.clsSide).appendTo(e),"left"===this&&s.addClass(n.clsSideLeft),"right"===this&&s.addClass(n.clsSideRight),"top"===this&&s.addClass(n.clsSideTop),o=0;o<i;o++)(a=t("<div>").addClass("cube-cell").addClass("cell-id-"+(o+1)).addClass(n.clsCell)).data("id",o+1).data("side",this),a.appendTo(s),!0===n.numbers&&a.html(o+1)});var a=e.find(".cube-cell");null!==n.color&&(j.isColor(n.color)?a.css({backgroundColor:n.color,borderColor:n.color}):a.addClass(n.color));t.each(["x","y","z"],function(){var s=t("<div>").addClass("axis "+n.axisStyle).addClass("axis-"+this).addClass(n.clsAxis);"x"===this&&s.addClass(n.clsAxisX),"y"===this&&s.addClass(n.clsAxisY),"z"===this&&s.addClass(n.clsAxisZ),s.appendTo(e)}),!1===n.showAxis&&e.find(".axis").hide(),this._run()},_run:function(){var e=this,t=this.element,n=this.options,s=0;clearInterval(this.interval),t.find(".cube-cell").removeClass("light"),n.custom!==c.noop?j.exec(n.custom,[t]):(t.find(".cube-cell").removeClass("light"),e._start(),s=j.isObject(this.rules)?j.objectLength(this.rules):0,this.interval=setInterval(function(){e._start()},s*n.flashInterval))},_createCssForCellSize:function(){var e,t,n=this.element,s=this.options,i=c.sheet;8===s.margin&&4===s.cells||(e=parseInt(j.getStyleOne(n,"width")),t=Math.ceil((e/2-s.margin*s.cells*2)/s.cells),j.addCssRule(i,"#"+n.attr("id")+" .side .cube-cell","width: "+t+"px!important; height: "+t+"px!important; margin: "+s.margin+"px!important;"))},_createCssForFlashColor:function(){var e,t,n,s=this.element,i=this.options,a=c.sheet,o=[],r=[];if(null!==i.flashColor){for(e="0 0 10px "+j.hexColorToRgbA(i.flashColor,1),t="0 0 10px "+j.hexColorToRgbA(i.flashColor,i.attenuation),n=0;n<3;n++)o.push(e),r.push(t);j.addCssRule(a,"@keyframes pulsar-cell-"+s.attr("id"),"0%, 100% { box-shadow: "+o.join(",")+"} 50% { box-shadow: "+r.join(",")+" }"),j.addCssRule(a,"#"+s.attr("id")+" .side .cube-cell.light","animation: pulsar-cell-"+s.attr("id")+" 2.5s 0s ease-out infinite; background-color: "+i.flashColor+"!important; border-color: "+i.flashColor+"!important;")}},_createEvents:function(){var e=this,n=this.element,s=this.options;t(window).on(c.events.blur+"-"+n.attr("id"),function(){!0===s.stopOnBlur&&!0===e.running&&e._stop()}),t(window).on(c.events.focus+"-"+n.attr("id"),function(){!0===s.stopOnBlur&&!1===e.running&&e._start()}),n.on(c.events.click,".cube-cell",function(){!0===s.cellClick&&t(this).toggleClass("light")})},_start:function(){var e=this,n=this.element;this.options;n.find(".cube-cell").removeClass("light"),this.running=!0,t.each(this.rules,function(t,n){e._execRule(t,n)})},_stop:function(){this.running=!1,clearInterval(this.interval),t.each(this.intervals,function(){clearInterval(this)})},_tick:function(e,t){var n=this,s=this.element,i=this.options;void 0===t&&(t=i.flashInterval*e);var a=setTimeout(function(){j.exec(i.onTick,[e],s[0]),clearInterval(a),j.arrayDelete(n.intervals,a)},t);this.intervals.push(a)},_toggle:function(e,t,n,s){var i=this;void 0===s&&(s=this.options.flashInterval*n);var a=setTimeout(function(){e["on"===t?"addClass":"removeClass"]("light"),clearInterval(a),j.arrayDelete(i.intervals,a)},s);this.intervals.push(a)},start:function(){this._start()},stop:function(){this._stop()},toRule:function(e,t){var n=this,s=this.element,i=this.options,a=this.rules;if(null!=a&&void 0!==a[e]){clearInterval(this.ruleInterval),this.ruleInterval=!1,this.stop(),s.find(".cube-cell").removeClass("light");for(var o=0;o<=e;o++)this._execRule(o,a[o],t);j.isInt(i.autoRestart)&&i.autoRestart>0&&(this.ruleInterval=setTimeout(function(){n._run()},i.autoRestart))}},_execRule:function(e,n,s){var i=this,a=this.element;this.options;this._tick(e,s),t.each(["left","right","top"],function(){var o="."+this+"-side",r=void 0!==n.on&&void 0!==n.on[this]&&n.on[this],l=void 0!==n.off&&void 0!==n.off[this]&&n.off[this];!1!==r&&t.each(r,function(){var t=a.find(o+" .cell-id-"+this);i._toggle(t,"on",e,s)}),!1!==l&&t.each(l,function(){var t=a.find(o+" .cell-id-"+this);i._toggle(t,"off",e,s)})})},rule:function(e){if(void 0===e)return this.rules;!0===this._parseRules(e)&&(this.options.rules=e,this.stop(),this.element.find(".cube-cell").removeClass("light"),this._run())},axis:function(e){var t=!0===e?"show":"hide";this.element.find(".axis")[t]()},changeRules:function(){var e=this.element,t=this.options,n=e.attr("data-rules");!0===this._parseRules(n)&&(this.stop(),e.find(".cube-cell").removeClass("light"),t.rules=n,this._run())},changeAxisVisibility:function(){var e=this.element,t=(this.options,!0===JSON.parse(e.attr("data-show-axis"))?"show":"hide");e.find(".axis")[t]()},changeAxisStyle:function(){var e=this.element,t=(this.options,e.attr("data-axis-style"));e.find(".axis").removeClass("arrow line no-style").addClass(t)},changeAttribute:function(e){switch(e){case"data-rules":this.changeRules();break;case"data-show-axis":this.changeAxisVisibility();break;case"data-axis-style":this.changeAxisStyle()}},destroy:function(){var e=this.element,n=this.options;clearInterval(this.interval),this.interval=null,t(window).off(c.events.blur+"-"+e.attr("id")),t(window).off(c.events.focus+"-"+e.attr("id")),e.off(c.events.click,".cube-cell"),e.html(""),e.removeClass("cube").removeClass(n.clsCube)}};c.plugin("cube",se);var ie={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.picker=null,this.isOpen=!1,this.value=new Date,this.locale=c.locales[METRO_LOCALE].calendar,this.offset=(new Date).getTimezoneOffset()/60+1,this._setOptionsFromDOM(),this._create(),this},options:{gmt:0,format:"%Y-%m-%d",locale:METRO_LOCALE,value:null,distance:3,month:!0,day:!0,year:!0,minYear:null,maxYear:null,scrollSpeed:5,copyInlineStyles:!0,clsPicker:"",clsPart:"",clsMonth:"",clsDay:"",clsYear:"",okButtonIcon:"<span class='default-icon-check'></span>",cancelButtonIcon:"<span class='default-icon-cross'></span>",onSet:c.noop,onOpen:c.noop,onClose:c.noop,onScroll:c.noop,onDatePickerCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;t.distance<1&&(t.distance=1),null!==t.value&&j.isDate(t.value)&&(this.value=new Date(t.value).addHours(this.offset)),void 0===c.locales[t.locale]&&(t.locale=METRO_LOCALE),this.locale=c.locales[t.locale].calendar,null===t.minYear&&(t.minYear=(new Date).getFullYear()-100),null===t.maxYear&&(t.maxYear=(new Date).getFullYear()+100),this._createStructure(),this._createEvents(),this._set(),j.exec(t.onDatePickerCreate,[e])},_createStructure:function(){var e,n,s,i,a,o,r,l,c,d,h=this.element,u=this.options,p=h.prev(),f=h.parent(),m=j.elementId("date-picker");if(e=t("<div>").attr("id",m).addClass("wheel-picker date-picker "+h[0].className).addClass(u.clsPicker),0===p.length?f.prepend(e):e.insertAfter(p),h.appendTo(e),r=t("<div>").addClass("date-wrapper").appendTo(e),!0===u.month&&(n=t("<div>").addClass("month").addClass(u.clsPart).addClass(u.clsMonth).appendTo(r)),!0===u.day&&(s=t("<div>").addClass("day").addClass(u.clsPart).addClass(u.clsDay).appendTo(r)),!0===u.year&&(i=t("<div>").addClass("year").addClass(u.clsPart).addClass(u.clsYear).appendTo(r)),l=t("<div>").addClass("select-wrapper").appendTo(e),c=t("<div>").addClass("select-block").appendTo(l),!0===u.month){for(n=t("<ul>").addClass("sel-month").appendTo(c),a=0;a<u.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(n);for(a=0;a<12;a++)t("<li>").addClass("js-month-"+a+" js-month-real-"+this.locale.months[a].toLowerCase()).html(this.locale.months[a]).data("value",a).appendTo(n);for(a=0;a<u.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(n)}if(!0===u.day){for(s=t("<ul>").addClass("sel-day").appendTo(c),a=0;a<u.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(s);for(a=0;a<31;a++)t("<li>").addClass("js-day-"+a+" js-day-real-"+(a+1)).html(a+1).data("value",a+1).appendTo(s);for(a=0;a<u.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(s)}if(!0===u.year){for(i=t("<ul>").addClass("sel-year").appendTo(c),a=0;a<u.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(i);for(a=u.minYear,o=0;a<=u.maxYear;a++,o++)t("<li>").addClass("js-year-"+o+" js-year-real-"+a).html(a).data("value",a).appendTo(i);for(a=0;a<u.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(i)}if(c.height(40*(2*u.distance+1)),d=t("<div>").addClass("action-block").appendTo(l),t("<button>").attr("type","button").addClass("button action-ok").html(u.okButtonIcon).appendTo(d),t("<button>").attr("type","button").addClass("button action-cancel").html(u.cancelButtonIcon).appendTo(d),h[0].className="",!0===u.copyInlineStyles)for(a=0;a<h[0].style.length;a++)e.css(h[0].style[a],h.css(h[0].style[a]));this.picker=e},_createEvents:function(){var e=this,n=this.options,s=this.picker;s.on(c.events.start,".select-block ul",function(e){if(!e.changedTouches){var s=this,i=j.pageXY(e).y;t(document).on(c.events.move+"-picker",function(e){s.scrollTop-=n.scrollSpeed*(i>j.pageXY(e).y?-1:1),i=j.pageXY(e).y}),t(document).on(c.events.stop+"-picker",function(){t(document).off(c.events.move+"-picker"),t(document).off(c.events.stop+"-picker")})}}),s.on(c.events.click,function(t){!1===e.isOpen&&e.open(),t.stopPropagation()}),s.on(c.events.click,".action-ok",function(t){var n,i,a,o=s.find(".sel-month li.active"),r=s.find(".sel-day li.active"),l=s.find(".sel-year li.active");n=0===o.length?e.value.getMonth():o.data("value"),i=0===r.length?e.value.getDate():r.data("value"),a=0===l.length?e.value.getFullYear():l.data("value"),e.value=new Date(a,n,i),e._correct(),e._set(),e.close(),t.stopPropagation()}),s.on(c.events.click,".action-cancel",function(t){e.close(),t.stopPropagation()}),this._addScrollEvents()},_addScrollEvents:function(){var e=this.picker,n=this.options;t.each(["month","day","year"],function(){var t=this,s=e.find(".sel-"+t);0!==s.length&&(s.on(c.events.scrollStart,function(){s.find(".active").removeClass("active")}),s.on(c.events.scrollStop,{latency:50},function(){var i=Math.round(Math.ceil(s.scrollTop())/40),a=s.find(".js-"+t+"-"+i),o=a.position().top-40*n.distance+s.scrollTop()-1;s.animate({scrollTop:o},100,function(){a.addClass("active"),j.exec(n.onScroll,[a,s,e],s[0])})}))})},_removeScrollEvents:function(){var e=this.picker;t.each(["month","day","year"],function(){e.find(".sel-"+this).off("scrollstart scrollstop")})},_correct:function(){var e=this.value.getMonth(),t=this.value.getDate(),n=this.value.getFullYear();this.value=new Date(n,e,t)},_set:function(){var e=this.element,t=this.options,n=this.picker,s=this.locale.months[this.value.getMonth()],i=this.value.getDate(),a=this.value.getFullYear();!0===t.month&&n.find(".month").html(s),!0===t.day&&n.find(".day").html(i),!0===t.year&&n.find(".year").html(a),e.val(this.value.format(t.format,t.locale)).trigger("change"),j.exec(t.onSet,[this.value,e.val(),e,n],e[0])},open:function(){var e,t,n,s,i,a=this.element,o=this.options,r=this.picker,l=this.value.getMonth(),c=this.value.getDate()-1,d=this.value.getFullYear(),h=r.find(".select-wrapper");h.parent().removeClass("for-top for-bottom"),h.show(),r.find("li").removeClass("active"),s=j.inViewport(h),i=j.rect(h),!s&&i.top>0&&h.parent().addClass("for-bottom"),!s&&i.top<0&&h.parent().addClass("for-top"),!0===o.month&&(e=r.find(".sel-month")).scrollTop(0).animate({scrollTop:e.find("li.js-month-"+l).addClass("active").position().top-40*o.distance},100),!0===o.day&&(t=r.find(".sel-day")).scrollTop(0).animate({scrollTop:t.find("li.js-day-"+c).addClass("active").position().top-40*o.distance},100),!0===o.year&&(n=r.find(".sel-year")).scrollTop(0).animate({scrollTop:n.find("li.js-year-real-"+d).addClass("active").position().top-40*o.distance},100),this.isOpen=!0,j.exec(o.onOpen,[this.value,a,r],a[0])},close:function(){var e=this.picker,t=this.options,n=this.element;e.find(".select-wrapper").hide(),this.isOpen=!1,j.exec(t.onClose,[this.value,n,e],n[0])},val:function(e){return void 0===e?this.element.val():!1!==j.isDate(e)&&(this.value=new Date(e).addHours(this.offset),void this._set())},date:function(e){if(void 0===e)return this.value;try{this.value=new Date(e.format("%Y-%m-%d")),this._set()}catch(e){return!1}},changeValueAttribute:function(){this.val(this.element.attr("data-value"))},changeAttribute:function(e){switch(e){case"data-value":this.changeValueAttribute()}},destroy:function(){var e=this.element,t=this.picker,n=e.parent();this._removeScrollEvents(),t.off(c.events.start,".select-block ul"),t.off(c.events.click),t.off(c.events.click,".action-ok"),t.off(c.events.click,".action-cancel"),e.insertBefore(n),n.remove()}};c.plugin("datepicker",ie),t(document).on(c.events.click,function(){t.each(t(".date-picker"),function(){t(this).find("input").data("datepicker").close()})});var ae={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.interval=null,this.overlay=null,this._setOptionsFromDOM(),this._create(),this},options:{toTop:!1,toBottom:!1,locale:METRO_LOCALE,title:"",content:"",actions:{},actionsAlign:"right",defaultAction:!0,overlay:!0,overlayColor:"#000000",overlayAlpha:.5,overlayClickClose:!1,width:"480",height:"auto",shadow:!0,closeAction:!0,clsDialog:"",clsTitle:"",clsContent:"",clsAction:"",clsDefaultAction:"",clsOverlay:"",autoHide:0,removeOnClose:!1,show:!1,onShow:c.noop,onHide:c.noop,onOpen:c.noop,onClose:c.noop,onDialogCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.options;this.locale=void 0!==c.locales[e.locale]?c.locales[e.locale]:c.locales["en-US"],this._build()},_build:function(){var e,n=this,s=this.element,i=this.options,a=t("body");if(s.addClass("dialog"),!0===i.shadow&&s.addClass("shadow-on"),void 0===s.attr("id")&&s.attr("id",j.elementId("dialog")),""!==i.title&&this.setTitle(i.title),""!==i.content&&this.setContent(i.content),!0===i.defaultAction||!1!==i.actions&&"object"==typeof i.actions&&j.objectLength(i.actions)>0){var o,r=s.find(".dialog-actions");0===r.length&&(r=t("<div>").addClass("dialog-actions").addClass("text-"+i.actionsAlign).appendTo(s)),!0===i.defaultAction&&0===j.objectLength(i.actions)&&0===s.find(".dialog-actions > *").length&&(o=t("<button>").addClass("button js-dialog-close").addClass(i.clsDefaultAction).html(this.locale.buttons.ok)).appendTo(r),t.each(i.actions,function(){var e=this;o=t("<button>").addClass("button").addClass(e.cls).html(e.caption),void 0!==e.onclick&&o.on(c.events.click,function(){j.exec(e.onclick,[s])}),o.appendTo(r)})}!0===i.overlay&&(e=this._overlay(),this.overlay=e),!0===i.closeAction&&s.on(c.events.click,".js-dialog-close",function(){n.close()}),s.css({width:i.width,height:i.height,visibility:"hidden",top:"100%",left:(t(window).width()-s.outerWidth())/2}),s.addClass(i.clsDialog),s.find(".dialog-title").addClass(i.clsTitle),s.find(".dialog-content").addClass(i.clsContent),s.find(".dialog-actions").addClass(i.clsAction),s.appendTo(a),i.show&&this.open(),t(window).on(c.events.resize+"_"+s.attr("id"),function(){n.setPosition()}),j.exec(this.options.onDialogCreate,[this.element])},_overlay:function(){this.element;var e=this.options,n=t("<div>");return n.addClass("overlay").addClass(e.clsOverlay),"transparent"===e.overlayColor?n.addClass("transparent"):n.css({background:j.hex2rgba(e.overlayColor,e.overlayAlpha)}),n},hide:function(e){var t=this.element,n=this.options,s=0;n.onHide!==c.noop&&(s=300,j.exec(n.onHide,[t])),setTimeout(function(){t.css({visibility:"hidden",top:"100%"}),j.callback(e)},s)},show:function(e){var t=this.element,n=this.options;this.setPosition(),t.css({visibility:"visible"}),j.callback(e),j.exec(n.onShow,[t])},setPosition:function(){var e,n,s=this.element,i=this.options;!0!==i.toTop&&!0!==i.toBottom?(e=(t(window).height()-s.outerHeight())/2,n="auto"):(!0===i.toTop&&(e=0,n="auto"),!0!==i.toTop&&!0===i.toBottom&&(n=0,e="auto")),s.css({top:e,bottom:n,left:(t(window).width()-s.outerWidth())/2})},setContent:function(e){var n=this.element,s=(this.options,n.find(".dialog-content"));0===s.length&&(s=t("<div>").addClass("dialog-content")).appendTo(n),!j.isJQueryObject(e)&&j.isFunc(e)&&(e=j.exec(e)),j.isJQueryObject(e)?e.appendTo(s):s.html(e)},setTitle:function(e){var n=this.element,s=(this.options,n.find(".dialog-title"));0===s.length&&(s=t("<div>").addClass("dialog-title")).appendTo(n),s.html(e)},close:function(){var e=this.element,n=this.options;t("body").find(".overlay").remove(),this.hide(function(){e.data("open",!1),j.exec(n.onClose,[e]),!0===n.removeOnClose&&e.remove()})},open:function(){var e=this,n=this.element,s=this.options;!0===s.overlay&&(this.overlay.appendTo(t("body")),!0===s.overlayClickClose&&this.overlay.on(c.events.click,function(){e.close()})),this.show(function(){j.exec(s.onOpen,[n]),n.data("open",!0),parseInt(s.autoHide)>0&&setTimeout(function(){e.close()},parseInt(s.autoHide))})},toggle:function(){this.element.data("open")?this.close():this.open()},isOpen:function(){return!0===this.element.data("open")},changeAttribute:function(e){}};c.plugin("dialog",ae),c.dialog={isDialog:function(e){return j.isMetroObject(e,"dialog")},open:function(e,n,s){if(!this.isDialog(e))return!1;var i=t(e).data("dialog");void 0!==s&&i.setTitle(s),void 0!==n&&i.setContent(n),i.open()},close:function(e){if(!this.isDialog(e))return!1;t(e).data("dialog").close()},toggle:function(e){if(!this.isDialog(e))return!1;t(e).data("dialog").toggle()},isOpen:function(e){return!!this.isDialog(e)&&t(e).data("dialog").isOpen()},remove:function(e){if(!this.isDialog(e))return!1;var n=t(e).data("dialog");n.options.removeOnClose=!0,n.close()},create:function(e){var n;n=t("<div>").appendTo(t("body"));var s=t.extend({},{show:!0,closeAction:!0,removeOnClose:!0},void 0!==e?e:{});return n.dialog(s)}};var oe={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.value=0,this.animation_change_interval=null,this._setOptionsFromDOM(),this._create(),j.exec(this.options.onDonutCreate,[this.element]),this},options:{size:100,radius:50,hole:.8,value:0,background:"#ffffff",color:"",stroke:"#d1d8e7",fill:"#49649f",fontSize:24,total:100,cap:"%",showText:!0,showValue:!1,animate:0,onChange:c.noop,onDonutCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options,n="",s=t.radius*(1-(1-t.hole)/2),i=t.radius*(1-t.hole),a=2*Math.PI*s,o=(t.value,t.total,"rotate(-90 "+t.radius+","+t.radius+")"),r=s*t.hole*.6;e.addClass("donut"),e.css({width:t.size,height:t.size,background:t.background}),n+="<svg>",n+="   <circle class='donut-back' r='"+s+"px' cx='"+t.radius+"px' cy='"+t.radius+"px' transform='"+o+"' fill='none' stroke='"+t.stroke+"' stroke-width='"+i+"'/>",n+="   <circle class='donut-fill' r='"+s+"px' cx='"+t.radius+"px' cy='"+t.radius+"px' transform='"+o+"' fill='none' stroke='"+t.fill+"' stroke-width='"+i+"'/>",!0===t.showText&&(n+="   <text   class='donut-title' x='"+t.radius+"px' y='"+t.radius+"px' dy='"+r/3+"px' text-anchor='middle' fill='"+(""!==t.color?t.color:t.fill)+"' font-size='"+r+"px'>0"+t.cap+"</text>"),n+="</svg>",e.html(n),this.val(t.value)},_setValue:function(e){var t=this.element,n=this.options,s=t.find(".donut-fill"),i=t.find(".donut-title"),a=n.radius*(1-(1-n.hole)/2),o=2*Math.PI*a,r=(n.showValue?e:j.percent(n.total,e,!0))+n.cap,l=e*o/n.total+" "+o;s.attr("stroke-dasharray",l),i.html(r)},val:function(e){var t=this,n=this.element,s=this.options;if(void 0===e)return this.value;if(parseInt(e)<0||parseInt(e)>s.total)return!1;if(s.animate>0&&!document.hidden){var i=e>t.value,a=t.value+(i?-1:1);clearInterval(t.animation_change_interval),this.animation_change_interval=setInterval(function(){i?(t._setValue(++a),a>=e&&clearInterval(t.animation_change_interval)):(t._setValue(--a),a<=e&&clearInterval(t.animation_change_interval))},s.animate)}else clearInterval(t.animation_change_interval),this._setValue(e);this.value=e,j.exec(s.onChange,[this.value,n])},changeValue:function(){this.val(this.element.attr("data-value"))},changeAttribute:function(e){switch(e){case"data-value":this.changeValue()}},destroy:function(){this.element.removeClass("donut").html("")}};c.plugin("donut",oe);var re={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.drag=!1,this.move=!1,this.backup={cursor:"default",zIndex:"0"},this._setOptionsFromDOM(),this._create(),j.exec(this.options.onDraggableCreate,[this.element]),this},options:{dragElement:"self",dragArea:"parent",onCanDrag:c.noop_true,onDragStart:c.noop,onDragStop:c.noop,onDragMove:c.noop,onDraggableCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,n,s,i=this,a=this.element,o=this.options,r="self"!==o.dragElement?a.find(o.dragElement):a;r[0].ondragstart=function(){return!1},r.on(c.events.start,function(r){if(!1!==a.data("canDrag")&&!0===j.exec(o.onCanDrag,[a])&&(!1!==l||1===r.which)){i.drag=!0,i.backup.cursor=a.css("cursor"),i.backup.zIndex=a.css("z-index"),a.addClass("draggable"),"document"!==o.dragArea&&"window"!==o.dragArea||(o.dragArea="body"),e="parent"===o.dragArea?a.parent():t(o.dragArea),n={left:e.offset().left,top:e.offset().top},s=j.pageXY(r);var d=a.outerHeight(),h=a.outerWidth(),u=a.offset().top+d-j.pageXY(r).y,p=a.offset().left+h-j.pageXY(r).x;j.exec(o.onDragStart,[s,a]),t(document).on(c.events.move,function(t){var r,l;if(!1!==i.drag){i.move=!0,r=j.pageXY(t).x-n.left;var c=(l=j.pageXY(t).y-n.top)>0?l+u-d:0,f=r>0?r+p-h:0,m=e.innerHeight()+e.scrollTop()-a.outerHeight(),v=e.innerWidth()+e.scrollLeft()-a.outerWidth();c>=0&&c<=m&&(s.y=c,a.offset({top:c+n.top})),f>=0&&f<=v&&(s.x=f,a.offset({left:f+n.left})),j.exec(o.onDragMove,[s,a]),t.preventDefault()}})}}),r.on(c.events.stop,function(e){a.css({cursor:i.backup.cursor,zIndex:i.backup.zIndex}).removeClass("draggable"),i.drag=!1,i.move=!1,s=j.pageXY(e),t(document).off(c.events.move),j.exec(o.onDragStop,[s,a])})},off:function(){this.element.data("canDrag",!1)},on:function(){this.element.data("canDrag",!0)},changeAttribute:function(e){}};c.plugin("draggable",re);var le={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._toggle=null,this.displayOrigin=null,this._setOptionsFromDOM(),this._create(),j.exec(this.options.onDropdownCreate,[this.element]),this},options:{effect:"slide",toggleElement:null,noClose:!1,duration:100,onDrop:c.noop,onUp:c.noop,onDropdownCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,n=this,s=this.element,i=this.options,a=s.parent();e=null!==i.toggleElement?t(i.toggleElement):s.siblings(".dropdown-toggle").length>0?s.siblings(".dropdown-toggle"):s.prev(),this.displayOrigin=s.css("display"),this.element.css("display","none"),e.on(c.events.click,function(e){if(a.siblings(a[0].tagName).removeClass("active-container"),t(".active-container").removeClass("active-container"),"none"===s.css("display")||s.hasClass("keep-open")){if(t("[data-role=dropdown]").each(function(e,i){s.parents("[data-role=dropdown]").is(i)||t(i).hasClass("keep-open")||"none"===t(i).css("display")||n._close(i)}),s.hasClass("horizontal")){s.css({visibility:"hidden",display:"block"});var i=0;t.each(s.children("li"),function(){i+=t(this).outerWidth(!0)}),s.css({visibility:"visible",display:"none"});var o=i;s.css("width",o)}n._open(s),a.addClass("active-container")}else n._close(s);e.preventDefault(),e.stopPropagation()}),this._toggle=e,!0===i.noClose&&s.addClass("keep-open").on(c.events.click,function(e){e.stopPropagation()}),t(s).find("li.disabled a").on(c.events.click,function(e){e.preventDefault()})},_close:function(e){!1===j.isJQueryObject(e)&&(e=t(e));var n=e.data("dropdown"),s=n._toggle,i=n.options,a="slide"===i.effect?"slideUp":"fadeOut";s.removeClass("active-toggle").removeClass("active-control"),n.element.parent().removeClass("active-container"),e[a](i.duration,function(){e.trigger("onClose",null,e)}),j.exec(i.onUp,[e])},_open:function(e){!1===j.isJQueryObject(e)&&(e=t(e));var n=e.data("dropdown"),s=n._toggle,i=n.options,a="slide"===i.effect?"slideDown":"fadeIn";s.addClass("active-toggle").addClass("active-control"),e[a](i.duration,function(){e.trigger("onOpen",null,e)}),j.exec(i.onDrop,[e])},close:function(){this._close(this.element)},open:function(){this._open(this.element)},changeAttribute:function(e){},destroy:function(){this._toggle.off(c.events.click)}};t(document).on(c.events.click,function(e){t("[data-role*=dropdown]").each(function(){var e=t(this);"block"===e.css("display")&&!1===e.hasClass("keep-open")&&e.data("dropdown").close()})}),c.plugin("dropdown",le);var ce={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),j.exec(this.options.onFileCreate,[this.element]),this},options:{copyInlineStyles:!0,prepend:"",caption:"Choose file",disabled:!1,onSelect:c.noop,onFileCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){this._createStructure(),this._createEvents()},_createStructure:function(){var e=this.element,n=this.options,s=e.prev(),i=e.parent(),a=t("<div>").addClass("file "+e[0].className),o=t("<span>").addClass("caption");(0===s.length?i.prepend(a):a.insertAfter(s),e.appendTo(a),o.insertBefore(e),t("<button>").addClass("button").attr("tabindex",-1).attr("type","button").html(n.caption).appendTo(a),"rtl"===e.attr("dir")&&a.addClass("rtl"),e[0].className="",""!==n.prepend)&&(j.isTag(n.prepend)?t(n.prepend):t("<span>"+n.prepend+"</span>")).addClass("prepend").addClass(n.clsPrepend).appendTo(a);if(!0===n.copyInlineStyles)for(var r=0,l=e[0].style.length;r<l;r++)a.css(e[0].style[r],e.css(e[0].style[r]));!0===n.disabled||e.is(":disabled")?this.disable():this.enable()},_createEvents:function(){var e=this.element,t=this.options,n=e.parent(),s=n.find(".caption");n.on(c.events.click,"button, .caption",function(){e.trigger("click")}),e.on(c.events.change,function(){var n,i=[];0!==this.files.length&&(Array.from(this.files).forEach(function(e){i.push(e.name)}),n=i.join(", "),s.html(n),s.attr("title",n),j.exec(t.onSelect,[this.files,e],e[0]))})},disable:function(){this.element.data("disabled",!0),this.element.parent().addClass("disabled")},enable:function(){this.element.data("disabled",!1),this.element.parent().removeClass("disabled")},toggleState:function(){!1===this.element.data("disabled")?this.disable():this.enable()},toggleDir:function(){"rtl"===this.element.attr("dir")?this.element.parent().addClass("rtl"):this.element.parent().removeClass("rtl")},changeAttribute:function(e){switch(e){case"disabled":this.toggleState();break;case"dir":this.toggleDir()}},destroy:function(){var e=this.element,t=e.parent();e.off(c.events.change),t.off(c.events.click,"button, .caption"),e.insertBefore(t),t.remove()}};c.plugin("file",ce);var de={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),j.exec(this.options.onGravatarCreate,[this.element]),this},options:{email:"",size:80,default:"404",onGravatarCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){this.get()},getImage:function(e,n,s,i){var a=t("<img>");return a.attr("src",this.getImageSrc(e,n)),!0===i?a:a[0]},getImageSrc:function(e,t,n){return void 0===e||""===e.trim()?"":(t=t||80,n=j.encodeURI(n)||"404","//www.gravatar.com/avatar/"+j.md5(e.toLowerCase().trim())+"?size="+t+"&d="+n)},get:function(){var e=this.element,t=this.options,n="IMG"===e[0].tagName?e:e.find("img");if(0!==n.length)return n.attr("src",this.getImageSrc(t.email,t.size,t.default)),this},resize:function(e){this.options.size=void 0!==e?e:this.element.attr("data-size"),this.get()},email:function(e){this.options.email=void 0!==e?e:this.element.attr("data-email"),this.get()},changeAttribute:function(e){switch(e){case"data-size":this.resize();break;case"data-email":this.email()}},destroy:function(){var e=this.element;"img"!==e[0].tagName.toLowerCase()&&e.html("")}};c.plugin("gravatar",de);var he={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.hint=null,this.hint_size={width:0,height:0},this._setOptionsFromDOM(),this._create(),j.exec(this.options.onHintCreate,[this.element]),this},options:{hintHide:5e3,clsHint:"",hintText:"",hintPosition:c.position.TOP,hintOffset:4,onHintCreate:c.noop,onHintShow:c.noop,onHintHide:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this,n=this.element,s=this.options;n.on(c.events.enter+"-hint",function(){e.createHint(),s.hintHide>0&&setTimeout(function(){e.removeHint()},s.hintHide)}),n.on(c.events.leave+"-hint",function(){e.removeHint()}),t(window).on(c.events.scroll+"-hint",function(){null!==e.hint&&e.setPosition()})},createHint:function(){var e=this.elem,n=this.element,s=this.options,i=t("<div>").addClass("hint").addClass(s.clsHint).html(s.hintText);if(this.hint=i,this.hint_size=j.hiddenElementSize(i),t(".hint:not(.permanent-hint)").remove(),"TD"===e.tagName||"TH"===e.tagName){var a=t("<div/>").css("display","inline-block").html(n.html());n.html(a),n=a}this.setPosition(),i.appendTo(t("body")),j.exec(s.onHintShow,[i,n])},setPosition:function(){var e=this.hint,n=this.hint_size,s=this.options,i=this.element;s.hintPosition===c.position.BOTTOM?(e.addClass("bottom"),e.css({top:i.offset().top-t(window).scrollTop()+i.outerHeight()+s.hintOffset,left:i.offset().left+i.outerWidth()/2-n.width/2-t(window).scrollLeft()})):s.hintPosition===c.position.RIGHT?(e.addClass("right"),e.css({top:i.offset().top+i.outerHeight()/2-n.height/2-t(window).scrollTop(),left:i.offset().left+i.outerWidth()-t(window).scrollLeft()+s.hintOffset})):s.hintPosition===c.position.LEFT?(e.addClass("left"),e.css({top:i.offset().top+i.outerHeight()/2-n.height/2-t(window).scrollTop(),left:i.offset().left-n.width-t(window).scrollLeft()-s.hintOffset})):(e.addClass("top"),e.css({top:i.offset().top-t(window).scrollTop()-n.height-s.hintOffset,left:i.offset().left+i.outerWidth()/2-n.width/2-t(window).scrollLeft()}))},removeHint:function(){var e=this,t=this.hint,n=this.element,s=this.options,i=s.onHintHide===c.noop?0:300;null!==t&&(j.exec(s.onHintHide,[t,n]),setTimeout(function(){t.hide(0,function(){t.remove(),e.hint=null})},i))},changeText:function(){this.options.hintText=this.element.attr("data-hint-text")},changeAttribute:function(e){switch(e){case"data-hint-text":this.changeText()}},destroy:function(){this.elem;var e=this.element;this.options;this.removeHint(),e.off(c.events.enter+"-hint"),e.off(c.events.leave+"-hint"),t(window).off(c.events.scroll+"-hint")}};c.plugin("hint",he);var ue={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.overlay=null,this._setOptionsFromDOM(),this._create(),this},options:{type:"",width:480,height:"auto",overlay:!0,overlayColor:"#000000",overlayAlpha:.5,autoHide:0,removeOnClose:!1,closeButton:!0,clsBox:"",clsBoxContent:"",clsOverlay:"",onOpen:c.noop,onClose:c.noop,onInfoBoxCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this._createStructure(),this._createEvents(),j.exec(t.onInfoBoxCreate,[e],e[0])},_overlay:function(){this.element;var e=this.options,n=t("<div>");return n.addClass("overlay").addClass(e.clsOverlay),"transparent"===e.overlayColor?n.addClass("transparent"):n.css({background:j.hex2rgba(e.overlayColor,e.overlayAlpha)}),n},_createStructure:function(){var e,n,s=this.element,i=this.options;!0===i.overlay&&(this.overlay=this._overlay()),void 0===s.attr("id")&&s.attr("id",j.elementId("infobox")),s.addClass("info-box").addClass(i.type).addClass(i.clsBox),0===(e=s.find("closer")).length&&(e=t("<span>").addClass("button square closer")).appendTo(s),!0!==i.closeButton&&e.hide(),(n=s.find(".info-box-content")).length>0&&n.addClass(i.clsBoxContent),s.css({width:i.width,height:i.height,visibility:"hidden",top:"100%",left:(t(window).width()-s.outerWidth())/2}),s.appendTo(t("body"))},_createEvents:function(){var e=this,n=this.element;this.options;n.on(c.events.click,".closer",function(){e.close()}),n.on(c.events.click,".js-dialog-close",function(){e.close()}),t(window).on(c.events.resize+"_"+n.attr("id"),function(){e.reposition()})},_setPosition:function(){var e=this.element;e.css({top:(t(window).height()-e.outerHeight())/2,left:(t(window).width()-e.outerWidth())/2})},reposition:function(){this._setPosition()},setContent:function(e){var t=this.element,n=(this.options,t.find(".info-box-content"));0!==n.length&&(n.html(e),this.reposition())},setType:function(e){var t=this.element;this.options;t.removeClass("success info alert warning").addClass(e)},open:function(){var e=this,n=this.element,s=this.options;!0===s.overlay&&this.overlay.appendTo(t("body")),this._setPosition(),n.css({visibility:"visible"}),j.exec(s.onOpen,[n],n[0]),n.data("open",!0),parseInt(s.autoHide)>0&&setTimeout(function(){e.close()},parseInt(s.autoHide))},close:function(){var e=this.element,n=this.options;!0===n.overlay&&t("body").find(".overlay").remove(),e.css({visibility:"hidden",top:"100%"}),j.exec(n.onClose,[e],e[0]),e.data("open",!1),!0===n.removeOnClose&&(this.destroy(),e.remove())},isOpen:function(){return!0===this.element.data("open")},changeAttribute:function(e){},destroy:function(){var e=this.element;this.options;e.off(c.events.click,".closer"),e.off(c.events.click,".js-dialog-close"),t(window).off(c.events.resize+"_"+e.attr("id"))}};c.plugin("infobox",ue),c.infobox={isInfoBox:function(e){return j.isMetroObject(e,"dialog")},open:function(e,n,s){if(!this.isInfoBox(e))return!1;var i=t(e).data("infobox");void 0!==n&&i.setContent(n),void 0!==s&&i.setType(s),i.open()},close:function(e){if(!this.isInfoBox(e))return!1;t(e).data("infobox").close()},setContent:function(e,n){if(!this.isInfoBox(e))return!1;void 0===n&&(n="");var s=t(e).data("infobox");s.setContent(n),s.reposition()},setType:function(e,n){if(!this.isInfoBox(e))return!1;var s=t(e).data("infobox");s.setType(n),s.reposition()},isOpen:function(e){return!!this.isInfoBox(e)&&t(e).data("infobox").isOpen()},create:function(e,n,s,i){var a,o,r;r=void 0!==n?n:"",a=t("<div>").appendTo(t("body")),t("<div>").addClass("info-box-content").appendTo(a);var l=t.extend({},{removeOnClose:!0,type:r},void 0!==s?s:{});return a.infobox(l),(o=a.data("infobox")).setContent(e),!1!==i&&o.open(),a}};var pe={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),j.exec(this.options.onInputCreate,[this.element]),this},options:{defaultValue:"",clsElement:"",clsInput:"",clsPrepend:"",clsAppend:"",clsClearButton:"",clsRevealButton:"",size:"default",prepend:"",append:"",copyInlineStyles:!0,clearButton:!0,revealButton:!0,clearButtonIcon:"<span class='default-icon-cross'></span>",revealButtonIcon:"<span class='default-icon-eye'></span>",customButtons:[],disabled:!1,onInputCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,n,s=this.element,i=this.options,a=s.prev(),o=s.parent(),r=t("<div>").addClass("input "+s[0].className),l=t("<div>").addClass("button-group");(void 0===s.attr("type")&&s.attr("type","text"),0===a.length?o.prepend(r):r.insertAfter(a),s.appendTo(r),l.appendTo(r),j.isValue(s.val().trim())||s.val(i.defaultValue),!1!==i.clearButton&&((e=t("<button>").addClass("button input-clear-button").addClass(i.clsClearButton).attr("tabindex",-1).attr("type","button").html(i.clearButtonIcon)).on(c.events.click,function(){s.val(j.isValue(i.defaultValue)?i.defaultValue:"").trigger("change").trigger("keyup").focus()}),e.appendTo(l)),"password"===s.attr("type")&&!1!==i.revealButton&&((n=t("<button>").addClass("button input-reveal-button").addClass(i.clsRevealButton).attr("tabindex",-1).attr("type","button").html(i.revealButtonIcon)).on(c.events.start,function(){s.attr("type","text")}).on(c.events.stop,function(){s.attr("type","password").focus()}),n.appendTo(l)),""!==i.prepend)&&(j.isTag(i.prepend)?t(i.prepend):t("<span>"+i.prepend+"</span>")).addClass("prepend").addClass(i.clsPrepend).appendTo(r);("string"==typeof i.customButtons&&(i.customButtons=j.isObject(i.customButtons)),"object"==typeof i.customButtons&&j.objectLength(i.customButtons)>0&&t.each(i.customButtons,function(){var e=this,n=t("<button>").addClass("button input-custom-button").addClass(e.cls).attr("tabindex",-1).attr("type","button").html(e.html);n.on(c.events.click,function(){j.exec(e.onclick,[s.val(),n],s[0])}),n.appendTo(l)}),""!==i.append)&&(j.isTag(i.append)?t(i.append):t("<span>"+i.append+"</span>")).addClass("append").addClass(i.clsAppend).appendTo(r);if("rtl"===s.attr("dir")&&r.addClass("rtl").attr("dir","rtl"),s[0].className="",!0===i.copyInlineStyles)for(var d=0,h=s[0].style.length;d<h;d++)r.css(s[0].style[d],s.css(s[0].style[d]));r.addClass(i.clsElement),s.addClass(i.clsInput),"default"!==i.size&&r.css({width:i.size}),s.on(c.events.blur,function(){r.removeClass("focused")}),s.on(c.events.focus,function(){r.addClass("focused")}),!0===i.disabled||s.is(":disabled")?this.disable():this.enable()},disable:function(){this.element.data("disabled",!0),this.element.parent().addClass("disabled")},enable:function(){this.element.data("disabled",!1),this.element.parent().removeClass("disabled")},toggleState:function(){!1===this.element.data("disabled")?this.disable():this.enable()},changeAttribute:function(e){switch(e){case"disabled":this.toggleState()}},destroy:function(){var e=this.element,t=(this.options,e.parent()),n=t.find(".input-clear-button"),s=t.find(".input-reveal-button"),i=t.find(".input-custom-button");n.length>0&&n.off(c.events.click),s.length>0&&(s.off(c.events.start),s.off(c.events.stop)),i.length>0&&n.off(c.events.click),e.off(c.events.blur),e.off(c.events.focus),e.insertBefore(t),t.remove()}};c.plugin("input",pe);var fe={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.value="",this.positions=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],this.keypad=null,this._setOptionsFromDOM(),this.keys=j.strToArray(this.options.keys,","),this.keys_to_work=this.keys,this._create(),this},options:{keySize:32,keys:"1, 2, 3, 4, 5, 6, 7, 8, 9, 0",copyInlineStyles:!1,target:null,length:0,shuffle:!1,shuffleCount:3,position:c.position.BOTTOM_LEFT,dynamicPosition:!1,serviceButtons:!0,showValue:!0,open:!1,sizeAsKeys:!1,clsKeypad:"",clsInput:"",clsKeys:"",clsKey:"",clsServiceKey:"",clsBackspace:"",clsClear:"",onChange:c.noop,onClear:c.noop,onBackspace:c.noop,onShuffle:c.noop,onKey:c.noop,onKeypadCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){this._createKeypad(),!0===this.options.shuffle&&this.shuffle(),this._createKeys(),this._createEvents(),j.exec(this.options.onKeypadCreate,[this.element])},_createKeypad:function(){var e,n,s=this.element,i=this.options,a=s.prev(),o=s.parent();if((e=o.hasClass("input")?o:t("<div>").addClass("input").addClass(s[0].className)).addClass("keypad"),"static"!==e.css("position")&&""!==e.css("position")||e.css({position:"relative"}),void 0===s.attr("type")&&s.attr("type","text"),0===a.length?o.prepend(e):e.insertAfter(a),s.attr("readonly",!0),s.appendTo(e),(n=t("<div>").addClass("keys").addClass(i.clsKeys)).appendTo(e),this._setKeysPosition(),!0===i.open&&n.addClass("open keep-open"),s[0].className="",!0===i.copyInlineStyles)for(var r=0,l=s[0].style.length;r<l;r++)e.css(s[0].style[r],s.css(s[0].style[r]));s.addClass(i.clsInput),e.addClass(i.clsKeypad),s.on(c.events.blur,function(){e.removeClass("focused")}),s.on(c.events.focus,function(){e.addClass("focused")}),!0===i.disabled||s.is(":disabled")?this.disable():this.enable(),this.keypad=e},_setKeysPosition:function(){var e=this.element,t=this.options;e.parent().find(".keys").removeClass(this.positions.join(" ")).addClass(t.position)},_createKeys:function(){var e,n=this.element,s=this.options,i=n.parent(),a=Math.round(Math.sqrt(this.keys.length+2)),o=a*s.keySize+4*a,r=i.find(".keys");if(r.html(""),t.each(this.keys_to_work,function(){(e=t("<span>").addClass("key").addClass(s.clsKey).html(this)).data("key",this),e.css({width:s.keySize,height:s.keySize,lineHeight:s.keySize-4+"px"}).appendTo(r)}),!0===s.serviceButtons){t.each(["&larr;","&times;"],function(){e=t("<span>").addClass("key service-key").addClass(s.clsKey).addClass(s.clsServiceKey).html(this),"&larr;"===this&&e.addClass(s.clsBackspace),"&times;"===this&&e.addClass(s.clsClear),e.data("key",this),e.css({width:s.keySize,height:s.keySize,lineHeight:s.keySize-4+"px"}).appendTo(r)})}r.width(o),!0===s.sizeAsKeys&&-1!==["top-left","top","top-right","bottom-left","bottom","bottom-right"].indexOf(s.position)&&i.outerWidth(r.outerWidth())},_createEvents:function(){var e=this,n=this.element,s=this.options,i=n.parent(),a=i.find(".keys");i.on(c.events.click,".keys",function(e){e.preventDefault(),e.stopPropagation()}),i.on(c.events.click,function(e){!0!==s.open&&(!0===a.hasClass("open")?a.removeClass("open"):a.addClass("open"),e.preventDefault(),e.stopPropagation())}),i.on(c.events.click,".key",function(i){var a=t(this);if("&larr;"!==a.data("key")&&"&times;"!==a.data("key")){if(s.length>0&&String(e.value).length===s.length)return!1;e.value=e.value+""+a.data("key"),!0===s.shuffle&&(e.shuffle(),e._createKeys()),!0===s.dynamicPosition&&(s.position=e.positions[j.random(0,e.positions.length-1)],e._setKeysPosition()),j.exec(s.onKey,[a.data("key"),e.value,n])}else"&times;"===a.data("key")&&(e.value="",j.exec(s.onClear,[n])),"&larr;"===a.data("key")&&(e.value=e.value.substring(0,e.value.length-1),j.exec(s.onBackspace,[e.value,n]));!0===s.showValue&&("INPUT"===n[0].tagName?n.val(e.value):n.text(e.value)),n.trigger("change"),j.exec(s.onChange,[e.value,n]),i.preventDefault(),i.stopPropagation()}),null!==s.target&&n.on(c.events.change,function(){var n=t(s.target);0!==n.length&&("INPUT"===n[0].tagName?n.val(e.value):n.text(e.value))})},shuffle:function(){for(var e=0;e<this.options.shuffleCount;e++)this.keys_to_work=this.keys_to_work.shuffle();j.exec(this.options.onShuffle,[this.keys_to_work,this.keys,this.element])},shuffleKeys:function(e){void 0===e&&(e=this.options.shuffleCount);for(var t=0;t<e;t++)this.keys_to_work=this.keys_to_work.shuffle();this._createKeys()},val:function(e){if(void 0===e)return this.value;this.value=e,"INPUT"===this.element[0].tagName?this.element.val(e):this.element.text(e)},open:function(){this.element.parent().find(".keys").addClass("open")},close:function(){this.element.parent().find(".keys").removeClass("open")},disable:function(){this.element.data("disabled",!0),this.element.parent().addClass("disabled")},enable:function(){this.element.data("disabled",!1),this.element.parent().removeClass("disabled")},toggleState:function(){!1===this.element.data("disabled")?this.disable():this.enable()},setPosition:function(e){var t=void 0!==e?e:this.element.attr("data-position");-1!==this.positions.indexOf(t)&&(this.options.position=t,this._setKeysPosition())},changeAttribute:function(e){switch(e){case"disabled":this.toggleState();break;case"data-position":this.setPosition()}},destroy:function(){var e=this.element,t=this.keypad;t.off(c.events.click,".keys"),t.off(c.events.click),t.off(c.events.click,".key"),e.off(c.events.change),e.insertBefore(t),t.remove()}};c.plugin("keypad",fe),t(document).on(c.events.click,function(){var e=t(".keypad .keys");t.each(e,function(){t(this).hasClass("keep-open")||t(this).removeClass("open")})});var me={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.currentPage=1,this.pagesCount=1,this.filterString="",this.data=null,this.activity=null,this.busy=!1,this.filters=[],this.wrapperInfo=null,this.wrapperSearch=null,this.wrapperRows=null,this.wrapperPagination=null,this.filterIndex=null,this.filtersIndexes=[],this.sort={dir:"asc",colIndex:0},this.header=null,this.items=[],this._setOptionsFromDOM(),this._create(),this},options:{thousandSeparator:",",decimalSeparator:",",sortTarget:"li",sortClass:null,sortDir:"asc",sortInitial:!1,filterClass:null,filter:null,filterString:"",filters:null,source:null,showItemsSteps:!1,showSearch:!1,showListInfo:!1,showPagination:!1,showAllPages:!1,showActivity:!0,muteList:!0,items:-1,itemsSteps:"all, 10,25,50,100",itemsAllTitle:"Show all",listItemsCountTitle:"Show entries:",listSearchTitle:"Search:",listInfoTitle:"Showing $1 to $2 of $3 entries",paginationPrevTitle:"Prev",paginationNextTitle:"Next",activityType:"cycle",activityStyle:"color",activityTimeout:100,searchWrapper:null,rowsWrapper:null,infoWrapper:null,paginationWrapper:null,clsComponent:"",clsList:"",clsListItem:"",clsListTop:"",clsItemsCount:"",clsSearch:"",clsListBottom:"",clsListInfo:"",clsListPagination:"",clsPagination:"",onDraw:c.noop,onDrawItem:c.noop,onSortStart:c.noop,onSortStop:c.noop,onSortItemSwitch:c.noop,onSearch:c.noop,onRowsCountChange:c.noop,onDataLoad:c.noop,onDataLoaded:c.noop,onFilterItemAccepted:c.noop,onFilterItemDeclined:c.noop,onListCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this,n=this.element,s=this.options;null!==s.source?(j.exec(s.onDataLoad,[s.source],n[0]),t.get(s.source,function(t){e._build(t),j.exec(s.onDataLoaded,[s.source,t],n[0])}).fail(function(e,t,n){console.log(t),console.log(e),console.log(n)})):e._build()},_build:function(e){var t=this.element,n=this.options;j.isValue(e)?this._createItemsFromJSON(e):this._createItemsFromHTML(),this._createStructure(),this._createEvents(),j.exec(n.onListCreate,[t],t[0])},_createItemsFromHTML:function(){var e=this,n=this.element,s=this.options;this.items=[],t.each(n.children(s.sortTarget),function(){e.items.push(this)})},_createItemsFromJSON:function(e){var n=this;this.items=[],j.isValue(e.header)&&(n.header=e.header),j.isValue(e.data)&&t.each(e.data,function(){var e=document.createElement("li"),s=j.isValue(n.header.template)?n.header.template:"";t.each(this,function(e,t){s=s.replace("$"+e,t)}),e.innerHTML=s,n.items.push(e)})},_createTopBlock:function(){var e,n,s,i=this,a=this.element,o=this.options,r=t("<div>").addClass("list-top").addClass(o.clsListTop).insertBefore(a);return e=j.isValue(this.wrapperSearch)?this.wrapperSearch:t("<div>").addClass("list-search-block").addClass(o.clsSearch).appendTo(r),t("<input>").attr("type","text").appendTo(e).input({prepend:o.listSearchTitle}),!0!==o.showSearch&&e.hide(),n=j.isValue(this.wrapperRows)?this.wrapperRows:t("<div>").addClass("list-rows-block").addClass(o.clsItemsCount).appendTo(r),s=t("<select>").appendTo(n),t.each(j.strToArray(o.itemsSteps),function(){var e=t("<option>").attr("value","all"===this?-1:this).text("all"===this?o.itemsAllTitle:this).appendTo(s);parseInt(this)===parseInt(o.items)&&e.attr("selected","selected")}),s.select({filter:!1,prepend:o.listItemsCountTitle,onChange:function(e){parseInt(e)!==parseInt(o.items)&&(o.items=parseInt(e),i.currentPage=1,i._draw(),j.exec(o.onRowsCountChange,[e],a[0]))}}),!0!==o.showItemsSteps&&n.hide(),r},_createBottomBlock:function(){var e,n,s=this.element,i=this.options,a=t("<div>").addClass("list-bottom").addClass(i.clsListBottom).insertAfter(s);return e=t("<div>").addClass("list-info").addClass(i.clsListInfo).appendTo(a),!0!==i.showListInfo&&e.hide(),n=t("<div>").addClass("list-pagination").addClass(i.clsListPagination).appendTo(a),!0!==i.showPagination&&n.hide(),a},_createStructure:function(){var e,n,s=this,i=this.element,a=this.options,o=t(a.searchWrapper),r=t(a.infoWrapper),l=t(a.rowsWrapper),c=t(a.paginationWrapper);o.length>0&&(this.wrapperSearch=o),r.length>0&&(this.wrapperInfo=r),l.length>0&&(this.wrapperRows=l),c.length>0&&(this.wrapperPagination=c),i.parent().hasClass("list-component")?e=i.parent():(e=t("<div>").addClass("list-component").insertBefore(i),i.appendTo(e)),e.addClass(a.clsComponent),this.activity=t("<div>").addClass("list-progress").appendTo(e),t("<div>").activity({type:a.activityType,style:a.activityStyle}).appendTo(this.activity),!0!==a.showActivity&&this.activity.css({visibility:"hidden"}),i.addClass(a.clsList),this._createTopBlock(),this._createBottomBlock(),j.isValue(a.filterString)&&(this.filterString=a.filterString),j.isValue(a.filter)&&(!1===(n=j.isFunc(a.filter))&&(n=j.func(a.filter)),s.filterIndex=s.addFilter(n)),j.isValue(a.filters)&&t.each(j.strToArray(a.filters),function(){!1!==(n=j.isFunc(this))&&s.filtersIndexes.push(s.addFilter(n))}),this.currentPage=1,this.sorting(a.sortClass,a.sortDir,!0)},_createEvents:function(){var e,n=this,s=this.element.parent();function i(e){var s=t(e),i=s.parent();i.hasClass("active")||(i.hasClass("service")?"prev"===s.data("page")?(n.currentPage--,0===n.currentPage&&(n.currentPage=1)):(n.currentPage++,n.currentPage>n.pagesCount&&(n.currentPage=n.pagesCount)):n.currentPage=s.data("page"),n._draw())}s.find(".list-search-block input").on(c.events.inputchange,function(){n.filterString=this.value.trim().toLowerCase(),":"!==n.filterString[n.filterString.length-1]&&(n.currentPage=1,n._draw())}),j.isValue(this.wrapperSearch)&&(e=this.wrapperSearch.find("input")).length>0&&e.on(c.events.inputchange,function(){n.filterString=this.value.trim().toLowerCase(),":"!==n.filterString[n.filterString.length-1]&&(n.currentPage=1,n._draw())}),s.on(c.events.click,".pagination .page-link",function(){i(this)}),j.isValue(this.wrapperPagination)&&this.wrapperPagination.on(c.events.click,".pagination .page-link",function(){i(this)})},_info:function(e,t,n){var s,i=this.element,a=this.options,o=i.parent(),r=j.isValue(this.wrapperInfo)?this.wrapperInfo:o.find(".list-info");0!==r.length&&(t>n&&(t=n),0===this.items.length&&(e=t=n=0),s=(s=(s=(s=a.listInfoTitle).replace("$1",e)).replace("$2",t)).replace("$3",n),r.html(s))},_paging:function(e){var n,s,i,a,o=this,r=this.element,l=this.options,c=r.parent(),d=j.isValue(this.wrapperPagination)?this.wrapperPagination:c.find(".list-pagination");if(d.html(""),a=t("<ul>").addClass("pagination").addClass(l.clsPagination).appendTo(d),0!==this.items.length){this.pagesCount=Math.ceil(e/l.items);var h=function(e,n,s){var i,a;return i=t("<li>").addClass("page-item").addClass(n),(a=t("<a>").addClass("page-link").html(e)).data("page",s),a.appendTo(i),i};if(s=h(l.paginationPrevTitle,"service prev-page","prev"),a.append(s),a.append(h(1,1===o.currentPage?"active":"",1)),!0===l.showAllPages||this.pagesCount<=7)for(n=2;n<this.pagesCount;n++)a.append(h(n,n===o.currentPage?"active":"",n));else if(o.currentPage<5){for(n=2;n<=5;n++)a.append(h(n,n===o.currentPage?"active":"",n));this.pagesCount>5&&a.append(h("...","no-link",null))}else if(o.currentPage<=o.pagesCount&&o.currentPage>o.pagesCount-5+1)for(this.pagesCount>5&&a.append(h("...","no-link",null)),n=o.pagesCount-5+1;n<o.pagesCount;n++)a.append(h(n,n===o.currentPage?"active":"",n));else a.append(h("...","no-link",null)),a.append(h(o.currentPage-1,"",o.currentPage-1)),a.append(h(o.currentPage,"active",o.currentPage)),a.append(h(o.currentPage+1,"",o.currentPage+1)),a.append(h("...","no-link",null));(o.pagesCount>1||o.currentPage<o.pagesCount)&&a.append(h(o.pagesCount,o.currentPage===o.pagesCount?"active":"",o.pagesCount)),i=h(l.paginationNextTitle,"service next-page","next"),a.append(i),1===this.currentPage&&s.addClass("disabled"),this.currentPage===this.pagesCount&&i.addClass("disabled")}},_filter:function(){var e,t,n,s,i,a,o=this,r=this.element,l=this.options;return j.isValue(this.filterString)||this.filters.length>0?(e=this.items.filter(function(e){if(n="",j.isValue(l.filterClass)){if((s=e.getElementsByClassName(l.filterClass)).length>0)for(t=0;t<s.length;t++)n+=s[t].textContent}else n=e.textContent;if(i=n.replace(/[\n\r]+|[\s]{2,}/g," ").trim().toLowerCase(),!0===(a=!j.isValue(o.filterString)||i.indexOf(o.filterString)>-1)&&o.filters.length>0)for(t=0;t<o.filters.length;t++)if(!0!==j.exec(o.filters[t],[e])){a=!1;break}return a?j.exec(l.onFilterItemAccepted,[e],r[0]):j.exec(l.onFilterItemDeclined,[e],r[0]),a}),j.exec(l.onSearch,[o.filterString,e],r[0])):e=this.items,e},_draw:function(e){var n,s,i=this.element,a=this.options,o=-1===a.items?0:a.items*(this.currentPage-1),r=-1===a.items?this.items.length-1:o+a.items-1;for(s=this._filter(),i.children(a.sortTarget).remove(),n=o;n<=r;n++)j.isValue(s[n])&&t(s[n]).addClass(a.clsListItem).appendTo(i),j.exec(a.onDrawItem,[s[n]],i[0]);this._info(o+1,r+1,s.length),this._paging(s.length),this.activity.hide(),j.exec(a.onDraw,[i],i[0]),void 0!==e&&j.exec(e,[i],i[0])},_getItemContent:function(e){var n,s,i,a,o=this.options;if(j.isValue(o.sortClass)){if(i="",(s=t(e).find("."+o.sortClass)).length>0)for(n=0;n<s.length;n++)i+=s[n].textContent;a=s.length>0?s[0].getAttribute("data-format"):""}else i=e.textContent,a=e.getAttribute("data-format");if(i=(""+i).toLowerCase().replace(/[\n\r]+|[\s]{2,}/g," ").trim(),j.isValue(a))switch(-1===["number","int","float","money"].indexOf(a)||","===o.thousandSeparator&&"."===o.decimalSeparator||(i=j.parseNumber(i,o.thousandSeparator,o.decimalSeparator)),a){case"date":i=j.isDate(i)?new Date(i):"";break;case"number":i=Number(i);break;case"int":i=parseInt(i);break;case"float":i=parseFloat(i);break;case"money":i=j.parseMoney(i)}return i},draw:function(){return this._draw()},sorting:function(e,t,n){var s=this,i=this.element,a=this.options;return j.isValue(e)&&(a.sortClass=e),j.isValue(t)&&["asc","desc"].indexOf(t)>-1&&(a.sortDir=t),j.exec(a.onSortStart,[this.items],i[0]),this.items.sort(function(e,t){var n=s._getItemContent(e),o=s._getItemContent(t),r=0;return n<o&&(r="asc"===a.sortDir?-1:1),n>o&&(r="asc"===a.sortDir?1:-1),0!==r&&j.exec(a.onSortItemSwitch,[e,t,r],i[0]),r}),j.exec(a.onSortStop,[this.items],i[0]),!0===n&&this._draw(),this},filter:function(e){this.filterString=e.trim().toLowerCase(),this.currentPage=1,this._draw()},loadData:function(e){var n=this,s=this.element,i=this.options;!0===j.isValue(e)&&(i.source=e,j.exec(i.onDataLoad,[i.source],s[0]),t.get(i.source,function(e){var a;j.exec(i.onDataLoaded,[i.source,e],s[0]),n._createItemsFromJSON(e),s.html(""),j.isValue(i.filterString)&&(n.filterString=i.filterString),j.isValue(i.filter)&&(!1===(a=j.isFunc(i.filter))&&(a=j.func(i.filter)),n.filterIndex=n.addFilter(a)),j.isValue(i.filters)&&t.each(j.strToArray(i.filters),function(){!1!==(a=j.isFunc(this))&&n.filtersIndexes.push(n.addFilter(a))}),n.currentPage=1,n.sorting(i.sortClass,i.sortDir,!0)}).fail(function(e,t,n){console.log(t),console.log(e),console.log(n)}))},next:function(){0!==this.items.length&&(this.currentPage++,this.currentPage>this.pagesCount?this.currentPage=this.pagesCount:this._draw())},prev:function(){0!==this.items.length&&(this.currentPage--,0!==this.currentPage?this._draw():this.currentPage=1)},first:function(){0!==this.items.length&&(this.currentPage=1,this._draw())},last:function(){0!==this.items.length&&(this.currentPage=this.pagesCount,this._draw())},page:function(e){e<=0&&(e=1),e>this.pagesCount&&(e=this.pagesCount),this.currentPage=e,this._draw()},addFilter:function(e,t){var n=j.isFunc(e);if(!1!==n)return this.filters.push(n),!0===t&&(this.currentPage=1,this.draw()),this.filters.length-1},removeFilter:function(e,t){return j.arrayDeleteByKey(this.filters,e),!0===t&&(this.currentPage=1,this.draw()),this},removeFilters:function(e){this.filters=[],!0===e&&(this.currentPage=1,this.draw())},getFilters:function(){return this.filters},getFilterIndex:function(){return this.filterIndex},getFiltersIndexes:function(){return this.filtersIndexes},changeAttribute:function(e){var t,n,s,i=this,a=this.element,o=this.options;switch(e){case"data-sort-dir":s=a.attr("data-sort-dir"),j.isValue(s)&&(o.sortDir=s,i.sorting(o.sortClass,o.sortDir,!0));break;case"data-sort-source":n=a.attr("data-sort-source"),j.isValue(n)&&(o.sortClass=n,i.sorting(o.sortClass,o.sortDir,!0));break;case"data-filter-string":t=a.attr("data-filter-string"),j.isValue(target)&&(o.filterString=t,i.filter(o.filterString))}},destroy:function(){}};c.plugin("list",me);var ve={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),this},options:{selectable:!1,effect:"slide",duration:100,view:c.listView.LIST,selectCurrent:!0,structure:{},onNodeInsert:c.noop,onNodeDelete:c.noop,onNodeClean:c.noop,onCollapseNode:c.noop,onExpandNode:c.noop,onGroupNodeClick:c.noop,onNodeClick:c.noop,onListviewCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this._createView(),this._createEvents(),j.exec(t.onListviewCreate,[e])},_createIcon:function(e){var n,s;return s=j.isTag(e)?t(e):t("<img>").attr("src",e),(n=t("<span>").addClass("icon")).html(s),n},_createCaption:function(e){return t("<div>").addClass("caption").html(e)},_createContent:function(e){return t("<div>").addClass("content").html(e)},_createToggle:function(){return t("<span>").addClass("node-toggle")},_createNode:function(e){this.element;var n,s=this.options;if(n=t("<li>"),void 0!==e.caption||void 0!==e.content){var i=t("<div>").addClass("data");n.prepend(i),void 0!==e.caption&&i.append(this._createCaption(e.caption)),void 0!==e.content&&i.append(this._createContent(e.content))}return void 0!==e.icon&&n.prepend(this._createIcon(e.icon)),j.objectLength(s.structure>0)&&t.each(s.structure,function(s,i){void 0!==e[s]&&t("<div>").addClass("node-data item-data-"+s).addClass(e[i]).html(e[s]).appendTo(n)}),n},_createView:function(){var e=this,n=this.element,s=this.options,i=n.find("li"),a=j.objectLength(s.structure);n.addClass("listview"),n.find("ul").addClass("listview"),t.each(i,function(){var n=t(this);if(void 0!==n.data("caption")||void 0!==n.data("content")){var i=t("<div>").addClass("data");n.prepend(i),void 0!==n.data("caption")&&i.append(e._createCaption(n.data("caption"))),void 0!==n.data("content")&&i.append(e._createContent(n.data("content")))}if(void 0!==n.data("icon")&&n.prepend(e._createIcon(n.data("icon"))),n.children("ul").length>0?(n.addClass("node-group"),n.append(e._createToggle()),!0!==n.data("collapsed")&&n.addClass("expanded")):n.addClass("node"),n.hasClass("node")){var o=t("<input data-role='checkbox'>");o.data("node",n),n.prepend(o)}a>0&&t.each(s.structure,function(e,s){void 0!==n.data(e)&&t("<div>").addClass("node-data item-data-"+e).addClass(n.data(e)).html(n.data(e)).appendTo(n)})}),this.toggleSelectable(),this.view(s.view)},_createEvents:function(){var e=this,n=this.element,s=this.options;n.on(c.events.click,".node",function(){var e=t(this);n.find(".node").removeClass("current"),e.toggleClass("current"),!0===s.selectCurrent&&(n.find(".node").removeClass("current-select"),e.toggleClass("current-select")),j.exec(s.onNodeClick,[e,n])}),n.on(c.events.click,".node-toggle",function(){var n=t(this).closest("li");e.toggleNode(n)}),n.on(c.events.click,".node-group > .data > .caption",function(){var e=t(this).closest("li");n.find(".node-group").removeClass("current-group"),e.addClass("current-group"),j.exec(s.onGroupNodeClick,[e,n])}),n.on(c.events.dblclick,".node-group > .data > .caption",function(){var n=t(this).closest("li");e.toggleNode(n)})},view:function(e){var n=this.element,s=this.options;if(void 0===e)return s.view;s.view=e,t.each(c.listView,function(e,t){n.removeClass("view-"+t),n.find("ul").removeClass("view-"+t)}),n.addClass("view-"+s.view),n.find("ul").addClass("view-"+s.view)},toggleNode:function(e){var t,n=this.element,s=this.options;e.hasClass("node-group")&&(e.toggleClass("expanded"),"slide"===s.effect?(t=!0!==e.hasClass("expanded")?"slideUp":"slideDown",j.exec(s.onCollapseNode,[e,n])):(t=!0!==e.hasClass("expanded")?"fadeOut":"fadeIn",j.exec(s.onExpandNode,[e,n])),e.children("ul")[t](s.duration))},toggleSelectable:function(){var e=this.element,t=!0===this.options.selectable?"addClass":"removeClass";e[t]("selectable"),e.find("ul")[t]("selectable")},add:function(e,n){var s,i,a=this.element,o=this.options;if(null===e)s=a;else{if(!e.hasClass("node-group"))return;0===(s=e.children("ul")).length&&(s=t("<ul>").addClass("listview").addClass("view-"+o.view).appendTo(e),this._createToggle().appendTo(e),e.addClass("expanded"))}(i=this._createNode(n)).addClass("node").appendTo(s);var r=t("<input>");return r.data("node",i),i.prepend(r),r.checkbox(),j.exec(o.onNodeInsert,[i,a]),i},addGroup:function(e){var n,s=this.element,i=this.options;return delete e.icon,(n=this._createNode(e)).addClass("node-group").appendTo(s),n.append(this._createToggle()),n.addClass("expanded"),n.append(t("<ul>").addClass("listview").addClass("view-"+i.view)),j.exec(i.onNodeInsert,[n,s]),n},insertBefore:function(e,t){var n=this.element,s=this.options,i=this._createNode(t);return i.insertBefore(e),j.exec(s.onNodeInsert,[i,n]),i},insertAfter:function(e,t){var n=this.element,s=this.options,i=this._createNode(t);return i.insertAfter(e),j.exec(s.onNodeInsert,[i,n]),i},del:function(e){var t=this.element,n=this.options,s=e.closest("ul"),i=s.closest("li");e.remove(),0!==s.children().length||s.is(t)||(s.remove(),i.removeClass("expanded"),i.children(".node-toggle").remove()),j.exec(n.onNodeDelete,[e,t])},clean:function(e){var t=this.element,n=this.options;e.children("ul").remove(),e.removeClass("expanded"),e.children(".node-toggle").remove(),j.exec(n.onNodeClean,[e,t])},changeView:function(){var e=this.element,t=(this.options,"view-"+e.attr("data-view"));this.view(t)},changeSelectable:function(){var e=this.element;this.options.selectable=!0===JSON.parse(e.attr("data-selectable")),this.toggleSelectable()},changeAttribute:function(e){switch(e){case"data-view":this.changeView();break;case"data-selectable":this.changeSelectable()}}};c.plugin("listview",ve);var ge={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.pages=[],this.currentIndex=0,this.isAnimate=!1,this._setOptionsFromDOM(),this._create(),this},options:{effect:"slide",effectFunc:"linear",duration:METRO_ANIMATION_DURATION,controlPrev:"<span class='default-icon-left-arrow'></span>",controlNext:"<span class='default-icon-right-arrow'></span>",controlTitle:"Master, page $1 of $2",backgroundImage:"",clsMaster:"",clsControls:"",clsControlPrev:"",clsControlNext:"",clsControlTitle:"",clsPages:"",clsPage:"",onBeforePage:c.noop_true,onBeforeNext:c.noop_true,onBeforePrev:c.noop_true,onMasterCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;e.addClass("master").addClass(t.clsMaster),e.css({backgroundImage:"url("+t.backgroundImage+")"}),this._createControls(),this._createPages(),this._createEvents(),j.exec(this.options.onMasterCreate,[this.element])},_createControls:function(){var e,n,s=this.element,i=this.options,a=s.find(".page");n=String(i.controlTitle).replace("$1","1"),n=String(n).replace("$2",a.length),t.each(["top","bottom"],function(){e=t("<div>").addClass("controls controls-"+this).addClass(i.clsControls).appendTo(s),t("<span>").addClass("prev").addClass(i.clsControlPrev).html(i.controlPrev).appendTo(e),t("<span>").addClass("next").addClass(i.clsControlNext).html(i.controlNext).appendTo(e),t("<span>").addClass("title").addClass(i.clsControlTitle).html(n).appendTo(e)}),this._enableControl("prev",!1)},_enableControl:function(e,t){var n=this.element.find(".controls ."+e);!0===t?n.removeClass("disabled"):n.addClass("disabled")},_setTitle:function(){var e=this.element.find(".controls .title"),t=this.options.controlTitle.replace("$1",this.currentIndex+1);t=t.replace("$2",String(this.pages.length)),e.html(t)},_createPages:function(){var e=this,n=this.element,s=this.options,i=n.find(".pages"),a=n.find(".page");0===i.length&&(i=t("<div>").addClass("pages").appendTo(n)),i.addClass(s.clsPages),t.each(a,function(){var i=t(this);void 0!==i.data("cover")?n.css({backgroundImage:"url("+i.data("cover")+")"}):n.css({backgroundImage:"url("+s.backgroundImage+")"}),i.css({left:"100%"}),i.addClass(s.clsPage).hide(0),e.pages.push(i)}),a.appendTo(i),this.currentIndex=0,void 0!==this.pages[this.currentIndex]&&(void 0!==this.pages[this.currentIndex].data("cover")&&n.css({backgroundImage:"url("+this.pages[this.currentIndex].data("cover")+")"}),this.pages[this.currentIndex].css("left","0").show(0),setTimeout(function(){i.css({height:e.pages[0].outerHeight(!0)+2})},0))},_createEvents:function(){var e=this,n=this.element,s=this.options;n.on(c.events.click,".controls .prev",function(){!0!==e.isAnimate&&!0===j.exec(s.onBeforePrev,[e.currentIndex,e.pages[e.currentIndex],n])&&!0===j.exec(s.onBeforePage,["prev",e.currentIndex,e.pages[e.currentIndex],n])&&e.prev()}),n.on(c.events.click,".controls .next",function(){!0!==e.isAnimate&&!0===j.exec(s.onBeforeNext,[e.currentIndex,e.pages[e.currentIndex],n])&&!0===j.exec(s.onBeforePage,["next",e.currentIndex,e.pages[e.currentIndex],n])&&e.next()}),t(window).on(c.events.resize+"-master"+n.attr("id"),function(){n.find(".pages").height(e.pages[e.currentIndex].outerHeight(!0)+2)})},_slideToPage:function(e){var t,n,s;void 0!==this.pages[e]&&this.currentIndex!==e&&(s=e>this.currentIndex?"next":"prev",t=this.pages[this.currentIndex],n=this.pages[e],this.currentIndex=e,this._effect(t,n,s))},_slideTo:function(e){var t,n;if(void 0!==e){if(t=this.pages[this.currentIndex],"next"===e){if(this.currentIndex+1>=this.pages.length)return;this.currentIndex++}else{if(this.currentIndex-1<0)return;this.currentIndex--}n=this.pages[this.currentIndex],this._effect(t,n,e)}},_effect:function(e,t,n){var s=this,i=this.element,a=this.options,o=i.width(),r=i.find(".pages");function l(){void 0!==t.data("cover")?i.css({backgroundImage:"url("+t.data("cover")+")"}):i.css({backgroundImage:"url("+a.backgroundImage+")"}),r.css("overflow","initial"),s.isAnimate=!1}switch(this._setTitle(),this.currentIndex===this.pages.length-1?this._enableControl("next",!1):this._enableControl("next",!0),0===this.currentIndex?this._enableControl("prev",!1):this._enableControl("prev",!0),this.isAnimate=!0,setTimeout(function(){r.animate({height:t.outerHeight(!0)+2})},0),r.css("overflow","hidden"),a.effect){case"fade":e.fadeOut(a.duration),t.hide(0).css("left",0).fadeIn(a.duration,function(){l()});break;case"switch":e.hide(0),t.hide(0).css("left",0).show(0,function(){l()});break;default:e.stop(!0,!0).animate({left:"next"===n?-o:o},a.duration,a.effectFunc,function(){e.hide(0)}),t.stop(!0,!0).css({left:"next"===n?o:-o}).show(0).animate({left:0},a.duration,a.effectFunc,function(){l()})}},toPage:function(e){this._slideToPage(e)},next:function(){this._slideTo("next")},prev:function(){this._slideTo("prev")},changeEffect:function(){this.options.effect=this.element.attr("data-effect")},changeEffectFunc:function(){this.options.effectFunc=this.element.attr("data-effect-func")},changeEffectDuration:function(){this.options.duration=this.element.attr("data-duration")},changeAttribute:function(e){switch(e){case"data-effect":this.changeEffect();break;case"data-effect-func":this.changeEffectFunc();break;case"data-duration":this.changeEffectDuration()}}};c.plugin("master",ge);var Ce={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.pane=null,this.content=null,this.paneToggle=null,this._setOptionsFromDOM(),this._create(),this},options:{compact:"md",expanded:"lg",toggle:null,onNavigationViewCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this._createView(),this._createEvents(),j.exec(t.onNavigationViewCreate,[e])},_createView:function(){var e,n,s,i,a=this.element,o=this.options;if(a.addClass("navview").addClass(!1!==o.compact?"compact-"+o.compact:"").addClass(!1!==o.expanded?"expanded-"+o.expanded:""),e=a.children(".navview-pane"),n=a.children(".navview-content"),s=t(o.toggle),(i=e.find(".navview-menu")).length>0){var r=0;t.each(i.prevAll(),function(){r+=t(this).outerHeight(!0)}),t.each(i.nextAll(),function(){r+=t(this).outerHeight(!0)}),i.css({height:"calc(100% - "+(r+20)+"px)"})}this.pane=e.length>0?e:null,this.content=n.length>0?n:null,this.paneToggle=s.length>0?s:null},_createEvents:function(){var e=this,n=this.element,s=this.options,i=this.pane;this.content;n.on(c.events.click,".pull-button, .holder",function(s){var a,o=i.width()<280,r=t(this);if(r.hasClass("holder")&&(a=r.parent().find("input"),setTimeout(function(){a.focus()},200)),e.pane.hasClass("open"))e.close();else if(!o&&!n.hasClass("expand")||n.hasClass("compacted")){if(!n.hasClass("compacted")&&o)return!0;n.toggleClass("compacted")}else n.toggleClass("expand")}),null!==this.paneToggle&&this.paneToggle.on(c.events.click,function(){e.pane.toggleClass("open")}),t(window).on(c.events.resize,function(){n.removeClass("expand"),e.pane.removeClass("open"),t(this).width()<=c.media_sizes[String(s.compact).toUpperCase()]&&n.removeClass("compacted")})},open:function(){this.pane.addClass("open")},close:function(){this.pane.removeClass("open")},changeAttribute:function(e){}};c.plugin("navview",Ce);var be={options:{container:null,width:220,timeout:METRO_TIMEOUT,duration:METRO_ANIMATION_DURATION,distance:"100vh",animation:"swing"},notifies:[],setup:function(e){var n,s=t("body");return this.options=t.extend({},this.options,e),null===this.options.container&&(n=t("<div>").addClass("notify-container"),s.prepend(n),this.options.container=n),this},reset:function(){var e={width:220,timeout:METRO_TIMEOUT,duration:METRO_ANIMATION_DURATION,distance:"100vh",animation:"swing"};this.options=t.extend({},this.options,e)},create:function(e,n,s){var i,a,o=this,r=this.options;if(void 0===e||""===e.trim())return!1;(i=t("<div>").addClass("notify")).css({width:r.width}),n&&(a=t("<div>").addClass("notify-title").html(n),i.prepend(a)),t("<div>").addClass("notify-message").html(e).appendTo(i),void 0!==s&&(void 0!==s.cls&&i.addClass(s.cls),void 0!==s.width&&i.css({width:s.width})),i.on(c.events.click,function(){o.kill(t(this))}),i.hide(function(){i.appendTo(r.container),i.css({marginTop:r.distance}).fadeIn(100,function(){i.animate({marginTop:".25rem"},r.duration,r.animation,function(){void 0!==s&&!0===s.keepOpen||setTimeout(function(){o.kill(i,void 0!==s&&void 0!==s.onClose?s.onClose:void 0)},r.timeout),void 0!==s&&void 0!==s.onShow&&j.callback(s.onShow)})})})},kill:function(e,t){e.fadeOut("slow",function(){e.remove(),j.callback(t)})},killAll:function(){var e=this,n=t(".notify");t.each(n,function(){e.kill(t(this))})}};c.notify=be.setup();var we={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),this},dependencies:["draggable","collapse"],options:{titleCaption:"",titleIcon:"",collapsible:!1,collapsed:!1,collapseDuration:METRO_ANIMATION_DURATION,width:"auto",height:"auto",draggable:!1,clsPanel:"",clsTitle:"",clsTitleCaption:"",clsTitleIcon:"",clsContent:"",clsCollapseToggle:"",onCollapse:c.noop,onExpand:c.noop,onDragStart:c.noop,onDragStop:c.noop,onDragMove:c.noop,onPanelCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,n=this.options,s=e.prev(),i=e.parent(),a=t("<div>").addClass("panel").addClass(n.clsPanel),o=j.uniqueId(),r=e[0].className;if(0===s.length?i.prepend(a):a.insertAfter(s),a.attr("id",o).addClass(r),e[0].className="",e.addClass("panel-content").addClass(n.clsContent).appendTo(a),""!==n.titleCaption||""!==n.titleIcon||!0===n.collapsible){var l=t("<div>").addClass("panel-title").addClass(n.clsTitle);if(""!==n.titleCaption&&t("<span>").addClass("caption").addClass(n.clsTitleCaption).html(n.titleCaption).appendTo(l),""!==n.titleIcon&&t(n.titleIcon).addClass("icon").addClass(n.clsTitleIcon).appendTo(l),!0===n.collapsible){var c=t("<span>").addClass("dropdown-toggle marker-center active-toggle").addClass(n.clsCollapseToggle).appendTo(l);e.collapse({toggleElement:c,duration:n.collapseDuration,onCollapse:n.onCollapse,onExpand:n.onExpand}),!0===n.collapsed&&this.collapse()}l.appendTo(a)}!0===n.draggable&&a.draggable({dragElement:l||a,onDragStart:n.onDragStart,onDragStop:n.onDragStop,onDragMove:n.onDragMove}),"auto"!==n.width&&parseInt(n.width)>=0&&a.outerWidth(parseInt(n.width)),"auto"!==n.height&&parseInt(n.height)>=0&&(a.outerHeight(parseInt(n.height)),e.css({overflow:"auto"})),this.panel=a,j.exec(n.onPanelCreate,[this.element])},collapse:function(){var e=this.element;this.options;!1!==j.isMetroObject(e,"collapse")&&e.data("collapse").collapse()},expand:function(){var e=this.element;this.options;!1!==j.isMetroObject(e,"collapse")&&e.data("collapse").expand()},changeAttribute:function(e){e}};c.plugin("panel",we);var ye={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.popover=null,this.popovered=!1,this.size={width:0,height:0},this._setOptionsFromDOM(),this._create(),this},options:{popoverText:"",popoverHide:3e3,popoverOffset:10,popoverTrigger:c.popoverEvents.HOVER,popoverPosition:c.position.TOP,hideOnLeave:!1,clsPopover:"",onPopoverShow:c.noop,onPopoverHide:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){this.element,this.options;this._createEvents()},_createEvents:function(){var e,n=this,s=this.element,i=this.options;switch(i.popoverTrigger){case c.popoverEvents.CLICK:e=c.events.click;break;case c.popoverEvents.FOCUS:e=c.events.focus;break;default:e=c.events.enter}s.on(e,function(){null===n.popover&&!0!==n.popovered&&(n.createPopover(),i.popoverHide>0&&setTimeout(function(){n.removePopover()},i.popoverHide))}),!0!==i.hideOnLeave||j.isTouchDevice()||s.on(c.events.leave,function(){n.removePopover()}),t(window).on(c.events.scroll,function(){null!==n.popover&&n.setPosition()})},setPosition:function(){var e=this.popover,n=this.size,s=this.options,i=this.element;s.popoverPosition===c.position.BOTTOM?(e.addClass("bottom"),e.css({top:i.offset().top-t(window).scrollTop()+i.outerHeight()+s.popoverOffset,left:i.offset().left+i.outerWidth()/2-n.width/2-t(window).scrollLeft()})):s.popoverPosition===c.position.RIGHT?(e.addClass("right"),e.css({top:i.offset().top+i.outerHeight()/2-n.height/2-t(window).scrollTop(),left:i.offset().left+i.outerWidth()-t(window).scrollLeft()+s.popoverOffset})):s.popoverPosition===c.position.LEFT?(e.addClass("left"),e.css({top:i.offset().top+i.outerHeight()/2-n.height/2-t(window).scrollTop(),left:i.offset().left-n.width-t(window).scrollLeft()-s.popoverOffset})):(e.addClass("top"),e.css({top:i.offset().top-t(window).scrollTop()-n.height-s.popoverOffset,left:i.offset().left+i.outerWidth()/2-n.width/2-t(window).scrollLeft()}))},createPopover:function(){var e,n=this,s=this.elem,i=this.element,a=this.options,o=t("<div>").addClass("popover neb").addClass(a.clsPopover).html(a.popoverText),r=j.elementId("popover");switch(o.attr("id",r),a.popoverPosition){case c.position.TOP:e="neb-s";break;case c.position.BOTTOM:e="neb-n";break;case c.position.RIGHT:e="neb-w";break;case c.position.LEFT:e="neb-e"}if(o.addClass(e),o.on(c.events.click,function(){n.removePopover()}),this.popover=o,this.size=j.hiddenElementSize(o),"TD"===s.tagName||"TH"===s.tagName){var l=t("<div/>").css("display","inline-block").html(i.html());i.html(l),i=l}this.setPosition(),o.appendTo(t("body")),this.popovered=!0,j.exec(a.onPopoverShow,[o,i])},removePopover:function(){var e=this,t=this.options.onPopoverHide===c.noop?0:300,n=this.popover;null!==n&&(j.exec(this.options.onPopoverHide,[n,this.element]),setTimeout(function(){n.hide(0,function(){n.remove(),e.popover=null,e.popovered=!1})},t))},show:function(){var e=this,t=this.options;!0!==this.popovered&&(this.createPopover(),t.popoverHide>0&&setTimeout(function(){e.removePopover()},t.popoverHide))},hide:function(){this.removePopover()},changeText:function(){this.options.popoverText=this.element.attr("data-popover-text")},changePosition:function(){this.options.popoverPosition=this.element.attr("data-popover-position")},changeAttribute:function(e){switch(e){case"data-popover-text":this.changeText()}}};c.plugin("popover",ye);var xe={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.value=0,this.buffer=0,this._setOptionsFromDOM(),this._create(),j.exec(this.options.onProgressCreate,[this.element]),this},options:{value:0,buffer:0,type:"bar",small:!1,clsBack:"",clsBar:"",clsBuffer:"",onValueChange:c.noop,onBufferChange:c.noop,onComplete:c.noop,onBuffered:c.noop,onProgressCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,n=this.options;switch(e.html("").addClass("progress"),n.type){case"buffer":t("<div>").addClass("bar").appendTo(e),t("<div>").addClass("buffer").appendTo(e);break;case"load":e.addClass("with-load"),t("<div>").addClass("bar").appendTo(e),t("<div>").addClass("buffer").appendTo(e),t("<div>").addClass("load").appendTo(e);break;case"line":e.addClass("line");break;default:t("<div>").addClass("bar").appendTo(e)}!0===n.small&&e.addClass("small"),e.addClass(n.clsBack),e.find(".bar").addClass(n.clsBar),e.find(".buffer").addClass(n.clsBuffer),this.val(n.value),this.buff(n.buffer)},val:function(e){var t=this.element,n=this.options;if(void 0===e)return this.value;var s=t.find(".bar");if(0===s.length)return!1;this.value=parseInt(e,10),s.css("width",this.value+"%"),t.trigger("valuechange",[this.value]),j.exec(n.onValueChange,[this.value,t]),100===this.value&&j.exec(n.onComplete,[this.value,t])},buff:function(e){var t=this.element,n=this.options;if(void 0===e)return this.buffer;var s=t.find(".buffer");if(0===s.length)return!1;this.buffer=parseInt(e,10),s.css("width",this.buffer+"%"),t.trigger("bufferchange",[this.buffer]),j.exec(n.onBufferChange,[this.buffer,t]),100===this.buffer&&j.exec(n.onBuffered,[this.buffer,t])},changeValue:function(){this.val(this.element.attr("data-value"))},changeBuffer:function(){this.buff(this.element.attr("data-buffer"))},changeAttribute:function(e){switch(e){case"data-value":this.changeValue();break;case"data-buffer":this.changeBuffer()}}};c.plugin("progress",xe);var Te={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.origin={className:""},this._setOptionsFromDOM(),this._create(),j.exec(this.options.onRadioCreate,[this.element]),this},options:{caption:"",captionPosition:"right",disabled:!1,clsElement:"",clsCheck:"",clsCaption:"",onRadioCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,n=this.options,s=e.prev(),i=e.parent(),a=t("<label>").addClass("radio "+e[0].className),o=t("<span>").addClass("check"),r=t("<span>").addClass("caption").html(n.caption);e.attr("type","radio"),0===s.length?i.prepend(a):a.insertAfter(s),e.appendTo(a),o.appendTo(a),r.appendTo(a),"left"===n.captionPosition&&a.addClass("caption-left"),this.origin.className=e[0].className,e[0].className="",a.addClass(n.clsElement),r.addClass(n.clsCaption),o.addClass(n.clsCheck),!0===n.disabled&&e.is(":disabled")?this.disable():this.enable()},disable:function(){this.element.data("disabled",!0),this.element.parent().addClass("disabled")},enable:function(){this.element.data("disabled",!1),this.element.parent().removeClass("disabled")},toggleState:function(){!1===this.element.data("disabled")?this.disable():this.enable()},changeAttribute:function(e){switch(e){case"disabled":this.toggleState()}},destroy:function(){var e=this.element,t=e.parent();e[0].className=this.origin.className,e.insertBefore(t),t.remove()}};c.plugin("radio",Te);var _e={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.value=0,this.values=[],this.rate=0,this.rating=null,this._setOptionsFromDOM(),this._create(),this},options:{static:!1,title:null,value:0,values:null,message:"",stars:5,starColor:null,staredColor:null,roundFunc:"round",clsRating:"",clsTitle:"",clsStars:"",clsResult:"",onStarClick:c.noop,onRatingCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,t=this.element,n=this.options;if(null!==n.values)Array.isArray(n.values)?this.values=n.values:"string"==typeof n.values&&(this.values=j.strToArray(n.values));else for(e=1;e<=n.stars;e++)this.values.push(e);this.value=n.value>0?Math[n.roundFunc](n.value):0,null!==n.starColor&&(j.isColor(n.starColor)||(n.starColor=h.color(n.starColor))),null!==n.staredColor&&(j.isColor(n.staredColor)||(n.staredColor=h.color(n.staredColor))),this._createRating(),this._createEvents(),j.exec(n.onRatingCreate,[t])},_createRating:function(){var e,n,s,i=this.element,a=this.options,o=i.prev(),r=i.parent(),l=j.elementId("rating"),d=t("<div>").addClass("rating "+String(i[0].className).replace("d-block","d-flex")).addClass(a.clsRating),h=c.sheet;for(i.val(this.value),d.attr("id",l),0===o.length?r.prepend(d):d.insertAfter(o),i.appendTo(d),n=t("<ul>").addClass("stars").addClass(a.clsStars).appendTo(d),e=1;e<=a.stars;e++)s=t("<li>").data("value",this.values[e-1]).appendTo(n),e<=this.value&&s.addClass("on");if(t("<span>").addClass("result").addClass(a.clsResult).appendTo(d).html(a.message),null!==a.starColor&&j.addCssRule(h,"#"+l+" .stars:hover li","color: "+a.starColor+";"),null!==a.staredColor&&j.addCssRule(h,"#"+l+" .stars li.on","color: "+a.staredColor+";"),null!==a.title){var u=t("<span>").addClass("title").addClass(a.clsTitle).html(a.title);d.prepend(u)}if(!0===a.static&&d.addClass("static"),i[0].className="",!0===a.copyInlineStyles)for(e=0;e<i[0].style.length;e++)d.css(i[0].style[e],i.css(i[0].style[e]));this.rating=d},_createEvents:function(){var e=this.element,n=this.options;this.rating.on(c.events.click,".stars li",function(){if(!0!==n.static){var s=t(this),i=s.data("value");s.addClass("scale"),setTimeout(function(){s.removeClass("scale")},300),e.val(i).trigger("change"),s.addClass("on"),s.prevAll().addClass("on"),s.nextAll().removeClass("on"),j.exec(n.onStarClick,[i,s,e])}})},val:function(e){var n=this,s=this.element,i=this.options,a=this.rating;if(void 0===e)return this.value;this.value=e>0?Math[i.roundFunc](e):0,s.val(this.value).trigger("change");var o=a.find(".stars li").removeClass("on");return t.each(o,function(){var e=t(this);e.data("value")<=n.value&&e.addClass("on")}),this},msg:function(e){var t=this.rating;if(void 0!==e)return t.find(".result").html(e),this},static:function(e){var t=this.options,n=this.rating;t.static=e,!0===e?n.addClass("static"):n.removeClass("static")},changeAttributeValue:function(e){var t=this.element,n="value"===e?t.val():t.attr("data-value");this.val(n)},changeAttributeMessage:function(){var e=this.element.attr("data-message");this.msg(e)},changeAttributeStatic:function(){var e=this.element,t=!0===JSON.parse(e.attr("data-static"));this.static(t)},changeAttribute:function(e){switch(e){case"value":case"data-value":this.changeAttributeValue(e);break;case"data-message":this.changeAttributeMessage();break;case"data-static":this.changeAttributeStatic()}}};c.plugin("rating",_e);var ke={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),j.exec(this.options.onResizableCreate,[this.element]),this},options:{resizeElement:".resize-element",onResizeStart:c.noop,onResizeStop:c.noop,onResize:c.noop,onResizableCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,n=this.options;""!==n.resizeElement&&0===t(n.resizeElement).length&&t("<span>").addClass("resize-element").appendTo(e),e.on(c.events.start,n.resizeElement,function(s){if(!1!==e.data("canResize")){var i=j.clientXY(s),a=parseInt(e.outerWidth()),o=parseInt(e.outerHeight()),r={width:a,height:o};j.exec(n.onResizeStart,[e,r]),t(document).on(c.events.move,function(t){var s=j.clientXY(t),r={width:a+s.x-i.x,height:o+s.y-i.y};e.css(r),j.exec(n.onResize,[e,r])})}}),e.on(c.events.stop,n.resizeElement,function(){t(document).off(c.events.move);var s={width:parseInt(e.outerWidth()),height:parseInt(e.outerHeight())};j.exec(n.onResizeStop,[e,s])})},off:function(){this.element.data("canResize",!1)},on:function(){this.element.data("canResize",!0)},changeAttribute:function(e){}};c.plugin("resizable",ke);var Se={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),this},dependencies:["buttongroup"],options:{onStatic:c.noop,onBeforeTab:c.noop_true,onTab:c.noop,onRibbonMenuCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this._createStructure(),this._createEvents(),j.exec(t.onRibbonMenuCreate,[e])},_createStructure:function(){var e=this.element;this.options;e.addClass("ribbon-menu");var n=e.find(".tabs-holder li:not(.static)"),s=e.find(".tabs-holder li.active");s.length>0?this.open(t(s[0])):n.length>0&&this.open(t(n[0]));var i=e.find(".ribbon-toggle-group");t.each(i,function(){var e=t(this);e.buttongroup({clsActive:"active"});var n=0,s=e.find(".ribbon-icon-button");t.each(s,function(){var e=t(this).outerWidth(!0);e>n&&(n=e)}),e.css("width",Math.ceil(n*s.length/3)+4)})},_createEvents:function(){var e=this,n=this.element,s=this.options;n.on(c.events.click,".tabs-holder li a",function(i){var a=t(this),o=t(this).parent("li");o.hasClass("static")?s.onStatic===c.noop&&void 0!==a.attr("href")?document.location.href=a.attr("href"):j.exec(s.onStatic,[o,n]):!0===j.exec(s.onBeforeTab,[o,n])&&e.open(o),i.preventDefault()})},open:function(e){var t=this.element,n=this.options,s=t.find(".tabs-holder li"),i=t.find(".content-holder .section"),a=e.children("a").attr("href"),o="#"!==a?t.find(a):null;s.removeClass("active"),e.addClass("active"),i.removeClass("active"),o&&o.addClass("active"),j.exec(n.onTab,[e,t])},changeAttribute:function(e){}};c.plugin("ribbonmenu",Se);var Oe={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),j.exec(this.options.onRippleCreate,[this.element]),this},options:{rippleColor:"#fff",rippleAlpha:.4,rippleTarget:"default",onRippleCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,n=this.options,s="default"===n.rippleTarget?null:n.rippleTarget;e.on(c.events.click,s,function(e){var s=t(this);"static"===s.css("position")&&s.css("position","relative"),s.css({overflow:"hidden"}),t(".ripple").remove();var i=Math.max(s.outerWidth(),s.outerHeight()),a=t("<span class='ripple'></span>").css({width:i,height:i});s.prepend(a);var o=e.pageX-s.offset().left-a.width()/2,r=e.pageY-s.offset().top-a.height()/2;a.css({background:j.hex2rgba(n.rippleColor,n.rippleAlpha),width:i,height:i,top:r+"px",left:o+"px"}).addClass("rippleEffect"),setTimeout(function(){null,t(".ripple").remove()},400)})},changeAttribute:function(e){}};c.plugin("ripple",Oe);var Ie={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),j.exec(this.options.onInputCreate,[this.element]),this},options:{clsElement:"",clsInput:"",clsPrepend:"",clsClearButton:"",clsSearchButton:"",size:"default",prepend:"",copyInlineStyles:!0,clearButton:!0,searchButton:!0,searchButtonClick:"submit",clearButtonIcon:"<span class='default-icon-cross'></span>",searchButtonIcon:"<span class='default-icon-search'></span>",customButtons:[],disabled:!1,onSearchButtonClick:c.noop,onInputCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,n,s=this.element,i=this.options,a=s.prev(),o=s.parent(),r=t("<div>").addClass("input "+s[0].className),l=t("<div>").addClass("button-group");(void 0===s.attr("type")&&s.attr("type","text"),0===a.length?o.prepend(r):r.insertAfter(a),s.appendTo(r),l.appendTo(r),!1!==i.clearButton&&((e=t("<button>").addClass("button input-clear-button").addClass(i.clsClearButton).attr("tabindex",-1).attr("type","button").html(i.clearButtonIcon)).on(c.events.click,function(){s.val("").trigger("change").trigger("keyup").focus()}),e.appendTo(l)),!1!==i.searchButton&&((n=t("<button>").addClass("button input-search-button").addClass(i.clsSearchButton).attr("tabindex",-1).attr("type","submit"===i.searchButtonClick?"submit":"button").html(i.searchButtonIcon)).on(c.events.click,function(){"submit"===i.searchButtonClick?j.exec(i.onSearchButtonClick,[s.val(),t(this)],s[0]):this.form.submit()}),n.appendTo(l)),""!==i.prepend)&&(j.isTag(i.prepend)?t(i.prepend):t("<span>"+i.prepend+"</span>")).addClass("prepend").addClass(i.clsPrepend).appendTo(r);if("string"==typeof i.customButtons&&(i.customButtons=j.isObject(i.customButtons)),"object"==typeof i.customButtons&&j.objectLength(i.customButtons)>0&&t.each(i.customButtons,function(){var e=this,n=t("<button>").addClass("button input-custom-button").addClass(e.cls).attr("tabindex",-1).attr("type","button").html(e.html);n.on(c.events.click,function(){j.exec(e.onclick,[s.val(),n],s[0])}),n.appendTo(l)}),"rtl"===s.attr("dir")&&r.addClass("rtl").attr("dir","rtl"),s[0].className="",!0===i.copyInlineStyles)for(var d=0,h=s[0].style.length;d<h;d++)r.css(s[0].style[d],s.css(s[0].style[d]));r.addClass(i.clsElement),s.addClass(i.clsInput),"default"!==i.size&&r.css({width:i.size}),s.on(c.events.blur,function(){r.removeClass("focused")}),s.on(c.events.focus,function(){r.addClass("focused")}),!0===i.disabled||s.is(":disabled")?this.disable():this.enable()},disable:function(){this.element.data("disabled",!0),this.element.parent().addClass("disabled")},enable:function(){this.element.data("disabled",!1),this.element.parent().removeClass("disabled")},toggleState:function(){!1===this.element.data("disabled")?this.disable():this.enable()},changeAttribute:function(e){switch(e){case"disabled":this.toggleState()}}};c.plugin("search",Ie);var Me={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.list=null,this._setOptionsFromDOM(),this._create(),j.exec(this.options.onSelectCreate,[this.element]),this},options:{duration:100,clsElement:"",clsSelect:"",clsPrepend:"",clsOption:"",clsOptionGroup:"",prepend:"",placeholder:"",filterPlaceholder:"",filter:!0,copyInlineStyles:!0,dropHeight:200,disabled:!1,onChange:c.noop,onSelectCreate:c.noop,onUp:c.noop,onDrop:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){this._createSelect(),this._createEvents()},_addOption:function(e,n){var s,i,a=t(e),o=this.element,r=this.options,l=o.siblings("input");s=t("<li>").addClass(r.clsOption).data("text",e.text).data("value",j.isValue(e.value)?e.value:"").appendTo(n),i=t("<a>").html(e.text).appendTo(s).addClass(e.className),a.is(":selected")&&(o.val(e.value),l.val(e.text).trigger("change"),o.trigger("change"),s.addClass("active")),i.appendTo(s),s.appendTo(n)},_addOptionGroup:function(e,n){var s=this,i=t(e);t("<li>").html(e.label).addClass("group-title").appendTo(n),t.each(i.children(),function(){s._addOption(this,n)})},_createSelect:function(){var e=this,n=this.element,s=this.options,i=n.prev(),a=n.parent(),o=t("<div>").addClass("select "+n[0].className).addClass(s.clsElement),r=n.prop("multiple"),l=j.elementId("select");if(o.attr("id",l).addClass("dropdown-toggle"),0===i.length?a.prepend(o):o.insertAfter(i),n.appendTo(o),n.addClass(s.clsSelect),!1===r){var d=t("<input>").attr("placeholder",s.placeholder).attr("type","text").attr("name","__"+l+"__").prop("readonly",!0),h=t("<div>").addClass("drop-container"),u=t("<ul>").addClass("d-menu").css({"max-height":s.dropHeight}),p=t("<input type='text' data-role='input'>").attr("placeholder",s.filterPlaceholder);o.append(d),o.append(h),h.append(p),!0!==s.filter&&p.hide(),h.append(u),t.each(n.children(),function(){"OPTION"===this.tagName?e._addOption(this,u):"OPTGROUP"===this.tagName&&e._addOptionGroup(this,u)}),h.dropdown({duration:s.duration,toggleElement:"#"+l,onDrop:function(){var e,i;e=t(".select .drop-container"),t.each(e,function(){var e=t(this);e.is(h)||e.data("dropdown").close()}),p.val("").trigger(c.events.keyup).focus(),void 0!==(i=u.find("li.active").length>0?t(u.find("li.active")[0]):void 0)&&(u.scrollTop(0),setTimeout(function(){u.animate({scrollTop:i.position().top-(u.height()-i.height())/2},100)},200)),j.exec(s.onDrop,[u,n],u[0])},onUp:function(){j.exec(s.onUp,[u,n],u[0])}}),this.list=u}""!==s.prepend&&(j.isTag(s.prepend)?t(s.prepend):t("<span>"+s.prepend+"</span>")).addClass("prepend").addClass(s.clsPrepend).appendTo(o);if(!0===s.copyInlineStyles)for(var f=0,m=n[0].style.length;f<m;f++)o.css(n[0].style[f],n.css(n[0].style[f]));"rtl"===n.attr("dir")&&o.addClass("rtl").attr("dir","rtl"),!0===s.disabled||n.is(":disabled")?this.disable():this.enable()},_createEvents:function(){var e=this.element,n=this.options,s=e.closest(".select"),i=s.find(".drop-container"),a=e.siblings("input"),o=i.find("input"),r=i.find("ul");s.on(c.events.click,function(e){e.preventDefault(),e.stopPropagation()}),a.on(c.events.blur,function(){s.removeClass("focused")}),a.on(c.events.focus,function(){s.addClass("focused")}),o.on(c.events.blur,function(){s.removeClass("focused")}),o.on(c.events.focus,function(){s.addClass("focused")}),r.on(c.events.click,"li",function(s){if(t(this).hasClass("group-title"))return s.preventDefault(),void s.stopPropagation();var o=t(this),l=o.data("value"),c=o.data("text");r.find("li.active").removeClass("active"),o.addClass("active"),a.val(c).trigger("change"),e.val(l),e.trigger("change"),i.data("dropdown").close(),j.exec(n.onChange,[l],e[0])}),o.on(c.events.keyup,function(){var e,n=this.value.toUpperCase(),s=r.find("li");for(e=0;e<s.length;e++)t(s[e]).hasClass("group-title")||(s[e].getElementsByTagName("a")[0].innerHTML.toUpperCase().indexOf(n)>-1?s[e].style.display="":s[e].style.display="none")}),i.on(c.events.click,function(e){e.preventDefault(),e.stopPropagation()})},disable:function(){this.element.data("disabled",!0),this.element.parent().addClass("disabled")},enable:function(){this.element.data("disabled",!1),this.element.parent().removeClass("disabled")},val:function(e){var n=this.element,s=this.options,i=n.siblings("input"),a=n.find("option"),o=this.list.find("li");if(void 0===e)return n.val();a.removeAttr("selected"),t.each(a,function(){""+this.value==""+e&&(this.setAttribute("selected","selected"),i.val(this.text),n.trigger("change"),o.removeClass("active"),t.each(o,function(){var n=t(this);n.hasClass("group-title")||""+n.data("value")==""+e&&n.addClass("active")}),j.exec(s.onChange,[e],n[0]))})},data:function(e){var n,s=this,i=this.element,a=i.parent().find("ul");i.html(""),a.html(""),"string"==typeof e?i.html(e):j.isObject(e)&&t.each(e,function(e,s){j.isObject(s)?(n=t("<optgroup>").attr("label",e).appendTo(i),t.each(s,function(e,s){t("<option>").attr("value",e).text(s).appendTo(n)})):t("<option>").attr("value",e).text(s).appendTo(i)}),t.each(i.children(),function(){"OPTION"===this.tagName?s._addOption(this,a):"OPTGROUP"===this.tagName&&s._addOptionGroup(this,a)})},changeAttribute:function(e){},destroy:function(){var e=this.element,t=e.closest(".select"),n=t.find(".drop-container"),s=e.siblings("input"),i=n.find("input"),a=n.find("ul");t.off(c.events.click),s.off(c.events.blur),s.off(c.events.focus),i.off(c.events.blur),i.off(c.events.focus),a.off(c.events.click,"li"),i.off(c.events.keyup),n.off(c.events.click),c.destroyPlugin(n,"dropdown"),e.insertBefore(t),t.remove()}};t(document).on(c.events.click,function(){var e=t(".select .drop-container");t.each(e,function(){t(this).data("dropdown").close()})}),c.plugin("select",Me);var De={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.toggle_element=null,this._setOptionsFromDOM(),this._create(),this},options:{shift:null,staticShift:null,toggle:null,duration:METRO_ANIMATION_DURATION,static:null,menuItemClick:!0,onOpen:c.noop,onClose:c.noop,onToggle:c.noop,onStaticSet:c.noop,onStaticLoss:c.noop,onSidebarCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,n=this.options;this._createStructure(),this._createEvents(),t(window).resize(),this._checkStatic(),j.exec(n.onSidebarCreate,[e],e[0])},_createStructure:function(){var e=this.element,n=this.options,s=e.find(".sidebar-header"),i=c.sheet;void 0===e.attr("id")&&e.attr("id",j.elementId("sidebar")),e.addClass("sidebar"),null!==n.toggle&&t(n.toggle).length>0&&(this.toggle_element=t(n.toggle)),s.length>0&&void 0!==s.data("image")&&s.css({backgroundImage:"url("+s.data("image")+")"}),null!==n.static&&null!==n.staticShift&&j.addCssRule(i,"@media screen and "+c.media_queries[n.static.toUpperCase()],n.staticShift+"{margin-left: 280px; width: calc(100% - 280px);}")},_createEvents:function(){var e=this,n=this.element,s=this.options,i=this.toggle_element;null!==i&&i.on(c.events.click,function(t){e.toggle()}),null!==s.static&&["fs","sm","md","lg","xl","xxl"].indexOf(s.static)&&t(window).on(c.events.resize+"_"+n.attr("id"),function(){e._checkStatic()}),!0===s.menuItemClick&&n.on(c.events.click,".sidebar-menu li > a",function(){e.close()})},_checkStatic:function(){var e=this.element,n=this.options;j.mediaExist(n.static)&&!e.hasClass("static")&&(e.addClass("static"),e.data("opened",!1).removeClass("open"),null!==n.shift&&t.each(n.shift.split(","),function(){t(this).css({left:0},n.duration)}),j.exec(n.onStaticSet,[e],e[0])),j.mediaExist(n.static)||(e.removeClass("static"),j.exec(n.onStaticLoss,[e],e[0]))},isOpen:function(){return!0===this.element.data("opened")},open:function(){var e=this.element,n=this.options;e.hasClass("static")||(e.data("opened",!0).addClass("open"),null!==n.shift&&t.each(n.shift.split(","),function(){t(this).animate({left:e.outerWidth()},n.duration)}),j.exec(n.onOpen,[e],e[0]))},close:function(){var e=this.element,n=this.options;e.hasClass("static")||(e.data("opened",!1).removeClass("open"),null!==n.shift&&t.each(n.shift.split(","),function(){t(this).animate({left:0},n.duration)}),j.exec(n.onClose,[e],e[0]))},toggle:function(){this.isOpen()?this.close():this.open(),j.exec(this.options.onToggle,[this.element],this.element[0])},changeAttribute:function(e){},destroy:function(){}};c.plugin("sidebar",De),c.sidebar={isSidebar:function(e){return j.isMetroObject(e,"sidebar")},open:function(e){this.isSidebar(e)&&t(e).data("sidebar").open()},close:function(e){this.isSidebar(e)&&t(e).data("sidebar").close()},toggle:function(e){this.isSidebar(e)&&t(e).data("sidebar").toggle()}};var Ae={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.slider=null,this.value=0,this.percent=0,this.pixel=0,this.buffer=0,this.keyInterval=!1,this._setOptionsFromDOM(),this._create(),this},options:{min:0,max:100,accuracy:0,showMinMax:!1,minMaxPosition:c.position.TOP,value:0,buffer:0,hint:!1,hintAlways:!1,hintPosition:c.position.TOP,hintMask:"$1",vertical:!1,target:null,returnType:"value",size:0,clsSlider:"",clsBackside:"",clsComplete:"",clsBuffer:"",clsMarker:"",clsHint:"",clsMinMax:"",clsMin:"",clsMax:"",onStart:c.noop,onStop:c.noop,onMove:c.noop,onClick:c.noop,onChangeValue:c.noop,onChangeBuffer:c.noop,onFocus:c.noop,onBlur:c.noop,onSliderCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this._createSlider(),this._createEvents(),this.buff(t.buffer),this.val(t.value),j.exec(t.onSliderCreate,[e])},_createSlider:function(){var e,n=this.element,s=this.options,i=n.prev(),a=n.parent(),o=t("<div>").addClass("slider "+n[0].className).addClass(s.clsSlider),r=t("<div>").addClass("backside").addClass(s.clsBackside),l=t("<div>").addClass("complete").addClass(s.clsComplete),d=t("<div>").addClass("buffer").addClass(s.clsBuffer),h=t("<button>").attr("type","button").addClass("marker").addClass(s.clsMarker),u=t("<div>").addClass("hint").addClass(s.hintPosition+"-side").addClass(s.clsHint),p=j.uniqueId();if(o.attr("id",p),s.size>0&&(!0===s.vertical?o.outerHeight(s.size):o.outerWidth(s.size)),!0===s.vertical&&o.addClass("vertical-slider"),0===i.length?a.prepend(o):o.insertAfter(i),!0===s.hintAlways&&u.css({display:"block"}).addClass("permanent-hint"),n.appendTo(o),r.appendTo(o),l.appendTo(o),d.appendTo(o),h.appendTo(o),u.appendTo(h),!0===s.showMinMax){var f=t("<div>").addClass("slider-min-max clear").addClass(s.clsMinMax);t("<span>").addClass("place-left").addClass(s.clsMin).html(s.min).appendTo(f),t("<span>").addClass("place-right").addClass(s.clsMax).html(s.max).appendTo(f),s.minMaxPosition===c.position.TOP?f.insertBefore(o):f.insertAfter(o)}if(n[0].className="",!0===s.copyInlineStyles)for(e=0;e<n[0].style.length;e++)o.css(n[0].style[e],n.css(n[0].style[e]));this.slider=o},_createEvents:function(){var e=this,n=this.slider,s=this.options,i=n.find(".marker"),a=n.find(".hint");i.on(c.events.start,function(){t(document).on(c.events.move,function(t){!0===s.hint&&!0!==s.hintAlways&&a.fadeIn(),e._move(t),j.exec(s.onMove,[e.value,e.percent,n])}),t(document).on(c.events.stop,function(){t(document).off(c.events.move),t(document).off(c.events.stop),!0!==s.hintAlways&&a.fadeOut(),j.exec(s.onStop,[e.value,e.percent,n])}),j.exec(s.onStart,[e.value,e.percent,n])}),i.on(c.events.focus,function(){j.exec(s.onFocus,[e.value,e.percent,n])}),i.on(c.events.blur,function(){j.exec(s.onBlur,[e.value,e.percent,n])}),i.on(c.events.keydown,function(t){var n=t.keyCode?t.keyCode:t.which;if(-1!==[37,38,39,40].indexOf(n)){var i=0===s.accuracy?1:s.accuracy;e.keyInterval||(e.keyInterval=setInterval(function(){var n=e.value;37!==t.keyCode&&40!==t.keyCode||(n-i<s.min?n=s.min:n-=i),38!==t.keyCode&&39!==t.keyCode||(n+i>s.max?n=s.max:n+=i),e.value=e._correct(n),e.percent=e._convert(e.value,"val2prc"),e.pixel=e._convert(e.percent,"prc2pix"),e._redraw()},100),t.preventDefault())}}),i.on(c.events.keyup,function(){clearInterval(e.keyInterval),e.keyInterval=!1}),n.on(c.events.click,function(t){e._move(t),j.exec(s.onClick,[e.value,e.percent,n]),j.exec(s.onStop,[e.value,e.percent,n])}),t(window).resize(function(){e.val(e.value),e.buff(e.buffer)})},_convert:function(e,t){var n=this.slider,s=this.options,i=(!0===s.vertical?n.outerHeight():n.outerWidth())-n.find(".marker").outerWidth();switch(t){case"pix2prc":return Math.round(100*e/i);case"pix2val":return Math.round(this._convert(e,"pix2prc")*((s.max-s.min)/100)+s.min);case"val2prc":return Math.round((e-s.min)/((s.max-s.min)/100));case"prc2pix":return Math.round(e/(100/i));case"val2pix":return Math.round(this._convert(this._convert(e,"val2prc"),"prc2pix"))}return 0},_correct:function(e){var t=this.options.accuracy,n=this.options.min,s=this.options.max;return 0===t||isNaN(t)?e:((e=Math.floor(e/t)*t+Math.round(e%t/t)*t)<n&&(e=n),e>s&&(e=s),e)},_move:function(e){var t,n,s=this.slider,i=this.options,a=s.offset(),o=s.find(".marker").outerWidth(),r=!0===i.vertical?s.outerHeight():s.outerWidth(),l=r-o;t=!0===i.vertical?j.pageXY(e).y-a.top:j.pageXY(e).x-a.left,(n=!0===i.vertical?r-t-o/2:t-o/2)<0||n>l||(this.value=this._correct(this._convert(n,"pix2val")),this.percent=this._convert(this.value,"val2prc"),this.pixel=this._convert(this.percent,"prc2pix"),this._redraw())},_hint:function(){var e,t=this.options,n=this.slider.find(".hint");e=t.hintMask.replace("$1",this.value).replace("$2",this.percent),n.text(e)},_value:function(){var e=this.element,n=this.options,s=this.slider,i="value"===n.returnType?this.value:this.percent;if("INPUT"===e[0].tagName&&e.val(i),e.trigger("change"),null!==n.target){var a=t(n.target);0!==a.length&&t.each(a,function(){var e=t(this);"INPUT"===this.tagName?e.val(i):e.text(i)})}j.exec(n.onChangeValue,[i,this.percent,s])},_marker:function(){var e=this.slider,t=this.options,n=e.find(".marker"),s=e.find(".complete"),i=!0===t.vertical?e.outerHeight():e.outerWidth(),a=parseInt(j.getStyleOne(n,"width")),o=j.isVisible(e);o&&n.css({"margin-top":0,"margin-left":0}),!0===t.vertical?(o?n.css("top",i-this.pixel):(n.css("top",this.percent+"%"),n.css("margin-top",0===this.percent?0:-1*a/2)),s.css("height",this.percent+"%")):(o?n.css("left",this.pixel):(n.css("left",this.percent+"%"),n.css("margin-left",0===this.percent?0:-1*a/2)),s.css("width",this.percent+"%"))},_redraw:function(){this._marker(),this._value(),this._hint()},_buffer:function(){var e=this.options,t=this.slider.find(".buffer");!0===e.vertical?t.css("height",this.buffer+"%"):t.css("width",this.buffer+"%"),j.exec(e.onChangeBuffer,[this.buffer,this.slider])},val:function(e){var t=this.options;if(void 0===e||isNaN(e))return this.value;e<t.min&&(e=t.min),e>t.max&&(e=t.max),this.value=this._correct(e),this.percent=this._convert(this.value,"val2prc"),this.pixel=this._convert(this.percent,"prc2pix"),this._redraw()},buff:function(e){var t=this.slider.find(".buffer");return void 0===e||isNaN(e)?this.buffer:0!==t.length&&((e=parseInt(e))>100&&(e=100),e<0&&(e=0),this.buffer=e,void this._buffer())},changeValue:function(){var e=this.element,t=this.options,n=e.attr("data-value");n<t.min&&(n=t.min),n>t.max&&(n=t.max),this.val(n)},changeBuffer:function(){var e=this.element,t=parseInt(e.attr("data-buffer"));t<0&&(t=0),t>100&&(t=100),this.buff(t)},changeAttribute:function(e){switch(e){case"data-value":this.changeValue();break;case"data-buffer":this.changeBuffer()}}};c.plugin("slider",Ae);var Ee={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.initial=[],this._setOptionsFromDOM(),this._create(),this},options:{thousandSeparator:",",decimalSeparator:",",sortTarget:null,sortSource:null,sortDir:"asc",sortStart:!0,saveInitial:!0,onSortStart:c.noop,onSortStop:c.noop,onSortItemSwitch:c.noop,onSorterCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this._createStructure(),j.exec(t.onSorterCreate,[e])},_createStructure:function(){var e=this.element,t=this.options;null===t.sortTarget&&(t.sortTarget=e.children()[0].tagName),this.initial=e.find(t.sortTarget).get(),!0===t.sortStart&&this.sort(t.sortDir)},_getItemContent:function(e){var t,n,s,i,a=this.options;if(j.isValue(a.sortSource)){if(t="",(n=e.getElementsByClassName(a.sortSource)).length>0)for(s=0;s<n.length;s++)t+=n[s].textContent;i=n[0].dataset.format}else t=e.textContent,i=e.dataset.format;if(t=(""+t).toLowerCase().replace(/[\n\r]+|[\s]{2,}/g," ").trim(),j.isValue(i))switch(-1===["number","int","float","money"].indexOf(i)||","===a.thousandSeparator&&"."===a.decimalSeparator||(t=j.parseNumber(t,a.thousandSeparator,a.decimalSeparator)),i){case"date":t=j.isDate(t)?new Date(t):"";break;case"number":t=Number(t);break;case"int":t=parseInt(t);break;case"float":t=parseFloat(t);break;case"money":t=Number(parseFloat(t.replace(/[^0-9-.]/g,"")))}return t},sort:function(e){var n,s,i=this,a=this.element,o=this.options,r=j.uniqueId();void 0!==e&&(o.sortDir=e),0!==(n=a.find(o.sortTarget).get()).length&&(s=t("<div>").attr("id",r).insertBefore(t(a.find(o.sortTarget)[0])),j.exec(o.onSortStart,[a],a[0]),n.sort(function(e,t){var n=i._getItemContent(e),s=i._getItemContent(t),r=0;return n<s?-1:n>s?1:(0!==r&&j.exec(o.onSortItemSwitch,[e,t],a[0]),r)}),"desc"===o.sortDir&&n.reverse(),a.find(o.sortTarget).remove(),t.each(n,function(){var e=t(this);e.insertAfter(s),s=e}),t("#"+r).remove(),j.exec(o.onSortStop,[a],a[0]))},reset:function(){var e,n,s=this.element,i=this.options,a=j.uniqueId();0!==(e=this.initial).length&&(n=t("<div>").attr("id",a).insertBefore(t(s.find(i.sortTarget)[0])),s.find(i.sortTarget).remove(),t.each(e,function(){var e=t(this);e.insertAfter(n),n=e}),t("#"+a).remove())},changeAttribute:function(e){var t,n,s=this,i=this.element,a=this.options;switch(e){case"data-sort-dir":""!==(n=i.attr("data-sort-dir").trim())&&(a.sortDir=n,s.sort());break;case"data-sort-content":""!==(t=i.attr("data-sort-content").trim())&&(a.sortContent=t,s.sort())}},destroy:function(){}};c.plugin("sorter",Ee),c.sorter={create:function(e,n){return t(e).sorter(n)},isSorter:function(e){return j.isMetroObject(e,"sorter")},sort:function(e,n){if(!this.isSorter(e))return!1;void 0===n&&(n="asc"),t(e).data("sorter").sort(n)},reset:function(e){if(!this.isSorter(e))return!1;t(e).data("sorter").reset()}};var Pe={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.current=0,this._setOptionsFromDOM(),this._create(),this},options:{view:c.stepperView.SQUARE,steps:3,step:1,stepClick:!1,clsStepper:"",clsStep:"",clsComplete:"",clsCurrent:"",onStep:c.noop,onStepClick:c.noop,onStepperCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;t.step<=0&&(t.step=1),this._createStepper(),this._createEvents(),j.exec(t.onStepperCreate,[e])},_createStepper:function(){var e,n=this.element,s=this.options;for(n.addClass("stepper").addClass(s.view).addClass(s.clsStepper),e=1;e<=s.steps;e++)t("<span>").addClass("step").addClass(s.clsStep).data("step",e).html("<span>"+e+"</span>").appendTo(n);this.current=1,this.toStep(s.step)},_createEvents:function(){var e=this,n=this.element,s=this.options;n.on(c.events.click,".step",function(){var i=t(this).data("step");!0===s.stepClick&&(e.toStep(i),j.exec(s.onStepClick,[i,n]))})},next:function(){var e=this.element,t=(this.options,e.find(".step"));this.current+1>t.length||(this.current++,this.toStep(this.current))},prev:function(){this.element,this.options;this.current-1!=0&&(this.current--,this.toStep(this.current))},last:function(){var e=this.element;this.options;this.toStep(e.find(".step").length)},first:function(){this.toStep(1)},toStep:function(e){var n=this.element,s=this.options,i=t(n.find(".step").get(e-1));0!==i.length&&(this.current=e,n.find(".step").removeClass("complete current").removeClass(s.clsCurrent).removeClass(s.clsComplete),i.addClass("current").addClass(s.clsCurrent),i.prevAll().addClass("complete").addClass(s.clsComplete),j.exec(s.onStep,[this.current,n]))},changeAttribute:function(e){}};c.plugin("stepper",Pe);var Ne={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.data=null,this._setOptionsFromDOM(),this._create(),this},options:{duration:METRO_ANIMATION_DURATION,defaultClosedIcon:"",defaultOpenIcon:"",changeUri:!0,encodeLink:!0,closed:!1,chromeNotice:!1,startFrom:null,slideToStart:!0,startSlideSleep:1e3,source:null,data:null,eventClick:"select",selectGlobal:!0,streamSelect:!1,excludeSelectElement:null,excludeClickElement:null,excludeElement:null,excludeSelectClass:"",excludeClickClass:"",excludeClass:"",onStreamClick:c.noop,onStreamSelect:c.noop,onEventClick:c.noop,onEventSelect:c.noop,onStreamerCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this,n=this.element,s=this.options;if(n.addClass("streamer"),void 0===n.attr("id")&&n.attr("id",j.elementId("streamer")),null===s.source&&null===s.data)return!1;t("<div>").addClass("streams").appendTo(n),t("<div>").addClass("events-area").appendTo(n),null!==s.source?t.get(s.source,function(t){e.data=t,e.build()}):(this.data=s.data,this.build()),this._createEvents(),!0===s.chromeNotice&&!0===j.detectChrome()&&!1===j.isTouchDevice()&&t("<p>").addClass("text-small text-muted").html("*) In Chrome browser please press and hold Shift and turn the mouse wheel.").insertAfter(n)},build:function(){var e=this,n=this.element,s=this.options,i=this.data,a=n.find(".streams").html(""),o=n.find(".events-area").html(""),r=t("<ul>").addClass("streamer-timeline").html("").appendTo(o),l=t("<div>").addClass("streamer-events").appendTo(o),d=t("<div>").addClass("event-group").appendTo(l),h=j.getURIParameter(null,"StreamerIDS");null!==h&&!0===s.encodeLink&&(h=atob(h));var u=h?h.split("|")[0]:null,p=h?h.split("|")[1].split(","):[];if(void 0!==i.actions){var f=t("<div>").addClass("streamer-actions").appendTo(a);t.each(i.actions,function(){var e=this,s=t("<button>").addClass("streamer-action").addClass(e.cls).html(e.html);void 0!==e.onclick&&s.on(c.events.click,function(){j.exec(e.onclick,[n])}),s.appendTo(f)})}r.html(""),void 0===i.timeline&&(i.timeline={start:"09:00",stop:"18:00",step:20});var m=new Date,v=new Date,g=i.timeline.start?i.timeline.start.split(":"):[9,0],C=i.timeline.stop?i.timeline.stop.split(":"):[18,0],b=i.timeline.step?60*parseInt(i.timeline.step):1200;m.setHours(g[0]),m.setMinutes(g[1]),m.setSeconds(0),v.setHours(C[0]),v.setMinutes(C[1]),v.setSeconds(0);for(var w=m.getTime()/1e3;w<=v.getTime()/1e3;w+=b){var y=new Date(1e3*w),x=y.getHours(),T=y.getMinutes(),_=(x<10?"0"+x:x)+":"+(T<10?"0"+T:T);t("<li>").data("time",_).addClass("js-time-point-"+_.replace(":","-")).html("<em>"+_+"</em>").appendTo(r)}void 0!==i.streams&&t.each(i.streams,function(e){var i=this,o=t("<div>").addClass("stream").addClass(this.cls).appendTo(a);o.addClass(i.cls).data("one",!1).data("data",i.data),t("<div>").addClass("stream-title").html(i.title).appendTo(o),t("<div>").addClass("stream-secondary").html(i.secondary).appendTo(o),t(i.icon).addClass("stream-icon").appendTo(o);var l=j.computedRgbToHex(j.getStyleOne(o,"background-color")),c=j.computedRgbToHex(j.getStyleOne(o,"color")),h=t("<div>").addClass("stream-events").data("background-color",l).data("text-color",c).appendTo(d);if(void 0!==i.events){t.each(i.events,function(i){var a,d=this,f=e+":"+i,m=void 0!==d.custom?d.custom:"",v=void 0!==d.custom_open?d.custom_open:"",g=void 0!==d.custom_close?d.custom_close:"",C=t("<div>").data("origin",d).data("sid",f).data("data",d.data).data("time",d.time).data("target",d.target).addClass("stream-event").addClass("size-"+d.size+"x").addClass(d.cls).appendTo(h),b=r.find(".js-time-point-"+this.time.replace(":","-"))[0].offsetLeft-o.outerWidth();C.css({position:"absolute",left:b});var w=t("<div>").addClass("stream-event-slide").appendTo(C),y=t("<div>").addClass("slide-logo").appendTo(w),x=t("<div>").addClass("slide-data").appendTo(w);void 0!==d.icon&&(j.isTag(d.icon)?t(d.icon).addClass("icon").appendTo(y):t("<img>").addClass("icon").attr("src",d.icon).appendTo(y)),t("<span>").addClass("time").css({backgroundColor:l,color:c}).html(d.time).appendTo(y),t("<div>").addClass("title").html(d.title).appendTo(x),t("<div>").addClass("subtitle").html(d.subtitle).appendTo(x),t("<div>").addClass("desc").html(d.desc).appendTo(x),(!1===s.closed&&n.attr("id")===u&&-1!==p.indexOf(f)||!0===d.selected||1===parseInt(d.selected))&&C.addClass("selected"),!0===s.closed||!0===d.closed||1===parseInt(d.closed)?(a=void 0!==d.closedIcon?j.isTag(d.closedIcon)?d.closedIcon:"<span>"+d.closedIcon+"</span>":j.isTag(s.defaultClosedIcon)?s.defaultClosedIcon:"<span>"+s.defaultClosedIcon+"</span>",t(a).addClass("state-icon").addClass(d.clsClosedIcon).appendTo(w),C.data("closed",!0).data("target",d.target),C.append(v)):(a=void 0!==d.openIcon?j.isTag(d.openIcon)?d.openIcon:"<span>"+d.openIcon+"</span>":j.isTag(s.defaultOpenIcon)?s.defaultOpenIcon:"<span>"+s.defaultOpenIcon+"</span>",t(a).addClass("state-icon").addClass(d.clsOpenIcon).appendTo(w),C.data("closed",!1),C.append(g)),C.append(m)});var f=h.find(".stream-event:last-child");f.length>0&&h.outerWidth(f[0].offsetLeft+f.outerWidth())}}),void 0!==i.global&&t.each(["before","after"],function(){void 0!==i.global[this]&&t.each(i.global[this],function(){var e=this,n=t("<div>").addClass("event-group").addClass("size-"+e.size+"x"),s=t("<div>").addClass("stream-events global-stream").appendTo(n),i=t("<div>").addClass("stream-event").appendTo(s);i.addClass("global-event").addClass(e.cls).data("time",e.time).data("origin",e).data("data",e.data),t("<div>").addClass("event-title").html(e.title).appendTo(i),t("<div>").addClass("event-subtitle").html(e.subtitle).appendTo(i),t("<div>").addClass("event-html").html(e.html).appendTo(i);var o,c=r.find(".js-time-point-"+this.time.replace(":","-"));c.length>0&&(o=c[0].offsetLeft-a.find(".stream").outerWidth()),n.css({position:"absolute",left:o,height:"100%"}).appendTo(l)})}),n.data("stream",-1),null!==s.startFrom&&!0===s.slideToStart&&setTimeout(function(){e.slideTo(s.startFrom)},s.startSlideSleep),j.exec(s.onStreamerCreate,[n])},_createEvents:function(){var e=this,n=this.element,s=this.options;n.on(c.events.click,".stream-event",function(n){var i=t(this);if(!(""!==s.excludeClass&&i.hasClass(s.excludeClass)||null!==s.excludeElement&&t(n.target).is(s.excludeElement)))if(!1===s.closed&&!0!==i.data("closed")&&"select"===s.eventClick)""!==s.excludeSelectClass&&i.hasClass(s.excludeSelectClass)||null!==s.excludeSelectElement&&t(n.target).is(s.excludeSelectElement)||(i.hasClass("global-event")?!0===s.selectGlobal&&i.toggleClass("selected"):i.toggleClass("selected"),!0===s.changeUri&&e._changeURI(),j.exec(s.onEventSelect,[i,i.hasClass("selected")]));else if(""!==s.excludeClickClass&&i.hasClass(s.excludeClickClass));else if(null!==s.excludeClickElement&&t(n.target).is(s.excludeClickElement));else if(j.exec(s.onEventClick,[i]),!0===s.closed||!0===i.data("closed")){var a=i.data("target");a&&(window.location.href=a)}}),n.on(c.events.click,".stream",function(i){var a=t(this),o=a.index();!1!==s.streamSelect&&(n.data("stream")===o?(n.find(".stream-event").removeClass("disabled"),n.data("stream",-1)):(n.data("stream",o),n.find(".stream-event").addClass("disabled"),e.enableStream(a),j.exec(s.onStreamSelect,[a])),j.exec(s.onStreamClick,[a]))}),!0!==j.isTouchDevice()&&n.on(c.events.mousewheel,".events-area",function(e){var n=t(this);if(void 0!==e.deltaY&&void 0!==e.deltaFactor&&e.deltaFactor>1){var s=n.scrollLeft()-30*e.deltaY;n.scrollLeft(s),e.preventDefault()}}),!0===j.isTouchDevice()&&n.on(c.events.click,".stream",function(){var e=t(this);e.toggleClass("focused"),t.each(n.find(".stream"),function(){t(this).is(e)||t(this).removeClass("focused")})})},_changeURI:function(){this.element,this.options,this.data;var e=this.getLink();history.pushState({},document.title,e)},slideTo:function(e){var n,s=this.element,i=this.options;this.data;n=t(void 0===e?s.find(".streamer-timeline li")[0]:s.find(".streamer-timeline .js-time-point-"+e.replace(":","-"))[0]),s.find(".events-area").animate({scrollLeft:n[0].offsetLeft-s.find(".streams .stream").outerWidth()},i.duration)},enableStream:function(e){var t=this.element,n=(this.options,this.data,e.index());e.removeClass("disabled").data("streamDisabled",!1),t.find(".stream-events").eq(n).find(".stream-event").removeClass("disabled")},disableStream:function(e){var t=this.element,n=(this.options,this.data,e.index());e.addClass("disabled").data("streamDisabled",!0),t.find(".stream-events").eq(n).find(".stream-event").addClass("disabled")},toggleStream:function(e){!0===e.data("streamDisabled")?this.enableStream(e):this.disableStream(e)},getLink:function(){var e,n=this.element,s=this.options,i=(this.data,n.find(".stream-event")),a=[],o=window.location.href;return t.each(i,function(){var e=t(this);void 0!==e.data("sid")&&e.hasClass("selected")&&a.push(e.data("sid"))}),e=n.attr("id")+"|"+a.join(","),!0===s.encodeLink&&(e=btoa(e)),j.updateURIParameter(o,"StreamerIDS",e)},getTimes:function(){var e=this.element,n=(this.options,this.data,e.find(".streamer-timeline > li")),s=[];return t.each(n,function(){s.push(t(this).data("time"))}),s},getEvents:function(e,n){var s,i=this.element,a=(this.options,this.data,[]);switch(e){case"selected":s=i.find(".stream-event.selected");break;case"non-selected":s=i.find(".stream-event:not(.selected)");break;default:s=i.find(".stream-event")}return t.each(s,function(){var e,s=t(this);!0!==n&&s.parent().hasClass("global-stream")||(e=s.data("origin"),a.push(e))}),a},source:function(e){if(void 0===e)return this.options.source;this.options.source=e,this.changeSource()},data:function(e){if(void 0===e)return this.options.source;this.options.data=e,this.changeData()},getStreamerData:function(){return this.data},toggleEvent:function(e){this.element;var n=this.options;this.data;(e=t(e)).hasClass("global-event")&&!0!==n.selectGlobal||(e.hasClass("selected")?this.selectEvent(e,!1):this.selectEvent(e,!0))},selectEvent:function(e,n){this.element;var s=this.options;this.data;void 0===n&&(n=!0),(e=t(e)).hasClass("global-event")&&!0!==s.selectGlobal||(!0===n?e.addClass("selected"):e.removeClass("selected"),!0===s.changeUri&&this._changeURI(),j.exec(s.onEventSelect,[e,n]))},changeSource:function(){var e=this,n=this.element,s=this.options,i=(this.data,n.attr("data-source"));""!==String(i).trim()&&(s.source=i,t.get(s.source,function(t){e.data=t,e.build()}),n.trigger("sourcechanged"))},changeData:function(){var e=this.element,t=this.options,n=(this.data,e.attr("data-data"));""!==String(n).trim()&&(t.data=n,this.data=JSON.parse(t.data),this.build(),e.trigger("datachanged"))},changeStreamSelectOption:function(){var e=this.element,t=this.options;this.data;t.streamSelect="true"===e.attr("data-stream-select").toLowerCase()},changeAttribute:function(e){switch(e){case"data-source":this.changeSource();break;case"data-data":this.changeData();break;case"data-stream-select":this.changeStreamSelectOption()}}};c.plugin("streamer",Ne);var Fe={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),j.exec(this.options.onSwitchCreate,[this.element]),this},options:{caption:"",captionPosition:"right",disabled:!1,clsElement:"",clsCheck:"",clsCaption:"",onSwitchCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,n=this.options,s=e.prev(),i=e.parent(),a=t("<label>").addClass("switch "+e[0].className),o=t("<span>").addClass("check"),r=t("<span>").addClass("caption").html(n.caption);e.attr("type","checkbox"),0===s.length?i.prepend(a):a.insertAfter(s),e.appendTo(a),o.appendTo(a),r.appendTo(a),"left"===n.captionPosition&&a.addClass("caption-left"),e[0].className="",a.addClass(n.clsElement),r.addClass(n.clsCaption),o.addClass(n.clsCheck),!0===n.disabled&&e.is(":disabled")?this.disable():this.enable()},disable:function(){this.element.data("disabled",!0),this.element.parent().addClass("disabled")},enable:function(){this.element.data("disabled",!1),this.element.parent().removeClass("disabled")},toggleState:function(){!1===this.element.data("disabled")?this.disable():this.enable()},changeAttribute:function(e){switch(e){case"disabled":this.toggleState()}}};c.plugin("switch",Fe);var Re={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.currentPage=1,this.pagesCount=1,this.filterString="",this.data=null,this.activity=null,this.busy=!1,this.filters=[],this.wrapperInfo=null,this.wrapperSearch=null,this.wrapperRows=null,this.wrapperPagination=null,this.filterIndex=null,this.filtersIndexes=null,this.component=null,this.inspector=null,this.view={},this.viewDefault={},this.locale=c.locales["en-US"],this.sort={dir:"asc",colIndex:0},this.service=[],this.heads=[],this.items=[],this.foots=[],this.filteredItems=[],this._setOptionsFromDOM(),this._create(),this},options:{locale:METRO_LOCALE,check:!1,checkColIndex:0,checkName:null,checkType:"checkbox",checkStoreKey:"TABLE:$1:KEYS",rownum:!1,filter:null,filters:null,source:null,filterMinLength:1,showRowsSteps:!0,showSearch:!0,showTableInfo:!0,showPagination:!0,paginationShortMode:!0,showActivity:!0,muteTable:!0,rows:10,rowsSteps:"10,25,50,100",viewSaveMode:"client",viewSavePath:"TABLE:$1:OPTIONS",sortDir:"asc",decimalSeparator:".",thousandSeparator:",",tableRowsCountTitle:"Show entries:",tableSearchTitle:"Search:",tableInfoTitle:"Showing $1 to $2 of $3 entries",paginationPrevTitle:"Prev",paginationNextTitle:"Next",allRecordsTitle:"All",inspectorTitle:"Inspector",activityType:"cycle",activityStyle:"color",activityTimeout:100,searchWrapper:null,rowsWrapper:null,infoWrapper:null,paginationWrapper:null,cellWrapper:!0,clsComponent:"",clsTable:"",clsHead:"",clsHeadRow:"",clsHeadCell:"",clsBody:"",clsBodyRow:"",clsBodyCell:"",clsFooter:"",clsFooterRow:"",clsFooterCell:"",clsTableTop:"",clsRowsCount:"",clsSearch:"",clsTableBottom:"",clsTableInfo:"",clsTablePagination:"",clsPagination:"",onDraw:c.noop,onDrawRow:c.noop,onDrawCell:c.noop,onAppendRow:c.noop,onAppendCell:c.noop,onSortStart:c.noop,onSortStop:c.noop,onSortItemSwitch:c.noop,onSearch:c.noop,onRowsCountChange:c.noop,onDataLoad:c.noop,onDataLoaded:c.noop,onFilterRowAccepted:c.noop,onFilterRowDeclined:c.noop,onCheckClick:c.noop,onCheckClickAll:c.noop,onCheckDraw:c.noop,onViewSave:c.noop,onViewGet:c.noop,onViewCreated:c.noop,onTableCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this,n=this.element,s=this.options,i=j.elementId("table");j.isValue(n.attr("id"))||n.attr("id",i),j.isValue(c.locales[s.locale])&&(this.locale=c.locales[s.locale]),null!==s.source?(j.exec(s.onDataLoad,[s.source],n[0]),t.get(s.source,function(t){e._build(t),j.exec(s.onDataLoaded,[s.source,t],n[0])}).fail(function(e,t,n){console.log(t),console.log(e),console.log(n)})):e._build()},_build:function(e){var n,s=this,i=this.element,a=this.options,o=i.attr("id");a.rows=parseInt(a.rows),this.items=[],this.heads=[],this.foots=[],j.isValue(e)?this._createItemsFromJSON(e):this._createItemsFromHTML(),this.view=this._createView(),this.viewDefault=j.objectClone(this.view),"client"===a.viewSaveMode.toLowerCase()?(n=c.storage.getItem(a.viewSavePath.replace("$1",o)),j.isValue(n)&&j.objectLength(n)===j.objectLength(this.view)&&(this.view=n,j.exec(a.onViewGet,[n],i[0])),this._final()):t.get(a.viewSavePath,{id:o},function(e){j.isValue(e)&&j.objectLength(e)===j.objectLength(s.view)&&(s.view=e,j.exec(a.onViewGet,[e],i[0])),s._final()}).fail(function(e,t){s._final(),console.log("Warning! View "+t+" for table "+i.attr("id")+" ")})},_final:function(){var e=this.element,t=this.options,n=e.attr("id");c.storage.delItem(t.checkStoreKey.replace("$1",n)),this._service(),this._createStructure(),this._createInspector(),this._createEvents(),j.exec(t.onTableCreate,[e],e[0])},_service:function(){var e,t,n=this.options,s=[];t={title:"#",format:void 0,name:void 0,sortable:!1,sortDir:void 0,clsColumn:!0!==n.rownum?"d-none":"",cls:!0!==n.rownum?"d-none":"",colspan:void 0,type:"rownum"},e={title:"checkbox"===n.checkType?"<input type='checkbox' data-role='checkbox' class='table-service-check-all'>":"",format:void 0,name:void 0,sortable:!1,sortDir:void 0,clsColumn:!0!==n.check?"d-none":"",cls:!0!==n.check?"d-none":"",colspan:void 0,type:"rowcheck"},s.push(t),s.push(e),this.service=s},_createView:function(){var e,n=this.options;return e={},t.each(this.heads,function(t){j.isValue(this.cls)&&(this.cls=this.cls.replace("hidden","")),j.isValue(this.clsColumn)&&(this.clsColumn=this.clsColumn.replace("hidden","")),e[t]={index:t,"index-view":t,show:!j.isValue(this.show)||this.show,size:j.isValue(this.size)?this.size:""}}),j.exec(n.onViewCreated,[e],e),e},_createInspector:function(){var e,n,s,i,a,o=this,r=this.options,l=this.component,c=t("<table>").addClass("table compact"),d=[];for(e=t("<div data-role='draggable' data-drag-element='h3' data-drag-area='body'>").addClass("table-inspector"),t("<h3 class='text-light'>"+r.inspectorTitle+"</h3>").appendTo(e),t("<hr class='thin bg-lightGray'>").appendTo(e),c.appendTo(e),i=this.heads,a=0;a<i.length;a++)d[a]=null;for(t.each(i,function(e){(n=t("<tr>")).data("index",e),n.data("index-view",e),t("<td>").html("<input type='checkbox' data-role='checkbox' name='column_show_check[]' value='"+e+"' "+(j.bool(o.view[e].show)?"checked":"")+">").appendTo(n),t("<td>").html(this.title).appendTo(n),t("<td>").html("<input type='number' name='column_size' value='"+o.view[e].size+"' data-index='"+e+"'>").appendTo(n),t("<td>").html("<button class='button mini js-table-inspector-field-up' type='button'><span class='mif-arrow-up'></span></button><button class='button mini js-table-inspector-field-down' type='button'><span class='mif-arrow-down'></span></button>").appendTo(n),d[o.view[e]["index-view"]]=n}),a=0;a<i.length;a++)d[a].appendTo(c);t("<hr class='thin bg-lightGray'>").appendTo(e),s=t("<div class='inspector-actions'>").appendTo(e),t("<button class='button primary js-table-inspector-save' type='button'>").html(this.locale.buttons.save).appendTo(s),t("<button class='button secondary js-table-inspector-reset ml-2 mr-2' type='button'>").html(this.locale.buttons.reset).appendTo(s),t("<button class='button link js-table-inspector-cancel place-right' type='button'>").html(this.locale.buttons.cancel).appendTo(s),this.inspector=e,l.append(e),this._createInspectorEvents()},_resetInspector:function(){var e,n,s,i=this.inspector.find("table"),a=[],o=this.view;for(i.html(""),e=this.heads,n=0;n<e.length;n++)a[n]=null;for(t.each(e,function(e){(s=t("<tr>")).data("index",e),s.data("index-view",e),t("<td>").html("<input type='checkbox' data-role='checkbox' name='column_show_check[]' value='"+e+"' "+(j.bool(o[e].show)?"checked":"")+">").appendTo(s),t("<td>").html(this.title).appendTo(s),t("<td>").html("<input type='number' name='column_size' value='"+o[e].size+"' data-index='"+e+"'>").appendTo(s),t("<td>").html("<button class='button mini js-table-inspector-field-up' type='button'><span class='mif-arrow-up'></span></button><button class='button mini js-table-inspector-field-down' type='button'><span class='mif-arrow-down'></span></button>").appendTo(s),a[o[e]["index-view"]]=s}),n=0;n<e.length;n++)a[n].appendTo(i);this._createInspectorEvents()},_createHeadsFormHTML:function(){var e=this,n=this.element.find("thead");n.length>0&&t.each(n.find("tr > *"),function(){var n,s,i,a=t(this);n=a.hasClass("sort-asc")?"asc":a.hasClass("sort-desc")?"desc":void 0,i=(i=(i=a[0].className.replace("sortable-column","")).replace("sort-asc","")).replace("sort-desc",""),s={title:a.html(),format:j.isValue(a.data("format"))?a.data("format"):void 0,name:j.isValue(a.data("name"))?a.data("name"):void 0,sortable:a.hasClass("sortable-column"),sortDir:n,clsColumn:j.isValue(a.data("cls-column"))?a.data("cls-column"):"",cls:i,colspan:a.attr("colspan"),type:"data",size:j.isValue(a.data("size"))?a.data("size"):""},e.heads.push(s)})},_createFootsFromHTML:function(){var e=this,n=this.element.find("tfoot");n.length>0&&t.each(n.find("tr > *"),function(){var n,s=t(this);n={title:s.html(),name:!!j.isValue(s.data("name"))&&s.data("name"),cls:s[0].className,colspan:s.attr("colspan")},e.foots.push(n)})},_createItemsFromHTML:function(){var e=this,n=this.element.find("tbody");n.length>0&&t.each(n.find("tr"),function(){var n=t(this),s=[];t.each(n.children("td"),function(){var e=t(this);s.push(e.html())}),e.items.push(s)}),this._createHeadsFormHTML(),this._createFootsFromHTML()},_createItemsFromJSON:function(e){var n=this;void 0!==e.header?n.heads=e.header:this._createHeadsFormHTML(),void 0!==e.data&&t.each(e.data,function(){var e=[];t.each(this,function(){e.push(this)}),n.items.push(e)}),void 0!==e.footer?this.foots=e.footer:this._createFootsFromHTML()},_createTableHeader:function(){var e,n,s,i,a=this.element,o=this.options,r=t("<thead>").html(""),l=[],c=this.view;if(a.find("thead").remove(),r.addClass(o.clsHead),0===this.heads.length)return r;for(e=t("<tr>").addClass(o.clsHeadRow).appendTo(r),t.each(this.service,function(){var s=this,i=[];n=t("<th>").appendTo(e),j.isValue(s.title)&&n.html(s.title),j.isValue(s.size)&&n.css({width:s.size}),j.isValue(s.cls)&&i.push(s.cls),"rowcheck"===s.type&&i.push("check-cell"),"rownum"===s.type&&i.push("rownum-cell"),i.push(o.clsHeadCell),n.addClass(i.join(" "))}),i=this.heads,s=0;s<i.length;s++)l[s]=null;for(t.each(i,function(e){var s=this,i=[];(n=t("<th>")).data("index",e),j.isValue(s.title)&&n.html(s.title),j.isValue(s.format)&&n.attr("data-format",s.format),j.isValue(s.name)&&n.attr("data-name",s.name),j.isValue(s.colspan)&&n.attr("colspan",s.colspan),j.isValue(c[e].size)&&n.css({width:c[e].size}),!0===s.sortable&&(i.push("sortable-column"),j.isValue(s.sortDir)&&i.push("sort-"+s.sortDir)),j.isValue(s.cls)&&i.push(s.cls),!1===j.bool(c[e].show)&&i.push("hidden"),"rowcheck"===s.type&&i.push("check-cell"),"rownum"===s.type&&i.push("rownum-cell"),i.push(o.clsHeadCell),j.bool(c[e].show)&&j.arrayDelete(i,"hidden"),n.addClass(i.join(" ")),l[c[e]["index-view"]]=n}),s=0;s<i.length;s++)l[s].appendTo(e);a.prepend(r)},_createTableBody:function(){var e,n=this.element;e=n.find("thead"),n.find("tbody").remove(),t("<tbody>").addClass(this.options.clsBody).insertAfter(e)},_createTableFooter:function(){var e,n,s=this.element,i=this.options,a=t("<tfoot>").addClass(i.clsFooter);s.find("tfoot").remove(),0!==this.foots.length?(e=t("<tr>").addClass(i.clsHeadRow).appendTo(a),t.each(this.foots,function(){var s=this;n=t("<th>").appendTo(e),void 0!==s.title&&n.html(s.title),void 0!==s.name&&n.addClass("foot-column-name-"+s.name),void 0!==s.cls&&n.addClass(s.cls),j.isValue(s.colspan)&&n.attr("colspan",s.colspan),n.appendTo(e)}),s.append(a)):s.append(a)},_createTopBlock:function(){var e,n,s,i=this,a=this.element,o=this.options,r=t("<div>").addClass("table-top").addClass(o.clsTableTop).insertBefore(a);return e=j.isValue(this.wrapperSearch)?this.wrapperSearch:t("<div>").addClass("table-search-block").addClass(o.clsSearch).appendTo(r),t("<input>").attr("type","text").appendTo(e).input({prepend:o.tableSearchTitle}),!0!==o.showSearch&&e.hide(),n=j.isValue(this.wrapperRows)?this.wrapperRows:t("<div>").addClass("table-rows-block").addClass(o.clsRowsCount).appendTo(r),s=t("<select>").appendTo(n),t.each(j.strToArray(o.rowsSteps),function(){var e=parseInt(this),n=t("<option>").attr("value",e).text(-1===e?o.allRecordsTitle:e).appendTo(s);e===parseInt(o.rows)&&n.attr("selected","selected")}),s.select({filter:!1,prepend:o.tableRowsCountTitle,onChange:function(e){(e=parseInt(e))!==parseInt(o.rows)&&(o.rows=e,i.currentPage=1,i._draw(),j.exec(o.onRowsCountChange,[e],a[0]))}}),!0!==o.showRowsSteps&&n.hide(),r},_createBottomBlock:function(){var e,n,s=this.element,i=this.options,a=t("<div>").addClass("table-bottom").addClass(i.clsTableBottom).insertAfter(s);return e=t("<div>").addClass("table-info").addClass(i.clsTableInfo).appendTo(a),!0!==i.showTableInfo&&e.hide(),n=t("<div>").addClass("table-pagination").addClass(i.clsTablePagination).appendTo(a),!0!==i.showPagination&&n.hide(),a},_createStructure:function(){var e,n,s=this,i=this.element,a=this.options,o=t(a.searchWrapper),r=t(a.infoWrapper),l=t(a.rowsWrapper),c=t(a.paginationWrapper);o.length>0&&(this.wrapperSearch=o),r.length>0&&(this.wrapperInfo=r),l.length>0&&(this.wrapperRows=l),c.length>0&&(this.wrapperPagination=c),i.parent().hasClass("table-component")?e=i.parent():(e=t("<div>").addClass("table-component").insertBefore(i),i.appendTo(e)),e.addClass(a.clsComponent),this.activity=t("<div>").addClass("table-progress").appendTo(e),t("<div>").activity({type:a.activityType,style:a.activityStyle}).appendTo(this.activity),!0!==a.showActivity&&this.activity.css({visibility:"hidden"}),i.html("").addClass(a.clsTable),this._createTableHeader(),this._createTableBody(),this._createTableFooter(),this._createTopBlock(),this._createBottomBlock();var d,h=!1;this.heads.length>0&&t.each(this.heads,function(e){!h&&["asc","desc"].indexOf(this.sortDir)>-1&&(h=!0,s.sort.colIndex=e,s.sort.dir=this.sortDir)}),h&&(n=i.find("thead th"),this._resetSortClass(n),t(n.get(this.sort.colIndex+s.service.length)).addClass("sort-"+this.sort.dir),this.sorting()),j.isValue(a.filter)&&(!1===(d=j.isFunc(a.filter))&&(d=j.func(a.filter)),s.filterIndex=s.addFilter(d)),j.isValue(a.filters)&&t.each(j.strToArray(a.filters),function(){!1!==(d=j.isFunc(this))&&s.filtersIndexes.push(s.addFilter(d))}),this.currentPage=1,this.component=e,this._draw()},_resetSortClass:function(e){t(e).removeClass("sort-asc sort-desc")},_createEvents:function(){var e,n=this,s=this.element,i=this.options,a=s.parent(),o=a.find(".table-search-block input"),r=s.attr("id");s.on(c.events.click,".sortable-column",function(){if(!0===i.muteTable&&s.addClass("disabled"),n.busy)return!1;n.busy=!0;var e=t(this);n.activity.show(i.activityTimeout,function(){n.currentPage=1,n.sort.colIndex=e.data("index"),e.has("sort-asc")||e.hasClass("sort-desc")?e.hasClass("sort-asc")?n.sort.dir="desc":n.sort.dir="asc":n.sort.dir=i.sortDir,n._resetSortClass(s.find(".sortable-column")),e.addClass("sort-"+n.sort.dir),n.sorting(),n._draw(function(){n.busy=!1,!0===i.muteTable&&s.removeClass("disabled")})})}),s.on(c.events.click,".table-service-check input",function(){var e=t(this),n=e.is(":checked"),s=""+e.val(),a=i.checkStoreKey.replace("$1",r),o=c.storage,l=o.getItem(a);n?j.isValue(l)?-1===Array(l).indexOf(s)&&l.push(s):l=[s]:j.isValue(l)?j.arrayDelete(l,s):l=[],o.setItem(a,l),j.exec(i.onCheckClick,[n],this)}),s.on(c.events.click,".table-service-check-all input",function(){var e=t(this).is(":checked"),s=i.checkStoreKey.replace("$1",r),a=[];e?t.each(n.filteredItems,function(){-1===a.indexOf(this[i.checkColIndex])&&a.push(""+this[i.checkColIndex])}):a=[],c.storage.setItem(s,a),n._draw(),j.exec(i.onCheckClickAll,[e],this)});var l=function(){n.filterString=this.value.trim().toLowerCase(),":"!==n.filterString[n.filterString.length-1]&&(n.currentPage=1,n._draw())};function d(e){var s=t(e),i=s.parent();i.hasClass("active")||(i.hasClass("service")?"prev"===s.data("page")?(n.currentPage--,0===n.currentPage&&(n.currentPage=1)):(n.currentPage++,n.currentPage>n.pagesCount&&(n.currentPage=n.pagesCount)):n.currentPage=s.data("page"),n._draw())}o.on(c.events.inputchange,l),j.isValue(this.wrapperSearch)&&(e=this.wrapperSearch.find("input")).length>0&&e.on(c.events.inputchange,l),a.on(c.events.click,".pagination .page-link",function(){d(this)}),j.isValue(this.wrapperPagination)&&this.wrapperPagination.on(c.events.click,".pagination .page-link",function(){d(this)}),this._createInspectorEvents()},_createInspectorEvents:function(){var e=this,n=this.inspector;this._removeInspectorEvents(),n.on(c.events.click,".js-table-inspector-field-up",function(){var n,s=t(this).closest("tr"),i=s.prev("tr"),a=s.data("index");0!==i.length&&(s.insertBefore(i),s.addClass("flash"),setTimeout(function(){s.removeClass("flash")},1e3),n=s.index(),s.data("index-view",n),e.view[a]["index-view"]=n,t.each(s.nextAll(),function(){var s=t(this);n++,s.data("index-view",n),e.view[s.data("index")]["index-view"]=n}),e._createTableHeader(),e._draw())}),n.on(c.events.click,".js-table-inspector-field-down",function(){var n,s=t(this).closest("tr"),i=s.next("tr"),a=s.data("index");0!==i.length&&(s.insertAfter(i),s.addClass("flash"),setTimeout(function(){s.removeClass("flash")},1e3),n=s.index(),s.data("index-view",n),e.view[a]["index-view"]=n,t.each(s.prevAll(),function(){var s=t(this);n--,s.data("index-view",n),e.view[s.data("index")]["index-view"]=n}),e._createTableHeader(),e._draw())}),n.on(c.events.click,"input[type=checkbox]",function(){var n=t(this),s=n.is(":checked"),i=n.val(),a=["cls","clsColumn"];s?t.each(a,function(){var t;t=j.isValue(e.heads[i][this])?j.strToArray(e.heads[i][this]):[],j.arrayDelete(t,"hidden"),e.heads[i][this]=t.join(" "),e.view[i].show=!0}):t.each(a,function(){var t;-1===(t=j.isValue(e.heads[i][this])?j.strToArray(e.heads[i][this]):[]).indexOf("hidden")&&t.push("hidden"),e.heads[i][this]=t.join(" "),e.view[i].show=!1}),e._createTableHeader(),e._draw()}),n.find("input[type=number]").on(c.events.inputchange,function(){var n=t(this),s=n.attr("data-index"),i=parseInt(n.val());e.view[s].size=0===i?"":i,e._createTableHeader()}),n.on(c.events.click,".js-table-inspector-save",function(){e._saveTableView(),e.openInspector(!1)}),n.on(c.events.click,".js-table-inspector-cancel",function(){e.openInspector(!1)}),n.on(c.events.click,".js-table-inspector-reset",function(t){e.resetView()})},_removeInspectorEvents:function(){var e=this.inspector;e.off(c.events.click,".js-table-inspector-field-up"),e.off(c.events.click,".js-table-inspector-field-down"),e.off(c.events.click,"input[type=checkbox]"),e.off(c.events.click,".js-table-inspector-save"),e.off(c.events.click,".js-table-inspector-cancel"),e.off(c.events.click,".js-table-inspector-reset"),e.find("input[type=number]").off(c.events.inputchange)},_saveTableView:function(){var e=this.element,n=this.options,s=this.view,i=e.attr("id");"client"===n.viewSaveMode.toLowerCase()?(c.storage.setItem(n.viewSavePath.replace("$1",i),s),j.exec(n.onViewSave,[n.viewSavePath,s],e[0])):t.post(n.viewSavePath,{id:e.attr("id"),view:s},function(t,i,a){j.exec(n.onViewSave,[n.viewSavePath,s,t,i,a],e[0])})},_info:function(e,t,n){var s,i=this.element,a=this.options,o=i.parent(),r=j.isValue(this.wrapperInfo)?this.wrapperInfo:o.find(".table-info");0!==r.length&&(t>n&&(t=n),0===this.items.length&&(e=t=n=0),s=(s=(s=(s=a.tableInfoTitle).replace("$1",e)).replace("$2",t)).replace("$3",n),r.html(s))},_paging:function(e){var n,s,i,a,o=this,r=this.element,l=this.options,c=r.parent(),d=j.isValue(this.wrapperPagination)?this.wrapperPagination:c.find(".table-pagination");if(d.html(""),a=t("<ul>").addClass("pagination").addClass(l.clsPagination).appendTo(d),0!==this.items.length&&-1!==l.rows){this.pagesCount=Math.ceil(e/l.rows);var h=function(e,n,s){var i,a;return i=t("<li>").addClass("page-item").addClass(n),(a=t("<a>").addClass("page-link").html(e)).data("page",s),a.appendTo(i),i};if(s=h(l.paginationPrevTitle,"service prev-page","prev"),a.append(s),a.append(h(1,1===o.currentPage?"active":"",1)),!0!==l.paginationShortMode||this.pagesCount<=7)for(n=2;n<this.pagesCount;n++)a.append(h(n,n===o.currentPage?"active":"",n));else if(o.currentPage<5){for(n=2;n<=5;n++)a.append(h(n,n===o.currentPage?"active":"",n));this.pagesCount>5&&a.append(h("...","no-link",null))}else if(o.currentPage<=o.pagesCount&&o.currentPage>o.pagesCount-5+1)for(this.pagesCount>5&&a.append(h("...","no-link",null)),n=o.pagesCount-5+1;n<o.pagesCount;n++)a.append(h(n,n===o.currentPage?"active":"",n));else a.append(h("...","no-link",null)),a.append(h(o.currentPage-1,"",o.currentPage-1)),a.append(h(o.currentPage,"active",o.currentPage)),a.append(h(o.currentPage+1,"",o.currentPage+1)),a.append(h("...","no-link",null));(o.pagesCount>1||o.currentPage<o.pagesCount)&&a.append(h(o.pagesCount,o.currentPage===o.pagesCount?"active":"",o.pagesCount)),i=h(l.paginationNextTitle,"service next-page","next"),a.append(i),1===this.currentPage&&s.addClass("disabled"),this.currentPage===this.pagesCount&&i.addClass("disabled")}},_filter:function(){var e,n,s,i=this,a=this.options,o=this.element,r=-1;return j.isValue(this.filterString)&&i.filterString.length>=a.filterMinLength||this.filters.length>0?((n=this.filterString.split(":")).length>1&&t.each(i.heads,function(e,t){n[0]===t.title.toLowerCase()&&(r=e)}),e=this.items.filter(function(e){var t=(""+(n.length>1&&r>-1?e[r]:e.join())).replace(/[\n\r]+|[\s]{2,}/g," ").trim().toLowerCase(),l=!(j.isValue(i.filterString)&&i.filterString.length>=a.filterMinLength)||~t.indexOf(n.length>1?n[1]:n[0]);if(!0===l&&i.filters.length>0)for(s=0;s<i.filters.length;s++)if(j.isValue(i.filters[s])&&!0!==j.exec(i.filters[s],[e,i.heads])){l=!1;break}return l?j.exec(a.onFilterRowAccepted,[e],o[0]):j.exec(a.onFilterRowDeclined,[e],o[0]),l}),j.exec(a.onSearch,[i.filterString,e],o[0])):e=this.items,this.filteredItems=e,e},_draw:function(e){var n,s,i=this,a=this.element,o=this.options,r=a.find("tbody"),l=-1===parseInt(o.rows)?0:o.rows*(this.currentPage-1),d=-1===parseInt(o.rows)?this.items.length-1:l+o.rows-1,h=c.storage.getItem(o.checkStoreKey.replace("$1",a.attr("id"))),u=this.view;for(r.html(""),s=this._filter(),n=l;n<=d;n++){var p,f,m,v,g=[],C=[];if(j.isValue(s[n])){for(f=t("<tr>").addClass(o.clsBodyRow),m=t("<td>").html(n+1),void 0!==i.service[0].clsColumn&&m.addClass(i.service[0].clsColumn),m.appendTo(f),m=t("<td>"),v="checkbox"===o.checkType?t("<input type='checkbox' data-role='checkbox' name='"+(j.isValue(o.checkName)?o.checkName:"table_row_check")+"[]' value='"+s[n][o.checkColIndex]+"'>"):t("<input type='radio' data-role='radio' name='"+(j.isValue(o.checkName)?o.checkName:"table_row_check")+"' value='"+s[n][o.checkColIndex]+"'>"),j.isValue(h)&&Array.isArray(h)&&h.indexOf(""+s[n][o.checkColIndex])>-1&&v.prop("checked",!0),v.addClass("table-service-check"),j.exec(o.onCheckDraw,[v],v[0]),v.appendTo(m),void 0!==i.service[1].clsColumn&&m.addClass(i.service[1].clsColumn),m.appendTo(f),g=s[n],p=0;p<g.length;p++)C[p]=null;for(t.each(g,function(e){!0===o.cellWrapper?(m=t("<td>"),t("<div>").addClass("cell-wrapper").html(this).appendTo(m)):m=t("<td>").html(this),m.addClass(o.clsBodyCell),j.isValue(i.heads[e].clsColumn)&&m.addClass(i.heads[e].clsColumn),!1===j.bool(u[e].show)&&m.addClass("hidden"),j.bool(u[e].show)&&m.removeClass("hidden"),C[u[e]["index-view"]]=m,j.exec(o.onDrawCell,[m,this,e,i.heads[e]],m[0])}),p=0;p<g.length;p++)C[p].appendTo(f),j.exec(o.onAppendCell,[C[p],f,p,a],C[p][0]);j.exec(o.onDrawRow,[f,i.view,i.heads,a],f[0]),f.appendTo(r),j.exec(o.onAppendRow,[f,a],f[0])}}this._info(l+1,d+1,s.length),this._paging(s.length),this.activity&&this.activity.hide(),j.exec(o.onDraw,[a],a[0]),void 0!==e&&j.exec(e,[a],a[0])},_getItemContent:function(e){var t,n=e[this.sort.colIndex],s=this.heads[this.sort.colIndex].format,i=this.heads[this.sort.colIndex].formatMask,a=this.options;if(t=(""+n).toLowerCase().replace(/[\n\r]+|[\s]{2,}/g," ").trim(),j.isValue(s))switch(-1===["number","int","float","money"].indexOf(s)||","===a.thousandSeparator&&"."===a.decimalSeparator||(t=j.parseNumber(t,a.thousandSeparator,a.decimalSeparator)),s){case"date":t=j.isValue(i)?t.toDate(i):new Date(t);break;case"number":t=Number(t);break;case"int":t=parseInt(t);break;case"float":t=parseFloat(t);break;case"money":t=j.parseMoney(t)}return t},draw:function(){return this._draw()},sorting:function(e){var t=this,n=this.element,s=this.options;j.isValue(e)&&(this.sort.dir=e),j.exec(s.onSortStart,[this.items],n[0]),this.items.sort(function(e,i){var a=t._getItemContent(e),o=t._getItemContent(i),r=0;return a<o&&(r="asc"===t.sort.dir?-1:1),a>o&&(r="asc"===t.sort.dir?1:-1),0!==r&&j.exec(s.onSortItemSwitch,[e,i,r],n[0]),r}),j.exec(s.onSortStop,[this.items],n[0])},filter:function(e){this.filterString=e.trim().toLowerCase(),this.currentPage=1,this._draw()},loadData:function(e,n){var s,i=this,a=this.element,o=this.options,r=!1;function l(){!0===n&&(i.view=i._createView()),i._createTableHeader(),i._createTableBody(),i._createTableFooter(),i.heads.length>0&&t.each(i.heads,function(e){!r&&["asc","desc"].indexOf(this.sortDir)>-1&&(r=!0,i.sort.colIndex=e,i.sort.dir=this.sortDir)}),r&&(s=a.find(".sortable-column"),i._resetSortClass(s),t(s.get(i.sort.colIndex)).addClass("sort-"+i.sort.dir),i.sorting()),i.currentPage=1,i._draw()}a.html(""),j.isValue(e)?(o.source=e,j.exec(o.onDataLoad,[o.source],a[0]),t.get(o.source,function(e){i.items=[],i.heads=[],i.foots=[],i._createItemsFromJSON(e),l(),j.exec(o.onDataLoaded,[o.source,e],a[0])}).fail(function(e,t,n){console.log(t),console.log(e),console.log(n)})):l()},reload:function(e){this.loadData(this.options.source,e)},next:function(){0!==this.items.length&&(this.currentPage++,this.currentPage>this.pagesCount?this.currentPage=this.pagesCount:this._draw())},prev:function(){0!==this.items.length&&(this.currentPage--,0!==this.currentPage?this._draw():this.currentPage=1)},first:function(){0!==this.items.length&&(this.currentPage=1,this._draw())},last:function(){0!==this.items.length&&(this.currentPage=this.pagesCount,this._draw())},page:function(e){e<=0&&(e=1),e>this.pagesCount&&(e=this.pagesCount),this.currentPage=e,this._draw()},addFilter:function(e,t){var n=j.isFunc(e);if(!1!==n)return this.filters.push(n),!0===t&&(this.currentPage=1,this.draw()),this.filters.length-1},removeFilter:function(e,t){return this.filters[e]=null,!0===t&&(this.currentPage=1,this.draw()),this},removeFilters:function(e){this.filters=[],!0===e&&(this.currentPage=1,this.draw())},getItems:function(){return this.items},getHeads:function(){return this.heads},getView:function(){return this.view},getFilteredItems:function(){return this.filteredItems.length>0?this.filteredItems:this.items},getSelectedItems:function(){var e=this.element,n=this.options,s=c.storage.getItem(n.checkStoreKey.replace("$1",e.attr("id"))),i=[];return j.isValue(s)?(t.each(this.items,function(){-1!==s.indexOf(""+this[n.checkColIndex])&&i.push(this)}),i):[]},getStoredKeys:function(){var e=this.element,t=this.options;return c.storage.getItem(t.checkStoreKey.replace("$1",e.attr("id")),[])},clearSelected:function(e){var t=this.element,n=this.options;c.storage.setItem(n.checkStoreKey.replace("$1",t.attr("id")),[]),t.find("table-service-check-all input").prop("checked",!1),!0===e&&this._draw()},getFilters:function(){return this.filters},getFilterIndex:function(){return this.filterIndex},getFiltersIndexes:function(){return this.filtersIndexes},openInspector:function(e){this.inspector[e?"addClass":"removeClass"]("open")},toggleInspector:function(){this.inspector.toggleClass("open")},resetView:function(){this.view=this._createView(),this._createTableHeader(),this._createTableFooter(),this._draw(),this._resetInspector(),this._saveTableView()},export:function(e,n,s,i){var a,o,r,l,c,d,h,p,f=this,m=this.options,v=document.createElement("table"),g=t("<thead>").appendTo(v),C=t("<tbody>").appendTo(v),b=[];for(n=j.isValue(n)?n.toLowerCase():"all-filtered",s=j.isValue(s)?s:j.elementId("table")+"-export.csv",c=t("<tr>"),r=this.heads,o=0;o<r.length;o++)b[o]=null;for(t.each(r,function(e){!1!==j.bool(f.view[e].show)&&(d=t("<th>"),j.isValue(this.title)&&d.html(this.title),b[f.view[e]["index-view"]]=d)}),o=0;o<r.length;o++)j.isValue(b[o])&&b[o].appendTo(c);for(c.appendTo(g),"checked"===n?(h=0,p=(l=this.getSelectedItems()).length-1):"view"===n?(l=this._filter(),h=-1===parseInt(m.rows)?0:m.rows*(this.currentPage-1),p=-1===parseInt(m.rows)?l.length-1:h+m.rows-1):"all"===n?(h=0,p=(l=this.items).length-1):(h=0,p=(l=this._filter()).length-1),a=h;a<=p;a++)if(j.isValue(l[a])){for(c=t("<tr>"),r=l[a],o=0;o<r.length;o++)b[o]=null;for(t.each(r,function(e){!1!==j.bool(f.view[e].show)&&(d=t("<td>").html(this),b[f.view[e]["index-view"]]=d)}),o=0;o<r.length;o++)j.isValue(b[o])&&b[o].appendTo(c);c.appendTo(C)}u.tableToCSV(v,s,i),v.remove()},changeAttribute:function(e){}};c.plugin("table",Re);var Be={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._targets=[],this._setOptionsFromDOM(),this._create(),j.exec(this.options.onTabsCreate,[this.element],this.elem),this},options:{expand:null,tabsPosition:"top",clsTabs:"",clsTabsList:"",clsTabsListItem:"",onTab:c.noop,onBeforeTab:c.noop_true,onTabsCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,n=(this.options,e.find(".active").length>0?t(e.find(".active")[0]):void 0);this._createStructure(),this._createEvents(),this._open(n)},_createStructure:function(){var e,n,s=this.element,i=this.options,a=(s.prev(),s.parent()),o=a.hasClass("tabs"),r=o?a:t("<div>").addClass("tabs tabs-wrapper");if(j.isValue(i.expand)&&r.addClass("tabs-expand-"+i.expand),r.addClass(i.tabsPosition.replace(["-","_","+"]," ")),i.tabsPosition.contains("vertical")&&r.addClass("tabs-expand-fs"),s.addClass("tabs-list"),o||(r.insertBefore(s),s.appendTo(r)),s.data("expanded",!1),e=t("<div>").addClass("expand-title"),r.prepend(e),0===(n=r.find(".hamburger")).length){n=t("<button>").attr("type","button").addClass("hamburger menu-down").appendTo(r);for(var l=0;l<3;l++)t("<span>").addClass("line").appendTo(n);!0===h.isLight(j.computedRgbToHex(j.getStyleOne(r,"background-color")))&&n.addClass("dark")}r.addClass(i.clsTabs),s.addClass(i.clsTabsList),s.children("li").addClass(i.clsTabsListItem)},_createEvents:function(){var e=this,n=this.element,s=this.options,i=n.parent();i.on(c.events.click,".hamburger, .expand-title",function(){!1===n.data("expanded")?(n.addClass("expand"),n.data("expanded",!0),i.find(".hamburger").addClass("active")):(n.removeClass("expand"),n.data("expanded",!1),i.find(".hamburger").removeClass("active"))}),n.on(c.events.click,"a",function(a){var o=t(this),r=o.attr("href"),l=o.parent("li");if(!0===n.data("expanded")&&(n.removeClass("expand"),n.data("expanded",!1),i.find(".hamburger").removeClass("active")),!0!==j.exec(s.onBeforeTab,[l,n],l[0]))return!1;j.isUrl(r)||(e._open(l),a.preventDefault())})},_collectTargets:function(){var e=this,n=this.element.find("li");t.each(n,function(){var n=t(this).find("a").attr("href").trim();n.length>1&&"#"===n[0]&&e._targets.push(n)})},_open:function(e){var n=this.element,s=this.options,i=n.find("li"),a=n.siblings(".expand-title");if(0!==i.length){this._collectTargets(),void 0===e&&(e=t(i[0]));var o=e.find("a").attr("href");void 0!==o&&(i.removeClass("active"),e.parent().hasClass("d-menu")?e.parent().parent().addClass("active"):e.addClass("active"),t.each(this._targets,function(){var e=t(this);e.length>0&&e.hide()}),"#"!==o&&t(o).show(),a.html(e.find("a").html()),j.exec(s.onTab,[e,n]))}},changeAttribute:function(e){}};c.plugin("tabs",Be);var He={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),j.exec(this.options.onTextareaCreate,[this.element]),this},options:{prepend:"",copyInlineStyles:!0,clearButton:!0,clearButtonIcon:"<span class='default-icon-cross'></span>",autoSize:!1,disabled:!1,onTextareaCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,n=this.element,s=this.options,i=n.prev(),a=n.parent(),o=t("<div>").addClass("textarea "+n[0].className);0===i.length?a.prepend(o):o.insertAfter(i),!1!==s.clearButton&&((e=t("<button>").addClass("button input-clear-button").attr("tabindex",-1).attr("type","button").html(s.clearButtonIcon)).on(c.events.click,function(){n.val("").trigger("change").trigger("keyup").focus()}),e.appendTo(o)),n.appendTo(o);var r=function(){n[0].style.cssText="height:auto;",n[0].style.cssText="height:"+n[0].scrollHeight+"px"};(s.autoSize&&(o.addClass("autosize"),setTimeout(function(){null,r()},0),n.on(c.events.keyup,r),n.on(c.events.keydown,r),n.on(c.events.change,r),n.on(c.events.focus,r),n.on(c.events.cut,r),n.on(c.events.paste,r),n.on(c.events.drop,r)),"rtl"===n.attr("dir")&&o.addClass("rtl").attr("dir","rtl"),""!==s.prepend)&&(j.isTag(s.prepend)?t(s.prepend):t("<span>"+s.prepend+"</span>")).addClass("prepend").addClass(s.clsPrepend).appendTo(o);if(n[0].className="",!0===s.copyInlineStyles)for(var l=0,d=n[0].style.length;l<d;l++)o.css(n[0].style[l],n.css(n[0].style[l]));n.on(c.events.blur,function(){o.removeClass("focused")}),n.on(c.events.focus,function(){o.addClass("focused")}),!0===s.disabled||n.is(":disabled")?this.disable():this.enable()},disable:function(){this.element.data("disabled",!0),this.element.parent().addClass("disabled")},enable:function(){this.element.data("disabled",!1),this.element.parent().removeClass("disabled")},toggleState:function(){!1===this.element.data("disabled")?this.disable():this.enable()},changeAttribute:function(e){switch(e){case"disabled":this.toggleState()}}};c.plugin("textarea",He);var Le={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.effectInterval=!1,this.images=[],this.slides=[],this.currentSlide=-1,this.unload=!1,this._setOptionsFromDOM(),this._create(),this},options:{size:"medium",cover:"",effect:"",effectInterval:3e3,effectDuration:500,target:null,canTransform:!0,onClick:c.noop,onTileCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this._createTile(),this._createEvents(),j.exec(t.onTileCreate,[e])},_createTile:function(){function e(e,t){setTimeout(function(){e.fadeOut(500,function(){e.css("background-image","url("+t+")"),e.fadeIn()})},j.random(0,1e3))}var n=this,s=this.element,i=this.options,a=s.find(".slide"),o=s.find(".slide-front, .slide-back");s.addClass("tile-"+i.size),i.effect.indexOf("hover-")>-1&&(s.addClass("effect-"+i.effect),t.each(o,function(){var e=t(this);void 0!==e.data("cover")&&n._setCover(e,e.data("cover"))})),i.effect.indexOf("animate-")>-1&&a.length>1&&(t.each(a,function(e){var s=t(this);n.slides.push(this),void 0!==s.data("cover")&&n._setCover(s,s.data("cover")),e>0&&(["animate-slide-up","animate-slide-down"].indexOf(i.effect)>-1&&s.css("top","100%"),["animate-slide-left","animate-slide-right"].indexOf(i.effect)>-1&&s.css("left","100%"),["animate-fade"].indexOf(i.effect)>-1&&s.css("opacity",0))}),this.currentSlide=0,this._runEffects()),""!==i.cover&&this._setCover(s,i.cover),"image-set"===i.effect&&(s.addClass("image-set"),t.each(s.children("img"),function(){var e=t(this),i=this.src,a=t("<div>").addClass("img");e.hasClass("icon")||(n.images.push(this),a.css("background-image","url("+i+")"),s.prepend(a),e.remove())}),setInterval(function(){for(var i=n.images.slice(),a=0;a<s.find(".img").length;a++){var o=j.random(0,i.length-1);e(t(s.find(".img").get(a)),i[o].src),i.splice(o,1)}},3e3))},_runEffects:function(){var e=this,n=this.options;!1===this.effectInterval&&(this.effectInterval=setInterval(function(){var s,i;s=t(e.slides[e.currentSlide]),e.currentSlide++,e.currentSlide===e.slides.length&&(e.currentSlide=0),i=e.slides[e.currentSlide],"animate-slide-up"===n.effect&&d.slideUp(t(s),t(i),n.effectDuration),"animate-slide-down"===n.effect&&d.slideDown(t(s),t(i),n.effectDuration),"animate-slide-left"===n.effect&&d.slideLeft(t(s),t(i),n.effectDuration),"animate-slide-right"===n.effect&&d.slideRight(t(s),t(i),n.effectDuration),"animate-fade"===n.effect&&d.fade(t(s),t(i),n.effectDuration)},n.effectInterval))},_stopEffects:function(){clearInterval(this.effectInterval),this.effectInterval=!1},_setCover:function(e,t){e.css({backgroundImage:"url("+t+")",backgroundSize:"cover",backgroundRepeat:"no-repeat"})},_createEvents:function(){var e=this,n=this.element,s=this.options;n.on(c.events.start,function(e){var i,a=t(this),o=n.width(),r=n.height(),l=j.pageXY(e).x-a.offset().left,c=j.pageXY(e).y-a.offset().top;!1===j.isRightMouse(e)&&(i=l<1*o/3&&(c<1*r/2||c>1*r/2)?"left":l>2*o/3&&(c<1*r/2||c>1*r/2)?"right":l>1*o/3&&l<2*o/3&&c>r/2?"bottom":"top",!0===s.canTransform&&a.addClass("transform-"+i),null!==s.target&&setTimeout(function(){document.location.href=s.target},100),j.exec(s.onClick,[a]))}),n.on([c.events.stop,c.events.leave].join(" "),function(e){t(this).removeClass("transform-left").removeClass("transform-right").removeClass("transform-top").removeClass("transform-bottom")}),t(window).on(c.events.blur,function(){e._stopEffects()}),t(window).on(c.events.focus,function(){e._runEffects()})},changeAttribute:function(e){}};c.plugin("tile",Le);var ze={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.picker=null,this.isOpen=!1,this.value=[],this.locale=c.locales[METRO_LOCALE].calendar,this._setOptionsFromDOM(),this._create(),this},options:{hoursStep:1,minutesStep:1,secondsStep:1,value:null,locale:METRO_LOCALE,distance:3,hours:!0,minutes:!0,seconds:!0,showLabels:!0,scrollSpeed:5,copyInlineStyles:!0,clsPicker:"",clsPart:"",clsHours:"",clsMinutes:"",clsSeconds:"",okButtonIcon:"<span class='default-icon-check'></span>",cancelButtonIcon:"<span class='default-icon-cross'></span>",onSet:c.noop,onOpen:c.noop,onClose:c.noop,onScroll:c.noop,onTimePickerCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,t=this.element,n=this.options,s=this.picker;for(n.distance<1&&(n.distance=1),n.hoursStep<1&&(n.hoursStep=1),n.hoursStep>23&&(n.hoursStep=23),n.minutesStep<1&&(n.minutesStep=1),n.minutesStep>59&&(n.minutesStep=59),n.secondsStep<1&&(n.secondsStep=1),n.secondsStep>59&&(n.secondsStep=59),""!==t.val()||j.isValue(n.value)||(n.value=(new Date).format("%H:%M:%S")),this.value=j.strToArray(""!==t.val()?t.val():String(n.value),":"),e=0;e<3;e++)void 0===this.value[e]||null===this.value[e]?this.value[e]=0:this.value[e]=parseInt(this.value[e]);this._normalizeValue(),void 0===c.locales[n.locale]&&(n.locale=METRO_LOCALE),this.locale=c.locales[n.locale].calendar,this._createStructure(),this._createEvents(),this._set(),j.exec(n.onTimePickerCreate,[t,s])},_normalizeValue:function(){var e=this.options;e.hoursStep>1&&(this.value[0]=j.nearest(this.value[0],e.hoursStep,!0)),e.minutesStep>1&&(this.value[1]=j.nearest(this.value[1],e.minutesStep,!0)),e.minutesStep>1&&(this.value[2]=j.nearest(this.value[2],e.secondsStep,!0))},_createStructure:function(){var e,n,s,i,a,o,r,l,c,d=this.element,h=this.options,u=d.prev(),p=d.parent(),f=j.elementId("time-picker");if(e=t("<div>").attr("id",f).addClass("wheel-picker time-picker "+d[0].className).addClass(h.clsPicker),0===u.length?p.prepend(e):e.insertAfter(u),d.attr("readonly",!0).appendTo(e),o=t("<div>").addClass("time-wrapper").appendTo(e),!0===h.hours&&(n=t("<div>").attr("data-title",this.locale.time.hours).addClass("hours").addClass(h.clsPart).addClass(h.clsHours).appendTo(o)),!0===h.minutes&&(s=t("<div>").attr("data-title",this.locale.time.minutes).addClass("minutes").addClass(h.clsPart).addClass(h.clsMinutes).appendTo(o)),!0===h.seconds&&(i=t("<div>").attr("data-title",this.locale.time.seconds).addClass("seconds").addClass(h.clsPart).addClass(h.clsSeconds).appendTo(o)),r=t("<div>").addClass("select-wrapper").appendTo(e),l=t("<div>").addClass("select-block").appendTo(r),!0===h.hours){for(n=t("<ul>").addClass("sel-hours").appendTo(l),a=0;a<h.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(n);for(a=0;a<24;a+=h.hoursStep)t("<li>").addClass("js-hours-"+a).html(a<10?"0"+a:a).data("value",a).appendTo(n);for(a=0;a<h.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(n)}if(!0===h.minutes){for(s=t("<ul>").addClass("sel-minutes").appendTo(l),a=0;a<h.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(s);for(a=0;a<60;a+=h.minutesStep)t("<li>").addClass("js-minutes-"+a).html(a<10?"0"+a:a).data("value",a).appendTo(s);for(a=0;a<h.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(s)}if(!0===h.seconds){for(i=t("<ul>").addClass("sel-seconds").appendTo(l),a=0;a<h.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(i);for(a=0;a<60;a+=h.secondsStep)t("<li>").addClass("js-seconds-"+a).html(a<10?"0"+a:a).data("value",a).appendTo(i);for(a=0;a<h.distance;a++)t("<li>").html("&nbsp;").data("value",-1).appendTo(i)}if(l.height(40*(2*h.distance+1)),c=t("<div>").addClass("action-block").appendTo(r),t("<button>").attr("type","button").addClass("button action-ok").html(h.okButtonIcon).appendTo(c),t("<button>").attr("type","button").addClass("button action-cancel").html(h.cancelButtonIcon).appendTo(c),d[0].className="",!0===h.copyInlineStyles)for(a=0;a<d[0].style.length;a++)e.css(d[0].style[a],d.css(d[0].style[a]));!0===h.showLabels&&e.addClass("show-labels"),this.picker=e},_createEvents:function(){var e=this,n=(this.element,this.options),s=this.picker;s.on(c.events.start,".select-block ul",function(e){if(!e.changedTouches){var s=this,i=j.pageXY(e).y;t(document).on(c.events.move+"-picker",function(e){s.scrollTop-=n.scrollSpeed*(i>j.pageXY(e).y?-1:1),i=j.pageXY(e).y}),t(document).on(c.events.stop+"-picker",function(e){t(document).off(c.events.move+"-picker"),t(document).off(c.events.stop+"-picker")})}}),s.on(c.events.click,function(t){!1===e.isOpen&&e.open(),t.stopPropagation()}),s.on(c.events.click,".action-ok",function(t){var n,i,a,o=s.find(".sel-hours li.active"),r=s.find(".sel-minutes li.active"),l=s.find(".sel-seconds li.active");n=0===o.length?0:o.data("value"),i=0===r.length?0:r.data("value"),a=0===l.length?0:l.data("value"),e.value=[n,i,a],e._normalizeValue(),e._set(),e.close(),t.stopPropagation()}),s.on(c.events.click,".action-cancel",function(t){e.close(),t.stopPropagation()}),this._addScrollEvents()},_addScrollEvents:function(){var e=this.picker,n=this.options;t.each(["hours","minutes","seconds"],function(){var t=e.find(".sel-"+this);0!==t.length&&(t.on(c.events.scrollStart,function(){t.find(".active").removeClass("active")}),t.on(c.events.scrollStop,{latency:50},function(){var s=Math.round(Math.ceil(t.scrollTop()+40)/40),i=t.find("li").eq(s+n.distance-1),a=i.position().top-40*n.distance+t.scrollTop();t.animate({scrollTop:a},100,function(){i.addClass("active"),j.exec(n.onScroll,[i,t,e])})}))})},_removeScrollEvents:function(){var e=this.picker;t.each(["hours","minutes","seconds"],function(){e.find(".sel-"+this).off("scrollstart scrollstop")})},_set:function(){var e=this.element,t=this.options,n=this.picker,s="00",i="00",a="00";!0===t.hours&&((s=this.value[0])<10&&(s="0"+s),n.find(".hours").html(s)),!0===t.minutes&&((i=this.value[1])<10&&(i="0"+i),n.find(".minutes").html(i)),!0===t.seconds&&((a=this.value[2])<10&&(a="0"+a),n.find(".seconds").html(a)),e.val([s,i,a].join(":")).trigger("change"),j.exec(t.onSet,[this.value,e.val(),e,n])},open:function(){var e,t,n,s,i,a,o,r,l=this.element,c=this.options,d=this.picker,h=d.find("li"),u=d.find(".select-wrapper");u.parent().removeClass("for-top for-bottom"),u.show(),h.removeClass("active"),o=j.inViewport(u),r=j.rect(u),!o&&r.top>0&&u.parent().addClass("for-bottom"),!o&&r.top<0&&u.parent().addClass("for-top");var p=function(e,t){e.scrollTop(0).animate({scrollTop:t.position().top-40*c.distance+e.scrollTop()},100)};!0===c.hours&&(e=parseInt(this.value[0]),p(s=d.find(".sel-hours"),s.find("li.js-hours-"+e).addClass("active"))),!0===c.minutes&&(t=parseInt(this.value[1]),p(i=d.find(".sel-minutes"),i.find("li.js-minutes-"+t).addClass("active"))),!0===c.seconds&&(n=parseInt(this.value[2]),p(a=d.find(".sel-seconds"),a.find("li.js-seconds-"+n).addClass("active"))),this.isOpen=!0,j.exec(c.onOpen,[this.value,l,d])},close:function(){var e=this.picker,t=this.options,n=this.element;e.find(".select-wrapper").hide(),this.isOpen=!1,j.exec(t.onClose,[this.value,n,e])},_convert:function(e){return Array.isArray(e)?e:"function"==typeof e.getMonth?[e.getHours(),e.getMinutes(),e.getSeconds()]:j.isObject(e)?[e.h,e.m,e.s]:j.strToArray(e,":")},val:function(e){if(void 0===e)return this.element.val();this.value=this._convert(e),this._normalizeValue(),this._set()},time:function(e){if(void 0===e)return{h:this.value[0],m:this.value[1],s:this.value[2]};this.value=this._convert(e),this._normalizeValue(),this._set()},date:function(e){if(void 0===e||"function"!=typeof e.getMonth){var t=new Date;return t.setHours(this.value[0]),t.setMinutes(this.value[1]),t.setSeconds(this.value[2]),t.setMilliseconds(0),t}this.value=this._convert(e),this._normalizeValue(),this._set()},changeAttribute:function(e){var t=this,n=this.element;switch(e){case"data-value":t.val(n.attr("data-value"))}}};c.plugin("timepicker",ze),t(document).on(c.events.click,function(e){t.each(t(".time-picker"),function(){t(this).find("input").data("timepicker").close()})});var Ve={create:function(e,n,s,i){var a=t("<div>").addClass("toast").html(e).appendTo(t("body")).hide(),o=a.outerWidth();s=s||METRO_TIMEOUT,a.css({left:"50%","margin-left":-o/2}).addClass(i).fadeIn(METRO_ANIMATION_DURATION),setTimeout(function(){null,a.fadeOut(METRO_ANIMATION_DURATION,function(){a.remove(),j.callback(n)})},s)}};c.toast=Ve;var je={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),this},options:{effect:"slide",duration:100,onNodeClick:c.noop,onNodeDblClick:c.noop,onNodeDelete:c.noop,onNodeInsert:c.noop,onNodeClean:c.noop,onCheckClick:c.noop,onRadioClick:c.noop,onExpandNode:c.noop,onCollapseNode:c.noop,onTreeviewCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this,n=this.element,s=this.options;this._createTree(),this._createEvents(),t.each(n.find("input"),function(){t(this).is(":checked")&&e._recheck(this)}),j.exec(s.onTreeviewCreate,[n])},_createIcon:function(e){var n,s;return s=j.isTag(e)?t(e):t("<img>").attr("src",e),(n=t("<span>").addClass("icon")).html(s),n},_createCaption:function(e){return t("<span>").addClass("caption").html(e)},_createToggle:function(){return t("<span>").addClass("node-toggle")},_createNode:function(e){var n;return n=t("<li>"),void 0!==e.caption&&n.prepend(this._createCaption(e.caption)),void 0!==e.icon&&n.prepend(this._createIcon(e.icon)),void 0!==e.html&&n.append(e.html),n},_createTree:function(){var e=this,n=this.element,s=(this.options,n.find("li"));n.addClass("treeview"),t.each(s,function(){var n=t(this);void 0!==n.data("caption")&&n.prepend(e._createCaption(n.data("caption"))),void 0!==n.data("icon")&&n.prepend(e._createIcon(n.data("icon"))),n.children("ul").length>0&&(n.append(e._createToggle()),!0!==n.data("collapsed")?n.addClass("expanded"):n.children("ul").hide())})},_createEvents:function(){var e=this,n=this.element,s=this.options;n.on(c.events.click,".node-toggle",function(n){var s=t(this).parent();e.toggleNode(s),n.preventDefault()}),n.on(c.events.click,"li > .caption",function(i){var a=t(this).parent();e.current(a),j.exec(s.onNodeClick,[a,n]),i.preventDefault()}),n.on(c.events.dblclick,"li > .caption",function(i){var a=t(this).closest("li"),o=a.children(".node-toggle"),r=a.children("ul");(o.length>0||r.length>0)&&e.toggleNode(a),j.exec(s.onNodeDblClick,[a,n]),i.preventDefault()}),n.on(c.events.click,"input[type=radio]",function(i){var a=t(this),o=a.is(":checked"),r=a.closest("li");e.current(r),j.exec(s.onRadioClick,[o,a,r,n])}),n.on(c.events.click,"input[type=checkbox]",function(i){var a=t(this),o=a.is(":checked"),r=a.closest("li");e._recheck(a),j.exec(s.onCheckClick,[o,a,r,n],this)})},_recheck:function(e){var n,s,i,a=this.element;j.isJQueryObject(e)||(e=t(e)),n=e.is(":checked"),s=e.closest("li"),this.current(s),(i=e.closest("li").find("ul input[type=checkbox]")).attr("data-indeterminate",!1),i.prop("checked",n),i=[],t.each(a.find(":checkbox"),function(){i.push(this)}),t.each(i.reverse(),function(){var e=t(this),n=e.closest("li").children("ul").find(":checkbox").length,s=e.closest("li").children("ul").find(":checkbox:checked").length;n>0&&0===s&&(e.attr("data-indeterminate",!1),e.prop("checked",!1)),0===s?e.attr("data-indeterminate",!1):s>0&&n>s?e.attr("data-indeterminate",!0):n===s&&(e.attr("data-indeterminate",!1),e.prop("checked",!0))})},current:function(e){var t=this.element;this.options;if(void 0===e)return t.find("li.current");t.find("li").removeClass("current"),e.addClass("current")},toggleNode:function(e){var t,n=this.element,s=this.options;e.toggleClass("expanded"),"slide"===s.effect?(t=!0!==e.hasClass("expanded")?"slideUp":"slideDown",j.exec(s.onCollapseNode,[e,n])):(t=!0!==e.hasClass("expanded")?"fadeOut":"fadeIn",j.exec(s.onExpandNode,[e,n])),e.children("ul")[t](s.duration)},addTo:function(e,n){var s,i,a=this.element,o=this.options;return null===e?s=a:0===(s=e.children("ul")).length&&(s=t("<ul>").appendTo(e),this._createToggle().appendTo(e),e.addClass("expanded")),(i=this._createNode(n)).appendTo(s),j.exec(o.onNodeInsert,[i,a]),i},insertBefore:function(e,t){var n=this.element,s=this.options,i=this._createNode(t);return i.insertBefore(e),j.exec(s.onNodeInsert,[i,n]),i},insertAfter:function(e,t){var n=this.element,s=this.options,i=this._createNode(t);return i.insertAfter(e),j.exec(s.onNodeInsert,[i,n]),i},del:function(e){var t=this.element,n=this.options,s=e.closest("ul"),i=s.closest("li");e.remove(),0!==s.children().length||s.is(t)||(s.remove(),i.removeClass("expanded"),i.children(".node-toggle").remove()),j.exec(n.onNodeDelete,[e,t])},clean:function(e){var t=this.element,n=this.options;e.children("ul").remove(),e.removeClass("expanded"),e.children(".node-toggle").remove(),j.exec(n.onNodeClean,[e,t])},changeAttribute:function(e){}};c.plugin("treeview",je);var Ye={required:function(e){return j.isValue(e.trim())},length:function(e,t){return!(!j.isValue(t)||isNaN(t)||t<=0)&&e.trim().length===parseInt(t)},minlength:function(e,t){return!(!j.isValue(t)||isNaN(t)||t<=0)&&e.trim().length>=parseInt(t)},maxlength:function(e,t){return!(!j.isValue(t)||isNaN(t)||t<=0)&&e.trim().length<=parseInt(t)},min:function(e,t){return!(!j.isValue(t)||isNaN(t))&&(!!this.number(e)&&(!isNaN(e)&&Number(e)>=Number(t)))},max:function(e,t){return!(!j.isValue(t)||isNaN(t))&&(!!this.number(e)&&(!isNaN(e)&&Number(e)<=Number(t)))},email:function(e){return/^[a-z0-9\u007F-\uffff!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9\u007F-\uffff!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/i.test(e)},domain:function(e){return/^((xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/.test(e)},url:function(e){return/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e)},date:function(e){return"Invalid Date"!==new Date(e)&&!isNaN(new Date(e))},number:function(e){return!isNaN(e)},integer:function(e){return j.isInt(e)},float:function(e){return j.isFloat(e)},digits:function(e){return/^\d+$/.test(e)},hexcolor:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},color:function(e){return!1!==h.color(e,h.PALETTES.STANDARD)},pattern:function(e,t){return!!j.isValue(t)&&new RegExp(t).test(e)},compare:function(e,t){return e===t},not:function(e,t){return e!==t},custom:function(e,t){return!1!==j.isFunc(t)&&j.exec(t,[e])},is_control:function(e){return e.parent().hasClass("input")||e.parent().hasClass("select")||e.parent().hasClass("textarea")||e.parent().hasClass("checkbox")||e.parent().hasClass("switch")||e.parent().hasClass("radio")},reset_state:function(e){var n=!1===j.isJQueryObject(e)?t(e):e;Ye.is_control(n)?n.parent().removeClass("invalid valid"):n.removeClass("invalid valid")},set_valid_state:function(e){!1===j.isJQueryObject(e)&&(e=t(e)),Ye.is_control(e)?e.parent().addClass("valid"):e.addClass("valid")},set_invalid_state:function(e){!1===j.isJQueryObject(e)&&(e=t(e)),Ye.is_control(e)?e.parent().addClass("invalid"):e.addClass("invalid")},reset:function(e){var n=this;return t.each(t(e).find("[data-validate]"),function(){n.reset_state(this)}),this},validate:function(e,n,s,i,a){var o=!0,r=t(e),l=(Ye.is_control(r),void 0!==r.data("validate")?String(r.data("validate")).split(" ").map(function(e){return e.trim()}):[]),c=[];l.indexOf("required");if(0===l.length)return!0;if(this.reset_state(r),r.attr("type")&&"checkbox"===r.attr("type").toLowerCase())!1===(o=-1===l.indexOf("required")||r.is(":checked"))&&c.push("required"),void 0!==n&&(n.val+=o?0:1);else if(r.attr("type")&&"radio"===r.attr("type").toLowerCase()){void 0===r.attr("name")&&(o=!0);var d="input[name="+r.attr("name")+"]:checked";o=t(d).length>0,void 0!==n&&(n.val+=o?0:1)}else t.each(l,function(){if(!1!==o){var e,t,s=this.split("=");e=s[0],s.shift(),t=s.join("="),"compare"===e&&(t=r[0].form.elements[t].value),!1===(o=!1===j.isFunc(Ye[e])||(!0===a||"required"===e?Ye[e](r.val(),t):""===r.val().trim()||Ye[e](r.val(),t)))&&c.push(e),void 0!==n&&(n.val+=o?0:1)}});return!1===o?(this.set_invalid_state(r),void 0!==n&&n.log.push({input:r[0],name:r.attr("name"),value:r.val(),funcs:l,errors:c}),void 0!==i&&j.exec(i,[r,r.val()],r[0])):(this.set_valid_state(r),void 0!==s&&j.exec(s,[r,r.val()],r[0])),o}};c.validator=Ye;var Je={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._onsubmit=null,this._onreset=null,this._action=null,this.result=[],this._setOptionsFromDOM(),this._create(),this},dependencies:["utils","colors"],options:{submitTimeout:200,interactiveCheck:!1,clearInvalid:0,requiredMode:!0,onBeforeSubmit:c.noop_true,onSubmit:c.noop,onError:c.noop,onValidate:c.noop,onErrorForm:c.noop,onValidateForm:c.noop,onValidatorCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this,n=this.element,s=this.options,i=n.find("[data-validate]");this._action=n[0].action,n.attr("novalidate","novalidate").attr("action","javascript:"),t.each(i,function(){var e=t(this);e.data("validate").indexOf("required")>-1&&(Ye.is_control(e)?e.parent().addClass("required"):e.addClass("required")),!0===s.interactiveCheck&&e.on(c.events.inputchange,function(){Ye.validate(this,void 0,void 0,void 0,s.requiredMode)})}),this._onsubmit=null,this._onreset=null,null!==n[0].onsubmit&&(this._onsubmit=n[0].onsubmit,n[0].onsubmit=null),null!==n[0].onreset&&(this._onreset=n[0].onreset,n[0].onreset=null),n[0].onsubmit=function(){return e._submit()},n[0].onreset=function(){return e._reset()},j.exec(this.options.onValidatorCreate,[n],this.elem)},_reset:function(){Ye.reset(this.element),null!==this._onsubmit&&j.exec(this._onsubmit,null,this.element[0])},_submit:function(){var e=this,n=this.element,s=this.options,i=this.elem,a=n.find("[data-validate]"),o=n.find(":submit").attr("disabled","disabled").addClass("disabled"),r={val:0,log:[]};return t.each(a,function(){Ye.validate(this,r,s.onValidate,s.onError,s.requiredMode)}),o.removeAttr("disabled").removeClass("disabled"),n[0].action=this._action,r.val+=!1===j.exec(s.onBeforeSubmit,[n],this.elem)?1:0,0===r.val?(j.exec(s.onValidateForm,[n],i),setTimeout(function(){j.exec(s.onSubmit,[n],i),null!==e._onsubmit&&j.exec(e._onsubmit,null,i)},s.submitTimeout)):(j.exec(s.onErrorForm,[r.log,n],i),s.clearInvalid>0&&setTimeout(function(){t.each(a,function(){var e=t(this);Ye.is_control(e)?e.parent().removeClass("invalid"):e.removeClass("invalid")})},s.clearInvalid)),0===r.val},changeAttribute:function(e){e}};c.plugin("validator",Je);var Ue={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.fullscreen=!1,this.preloader=null,this.player=null,this.video=n,this.stream=null,this.volume=null,this.volumeBackup=0,this.muted=!1,this.fullScreenInterval=!1,this._setOptionsFromDOM(),this._create(),this},options:{src:null,poster:"",logo:"",logoHeight:32,logoWidth:"auto",logoTarget:"",volume:.5,loop:!1,autoplay:!1,fullScreenMode:c.fullScreenMode.DESKTOP,aspectRatio:c.aspectRatio.HD,controlsHide:3e3,showLoop:!0,showPlay:!0,showStop:!0,showMute:!0,showFull:!0,showStream:!0,showVolume:!0,showInfo:!0,loopIcon:"<span class='default-icon-loop'></span>",stopIcon:"<span class='default-icon-stop'></span>",playIcon:"<span class='default-icon-play'></span>",pauseIcon:"<span class='default-icon-pause'></span>",muteIcon:"<span class='default-icon-mute'></span>",volumeLowIcon:"<span class='default-icon-low-volume'></span>",volumeMediumIcon:"<span class='default-icon-medium-volume'></span>",volumeHighIcon:"<span class='default-icon-high-volume'></span>",screenMoreIcon:"<span class='default-icon-enlarge'></span>",screenLessIcon:"<span class='default-icon-shrink'></span>",onPlay:c.noop,onPause:c.noop,onStop:c.noop,onEnd:c.noop,onMetadata:c.noop,onTime:c.noop,onVideoCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this.video;!1===c.fullScreenEnabled&&(t.fullScreenMode=c.fullScreenMode.WINDOW),this._createPlayer(),this._createControls(),this._createEvents(),this._setAspectRatio(),!0===t.autoplay&&this.play(),j.exec(t.onVideoCreate,[e,this.player])},_createPlayer:function(){var e=this.element,n=this.options,s=this.video,i=e.prev(),a=e.parent(),o=t("<div>").addClass("media-player video-player "+e[0].className),r=t("<div>").addClass("preloader").appendTo(o),l=t("<a>").attr("href",n.logoTarget).addClass("logo").appendTo(o);0===i.length?a.prepend(o):o.insertAfter(i),e.appendTo(o),t.each(["muted","autoplay","controls","height","width","loop","poster","preload"],function(){e.removeAttr(this)}),e.attr("preload","auto"),""!==n.poster&&e.attr("poster",n.poster),s.volume=n.volume,r.activity({type:"cycle",style:"color"}),r.hide(0),this.preloader=r,""!==n.logo&&t("<img>").css({height:n.logoHeight,width:n.logoWidth}).attr("src",n.logo).appendTo(l),null!==n.src&&this._setSource(n.src),e[0].className="",this.player=o},_setSource:function(e){var n=this.element;n.find("source").remove(),n.removeAttr("src"),Array.isArray(e)?t.each(e,function(){void 0!==this.src&&t("<source>").attr("src",this.src).attr("type",void 0!==this.type?this.type:"").appendTo(n)}):n.attr("src",e)},_createControls:function(){var e,n=this,s=this.element,i=this.options,a=this.elem,o=(this.player,t("<div>").addClass("controls").addClass(i.clsControls).insertAfter(s)),r=t("<div>").addClass("stream").appendTo(o),l=t("<input>").addClass("stream-slider ultra-thin cycle-marker").appendTo(r),c=t("<div>").addClass("volume").appendTo(o),d=t("<input>").addClass("volume-slider ultra-thin cycle-marker").appendTo(c),h=t("<div>").addClass("info-box").appendTo(o);!0!==i.showInfo&&h.hide(),l.slider({clsMarker:"bg-red",clsHint:"bg-cyan fg-white",clsComplete:"bg-cyan",hint:!0,onStart:function(){a.paused||a.pause()},onStop:function(e){a.seekable.length>0&&(a.currentTime=(n.duration*e/100).toFixed(0)),a.paused&&a.currentTime>0&&a.play()}}),this.stream=l,!0!==i.showStream&&r.hide(),d.slider({clsMarker:"bg-red",clsHint:"bg-cyan fg-white",hint:!0,value:100*i.volume,onChangeValue:function(e){a.volume=e/100}}),this.volume=d,!0!==i.showVolume&&c.hide(),!0===i.showLoop&&(e=t("<button>").attr("type","button").addClass("button square loop").html(i.loopIcon).appendTo(o)),!0===i.showPlay&&t("<button>").attr("type","button").addClass("button square play").html(i.playIcon).appendTo(o),!0===i.showStop&&t("<button>").attr("type","button").addClass("button square stop").html(i.stopIcon).appendTo(o),!0===i.showMute&&t("<button>").attr("type","button").addClass("button square mute").html(i.muteIcon).appendTo(o),!0===i.showFull&&t("<button>").attr("type","button").addClass("button square full").html(i.screenMoreIcon).appendTo(o),!0===i.loop&&(e.addClass("active"),s.attr("loop","loop")),this._setVolume(),i.muted&&(n.volumeBackup=a.volume,n.volume.data("slider").val(0),a.volume=0),h.html("00:00 / 00:00")},_createEvents:function(){var e=this,n=this.element,s=this.options,i=this.elem,a=this.player;n.on("loadstart",function(){e.preloader.fadeIn()}),n.on("loadedmetadata",function(){e.duration=i.duration.toFixed(0),e._setInfo(0,e.duration),j.exec(s.onMetadata,[i,a])}),n.on("canplay",function(){e._setBuffer(),e.preloader.fadeOut()}),n.on("progress",function(){e._setBuffer()}),n.on("timeupdate",function(){var t=Math.round(100*i.currentTime/e.duration);e._setInfo(i.currentTime,e.duration),e.stream.data("slider").val(t),j.exec(s.onTime,[i.currentTime,e.duration,i,a])}),n.on("waiting",function(){e.preloader.fadeIn()}),n.on("loadeddata",function(){}),n.on("play",function(){a.find(".play").html(s.pauseIcon),j.exec(s.onPlay,[i,a]),e._onMouse()}),n.on("pause",function(){a.find(".play").html(s.playIcon),j.exec(s.onPause,[i,a]),e._offMouse()}),n.on("stop",function(){e.stream.data("slider").val(0),j.exec(s.onStop,[i,a]),e._offMouse()}),n.on("ended",function(){e.stream.data("slider").val(0),j.exec(s.onEnd,[i,a]),e._offMouse()}),n.on("volumechange",function(){e._setVolume()}),a.on(c.events.click,".play",function(t){i.paused?e.play():e.pause()}),a.on(c.events.click,".stop",function(t){e.stop()}),a.on(c.events.click,".mute",function(t){e._toggleMute()}),a.on(c.events.click,".loop",function(){e._toggleLoop()}),a.on(c.events.click,".full",function(n){e.fullscreen=!e.fullscreen,a.find(".full").html(!0===e.fullscreen?s.screenLessIcon:s.screenMoreIcon),s.fullScreenMode===c.fullScreenMode.WINDOW?!0===e.fullscreen?a.addClass("full-screen"):a.removeClass("full-screen"):!0===e.fullscreen?(c.requestFullScreen(i),!1===e.fullScreenInterval&&(e.fullScreenInterval=setInterval(function(){!1===c.inFullScreen()&&(e.fullscreen=!1,clearInterval(e.fullScreenInterval),e.fullScreenInterval=!1,a.find(".full").html(s.screenMoreIcon))},1e3))):c.exitFullScreen(),!0===e.fullscreen?t(document).on(c.events.keyup+"_video",function(e){27===e.keyCode&&a.find(".full").click()}):t(document).off(c.events.keyup+"_video")}),t(window).resize(function(){e._setAspectRatio()})},_onMouse:function(){var e=this.player,t=this.options;t.controlsHide>0&&(e.on(c.events.enter,function(){e.find(".controls").fadeIn()}),e.on(c.events.leave,function(){setTimeout(function(){e.find(".controls").fadeOut()},t.controlsHide)}))},_offMouse:function(){this.player.off(c.events.enter),this.player.off(c.events.leave),this.player.find(".controls").fadeIn()},_toggleLoop:function(){var e=this.player.find(".loop");0!==e.length&&(e.toggleClass("active"),e.hasClass("active")?this.element.attr("loop","loop"):this.element.removeAttr("loop"))},_toggleMute:function(){this.muted=!this.muted,!1===this.muted?(this.video.volume=this.volumeBackup,this.volume.data("slider").val(100*this.volumeBackup)):(this.volumeBackup=this.video.volume,this.volume.data("slider").val(0),this.video.volume=0)},_setInfo:function(e,t){this.player.find(".info-box").html(j.secondsToFormattedString(Math.round(e))+" / "+j.secondsToFormattedString(Math.round(t)))},_setBuffer:function(){var e=this.video.buffered.length?Math.round(Math.floor(this.video.buffered.end(0))/Math.floor(this.video.duration)*100):0;this.stream.data("slider").buff(e)},_setVolume:function(){var e=this.video,t=this.player,n=this.options,s=t.find(".mute"),i=100*e.volume;i>1&&i<30?s.html(n.volumeLowIcon):i>=30&&i<60?s.html(n.volumeMediumIcon):i>=60&&i<=100?s.html(n.volumeHighIcon):s.html(n.muteIcon)},_setAspectRatio:function(){var e,t=this.player,n=this.options,s=t.outerWidth();switch(n.aspectRatio){case c.aspectRatio.SD:e=j.aspectRatioH(s,"4/3");break;case c.aspectRatio.CINEMA:e=j.aspectRatioH(s,"21/9");break;default:e=j.aspectRatioH(s,"16/9")}t.outerHeight(e)},aspectRatio:function(e){this.options.aspectRatio=e,this._setAspectRatio()},play:function(e){void 0!==e&&this._setSource(e),void 0===this.element.attr("src")&&0===this.element.find("source").length||this.video.play()},pause:function(){this.video.pause()},resume:function(){this.video.paused&&this.play()},stop:function(){this.video.pause(),this.video.currentTime=0,this.stream.data("slider").val(0),this._offMouse()},volume:function(e){if(void 0===e)return this.video.volume;e>1&&(e/=100),this.video.volume=e,this.volume.data("slider").val(100*e)},loop:function(){this._toggleLoop()},mute:function(){this._toggleMute()},changeAspectRatio:function(){this.options.aspectRatio=this.element.attr("data-aspect-ratio"),this._setAspectRatio()},changeSource:function(){var e=JSON.parse(this.element.attr("data-src"));this.play(e)},changeVolume:function(){var e=this.element.attr("data-volume");this.volume(e)},changeAttribute:function(e){switch(e){case"data-aspect-ratio":this.changeAspectRatio();break;case"data-src":this.changeSource();break;case"data-volume":this.changeVolume()}}};c.plugin("video",Ue);var We={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this.win=null,this.overlay=null,this._setOptionsFromDOM(),this._create(),j.exec(this.options.onWindowCreate,[this.win,this.element]),this},dependencies:["draggable","resizeable"],options:{width:"auto",height:"auto",btnClose:!0,btnMin:!0,btnMax:!0,clsCaption:"",clsContent:"",clsWindow:"",draggable:!0,dragElement:".window-caption",dragArea:"parent",shadow:!1,icon:"",title:"Window",content:"default",resizable:!0,overlay:!1,overlayColor:"transparent",overlayAlpha:.5,modal:!1,position:"absolute",checkEmbed:!0,top:"auto",left:"auto",place:"auto",closeAction:c.actions.REMOVE,onDragStart:c.noop,onDragStop:c.noop,onDragMove:c.noop,onCaptionDblClick:c.noop,onCloseClick:c.noop,onMaxClick:c.noop,onMinClick:c.noop,onResizeStart:c.noop,onResizeStop:c.noop,onResize:c.noop,onWindowCreate:c.noop,onShow:c.noop,onWindowDestroy:c.noop,onCanClose:c.noop_true,onClose:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e,t,n=this.element,s=this.options,i=n.prev(),a=n.parent();!0===s.modal&&(s.btnMax=!1,s.btnMin=!1,s.resizable=!1),"default"===s.content&&(s.content=n),e=this._window(s),0===i.length?a.prepend(e):e.insertAfter(i),!0===s.overlay&&((t=this._overlay()).appendTo(e.parent()),this.overlay=t),j.exec(s.onShow,[e]),this.win=e},_window:function(e){var n,s,i,a,o,r=this;return(n=t("<div>").addClass("window")).css({width:e.width,height:e.height,position:e.position,top:e.top,left:e.left}),!0===e.modal&&n.addClass("modal"),s=t("<div>").addClass("window-caption"),i=t("<div>").addClass("window-content"),n.append(s),n.append(i),!0===e.status&&(o=t("<div>").addClass("window-status"),n.append(o)),!0===e.shadow&&n.addClass("win-shadow"),void 0!==e.icon&&t("<span>").addClass("icon").html(e.icon).appendTo(s),void 0!==e.title&&t("<span>").addClass("title").html(e.title).appendTo(s),void 0!==e.content&&"original"!==e.content&&(j.isUrl(e.content)&&j.isVideoUrl(e.content)&&(e.content=j.embedUrl(e.content)),!j.isJQueryObject(e.content)&&j.isFunc(e.content)&&(e.content=j.exec(e.content)),j.isJQueryObject(e.content)?e.content.appendTo(i):i.html(e.content)),!0!==e.btnClose&&!0!==e.btnMin&&!0!==e.btnMax||((a=t("<div>").addClass("buttons")).appendTo(s),!0===e.btnMax&&t("<span>").addClass("btn-max").appendTo(a),!0===e.btnMin&&t("<span>").addClass("btn-min").appendTo(a),!0===e.btnClose&&t("<span>").addClass("btn-close").appendTo(a)),n.attr("id",void 0===e.id?j.elementId("window"):e.id),!0===e.resizable&&(t("<span>").addClass("resize-element").appendTo(n),n.addClass("resizable")),n.on(c.events.dblclick,".window-caption",function(e){r.maximized(e)}),n.on(c.events.click,".btn-max",function(e){r.maximized(e)}),n.on(c.events.click,".btn-min",function(e){r.minimized(e)}),n.on(c.events.click,".btn-close",function(e){r.close(e)}),!0===e.resizable&&n.resizable({resizeElement:".resize-element",onResizeStart:e.onResizeStart,onResizeStop:e.onResizeStop,onResize:e.onResize}),!0===e.draggable&&n.draggable({dragElement:e.dragElement,dragArea:e.dragArea,onDragStart:e.onDragStart,onDragStop:e.onDragStop,onDragMove:e.onDragMove}),"auto"!==e.place&&n.addClass("pos-"+e.place),n.addClass(e.clsWindow),s.addClass(e.clsCaption),i.addClass(e.clsContent),n},_overlay:function(){this.win,this.element;var e=this.options,n=t("<div>");return n.addClass("overlay"),"transparent"===e.overlayColor?n.addClass("transparent"):n.css({background:j.hex2rgba(e.overlayColor,e.overlayAlpha)}),n},maximized:function(e){var n=this.win,s=(this.element,this.options),i=t(e.currentTarget);n.toggleClass("maximized"),i.hasClass("window-caption")?j.exec(s.onCaptionDblClick,[n]):j.exec(s.onMaxClick,[n])},minimized:function(e){var t=this.win,n=this.element,s=this.options;t.toggleClass("minimized"),j.exec(s.onMinClick,[t],n[0])},close:function(e){var t=this,n=this.win,s=this.element,i=this.options;if(!1===j.exec(i.onCanClose,[n]))return!1;var a=0;i.onClose!==c.noop&&(a=500),j.exec(i.onClose,[n],s[0]),setTimeout(function(){null,!0===i.modal&&n.siblings(".overlay").remove(),j.exec(i.onCloseClick,[n],s[0]),j.exec(i.onWindowDestroy,[n],s[0]),i.closeAction===c.actions.REMOVE?n.remove():t.hide()},a)},hide:function(){this.win.addClass("no-visible")},show:function(){this.win.removeClass("no-visible")},toggle:function(){this.win.hasClass("no-visible")?this.show():this.hide()},isOpen:function(){return this.win.hasClass("no-visible")},min:function(e){e?this.win.addClass("minimized"):this.win.removeClass("minimized")},max:function(e){e?this.win.addClass("maximized"):this.win.removeClass("maximized")},toggleButtons:function(e){this.element;var t=this.win,n=(this.options,t.find(".btn-close")),s=t.find(".btn-min"),i=t.find(".btn-max");"data-btn-close"===e&&n.toggle(),"data-btn-min"===e&&s.toggle(),"data-btn-max"===e&&i.toggle()},changeSize:function(e){var t=this.element,n=this.win;this.options;"data-width"===e&&n.css("width",t.data("width")),"data-height"===e&&n.css("height",t.data("height"))},changeClass:function(e){var t=this.element,n=this.win,s=this.options;"data-cls-window"===e&&(n[0].className="window "+(s.resizable?" resizeable ":" ")+t.attr("data-cls-window")),"data-cls-caption"===e&&(n.find(".window-caption")[0].className="window-caption "+t.attr("data-cls-caption")),"data-cls-content"===e&&(n.find(".window-content")[0].className="window-content "+t.attr("data-cls-content"))},toggleShadow:function(){var e=this.element,t=this.win;this.options;!0===JSON.parse(e.attr("data-shadow"))?t.addClass("win-shadow"):t.removeClass("win-shadow")},setContent:function(){var e,t=this.element,n=this.win,s=(this.options,t.attr("data-content"));e=!j.isJQueryObject(s)&&j.isFunc(s)?j.exec(s):j.isJQueryObject(s)?s.html():s,n.find(".window-content").html(e)},setTitle:function(){var e=this.element,t=this.win,n=(this.options,e.attr("data-title"));t.find(".window-caption .title").html(n)},setIcon:function(){var e=this.element,t=this.win,n=(this.options,e.attr("data-icon"));t.find(".window-caption .icon").html(n)},getIcon:function(){this.element;var e=this.win;this.options;return e.find(".window-caption .icon").html()},getTitle:function(){this.element;var e=this.win;this.options;return e.find(".window-caption .title").html()},toggleDraggable:function(){var e=this.element,t=this.win,n=(this.options,JSON.parse(e.attr("data-draggable"))),s=t.data("draggable");!0===n?s.on():s.off()},toggleResizable:function(){var e=this.element,t=this.win,n=(this.options,JSON.parse(e.attr("data-resizable"))),s=t.data("resizable");!0===n?(s.on(),t.find(".resize-element").removeClass("resize-element-disabled")):(s.off(),t.find(".resize-element").addClass("resize-element-disabled"))},changeTopLeft:function(e){var t,n=this.element,s=this.win;this.options;if("data-top"===e){if(t=parseInt(n.attr("data-top")),!isNaN(t))return;s.css("top",t)}if("data-left"===e){if(t=parseInt(n.attr("data-left")),!isNaN(t))return;s.css("left",t)}},changePlace:function(e){var t=this.element,n=this.win,s=(this.options,t.attr("data-place"));n.addClass(s)},changeAttribute:function(e){switch(e){case"data-btn-close":case"data-btn-min":case"data-btn-max":this.toggleButtons(e);break;case"data-width":case"data-height":this.changeSize(e);break;case"data-cls-window":case"data-cls-caption":case"data-cls-content":this.changeClass(e);break;case"data-shadow":this.toggleShadow();break;case"data-icon":this.setIcon();break;case"data-title":this.setTitle();break;case"data-content":this.setContent();break;case"data-draggable":this.toggleDraggable();break;case"data-resizable":this.toggleResizable();break;case"data-top":case"data-left":this.changeTopLeft(e);break;case"data-place":this.changePlace()}}};c.plugin("window",We),c.window={isWindow:function(e){return j.isMetroObject(e,"window")},min:function(e,n){if(!this.isWindow(e))return!1;t(e).data("window").min(n)},max:function(e,n){if(!this.isWindow(e))return!1;t(e).data("window").max(n)},show:function(e){if(!this.isWindow(e))return!1;t(e).data("window").show()},hide:function(e){if(!this.isWindow(e))return!1;t(e).data("window").hide()},toggle:function(e){if(!this.isWindow(e))return!1;t(e).data("window").toggle()},isOpen:function(e){return!!this.isWindow(e)&&t(e).data("window").isOpen()},close:function(e){if(!this.isWindow(e))return!1;t(e).data("window").close()},create:function(e){var n;n=t("<div>").appendTo(t("body"));var s=t.extend({},{},void 0!==e?e:{});return n.window(s)}};var Ge={init:function(e,n){return this.options=t.extend({},this.options,e),this.elem=n,this.element=t(n),this._setOptionsFromDOM(),this._create(),this},options:{start:1,finish:0,iconHelp:"<span class='default-icon-help'></span>",iconPrev:"<span class='default-icon-left-arrow'></span>",iconNext:"<span class='default-icon-right-arrow'></span>",iconFinish:"<span class='default-icon-check'></span>",buttonMode:"cycle",buttonOutline:!0,clsWizard:"",clsActions:"",clsHelp:"",clsPrev:"",clsNext:"",clsFinish:"",onPage:c.noop,onHelpClick:c.noop,onPrevClick:c.noop,onNextClick:c.noop,onFinishClick:c.noop,onBeforePrev:c.noop_true,onBeforeNext:c.noop_true,onWizardCreate:c.noop},_setOptionsFromDOM:function(){var e=this.element,n=this.options;t.each(e.data(),function(e,t){if(e in n)try{n[e]=JSON.parse(t)}catch(s){n[e]=t}})},_create:function(){var e=this.element,t=this.options;this._createWizard(),this._createEvents(),j.exec(t.onWizardCreate,[e])},_createWizard:function(){var e,n=this.element,s=this.options;n.addClass("wizard").addClass(s.view).addClass(s.clsWizard),e=t("<div>").addClass("action-bar").addClass(s.clsActions).appendTo(n);var i="button"===s.buttonMode?"":s.buttonMode;!0===s.buttonOutline&&(i+=" outline"),!1!==s.iconHelp&&t("<button>").attr("type","button").addClass("button wizard-btn-help").addClass(i).addClass(s.clsHelp).html(j.isTag(s.iconHelp)?s.iconHelp:t("<img>").attr("src",s.iconHelp)).appendTo(e),!1!==s.iconPrev&&t("<button>").attr("type","button").addClass("button wizard-btn-prev").addClass(i).addClass(s.clsPrev).html(j.isTag(s.iconPrev)?s.iconPrev:t("<img>").attr("src",s.iconPrev)).appendTo(e),!1!==s.iconNext&&t("<button>").attr("type","button").addClass("button wizard-btn-next").addClass(i).addClass(s.clsNext).html(j.isTag(s.iconNext)?s.iconNext:t("<img>").attr("src",s.iconNext)).appendTo(e),!1!==s.iconFinish&&t("<button>").attr("type","button").addClass("button wizard-btn-finish").addClass(i).addClass(s.clsFinish).html(j.isTag(s.iconFinish)?s.iconFinish:t("<img>").attr("src",s.iconFinish)).appendTo(e),this.toPage(s.start),this._setHeight()},_setHeight:function(){var e=this.element,n=(this.options,e.children("section")),s=0;n.children(".page-content").css("max-height","none"),t.each(n,function(){var e=t(this).height();s<parseInt(e)&&(s=e)}),e.height(s)},_createEvents:function(){var e=this,n=this.element,s=this.options;n.on(c.events.click,".wizard-btn-help",function(){var t=n.children("section").get(e.current-1);j.exec(s.onHelpClick,[e.current,t,n])}),n.on(c.events.click,".wizard-btn-prev",function(){e.prev(),j.exec(s.onPrevClick,[e.current,n])}),n.on(c.events.click,".wizard-btn-next",function(){e.next(),j.exec(s.onNextClick,[e.current,n])}),n.on(c.events.click,".wizard-btn-finish",function(){j.exec(s.onFinishClick,[e.current,n])}),n.on(c.events.click,".complete",function(){var n=t(this).index()+1;e.toPage(n)}),t(window).on(c.events.resize,function(){e._setHeight()})},next:function(){var e=this.element,n=this.options,s=e.children("section"),i=t(e.children("section").get(this.current-1));this.current+1>s.length||!1===j.exec(n.onBeforeNext,[this.current,i,e])||(this.current++,this.toPage(this.current))},prev:function(){var e=this.element,n=this.options,s=t(e.children("section").get(this.current-1));this.current-1!=0&&!1!==j.exec(n.onBeforePrev,[this.current,s,e])&&(this.current--,this.toPage(this.current))},last:function(){var e=this.element;this.options;this.toPage(e.children("section").length)},first:function(){this.toPage(1)},toPage:function(e){var n=this.element,s=this.options,i=t(n.children("section").get(e-1)),a=n.children("section"),o=n.find(".action-bar");if(0!==i.length){var r=n.find(".wizard-btn-finish").addClass("disabled"),l=n.find(".wizard-btn-next").addClass("disabled"),c=n.find(".wizard-btn-prev").addClass("disabled");this.current=e,n.children("section").removeClass("complete current").removeClass(s.clsCurrent).removeClass(s.clsComplete),i.addClass("current").addClass(s.clsCurrent),i.prevAll().addClass("complete").addClass(s.clsComplete);var d=0===n.children("section.complete").length?0:parseInt(j.getStyleOne(n.children("section.complete")[0],"border-left-width"));o.animate({left:n.children("section.complete").length*d+41}),(this.current===a.length||s.finish>0&&this.current>=s.finish)&&r.removeClass("disabled"),this.current<a.length&&l.removeClass("disabled"),this.current>1&&c.removeClass("disabled"),n.trigger("onpage",[this.current,i,n]),j.exec(s.onPage,[this.current,i,n])}},changeAttribute:function(e){}};return c.plugin("wizard",Ge),!0===METRO_INIT?c.init():c});
  //# sourceMappingURL=metro.min.js.map