var Handlebars,BST;if(window.Modernizr=function(n,t,i){function a(n){c.cssText=n}function vt(n,t){return a(y.join(n+";")+(t||""))}function h(n,t){return typeof n===t}function v(n,t){return!!~(""+n).indexOf(t)}function lt(n,t){var u,r;for(u in n)if(r=n[u],!v(r,"-")&&c[r]!==i)return t=="pfx"?r:!0;return!1}function yt(n,t,r){var f,u;for(f in n)if(u=t[n[f]],u!==i)return r===!1?n[f]:h(u,"function")?u.bind(r||t):u;return!1}function f(n,t,i){var r=n.charAt(0).toUpperCase()+n.slice(1),u=(n+" "+ot.join(r+" ")+r).split(" ");return h(t,"string")||h(t,"undefined")?lt(u,t):(u=(n+" "+st.join(r+" ")+r).split(" "),yt(u,t,i))}function pt(){u.input=function(i){for(var r=0,u=i.length;r<u;r++)w[i[r]]=!!(i[r]in o);return w.list&&(w.list=!!(t.createElement("datalist")&&n.HTMLDataListElement)),w}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));u.inputtypes=function(n){for(var u=0,r,f,e,h=n.length;u<h;u++)o.setAttribute("type",f=n[u]),r=o.type!=="text",r&&(o.value=g,o.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&o.style.WebkitAppearance!==i?(s.appendChild(o),e=t.defaultView,r=e.getComputedStyle&&e.getComputedStyle(o,null).WebkitAppearance!=="textfield"&&o.offsetHeight!==0,s.removeChild(o)):/^(search|tel)$/.test(f)||(r=/^(url|email)$/.test(f)?o.checkValidity&&o.checkValidity()===!1:o.value!=g)),ht[n[u]]=!!r;return ht}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var u={},d=!0,s=t.documentElement,e="modernizr",ut=t.createElement(e),c=ut.style,o=t.createElement("input"),g=":)",ft={}.toString,y=" -webkit- -moz- -o- -ms- ".split(" "),et="Webkit Moz O ms",ot=et.split(" "),st=et.toLowerCase().split(" "),p={svg:"http://www.w3.org/2000/svg"},r={},ht={},w={},nt=[],tt=nt.slice,b,l=function(n,i,r,u){var l,a,c,v,f=t.createElement("div"),h=t.body,o=h||t.createElement("body");if(parseInt(r,10))while(r--)c=t.createElement("div"),c.id=u?u[r]:e+(r+1),f.appendChild(c);return l=["&#173;",'<style id="s',e,'">',n,"<\/style>"].join(""),f.id=e,(h?f:o).innerHTML+=l,o.appendChild(f),h||(o.style.background="",o.style.overflow="hidden",v=s.style.overflow,s.style.overflow="hidden",s.appendChild(o)),a=i(f,n),h?f.parentNode.removeChild(f):(o.parentNode.removeChild(o),s.style.overflow=v),!!a},at=function(t){var i=n.matchMedia||n.msMatchMedia,r;return i?i(t).matches:(l("@media "+t+" { #"+e+" { position: absolute; } }",function(t){r=(n.getComputedStyle?getComputedStyle(t,null):t.currentStyle).position=="absolute"}),r)},ct=function(){function r(r,u){u=u||t.createElement(n[r]||"div");r="on"+r;var f=r in u;return f||(u.setAttribute||(u=t.createElement("div")),u.setAttribute&&u.removeAttribute&&(u.setAttribute(r,""),f=h(u[r],"function"),h(u[r],"undefined")||(u[r]=i),u.removeAttribute(r))),u=null,f}var n={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return r}(),it={}.hasOwnProperty,rt,k;rt=h(it,"undefined")||h(it.call,"undefined")?function(n,t){return t in n&&h(n.constructor.prototype[t],"undefined")}:function(n,t){return it.call(n,t)};Function.prototype.bind||(Function.prototype.bind=function(n){var t=this,i,r;if(typeof t!="function")throw new TypeError;return i=tt.call(arguments,1),r=function(){var f,e,u;return this instanceof r?(f=function(){},f.prototype=t.prototype,e=new f,u=t.apply(e,i.concat(tt.call(arguments))),Object(u)===u)?u:e:t.apply(n,i.concat(tt.call(arguments)))},r});r.flexbox=function(){return f("flexWrap")};r.flexboxlegacy=function(){return f("boxDirection")};r.canvas=function(){var n=t.createElement("canvas");return!!(n.getContext&&n.getContext("2d"))};r.canvastext=function(){return!!(u.canvas&&h(t.createElement("canvas").getContext("2d").fillText,"function"))};r.webgl=function(){return!!n.WebGLRenderingContext};r.touch=function(){var i;return"ontouchstart"in n||n.DocumentTouch&&t instanceof DocumentTouch?i=!0:l(["@media (",y.join("touch-enabled),("),e,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(n){i=n.offsetTop===9}),i};r.geolocation=function(){return"geolocation"in navigator};r.postmessage=function(){return!!n.postMessage};r.websqldatabase=function(){return!!n.openDatabase};r.indexedDB=function(){return!!f("indexedDB",n)};r.hashchange=function(){return ct("hashchange",n)&&(t.documentMode===i||t.documentMode>7)};r.history=function(){return!!(n.history&&history.pushState)};r.draganddrop=function(){var n=t.createElement("div");return"draggable"in n||"ondragstart"in n&&"ondrop"in n};r.websockets=function(){return"WebSocket"in n||"MozWebSocket"in n};r.rgba=function(){return a("background-color:rgba(150,255,150,.5)"),v(c.backgroundColor,"rgba")};r.hsla=function(){return a("background-color:hsla(120,40%,100%,.5)"),v(c.backgroundColor,"rgba")||v(c.backgroundColor,"hsla")};r.multiplebgs=function(){return a("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(c.background)};r.backgroundsize=function(){return f("backgroundSize")};r.borderimage=function(){return f("borderImage")};r.borderradius=function(){return f("borderRadius")};r.boxshadow=function(){return f("boxShadow")};r.textshadow=function(){return t.createElement("div").style.textShadow===""};r.opacity=function(){return vt("opacity:.55"),/^0.55$/.test(c.opacity)};r.cssanimations=function(){return f("animationName")};r.csscolumns=function(){return f("columnCount")};r.cssgradients=function(){var n="background-image:";return a((n+"-webkit- ".split(" ").join("gradient(linear,left top,right bottom,from(#9f9),to(white));"+n)+y.join("linear-gradient(left top,#9f9, white);"+n)).slice(0,-n.length)),v(c.backgroundImage,"gradient")};r.cssreflections=function(){return f("boxReflect")};r.csstransforms=function(){return!!f("transform")};r.csstransforms3d=function(){var n=!!f("perspective");return n&&"webkitPerspective"in s.style&&l("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(t){n=t.offsetLeft===9&&t.offsetHeight===3}),n};r.csstransitions=function(){return f("transition")};r.fontface=function(){var n;return l('@font-face {font-family:"font";src:url("https://")}',function(i,r){var f=t.getElementById("smodernizr"),u=f.sheet||f.styleSheet,e=u?u.cssRules&&u.cssRules[0]?u.cssRules[0].cssText:u.cssText||"":"";n=/src/i.test(e)&&e.indexOf(r.split(" ")[0])===0}),n};r.generatedcontent=function(){var n;return l(["#",e,"{font:0/0 a}#",e,':after{content:"',g,'";visibility:hidden;font:3px/1 a}'].join(""),function(t){n=t.offsetHeight>=3}),n};r.video=function(){var i=t.createElement("video"),n=!1;try{(n=!!i.canPlayType)&&(n=new Boolean(n),n.ogg=i.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),n.h264=i.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),n.webm=i.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(r){}return n};r.audio=function(){var i=t.createElement("audio"),n=!1;try{(n=!!i.canPlayType)&&(n=new Boolean(n),n.ogg=i.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),n.mp3=i.canPlayType("audio/mpeg;").replace(/^no$/,""),n.wav=i.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),n.m4a=(i.canPlayType("audio/x-m4a;")||i.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(r){}return n};r.localstorage=function(){try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(n){return!1}};r.sessionstorage=function(){try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(n){return!1}};r.webworkers=function(){return!!n.Worker};r.applicationcache=function(){return!!n.applicationCache};r.svg=function(){return!!t.createElementNS&&!!t.createElementNS(p.svg,"svg").createSVGRect};r.inlinesvg=function(){var n=t.createElement("div");return n.innerHTML="<svg/>",(n.firstChild&&n.firstChild.namespaceURI)==p.svg};r.smil=function(){return!!t.createElementNS&&/SVGAnimate/.test(ft.call(t.createElementNS(p.svg,"animate")))};r.svgclippaths=function(){return!!t.createElementNS&&/SVGClipPath/.test(ft.call(t.createElementNS(p.svg,"clipPath")))};for(k in r)rt(r,k)&&(b=k.toLowerCase(),u[b]=r[k](),nt.push((u[b]?"":"no-")+b));return u.input||pt(),u.addTest=function(n,t){if(typeof n=="object")for(var r in n)rt(n,r)&&u.addTest(r,n[r]);else{if(n=n.toLowerCase(),u[n]!==i)return u;t=typeof t=="function"?t():t;typeof d!="undefined"&&d&&(s.className+=" "+(t?"":"no-")+n);u[n]=t}return u},a(""),ut=o=null,function(n,t){function p(n,t){var i=n.createElement("p"),r=n.getElementsByTagName("head")[0]||n.documentElement;return i.innerHTML="x<style>"+t+"<\/style>",r.insertBefore(i.lastChild,r.firstChild)}function c(){var n=r.elements;return typeof n=="string"?n.split(" "):n}function o(n){var t=h[n[s]];return t||(t={},e++,n[s]=e,h[e]=t),t}function l(n,r,u){if(r||(r=t),i)return r.createElement(n);u||(u=o(r));var f;return f=u.cache[n]?u.cache[n].cloneNode():y.test(n)?(u.cache[n]=u.createElem(n)).cloneNode():u.createElem(n),f.canHaveChildren&&!v.test(n)?u.frag.appendChild(f):f}function w(n,r){if(n||(n=t),i)return n.createDocumentFragment();r=r||o(n);for(var f=r.frag.cloneNode(),u=0,e=c(),s=e.length;u<s;u++)f.createElement(e[u]);return f}function b(n,t){t.cache||(t.cache={},t.createElem=n.createElement,t.createFrag=n.createDocumentFragment,t.frag=t.createFrag());n.createElement=function(i){return r.shivMethods?l(i,n,t):t.createElem(i)};n.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+c().join().replace(/\w+/g,function(n){return t.createElem(n),t.frag.createElement(n),'c("'+n+'")'})+");return n}")(r,t.frag)}function a(n){n||(n=t);var u=o(n);return!r.shivCSS||f||u.hasCSS||(u.hasCSS=!!p(n,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),i||b(n,u),n}var u=n.html5||{},v=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,y=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,s="_html5shiv",e=0,h={},i,r;(function(){try{var n=t.createElement("a");n.innerHTML="<xyz><\/xyz>";f="hidden"in n;i=n.childNodes.length==1||function(){t.createElement("a");var n=t.createDocumentFragment();return typeof n.cloneNode=="undefined"||typeof n.createDocumentFragment=="undefined"||typeof n.createElement=="undefined"}()}catch(r){f=!0;i=!0}})();r={elements:u.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:u.shivCSS!==!1,supportsUnknownElements:i,shivMethods:u.shivMethods!==!1,type:"default",shivDocument:a,createElement:l,createDocumentFragment:w};n.html5=r;a(t)}(this,t),u._version="2.6.2",u._prefixes=y,u._domPrefixes=st,u._cssomPrefixes=ot,u.mq=at,u.hasEvent=ct,u.testProp=function(n){return lt([n])},u.testAllProps=f,u.testStyles=l,u.prefixed=function(n,t,i){return t?f(n,t,i):f(n,"pfx")},s.className=s.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(d?" js "+nt.join(" "):""),u}(this,this.document),jQuery.browser={},function(){jQuery.browser.msie=!1;jQuery.browser.version=0;navigator.userAgent.match(/MSIE ([0-9]+)\./)&&(jQuery.browser.msie=!0,jQuery.browser.version=RegExp.$1)}(),function(n,t){var r,i;n.fn.jPlayer=function(i){var r="jPlayer",u=typeof i=="string",f=Array.prototype.slice.call(arguments,1),e=this;return(i=!u&&f.length?n.extend.apply(null,[!0,i].concat(f)):i,u&&i.charAt(0)==="_")?e:(u?this.each(function(){var u=n.data(this,r),o=u&&n.isFunction(u[i])?u[i].apply(u,f):u;if(o!==u&&o!==t)return e=o,!1}):this.each(function(){var t=n.data(this,r);t?t.option(i||{}):n.data(this,r,new n.jPlayer(i,this))}),e)};n.jPlayer=function(t,i){if(arguments.length){this.element=n(i);this.options=n.extend(!0,{},this.options,t);var r=this;this.element.bind("remove.jPlayer",function(){r.destroy()});this._init()}};n.jPlayer.emulateMethods="load play pause";n.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate";n.jPlayer.emulateOptions="muted volume";n.jPlayer.reservedEvent="ready flashreset resize repeat error warning";n.jPlayer.event={ready:"jPlayer_ready",flashreset:"jPlayer_flashreset",resize:"jPlayer_resize",repeat:"jPlayer_repeat",click:"jPlayer_click",error:"jPlayer_error",warning:"jPlayer_warning",loadstart:"jPlayer_loadstart",progress:"jPlayer_progress",suspend:"jPlayer_suspend",abort:"jPlayer_abort",emptied:"jPlayer_emptied",stalled:"jPlayer_stalled",play:"jPlayer_play",pause:"jPlayer_pause",loadedmetadata:"jPlayer_loadedmetadata",loadeddata:"jPlayer_loadeddata",waiting:"jPlayer_waiting",playing:"jPlayer_playing",canplay:"jPlayer_canplay",canplaythrough:"jPlayer_canplaythrough",seeking:"jPlayer_seeking",seeked:"jPlayer_seeked",timeupdate:"jPlayer_timeupdate",ended:"jPlayer_ended",ratechange:"jPlayer_ratechange",durationchange:"jPlayer_durationchange",volumechange:"jPlayer_volumechange"};n.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","ratechange"];n.jPlayer.pause=function(){n.each(n.jPlayer.prototype.instances,function(n,t){t.data("jPlayer").status.srcSet&&t.jPlayer("pause")})};n.jPlayer.timeFormat={showHour:!0,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};n.jPlayer.convertTime=function(t){var i=new Date(t*1e3),r=i.getUTCHours(),u=i.getUTCMinutes(),f=i.getUTCSeconds(),e=n.jPlayer.timeFormat.padHour&&r<10?"0"+r:r,o=n.jPlayer.timeFormat.padMin&&u<10?"0"+u:u,s=n.jPlayer.timeFormat.padSec&&f<10?"0"+f:f;return(n.jPlayer.timeFormat.showHour?e+n.jPlayer.timeFormat.sepHour:"")+(n.jPlayer.timeFormat.showMin?o+n.jPlayer.timeFormat.sepMin:"")+(n.jPlayer.timeFormat.showSec?s+n.jPlayer.timeFormat.sepSec:"")};n.jPlayer.uaBrowser=function(n){var t=n.toLowerCase(),i=/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(t)||[];return{browser:i[1]||"",version:i[2]||"0"}};n.jPlayer.uaPlatform=function(n){var t=n.toLowerCase(),i=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/.exec(t)||[],r=/(ipad|playbook)/.exec(t)||!/(mobile)/.exec(t)&&/(android)/.exec(t)||[];return i[1]&&(i[1]=i[1].replace(/\s/g,"_")),{platform:i[1]||"",tablet:r[1]||""}};n.jPlayer.browser={};n.jPlayer.platform={};r=n.jPlayer.uaBrowser(navigator.userAgent);r.browser&&(n.jPlayer.browser[r.browser]=!0,n.jPlayer.browser.version=r.version);i=n.jPlayer.uaPlatform(navigator.userAgent);i.platform&&(n.jPlayer.platform[i.platform]=!0,n.jPlayer.platform.mobile=!i.tablet,n.jPlayer.platform.tablet=!!i.tablet);n.jPlayer.prototype={count:0,version:{script:"2.1.2",needFlash:"2.1.2",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",preload:"metadata",volume:.8,muted:!1,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",currentTime:".jp-current-time",duration:".jp-duration",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},fullScreen:!1,autohide:{restored:!1,full:!0,fadeIn:200,fadeOut:600,hold:1e3},loop:!1,repeat:function(t){t.jPlayer.options.loop?n(this).unbind(".jPlayerRepeat").bind(n.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){n(this).jPlayer("play")}):n(this).unbind(".jPlayerRepeat")},nativeVideoControls:{},noFullScreen:{msie:/msie [0-6]/,ipad:/ipad.*?os [0-4]/,iphone:/iphone/,ipod:/ipod/,android_pad:/android [0-3](?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,webos:/webos/,playbook:/playbook/},verticalVolume:!1,idPrefix:"jp",noConflict:"jQuery",emulateHtml:!1,errorAlerts:!1,warningAlerts:!1},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",height:"0px",cssClass:""}},optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",media:{},paused:!0,format:{},formatType:"",waitForPlay:!0,waitForLoad:!0,srcSet:!1,video:!1,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:!1},solution:{html:!0,flash:!0},format:{mp3:{codec:'audio/mpeg; codecs="mp3"',flashCanPlay:!0,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis"',flashCanPlay:!1,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:!1,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:!1,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:!0,media:"audio"},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!0,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:!1,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:!1,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:!0,media:"video"},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"video"}},_init:function(){var i=this,r,e,s,o,f,u;if(this.element.empty(),this.status=n.extend({},this.status),this.internal=n.extend({},this.internal),this.internal.domNode=this.element.get(0),this.formats=[],this.solutions=[],this.require={},this.htmlElement={},this.html={},this.html.audio={},this.html.video={},this.flash={},this.css={},this.css.cs={},this.css.jq={},this.ancestorJq=[],this.options.volume=this._limitValue(this.options.volume,0,1),n.each(this.options.supplied.toLowerCase().split(","),function(t,r){var u=r.replace(/^\s+|\s+$/g,""),f;i.format[u]&&(f=!1,n.each(i.formats,function(n,t){if(u===t)return f=!0,!1}),f||i.formats.push(u))}),n.each(this.options.solution.toLowerCase().split(","),function(t,r){var u=r.replace(/^\s+|\s+$/g,""),f;i.solution[u]&&(f=!1,n.each(i.solutions,function(n,t){if(u===t)return f=!0,!1}),f||i.solutions.push(u))}),this.internal.instance="jp_"+this.count,this.instances[this.internal.instance]=this.element,this.element.attr("id")||this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count),this.internal.self=n.extend({},{id:this.element.attr("id"),jq:this.element}),this.internal.audio=n.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:t}),this.internal.video=n.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:t}),this.internal.flash=n.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:t,swf:this.options.swfPath+(this.options.swfPath.toLowerCase().slice(-4)!==".swf"?(this.options.swfPath&&this.options.swfPath.slice(-1)!=="/"?"/":"")+"Jplayer.swf":"")}),this.internal.poster=n.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:t}),n.each(n.jPlayer.event,function(n,r){i.options[n]!==t&&(i.element.bind(r+".jPlayer",i.options[n]),i.options[n]=t)}),this.require.audio=!1,this.require.video=!1,n.each(this.formats,function(n,t){i.require[i.format[t].media]=!0}),this.options=this.require.video?n.extend(!0,{},this.optionsVideo,this.options):n.extend(!0,{},this.optionsAudio,this.options),this._setSize(),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this.status.noFullScreen=this._uaBlocklist(this.options.noFullScreen),this.status.noVolume=this._uaBlocklist(this.options.noVolume),this._restrictNativeVideoControls(),this.htmlElement.poster=document.createElement("img"),this.htmlElement.poster.id=this.internal.poster.id,this.htmlElement.poster.onload=function(){(!i.status.video||i.status.waitForPlay)&&i.internal.poster.jq.show()},this.element.append(this.htmlElement.poster),this.internal.poster.jq=n("#"+this.internal.poster.id),this.internal.poster.jq.css({width:this.status.width,height:this.status.height}),this.internal.poster.jq.hide(),this.internal.poster.jq.bind("click.jPlayer",function(){i._trigger(n.jPlayer.event.click)}),this.html.audio.available=!1,this.require.audio&&(this.htmlElement.audio=document.createElement("audio"),this.htmlElement.audio.id=this.internal.audio.id,this.html.audio.available=!!this.htmlElement.audio.canPlayType&&this._testCanPlayType(this.htmlElement.audio)),this.html.video.available=!1,this.require.video&&(this.htmlElement.video=document.createElement("video"),this.htmlElement.video.id=this.internal.video.id,this.html.video.available=!!this.htmlElement.video.canPlayType&&this._testCanPlayType(this.htmlElement.video)),this.flash.available=this._checkForFlash(10),this.html.canPlay={},this.flash.canPlay={},n.each(this.formats,function(n,t){i.html.canPlay[t]=i.html[i.format[t].media].available&&""!==i.htmlElement[i.format[t].media].canPlayType(i.format[t].codec);i.flash.canPlay[t]=i.format[t].flashCanPlay&&i.flash.available}),this.html.desired=!1,this.flash.desired=!1,n.each(this.solutions,function(t,r){if(t===0)i[r].desired=!0;else{var u=!1,f=!1;n.each(i.formats,function(n,t){i[i.solutions[0]].canPlay[t]&&(i.format[t].media==="video"?f=!0:u=!0)});i[r].desired=i.require.audio&&!u||i.require.video&&!f}}),this.html.support={},this.flash.support={},n.each(this.formats,function(n,t){i.html.support[t]=i.html.canPlay[t]&&i.html.desired;i.flash.support[t]=i.flash.canPlay[t]&&i.flash.desired}),this.html.used=!1,this.flash.used=!1,n.each(this.solutions,function(t,r){n.each(i.formats,function(n,t){if(i[r].support[t])return i[r].used=!0,!1})}),this._resetActive(),this._resetGate(),this._cssSelectorAncestor(this.options.cssSelectorAncestor),this.html.used||this.flash.used?this.css.jq.noSolution.length&&this.css.jq.noSolution.hide():(this._error({type:n.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:n.jPlayer.errorMsg.NO_SOLUTION,hint:n.jPlayer.errorHint.NO_SOLUTION}),this.css.jq.noSolution.length&&this.css.jq.noSolution.show()),this.flash.used){if(e="jQuery="+encodeURI(this.options.noConflict)+"&id="+encodeURI(this.internal.self.id)+"&vol="+this.options.volume+"&muted="+this.options.muted,n.browser.msie&&Number(n.browser.version)<=8)for(s='<object id="'+this.internal.flash.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0"><\/object>',o=['<param name="movie" value="'+this.internal.flash.swf+'" />','<param name="FlashVars" value="'+e+'" />','<param name="allowScriptAccess" value="always" />','<param name="bgcolor" value="'+this.options.backgroundColor+'" />','<param name="wmode" value="'+this.options.wmode+'" />'],r=document.createElement(s),f=0;f<o.length;f++)r.appendChild(document.createElement(o[f]));else u=function(n,t,i){var r=document.createElement("param");r.setAttribute("name",t);r.setAttribute("value",i);n.appendChild(r)},r=document.createElement("object"),r.setAttribute("id",this.internal.flash.id),r.setAttribute("data",this.internal.flash.swf),r.setAttribute("type","application/x-shockwave-flash"),r.setAttribute("width","1"),r.setAttribute("height","1"),u(r,"flashvars",e),u(r,"allowscriptaccess","always"),u(r,"bgcolor",this.options.backgroundColor),u(r,"wmode",this.options.wmode);this.element.append(r);this.internal.flash.jq=n(r)}this.html.used&&(this.html.audio.available&&(this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio),this.element.append(this.htmlElement.audio),this.internal.audio.jq=n("#"+this.internal.audio.id)),this.html.video.available&&(this._addHtmlEventListeners(this.htmlElement.video,this.html.video),this.element.append(this.htmlElement.video),this.internal.video.jq=n("#"+this.internal.video.id),this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):this.internal.video.jq.css({width:"0px",height:"0px"}),this.internal.video.jq.bind("click.jPlayer",function(){i._trigger(n.jPlayer.event.click)})));this.options.emulateHtml&&this._emulateHtmlBridge();this.html.used&&!this.flash.used&&setTimeout(function(){i.internal.ready=!0;i.version.flash="n/a";i._trigger(n.jPlayer.event.repeat);i._trigger(n.jPlayer.event.ready)},100);this._updateNativeVideoControls();this._updateInterface();this._updateButtons(!1);this._updateAutohide();this._updateVolume(this.options.volume);this._updateMute(this.options.muted);this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();n.jPlayer.prototype.count++},destroy:function(){this.clearMedia();this._removeUiClass();this.css.jq.currentTime.length&&this.css.jq.currentTime.text("");this.css.jq.duration.length&&this.css.jq.duration.text("");n.each(this.css.jq,function(n,t){t.length&&t.unbind(".jPlayer")});this.internal.poster.jq.unbind(".jPlayer");this.internal.video.jq&&this.internal.video.jq.unbind(".jPlayer");this.options.emulateHtml&&this._destroyHtmlBridge();this.element.removeData("jPlayer");this.element.unbind(".jPlayer");this.element.empty();delete this.instances[this.internal.instance]},enable:function(){},disable:function(){},_testCanPlayType:function(n){try{return n.canPlayType(this.format.mp3.codec),!0}catch(t){return!1}},_uaBlocklist:function(t){var r=navigator.userAgent.toLowerCase(),i=!1;return n.each(t,function(n,t){if(t&&t.test(r))return i=!0,!1}),i},_restrictNativeVideoControls:function(){this.require.audio&&this.status.nativeVideoControls&&(this.status.nativeVideoControls=!1,this.status.noFullScreen=!0)},_updateNativeVideoControls:function(){this.html.video.available&&this.html.used&&(this.htmlElement.video.controls=this.status.nativeVideoControls,this._updateAutohide(),this.status.nativeVideoControls&&this.require.video?(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})):this.status.waitForPlay&&this.status.video&&(this.internal.poster.jq.show(),this.internal.video.jq.css({width:"0px",height:"0px"})))},_addHtmlEventListeners:function(t,i){var r=this;t.preload=this.options.preload;t.muted=this.options.muted;t.volume=this.options.volume;t.addEventListener("progress",function(){i.gate&&(r._getHtmlStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.progress))},!1);t.addEventListener("timeupdate",function(){i.gate&&(r._getHtmlStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.timeupdate))},!1);t.addEventListener("durationchange",function(){i.gate&&(r.status.duration=this.duration,r._getHtmlStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.durationchange))},!1);t.addEventListener("play",function(){i.gate&&(r._updateButtons(!0),r._html_checkWaitForPlay(),r._trigger(n.jPlayer.event.play))},!1);t.addEventListener("playing",function(){i.gate&&(r._updateButtons(!0),r._seeked(),r._trigger(n.jPlayer.event.playing))},!1);t.addEventListener("pause",function(){i.gate&&(r._updateButtons(!1),r._trigger(n.jPlayer.event.pause))},!1);t.addEventListener("waiting",function(){i.gate&&(r._seeking(),r._trigger(n.jPlayer.event.waiting))},!1);t.addEventListener("seeking",function(){i.gate&&(r._seeking(),r._trigger(n.jPlayer.event.seeking))},!1);t.addEventListener("seeked",function(){i.gate&&(r._seeked(),r._trigger(n.jPlayer.event.seeked))},!1);t.addEventListener("volumechange",function(){i.gate&&(r.options.volume=t.volume,r.options.muted=t.muted,r._updateMute(),r._updateVolume(),r._trigger(n.jPlayer.event.volumechange))},!1);t.addEventListener("suspend",function(){i.gate&&(r._seeked(),r._trigger(n.jPlayer.event.suspend))},!1);t.addEventListener("ended",function(){i.gate&&(n.jPlayer.browser.webkit||(r.htmlElement.media.currentTime=0),r.htmlElement.media.pause(),r._updateButtons(!1),r._getHtmlStatus(t,!0),r._updateInterface(),r._trigger(n.jPlayer.event.ended))},!1);t.addEventListener("error",function(){i.gate&&(r._updateButtons(!1),r._seeked(),r.status.srcSet&&(clearTimeout(r.internal.htmlDlyCmdId),r.status.waitForLoad=!0,r.status.waitForPlay=!0,r.status.video&&!r.status.nativeVideoControls&&r.internal.video.jq.css({width:"0px",height:"0px"}),r._validString(r.status.media.poster)&&!r.status.nativeVideoControls&&r.internal.poster.jq.show(),r.css.jq.videoPlay.length&&r.css.jq.videoPlay.show(),r._error({type:n.jPlayer.error.URL,context:r.status.src,message:n.jPlayer.errorMsg.URL,hint:n.jPlayer.errorHint.URL})))},!1);n.each(n.jPlayer.htmlEvent,function(u,f){t.addEventListener(this,function(){i.gate&&r._trigger(n.jPlayer.event[f])},!1)})},_getHtmlStatus:function(n,t){var i=0,r=0,f=0,u=0;n.duration&&(this.status.duration=n.duration);i=n.currentTime;r=this.status.duration>0?100*i/this.status.duration:0;typeof n.seekable=="object"&&n.seekable.length>0?(f=this.status.duration>0?100*n.seekable.end(n.seekable.length-1)/this.status.duration:100,u=100*n.currentTime/n.seekable.end(n.seekable.length-1)):(f=100,u=r);t&&(i=0,u=0,r=0);this.status.seekPercent=f;this.status.currentPercentRelative=u;this.status.currentPercentAbsolute=r;this.status.currentTime=i;this.status.readyState=n.readyState;this.status.networkState=n.networkState;this.status.playbackRate=n.playbackRate;this.status.ended=n.ended},_resetStatus:function(){this.status=n.extend({},this.status,n.jPlayer.prototype.status)},_trigger:function(t,i,r){var u=n.Event(t);u.jPlayer={};u.jPlayer.version=n.extend({},this.version);u.jPlayer.options=n.extend(!0,{},this.options);u.jPlayer.status=n.extend(!0,{},this.status);u.jPlayer.html=n.extend(!0,{},this.html);u.jPlayer.flash=n.extend(!0,{},this.flash);i&&(u.jPlayer.error=n.extend({},i));r&&(u.jPlayer.warning=n.extend({},r));this.element.trigger(u)},jPlayerFlashEvent:function(t,i){if(t===n.jPlayer.event.ready)if(this.internal.ready){if(this.flash.gate){if(this.status.srcSet){var r=this.status.currentTime,u=this.status.paused;this.setMedia(this.status.media);r>0&&(u?this.pause(r):this.play(r))}this._trigger(n.jPlayer.event.flashreset)}}else this.internal.ready=!0,this.internal.flash.jq.css({width:"0px",height:"0px"}),this.version.flash=i.version,this.version.needFlash!==this.version.flash&&this._error({type:n.jPlayer.error.VERSION,context:this.version.flash,message:n.jPlayer.errorMsg.VERSION+this.version.flash,hint:n.jPlayer.errorHint.VERSION}),this._trigger(n.jPlayer.event.repeat),this._trigger(t);if(this.flash.gate)switch(t){case n.jPlayer.event.progress:this._getFlashStatus(i);this._updateInterface();this._trigger(t);break;case n.jPlayer.event.timeupdate:this._getFlashStatus(i);this._updateInterface();this._trigger(t);break;case n.jPlayer.event.play:this._seeked();this._updateButtons(!0);this._trigger(t);break;case n.jPlayer.event.pause:this._updateButtons(!1);this._trigger(t);break;case n.jPlayer.event.ended:this._updateButtons(!1);this._trigger(t);break;case n.jPlayer.event.click:this._trigger(t);break;case n.jPlayer.event.error:this.status.waitForLoad=!0;this.status.waitForPlay=!0;this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"});this._validString(this.status.media.poster)&&this.internal.poster.jq.show();this.css.jq.videoPlay.length&&this.status.video&&this.css.jq.videoPlay.show();this.status.video?this._flash_setVideo(this.status.media):this._flash_setAudio(this.status.media);this._updateButtons(!1);this._error({type:n.jPlayer.error.URL,context:i.src,message:n.jPlayer.errorMsg.URL,hint:n.jPlayer.errorHint.URL});break;case n.jPlayer.event.seeking:this._seeking();this._trigger(t);break;case n.jPlayer.event.seeked:this._seeked();this._trigger(t);break;case n.jPlayer.event.ready:break;default:this._trigger(t)}return!1},_getFlashStatus:function(n){this.status.seekPercent=n.seekPercent;this.status.currentPercentRelative=n.currentPercentRelative;this.status.currentPercentAbsolute=n.currentPercentAbsolute;this.status.currentTime=n.currentTime;this.status.duration=n.duration;this.status.readyState=4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=!1},_updateButtons:function(n){n!==t&&(this.status.paused=!n,this.css.jq.play.length&&this.css.jq.pause.length&&(n?(this.css.jq.play.hide(),this.css.jq.pause.show()):(this.css.jq.play.show(),this.css.jq.pause.hide())));this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length&&(this.status.noFullScreen?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.hide()):this.options.fullScreen?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.show()):(this.css.jq.fullScreen.show(),this.css.jq.restoreScreen.hide()));this.css.jq.repeat.length&&this.css.jq.repeatOff.length&&(this.options.loop?(this.css.jq.repeat.hide(),this.css.jq.repeatOff.show()):(this.css.jq.repeat.show(),this.css.jq.repeatOff.hide()))},_updateInterface:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+"%");this.css.jq.playBar.length&&this.css.jq.playBar.width(this.status.currentPercentRelative+"%");this.css.jq.currentTime.length&&this.css.jq.currentTime.text(n.jPlayer.convertTime(this.status.currentTime));this.css.jq.duration.length&&this.css.jq.duration.text(n.jPlayer.convertTime(this.status.duration))},_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg")},_resetGate:function(){this.html.audio.gate=!1;this.html.video.gate=!1;this.flash.gate=!1},_resetActive:function(){this.html.active=!1;this.flash.active=!1},setMedia:function(t){var i=this,r=!1,u=this.status.media.poster!==t.poster;this._resetMedia();this._resetGate();this._resetActive();n.each(this.formats,function(u,f){var e=i.format[f].media==="video";return n.each(i.solutions,function(n,u){if(i[u].support[f]&&i._validString(t[f])){var o=u==="html";return e?(o?(i.html.video.gate=!0,i._html_setVideo(t),i.html.active=!0):(i.flash.gate=!0,i._flash_setVideo(t),i.flash.active=!0),i.css.jq.videoPlay.length&&i.css.jq.videoPlay.show(),i.status.video=!0):(o?(i.html.audio.gate=!0,i._html_setAudio(t),i.html.active=!0):(i.flash.gate=!0,i._flash_setAudio(t),i.flash.active=!0),i.css.jq.videoPlay.length&&i.css.jq.videoPlay.hide(),i.status.video=!1),r=!0,!1}}),r?!1:void 0});r?(this.status.nativeVideoControls&&this.html.video.gate||this._validString(t.poster)&&(u?this.htmlElement.poster.src=t.poster:this.internal.poster.jq.show()),this.status.srcSet=!0,this.status.media=n.extend({},t),this._updateButtons(!1),this._updateInterface()):this._error({type:n.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:n.jPlayer.errorMsg.NO_SUPPORT,hint:n.jPlayer.errorHint.NO_SUPPORT})},_resetMedia:function(){this._resetStatus();this._updateButtons(!1);this._updateInterface();this._seeked();this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);this.html.active?this._html_resetMedia():this.flash.active&&this._flash_resetMedia()},clearMedia:function(){this._resetMedia();this.html.active?this._html_clearMedia():this.flash.active&&this._flash_clearMedia();this._resetGate();this._resetActive()},load:function(){this.status.srcSet?this.html.active?this._html_load():this.flash.active&&this._flash_load():this._urlNotSetError("load")},play:function(n){n=typeof n=="number"?n:NaN;this.status.srcSet?this.html.active?this._html_play(n):this.flash.active&&this._flash_play(n):this._urlNotSetError("play")},videoPlay:function(){this.play()},pause:function(n){n=typeof n=="number"?n:NaN;this.status.srcSet?this.html.active?this._html_pause(n):this.flash.active&&this._flash_pause(n):this._urlNotSetError("pause")},pauseOthers:function(){var t=this;n.each(this.instances,function(n,i){t.element!==i&&i.data("jPlayer").status.srcSet&&i.jPlayer("pause")})},stop:function(){this.status.srcSet?this.html.active?this._html_pause(0):this.flash.active&&this._flash_pause(0):this._urlNotSetError("stop")},playHead:function(n){n=this._limitValue(n,0,100);this.status.srcSet?this.html.active?this._html_playHead(n):this.flash.active&&this._flash_playHead(n):this._urlNotSetError("playHead")},_muted:function(t){this.options.muted=t;this.html.used&&this._html_mute(t);this.flash.used&&this._flash_mute(t);this.html.video.gate||this.html.audio.gate||(this._updateMute(t),this._updateVolume(this.options.volume),this._trigger(n.jPlayer.event.volumechange))},mute:function(n){n=n===t?!0:!!n;this._muted(n)},unmute:function(n){n=n===t?!0:!!n;this._muted(!n)},_updateMute:function(n){n===t&&(n=this.options.muted);this.css.jq.mute.length&&this.css.jq.unmute.length&&(this.status.noVolume?(this.css.jq.mute.hide(),this.css.jq.unmute.hide()):n?(this.css.jq.mute.hide(),this.css.jq.unmute.show()):(this.css.jq.mute.show(),this.css.jq.unmute.hide()))},volume:function(t){t=this._limitValue(t,0,1);this.options.volume=t;this.html.used&&this._html_volume(t);this.flash.used&&this._flash_volume(t);this.html.video.gate||this.html.audio.gate||(this._updateVolume(t),this._trigger(n.jPlayer.event.volumechange))},volumeBar:function(n){if(this.css.jq.volumeBar.length){var t=this.css.jq.volumeBar.offset(),i=n.pageX-t.left,r=this.css.jq.volumeBar.width(),u=this.css.jq.volumeBar.height()-n.pageY+t.top,f=this.css.jq.volumeBar.height();this.options.verticalVolume?this.volume(u/f):this.volume(i/r)}this.options.muted&&this._muted(!1)},volumeBarValue:function(n){this.volumeBar(n)},_updateVolume:function(n){n===t&&(n=this.options.volume);n=this.options.muted?0:n;this.status.noVolume?(this.css.jq.volumeBar.length&&this.css.jq.volumeBar.hide(),this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.hide(),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.hide()):(this.css.jq.volumeBar.length&&this.css.jq.volumeBar.show(),this.css.jq.volumeBarValue.length&&(this.css.jq.volumeBarValue.show(),this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"](n*100+"%")),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.show())},volumeMax:function(){this.volume(1);this.options.muted&&this._muted(!1)},_cssSelectorAncestor:function(t){var i=this;this.options.cssSelectorAncestor=t;this._removeUiClass();this.ancestorJq=t?n(t):[];t&&this.ancestorJq.length!==1&&this._warning({type:n.jPlayer.warning.CSS_SELECTOR_COUNT,context:t,message:n.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:n.jPlayer.warningHint.CSS_SELECTOR_COUNT});this._addUiClass();n.each(this.options.cssSelector,function(n,t){i._cssSelector(n,t)})},_cssSelector:function(t,i){var u=this,r;typeof i=="string"?n.jPlayer.prototype.options.cssSelector[t]?(this.css.jq[t]&&this.css.jq[t].length&&this.css.jq[t].unbind(".jPlayer"),this.options.cssSelector[t]=i,this.css.cs[t]=this.options.cssSelectorAncestor+" "+i,this.css.jq[t]=i?n(this.css.cs[t]):[],this.css.jq[t].length&&(r=function(i){return u[t](i),n(this).blur(),!1},this.css.jq[t].bind("click.jPlayer",r)),i&&this.css.jq[t].length!==1&&this._warning({type:n.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[t],message:n.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[t].length+" found for "+t+" method.",hint:n.jPlayer.warningHint.CSS_SELECTOR_COUNT})):this._warning({type:n.jPlayer.warning.CSS_SELECTOR_METHOD,context:t,message:n.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:n.jPlayer.warningHint.CSS_SELECTOR_METHOD}):this._warning({type:n.jPlayer.warning.CSS_SELECTOR_STRING,context:i,message:n.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:n.jPlayer.warningHint.CSS_SELECTOR_STRING})},seekBar:function(n){if(this.css.jq.seekBar){var t=this.css.jq.seekBar.offset(),i=n.pageX-t.left,r=this.css.jq.seekBar.width(),u=100*i/r;this.playHead(u)}},playBar:function(n){this.seekBar(n)},repeat:function(){this._loop(!0)},repeatOff:function(){this._loop(!1)},_loop:function(t){this.options.loop!==t&&(this.options.loop=t,this._updateButtons(),this._trigger(n.jPlayer.event.repeat))},currentTime:function(){},duration:function(){},gui:function(){},noSolution:function(){},option:function(i,r){var h=i,u,e,o,s,f;if(arguments.length===0)return n.extend(!0,{},this.options);if(typeof i=="string"){if(u=i.split("."),r===t){for(e=n.extend(!0,{},this.options),o=0;o<u.length;o++)if(e[u[o]]!==t)e=e[u[o]];else return this._warning({type:n.jPlayer.warning.OPTION_KEY,context:i,message:n.jPlayer.warningMsg.OPTION_KEY,hint:n.jPlayer.warningHint.OPTION_KEY}),t;return e}for(h={},s=h,f=0;f<u.length;f++)f<u.length-1?(s[u[f]]={},s=s[u[f]]):s[u[f]]=r}return this._setOptions(h),this},_setOptions:function(t){var i=this;return n.each(t,function(n,t){i._setOption(n,t)}),this},_setOption:function(t,i){var r=this;switch(t){case"volume":this.volume(i);break;case"muted":this._muted(i);break;case"cssSelectorAncestor":this._cssSelectorAncestor(i);break;case"cssSelector":n.each(i,function(n,t){r._cssSelector(n,t)});break;case"fullScreen":this.options[t]!==i&&(this._removeUiClass(),this.options[t]=i,this._refreshSize());break;case"size":this.options.fullScreen||this.options[t].cssClass===i.cssClass||this._removeUiClass();this.options[t]=n.extend({},this.options[t],i);this._refreshSize();break;case"sizeFull":this.options.fullScreen&&this.options[t].cssClass!==i.cssClass&&this._removeUiClass();this.options[t]=n.extend({},this.options[t],i);this._refreshSize();break;case"autohide":this.options[t]=n.extend({},this.options[t],i);this._updateAutohide();break;case"loop":this._loop(i);break;case"nativeVideoControls":this.options[t]=n.extend({},this.options[t],i);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this._restrictNativeVideoControls();this._updateNativeVideoControls();break;case"noFullScreen":this.options[t]=n.extend({},this.options[t],i);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullScreen=this._uaBlocklist(this.options.noFullScreen);this._restrictNativeVideoControls();this._updateButtons();break;case"noVolume":this.options[t]=n.extend({},this.options[t],i);this.status.noVolume=this._uaBlocklist(this.options.noVolume);this._updateVolume();this._updateMute();break;case"emulateHtml":this.options[t]!==i&&(this.options[t]=i,i?this._emulateHtmlBridge():this._destroyHtmlBridge())}return this},_refreshSize:function(){this._setSize();this._addUiClass();this._updateSize();this._updateButtons();this._updateAutohide();this._trigger(n.jPlayer.event.resize)},_setSize:function(){this.options.fullScreen?(this.status.width=this.options.sizeFull.width,this.status.height=this.options.sizeFull.height,this.status.cssClass=this.options.sizeFull.cssClass):(this.status.width=this.options.size.width,this.status.height=this.options.size.height,this.status.cssClass=this.options.size.cssClass);this.element.css({width:this.status.width,height:this.status.height})},_addUiClass:function(){this.ancestorJq.length&&this.ancestorJq.addClass(this.status.cssClass)},_removeUiClass:function(){this.ancestorJq.length&&this.ancestorJq.removeClass(this.status.cssClass)},_updateSize:function(){this.internal.poster.jq.css({width:this.status.width,height:this.status.height});!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):!this.status.waitForPlay&&this.flash.active&&this.status.video&&this.internal.flash.jq.css({width:this.status.width,height:this.status.height})},_updateAutohide:function(){var n=this,t=".jPlayerAutohide",i="mousemove.jPlayer"+t,r=function(){n.css.jq.gui.fadeIn(n.options.autohide.fadeIn,function(){clearTimeout(n.internal.autohideId);n.internal.autohideId=setTimeout(function(){n.css.jq.gui.fadeOut(n.options.autohide.fadeOut)},n.options.autohide.hold)})};this.css.jq.gui.length&&(this.css.jq.gui.stop(!0,!0),clearTimeout(this.internal.autohideId),this.element.unbind(t),this.css.jq.gui.unbind(t),this.status.nativeVideoControls?this.css.jq.gui.hide():this.options.fullScreen&&this.options.autohide.full||!this.options.fullScreen&&this.options.autohide.restored?(this.element.bind(i,r),this.css.jq.gui.bind(i,r),this.css.jq.gui.hide()):this.css.jq.gui.show())},fullScreen:function(){this._setOption("fullScreen",!0)},restoreScreen:function(){this._setOption("fullScreen",!1)},_html_initMedia:function(){this.htmlElement.media.src=this.status.src;this.options.preload!=="none"&&this._html_load();this._trigger(n.jPlayer.event.timeupdate)},_html_setAudio:function(t){var i=this;n.each(this.formats,function(n,r){if(i.html.support[r]&&t[r])return i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1});this.htmlElement.media=this.htmlElement.audio;this._html_initMedia()},_html_setVideo:function(t){var i=this;n.each(this.formats,function(n,r){if(i.html.support[r]&&t[r])return i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1});this.status.nativeVideoControls&&(this.htmlElement.video.poster=this._validString(t.poster)?t.poster:"");this.htmlElement.media=this.htmlElement.video;this._html_initMedia()},_html_resetMedia:function(){this.htmlElement.media&&(this.htmlElement.media.id!==this.internal.video.id||this.status.nativeVideoControls||this.internal.video.jq.css({width:"0px",height:"0px"}),this.htmlElement.media.pause())},_html_clearMedia:function(){this.htmlElement.media&&(this.htmlElement.media.src="",this.htmlElement.media.load())},_html_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.htmlElement.media.load());clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(n){var t=this;if(this._html_load(),this.htmlElement.media.play(),!isNaN(n))try{this.htmlElement.media.currentTime=n}catch(i){this.internal.htmlDlyCmdId=setTimeout(function(){t.play(n)},100);return}this._html_checkWaitForPlay()},_html_pause:function(n){var t=this;if(n>0?this._html_load():clearTimeout(this.internal.htmlDlyCmdId),this.htmlElement.media.pause(),!isNaN(n))try{this.htmlElement.media.currentTime=n}catch(i){this.internal.htmlDlyCmdId=setTimeout(function(){t.pause(n)},100);return}n>0&&this._html_checkWaitForPlay()},_html_playHead:function(n){var t=this;this._html_load();try{if(typeof this.htmlElement.media.seekable=="object"&&this.htmlElement.media.seekable.length>0)this.htmlElement.media.currentTime=n*this.htmlElement.media.seekable.end(this.htmlElement.media.seekable.length-1)/100;else if(this.htmlElement.media.duration>0&&!isNaN(this.htmlElement.media.duration))this.htmlElement.media.currentTime=n*this.htmlElement.media.duration/100;else throw"e";}catch(i){this.internal.htmlDlyCmdId=setTimeout(function(){t.playHead(n)},100);return}this.status.waitForLoad||this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})))},_html_volume:function(n){this.html.audio.available&&(this.htmlElement.audio.volume=n);this.html.video.available&&(this.htmlElement.video.volume=n)},_html_mute:function(n){this.html.audio.available&&(this.htmlElement.audio.muted=n);this.html.video.available&&(this.htmlElement.video.muted=n)},_flash_setAudio:function(t){var i=this;try{n.each(this.formats,function(n,r){if(i.flash.support[r]&&t[r]){switch(r){case"m4a":case"fla":i._getMovie().fl_setAudio_m4a(t[r]);break;case"mp3":i._getMovie().fl_setAudio_mp3(t[r]);break;case"rtmpa":i._getMovie().fl_setAudio_rtmp(t[r])}return i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1}});this.options.preload==="auto"&&(this._flash_load(),this.status.waitForLoad=!1)}catch(r){this._flashError(r)}},_flash_setVideo:function(t){var i=this;try{n.each(this.formats,function(n,r){if(i.flash.support[r]&&t[r]){switch(r){case"m4v":case"flv":i._getMovie().fl_setVideo_m4v(t[r]);break;case"rtmpv":i._getMovie().fl_setVideo_rtmp(t[r])}return i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1}});this.options.preload==="auto"&&(this._flash_load(),this.status.waitForLoad=!1)}catch(r){this._flashError(r)}},_flash_resetMedia:function(){this.internal.flash.jq.css({width:"0px",height:"0px"});this._flash_pause(NaN)},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia()}catch(n){this._flashError(n)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(n){this._flashError(n)}this.status.waitForLoad=!1},_flash_play:function(n){try{this._getMovie().fl_play(n)}catch(t){this._flashError(t)}this.status.waitForLoad=!1;this._flash_checkWaitForPlay()},_flash_pause:function(n){try{this._getMovie().fl_pause(n)}catch(t){this._flashError(t)}n>0&&(this.status.waitForLoad=!1,this._flash_checkWaitForPlay())},_flash_playHead:function(n){try{this._getMovie().fl_play_head(n)}catch(t){this._flashError(t)}this.status.waitForLoad||this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.flash.jq.css({width:this.status.width,height:this.status.height})))},_flash_volume:function(n){try{this._getMovie().fl_volume(n)}catch(t){this._flashError(t)}},_flash_mute:function(n){try{this._getMovie().fl_mute(n)}catch(t){this._flashError(t)}},_getMovie:function(){return document[this.internal.flash.id]},_checkForFlash:function(n){var t=!1,i,r;if(window.ActiveXObject)try{i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+n);t=!0}catch(u){}else navigator.plugins&&navigator.mimeTypes.length>0&&(i=navigator.plugins["Shockwave Flash"],i&&(r=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1"),r>=n&&(t=!0)));return t},_validString:function(n){return n&&typeof n=="string"},_limitValue:function(n,t,i){return n<t?t:n>i?i:n},_urlNotSetError:function(t){this._error({type:n.jPlayer.error.URL_NOT_SET,context:t,message:n.jPlayer.errorMsg.URL_NOT_SET,hint:n.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(t){var i;i=this.internal.ready?"FLASH_DISABLED":"FLASH";this._error({type:n.jPlayer.error[i],context:this.internal.flash.swf,message:n.jPlayer.errorMsg[i]+t.message,hint:n.jPlayer.errorHint[i]});this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(t){this._trigger(n.jPlayer.event.error,t);this.options.errorAlerts&&this._alert("Error!"+(t.message?"\n\n"+t.message:"")+(t.hint?"\n\n"+t.hint:"")+"\n\nContext: "+t.context)},_warning:function(i){this._trigger(n.jPlayer.event.warning,t,i);this.options.warningAlerts&&this._alert("Warning!"+(i.message?"\n\n"+i.message:"")+(i.hint?"\n\n"+i.hint:"")+"\n\nContext: "+i.context)},_alert:function(n){alert("jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+n)},_emulateHtmlBridge:function(){var t=this,i=n.jPlayer.emulateMethods;n.each(n.jPlayer.emulateMethods.split(/\s+/g),function(n,i){t.internal.domNode[i]=function(n){t[i](n)}});n.each(n.jPlayer.event,function(i,r){var u=!0;n.each(n.jPlayer.reservedEvent.split(/\s+/g),function(n,t){if(t===i)return u=!1,!1});u&&t.element.bind(r+".jPlayer.jPlayerHtml",function(){t._emulateHtmlUpdate();var n=document.createEvent("Event");n.initEvent(i,!1,!0);t.internal.domNode.dispatchEvent(n)})})},_emulateHtmlUpdate:function(){var t=this;n.each(n.jPlayer.emulateStatus.split(/\s+/g),function(n,i){t.internal.domNode[i]=t.status[i]});n.each(n.jPlayer.emulateOptions.split(/\s+/g),function(n,i){t.internal.domNode[i]=t.options[i]})},_destroyHtmlBridge:function(){var i=this,t;this.element.unbind(".jPlayerHtml");t=n.jPlayer.emulateMethods+" "+n.jPlayer.emulateStatus+" "+n.jPlayer.emulateOptions;n.each(t.split(/\s+/g),function(n,t){delete i.internal.domNode[t]})}};n.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};n.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+n.jPlayer.prototype.version.script+" needs Jplayer.swf version "+n.jPlayer.prototype.version.needFlash+" but found "};n.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};n.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};n.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};n.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}}(jQuery),function(n,t){jPlayerPlaylist=function(t,i,r){var u=this;this.current=0;this.removing=this.shuffled=this.loop=!1;this.cssSelector=n.extend({},this._cssSelector,t);this.options=n.extend(!0,{keyBindings:{next:{key:39,fn:function(){u.next()}},previous:{key:37,fn:function(){u.previous()}}}},this._options,r);this.playlist=[];this.original=[];this._initPlaylist(i);this.cssSelector.title=this.cssSelector.cssSelectorAncestor+" .jp-title";this.cssSelector.playlist=this.cssSelector.cssSelectorAncestor+" .jp-playlist";this.cssSelector.next=this.cssSelector.cssSelectorAncestor+" .jp-next";this.cssSelector.previous=this.cssSelector.cssSelectorAncestor+" .jp-previous";this.cssSelector.shuffle=this.cssSelector.cssSelectorAncestor+" .jp-shuffle";this.cssSelector.shuffleOff=this.cssSelector.cssSelectorAncestor+" .jp-shuffle-off";this.options.cssSelectorAncestor=this.cssSelector.cssSelectorAncestor;this.options.repeat=function(n){u.loop=n.jPlayer.options.loop};n(this.cssSelector.jPlayer).bind(n.jPlayer.event.ready,function(){u._init()});n(this.cssSelector.jPlayer).bind(n.jPlayer.event.ended,function(){u.next()});n(this.cssSelector.jPlayer).bind(n.jPlayer.event.play,function(){n(this).jPlayer("pauseOthers")});n(this.cssSelector.jPlayer).bind(n.jPlayer.event.resize,function(t){t.jPlayer.options.fullScreen?n(u.cssSelector.title).show():n(u.cssSelector.title).hide()});n(this.cssSelector.previous).click(function(){return u.previous(),n(this).blur(),!1});n(this.cssSelector.next).click(function(){return u.next(),n(this).blur(),!1});n(this.cssSelector.shuffle).click(function(){return u.shuffle(!0),!1});n(this.cssSelector.shuffleOff).click(function(){return u.shuffle(!1),!1}).hide();this.options.fullScreen||n(this.cssSelector.title).hide();n(this.cssSelector.playlist+" ul").empty();this._createItemHandlers();n(this.cssSelector.jPlayer).jPlayer(this.options)};jPlayerPlaylist.prototype={_cssSelector:{jPlayer:"#jquery_jplayer_1",cssSelectorAncestor:"#jp_container_1"},_options:{playlistOptions:{autoPlay:!1,loopOnPrevious:!1,shuffleOnLoop:!0,enableRemoveControls:!1,displayTime:"slow",addTime:"fast",removeTime:"fast",shuffleTime:"slow",itemClass:"jp-playlist-item",freeGroupClass:"jp-free-media",freeItemClass:"jp-playlist-item-free",removeItemClass:"jp-playlist-item-remove"}},option:function(n,i){if(i===t)return this.options.playlistOptions[n];this.options.playlistOptions[n]=i;switch(n){case"enableRemoveControls":this._updateControls();break;case"itemClass":case"freeGroupClass":case"freeItemClass":case"removeItemClass":this._refresh(!0);this._createItemHandlers()}return this},_init:function(){var n=this;this._refresh(function(){n.options.playlistOptions.autoPlay?n.play(n.current):n.select(n.current)})},_initPlaylist:function(t){this.current=0;this.removing=this.shuffled=!1;this.original=n.extend(!0,[],t);this._originalPlaylist()},_originalPlaylist:function(){var t=this;this.playlist=[];n.each(this.original,function(n){t.playlist[n]=t.original[n]})},_refresh:function(t){var i=this,r;t&&!n.isFunction(t)?(n(this.cssSelector.playlist+" ul").empty(),n.each(this.playlist,function(t){n(i.cssSelector.playlist+" ul").append(i._createListItem(i.playlist[t]))}),this._updateControls()):(r=n(this.cssSelector.playlist+" ul").children().length?this.options.playlistOptions.displayTime:0,n(this.cssSelector.playlist+" ul").slideUp(r,function(){var r=n(this);n(this).empty();n.each(i.playlist,function(n){r.append(i._createListItem(i.playlist[n]))});i._updateControls();n.isFunction(t)&&t();i.playlist.length?n(this).slideDown(i.options.playlistOptions.displayTime):n(this).show()}))},_createListItem:function(t){var u=this,i="<li><div>",i=i+("<a href='javascript:;' class='"+this.options.playlistOptions.removeItemClass+"'>&times;<\/a>"),r;return t.free&&(r=!0,i=i+("<span class='"+this.options.playlistOptions.freeGroupClass+"'>("),n.each(t,function(t,f){n.jPlayer.prototype.format[t]&&(r?r=!1:i+=" | ",i+="<a class='"+u.options.playlistOptions.freeItemClass+"' href='"+f+"' tabindex='1'>"+t+"<\/a>")}),i+=")<\/span>"),i+="<a href='javascript:;' class='"+this.options.playlistOptions.itemClass+"' tabindex='1'>"+t.title+(t.artist?" <span class='jp-artist'>by "+t.artist+"<\/span>":"")+"<\/a>",i+="<\/div><\/li>"},_createItemHandlers:function(){var t=this;n(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.itemClass).on("click","a."+this.options.playlistOptions.itemClass,function(){var i=n(this).parent().parent().index();return t.current!==i?t.play(i):n(t.cssSelector.jPlayer).jPlayer("play"),n(this).blur(),!1});n(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.freeItemClass).on("click","a."+this.options.playlistOptions.freeItemClass,function(){return n(this).parent().parent().find("."+t.options.playlistOptions.itemClass).click(),n(this).blur(),!1});n(this.cssSelector.playlist).off("click","a."+this.options.playlistOptions.removeItemClass).on("click","a."+this.options.playlistOptions.removeItemClass,function(){var i=n(this).parent().parent().index();return t.remove(i),n(this).blur(),!1})},_updateControls:function(){this.options.playlistOptions.enableRemoveControls?n(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).show():n(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).hide();this.shuffled?(n(this.cssSelector.shuffleOff).show(),n(this.cssSelector.shuffle).hide()):(n(this.cssSelector.shuffleOff).hide(),n(this.cssSelector.shuffle).show())},_highlight:function(i){this.playlist.length&&i!==t&&(n(this.cssSelector.playlist+" .jp-playlist-current").removeClass("jp-playlist-current"),n(this.cssSelector.playlist+" li:nth-child("+(i+1)+")").addClass("jp-playlist-current").find(".jp-playlist-item").addClass("jp-playlist-current"),n(this.cssSelector.title+" li").html(this.playlist[i].title+(this.playlist[i].artist?" <span class='jp-artist'>by "+this.playlist[i].artist+"<\/span>":"")))},setPlaylist:function(n){this._initPlaylist(n);this._init()},add:function(t,i){n(this.cssSelector.playlist+" ul").append(this._createListItem(t)).find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime);this._updateControls();this.original.push(t);this.playlist.push(t);i?this.play(this.playlist.length-1):1===this.original.length&&this.select(0)},remove:function(i){var r=this;return i===t?(this._initPlaylist([]),this._refresh(function(){n(r.cssSelector.jPlayer).jPlayer("clearMedia")}),!0):this.removing?!1:(i=0>i?r.original.length+i:i,0<=i&&i<this.playlist.length&&(this.removing=!0,n(this.cssSelector.playlist+" li:nth-child("+(i+1)+")").slideUp(this.options.playlistOptions.removeTime,function(){if(n(this).remove(),r.shuffled){var t=r.playlist[i];n.each(r.original,function(n){if(r.original[n]===t)return r.original.splice(n,1),!1})}else r.original.splice(i,1);r.playlist.splice(i,1);r.original.length?i===r.current?(r.current=i<r.original.length?r.current:r.original.length-1,r.select(r.current)):i<r.current&&r.current--:(n(r.cssSelector.jPlayer).jPlayer("clearMedia"),r.current=0,r.shuffled=!1,r._updateControls());r.removing=!1})),!0)},select:function(t){t=0>t?this.original.length+t:t;0<=t&&t<this.playlist.length?(this.current=t,this._highlight(t),n(this.cssSelector.jPlayer).jPlayer("setMedia",this.playlist[this.current])):this.current=0},play:function(i){i=0>i?this.original.length+i:i;0<=i&&i<this.playlist.length?this.playlist.length&&(this.select(i),n(this.cssSelector.jPlayer).jPlayer("play")):i===t&&n(this.cssSelector.jPlayer).jPlayer("play")},pause:function(){n(this.cssSelector.jPlayer).jPlayer("pause")},next:function(){var n=this.current+1<this.playlist.length?this.current+1:0;this.loop?0===n&&this.shuffled&&this.options.playlistOptions.shuffleOnLoop&&1<this.playlist.length?this.shuffle(!0,!0):this.play(n):0<n&&this.play(n)},previous:function(){var n=0<=this.current-1?this.current-1:this.playlist.length-1;(this.loop&&this.options.playlistOptions.loopOnPrevious||n<this.playlist.length-1)&&this.play(n)},shuffle:function(i,r){var u=this;i===t&&(i=!this.shuffled);(i||i!==this.shuffled)&&n(this.cssSelector.playlist+" ul").slideUp(this.options.playlistOptions.shuffleTime,function(){(u.shuffled=i)?u.playlist.sort(function(){return.5-Math.random()}):u._originalPlaylist();u._refresh(!0);r||!n(u.cssSelector.jPlayer).data("jPlayer").status.paused?u.play(0):u.select(0);n(this).slideDown(u.options.playlistOptions.shuffleTime)})}}}(jQuery),!function(){function n(t){var i=n.modules[t];if(!i)throw new Error('failed to require "'+t+'"');return"exports"in i||"function"!=typeof i.definition||(i.client=i.component=!0,i.definition.call(this,i.exports={},i),delete i.definition),i.exports}n.modules={};n.register=function(t,i){n.modules[t]={definition:i}};n.define=function(t,i){n.modules[t]={exports:i}};n.register("component~emitter@1.1.2",function(n,t){function i(n){if(n)return r(n)}function r(n){for(var t in i.prototype)n[t]=i.prototype[t];return n}t.exports=i;i.prototype.on=i.prototype.addEventListener=function(n,t){return this._callbacks=this._callbacks||{},(this._callbacks[n]=this._callbacks[n]||[]).push(t),this};i.prototype.once=function(n,t){function i(){r.off(n,i);t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},i.fn=t,this.on(n,i),this};i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(n,t){var i,u,r;if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;if(i=this._callbacks[n],!i)return this;if(1==arguments.length)return delete this._callbacks[n],this;for(r=0;r<i.length;r++)if(u=i[r],u===t||u.fn===t){i.splice(r,1);break}return this};i.prototype.emit=function(n){var r,t,i,u;if(this._callbacks=this._callbacks||{},r=[].slice.call(arguments,1),t=this._callbacks[n],t)for(t=t.slice(0),i=0,u=t.length;u>i;++i)t[i].apply(this,r);return this};i.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks[n]||[]};i.prototype.hasListeners=function(n){return!!this.listeners(n).length}});n.register("dropzone",function(t,i){i.exports=n("dropzone/lib/dropzone.js")});n.register("dropzone/lib/dropzone.js",function(t,i){(function(){var t,u,f,e,o,s,r,h,c={}.hasOwnProperty,l=function(n,t){function r(){this.constructor=n}for(var i in t)c.call(t,i)&&(n[i]=t[i]);return r.prototype=t.prototype,n.prototype=new r,n.__super__=t.prototype,n},a=[].slice;u="undefined"!=typeof Emitter&&null!==Emitter?Emitter:n("component~emitter@1.1.2");r=function(){};t=function(n){function t(n,r){var f,u,e;if(this.element=n,this.version=t.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(t.instances.push(this),this.element.dropzone=this,f=null!=(e=t.optionsForElement(this.element))?e:{},this.options=i({},this.defaultOptions,f,null!=r?r:{}),this.options.forceFallback||!t.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes);this.options.method=this.options.method.toUpperCase();(u=this.getExistingFallback())&&u.parentNode&&u.parentNode.removeChild(u);this.options.previewsContainer!==!1&&(this.previewsContainer=this.options.previewsContainer?t.getElement(this.options.previewsContainer,"previewsContainer"):this.element);this.options.clickable&&(this.clickableElements=this.options.clickable===!0?[this.element]:t.getElements(this.options.clickable,"clickable"));this.init()}var i;return l(t,n),t.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached"],t.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:100,thumbnailHeight:100,maxFiles:null,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",accept:function(n,t){return t()},init:function(){return r},forceFallback:!1,fallback:function(){var i,n,u,r,e,f;for(this.element.className=""+this.element.className+" dz-browser-not-supported",f=this.element.getElementsByTagName("div"),r=0,e=f.length;e>r;r++)i=f[r],/(^| )dz-message($| )/.test(i.className)&&(n=i,i.className="dz-message");return n||(n=t.createElement('<div class="dz-message"><span><\/span><\/div>'),this.element.appendChild(n)),u=n.getElementsByTagName("span")[0],u&&(u.textContent=this.options.dictFallbackMessage),this.element.appendChild(this.getFallbackForm())},resize:function(n){var t,i,r;return t={srcX:0,srcY:0,srcWidth:n.width,srcHeight:n.height},i=n.width/n.height,t.optWidth=this.options.thumbnailWidth,t.optHeight=this.options.thumbnailHeight,null==t.optWidth&&null==t.optHeight?(t.optWidth=t.srcWidth,t.optHeight=t.srcHeight):null==t.optWidth?t.optWidth=i*t.optHeight:null==t.optHeight&&(t.optHeight=1/i*t.optWidth),r=t.optWidth/t.optHeight,n.height<t.optHeight||n.width<t.optWidth?(t.trgHeight=t.srcHeight,t.trgWidth=t.srcWidth):i>r?(t.srcHeight=n.height,t.srcWidth=t.srcHeight*r):(t.srcWidth=n.width,t.srcHeight=t.srcWidth/r),t.srcX=(n.width-t.srcWidth)/2,t.srcY=(n.height-t.srcHeight)/2,t},drop:function(){return this.element.classList.remove("dz-drag-hover")},dragstart:r,dragend:function(){return this.element.classList.remove("dz-drag-hover")},dragenter:function(){return this.element.classList.add("dz-drag-hover")},dragover:function(){return this.element.classList.add("dz-drag-hover")},dragleave:function(){return this.element.classList.remove("dz-drag-hover")},paste:r,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(n){var i,c,l,r,u,f,a,v,y,e,o,s,h;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(n.previewElement=t.createElement(this.options.previewTemplate.trim()),n.previewTemplate=n.previewElement,this.previewsContainer.appendChild(n.previewElement),e=n.previewElement.querySelectorAll("[data-dz-name]"),r=0,a=e.length;a>r;r++)i=e[r],i.textContent=n.name;for(o=n.previewElement.querySelectorAll("[data-dz-size]"),u=0,v=o.length;v>u;u++)i=o[u],i.innerHTML=this.filesize(n.size);for(this.options.addRemoveLinks&&(n._removeLink=t.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"<\/a>"),n.previewElement.appendChild(n._removeLink)),c=function(i){return function(r){return r.preventDefault(),r.stopPropagation(),n.status===t.UPLOADING?t.confirm(i.options.dictCancelUploadConfirmation,function(){return i.removeFile(n)}):i.options.dictRemoveFileConfirmation?t.confirm(i.options.dictRemoveFileConfirmation,function(){return i.removeFile(n)}):i.removeFile(n)}}(this),s=n.previewElement.querySelectorAll("[data-dz-remove]"),h=[],f=0,y=s.length;y>f;f++)l=s[f],h.push(l.addEventListener("click",c));return h}},removedfile:function(n){var t;return n.previewElement&&null!=(t=n.previewElement)&&t.parentNode.removeChild(n.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(n,t){var r,i,e,u,f;if(n.previewElement){for(n.previewElement.classList.remove("dz-file-preview"),n.previewElement.classList.add("dz-image-preview"),u=n.previewElement.querySelectorAll("[data-dz-thumbnail]"),f=[],i=0,e=u.length;e>i;i++)r=u[i],r.alt=n.name,f.push(r.src=t);return f}},error:function(n,t){var f,i,e,r,u;if(n.previewElement){for(n.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error),r=n.previewElement.querySelectorAll("[data-dz-errormessage]"),u=[],i=0,e=r.length;e>i;i++)f=r[i],u.push(f.textContent=t);return u}},errormultiple:r,processing:function(n){if(n.previewElement&&(n.previewElement.classList.add("dz-processing"),n._removeLink))return n._removeLink.textContent=this.options.dictCancelUpload},processingmultiple:r,uploadprogress:function(n,t){var f,i,e,r,u;if(n.previewElement){for(r=n.previewElement.querySelectorAll("[data-dz-uploadprogress]"),u=[],i=0,e=r.length;e>i;i++)f=r[i],u.push(f.style.width=""+t+"%");return u}},totaluploadprogress:r,sending:r,sendingmultiple:r,success:function(n){if(n.previewElement)return n.previewElement.classList.add("dz-success")},successmultiple:r,canceled:function(n){return this.emit("error",n,"Upload canceled.")},canceledmultiple:r,complete:function(n){if(n._removeLink)return n._removeLink.textContent=this.options.dictRemoveFile},completemultiple:r,maxfilesexceeded:r,maxfilesreached:r,previewTemplate:'<div class="dz-preview dz-file-preview">\n  <div class="dz-details">\n    <div class="dz-filename"><span data-dz-name><\/span><\/div>\n    <div class="dz-size" data-dz-size><\/div>\n    <img data-dz-thumbnail />\n  <\/div>\n  <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress><\/span><\/div>\n  <div class="dz-success-mark"><span>✔<\/span><\/div>\n  <div class="dz-error-mark"><span>✘<\/span><\/div>\n  <div class="dz-error-message"><span data-dz-errormessage><\/span><\/div>\n<\/div>'},i=function(){var t,i,r,u,f,n,e;for(u=arguments[0],r=2<=arguments.length?a.call(arguments,1):[],n=0,e=r.length;e>n;n++){i=r[n];for(t in i)f=i[t],u[t]=f}return u},t.prototype.getAcceptedFiles=function(){var t,n,u,i,r;for(i=this.files,r=[],n=0,u=i.length;u>n;n++)t=i[n],t.accepted&&r.push(t);return r},t.prototype.getRejectedFiles=function(){var t,n,u,i,r;for(i=this.files,r=[],n=0,u=i.length;u>n;n++)t=i[n],t.accepted||r.push(t);return r},t.prototype.getFilesWithStatus=function(n){var i,t,f,r,u;for(r=this.files,u=[],t=0,f=r.length;f>t;t++)i=r[t],i.status===n&&u.push(i);return u},t.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(t.QUEUED)},t.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(t.UPLOADING)},t.prototype.getActiveFiles=function(){var n,i,f,r,u;for(r=this.files,u=[],i=0,f=r.length;f>i;i++)n=r[i],(n.status===t.UPLOADING||n.status===t.QUEUED)&&u.push(n);return u},t.prototype.init=function(){var r,n,f,i,e,o,u;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(t.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"<\/span><\/div>")),this.clickableElements.length&&(f=function(n){return function(){return n.hiddenFileInput&&document.body.removeChild(n.hiddenFileInput),n.hiddenFileInput=document.createElement("input"),n.hiddenFileInput.setAttribute("type","file"),(null==n.options.maxFiles||n.options.maxFiles>1)&&n.hiddenFileInput.setAttribute("multiple","multiple"),n.hiddenFileInput.className="dz-hidden-input",null!=n.options.acceptedFiles&&n.hiddenFileInput.setAttribute("accept",n.options.acceptedFiles),n.hiddenFileInput.style.visibility="hidden",n.hiddenFileInput.style.position="absolute",n.hiddenFileInput.style.top="0",n.hiddenFileInput.style.left="0",n.hiddenFileInput.style.height="0",n.hiddenFileInput.style.width="0",document.body.appendChild(n.hiddenFileInput),n.hiddenFileInput.addEventListener("change",function(){var r,t,i,u;if(t=n.hiddenFileInput.files,t.length)for(i=0,u=t.length;u>i;i++)r=t[i],n.addFile(r);return f()})}}(this))(),this.URL=null!=(o=window.URL)?o:window.webkitURL,u=this.events,i=0,e=u.length;e>i;i++)r=u[i],this.on(r,this.options[r]);return this.on("uploadprogress",function(n){return function(){return n.updateTotalUploadProgress()}}(this)),this.on("removedfile",function(n){return function(){return n.updateTotalUploadProgress()}}(this)),this.on("canceled",function(n){return function(t){return n.emit("complete",t)}}(this)),this.on("complete",function(n){return function(){if(0===n.getUploadingFiles().length&&0===n.getQueuedFiles().length)return setTimeout(function(){return n.emit("queuecomplete")},0)}}(this)),n=function(n){return n.stopPropagation(),n.preventDefault?n.preventDefault():n.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(n){return function(t){return n.emit("dragstart",t)}}(this),dragenter:function(t){return function(i){return n(i),t.emit("dragenter",i)}}(this),dragover:function(t){return function(i){var r;try{r=i.dataTransfer.effectAllowed}catch(u){}return i.dataTransfer.dropEffect="move"===r||"linkMove"===r?"move":"copy",n(i),t.emit("dragover",i)}}(this),dragleave:function(n){return function(t){return n.emit("dragleave",t)}}(this),drop:function(t){return function(i){return n(i),t.drop(i)}}(this),dragend:function(n){return function(t){return n.emit("dragend",t)}}(this)}}],this.clickableElements.forEach(function(n){return function(i){return n.listeners.push({element:i,events:{click:function(r){if(i!==n.element||r.target===n.element||t.elementInside(r.target,n.element.querySelector(".dz-message")))return n.hiddenFileInput.click()}}})}}(this)),this.enable(),this.options.init.call(this)},t.prototype.destroy=function(){var n;return this.disable(),this.removeAllFiles(!0),(null!=(n=this.hiddenFileInput)?n.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,t.instances.splice(t.instances.indexOf(this),1)},t.prototype.updateTotalUploadProgress=function(){var e,r,n,t,u,i,o,f;if(t=0,n=0,e=this.getActiveFiles(),e.length){for(f=this.getActiveFiles(),i=0,o=f.length;o>i;i++)r=f[i],t+=r.upload.bytesSent,n+=r.upload.total;u=100*t/n}else u=100;return this.emit("totaluploadprogress",u,n,t)},t.prototype._getParamName=function(n){return"function"==typeof this.options.paramName?this.options.paramName(n):""+this.options.paramName+(this.options.uploadMultiple?"["+n+"]":"")},t.prototype.getFallbackForm=function(){var u,r,n,i;return(u=this.getExistingFallback())?u:(n='<div class="dz-fallback">',this.options.dictFallbackText&&(n+="<p>"+this.options.dictFallbackText+"<\/p>"),n+='<input type="file" name="'+this._getParamName(0)+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"><\/div>',r=t.createElement(n),"FORM"!==this.element.tagName?(i=t.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"><\/form>'),i.appendChild(r)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=i?i:r)},t.prototype.getExistingFallback=function(){var i,r,u,n,f,t;for(r=function(n){for(var i,t=0,r=n.length;r>t;t++)if(i=n[t],/(^| )fallback($| )/.test(i.className))return i},t=["div","form"],n=0,f=t.length;f>n;n++)if(u=t[n],i=r(this.element.getElementsByTagName(u)))return i},t.prototype.setupEventListeners=function(){var t,i,f,n,e,r,u;for(r=this.listeners,u=[],n=0,e=r.length;e>n;n++)t=r[n],u.push(function(){var n,r;n=t.events;r=[];for(i in n)f=n[i],r.push(t.element.addEventListener(i,f,!1));return r}());return u},t.prototype.removeEventListeners=function(){var t,i,f,n,e,r,u;for(r=this.listeners,u=[],n=0,e=r.length;e>n;n++)t=r[n],u.push(function(){var n,r;n=t.events;r=[];for(i in n)f=n[i],r.push(t.element.removeEventListener(i,f,!1));return r}());return u},t.prototype.disable=function(){var r,n,u,t,i;for(this.clickableElements.forEach(function(n){return n.classList.remove("dz-clickable")}),this.removeEventListeners(),t=this.files,i=[],n=0,u=t.length;u>n;n++)r=t[n],i.push(this.cancelUpload(r));return i},t.prototype.enable=function(){return this.clickableElements.forEach(function(n){return n.classList.add("dz-clickable")}),this.setupEventListeners()},t.prototype.filesize=function(n){var t;return n>=109951162777.6?(n/=109951162777.6,t="TiB"):n>=107374182.4?(n/=107374182.4,t="GiB"):n>=104857.6?(n/=104857.6,t="MiB"):n>=102.4?(n/=102.4,t="KiB"):(n=10*n,t="b"),"<strong>"+Math.round(n)/10+"<\/strong> "+t},t.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},t.prototype.drop=function(n){var i,t;n.dataTransfer&&(this.emit("drop",n),i=n.dataTransfer.files,i.length&&(t=n.dataTransfer.items,t&&t.length&&null!=t[0].webkitGetAsEntry?this._addFilesFromItems(t):this.handleFiles(i)))},t.prototype.paste=function(n){var t,i;if(null!=(null!=n&&null!=(i=n.clipboardData)?i.items:void 0))return this.emit("paste",n),t=n.clipboardData.items,t.length?this._addFilesFromItems(t):void 0},t.prototype.handleFiles=function(n){var r,t,u,i;for(i=[],t=0,u=n.length;u>t;t++)r=n[t],i.push(this.addFile(r));return i},t.prototype._addFilesFromItems=function(n){var i,t,r,f,u;for(u=[],r=0,f=n.length;f>r;r++)t=n[r],u.push(null!=t.webkitGetAsEntry&&(i=t.webkitGetAsEntry())?i.isFile?this.addFile(t.getAsFile()):i.isDirectory?this._addFilesFromDirectory(i,i.name):void 0:null!=t.getAsFile?null==t.kind||"file"===t.kind?this.addFile(t.getAsFile()):void 0:void 0);return u},t.prototype._addFilesFromDirectory=function(n,t){var i,r;return i=n.createReader(),r=function(n){return function(i){for(var r,u=0,f=i.length;f>u;u++)r=i[u],r.isFile?r.file(function(i){if(!n.options.ignoreHiddenFiles||"."!==i.name.substring(0,1))return(i.fullPath=""+t+"/"+i.name,n.addFile(i))}):r.isDirectory&&n._addFilesFromDirectory(r,""+t+"/"+r.name)}}(this),i.readEntries(r,function(n){if("undefined"!=typeof console&&null!==console&&"function"==typeof console.log)return console.log(n)})},t.prototype.accept=function(n,i){return n.size>1048576*this.options.maxFilesize?i(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(n.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):t.isValidFile(n,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(i(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",n)):this.options.accept.call(this,n,i):i(this.options.dictInvalidFileType)},t.prototype.addFile=function(n){return n.upload={progress:0,total:n.size,bytesSent:0},this.files.push(n),n.status=t.ADDED,this.emit("addedfile",n),this._enqueueThumbnail(n),this.accept(n,function(t){return function(i){return i?(n.accepted=!1,t._errorProcessing([n],i)):(n.accepted=!0,t.options.autoQueue&&t.enqueueFile(n)),t._updateMaxFilesReachedClass()}}(this))},t.prototype.enqueueFiles=function(n){for(var i,t=0,r=n.length;r>t;t++)i=n[t],this.enqueueFile(i);return null},t.prototype.enqueueFile=function(n){if(n.status!==t.ADDED||n.accepted!==!0)throw new Error("This file can't be queued because it has already been processed or was rejected.");return n.status=t.QUEUED,this.options.autoProcessQueue?setTimeout(function(n){return function(){return n.processQueue()}}(this),0):void 0},t.prototype._thumbnailQueue=[],t.prototype._processingThumbnail=!1,t.prototype._enqueueThumbnail=function(n){if(this.options.createImageThumbnails&&n.type.match(/image.*/)&&n.size<=1048576*this.options.maxThumbnailFilesize)return(this._thumbnailQueue.push(n),setTimeout(function(n){return function(){return n._processThumbnailQueue()}}(this),0))},t.prototype._processThumbnailQueue=function(){if(!this._processingThumbnail&&0!==this._thumbnailQueue.length)return(this._processingThumbnail=!0,this.createThumbnail(this._thumbnailQueue.shift(),function(n){return function(){return n._processingThumbnail=!1,n._processThumbnailQueue()}}(this)))},t.prototype.removeFile=function(n){return n.status===t.UPLOADING&&this.cancelUpload(n),this.files=h(this.files,n),this.emit("removedfile",n),0===this.files.length?this.emit("reset"):void 0},t.prototype.removeAllFiles=function(n){var r,i,f,u;for(null==n&&(n=!1),u=this.files.slice(),i=0,f=u.length;f>i;i++)r=u[i],(r.status!==t.UPLOADING||n)&&this.removeFile(r);return null},t.prototype.createThumbnail=function(n,t){var i;return i=new FileReader,i.onload=function(r){return function(){var u;return u=document.createElement("img"),u.onload=function(){var f,e,i,o,h,c,l,a;return n.width=u.width,n.height=u.height,i=r.options.resize.call(r,n),null==i.trgWidth&&(i.trgWidth=i.optWidth),null==i.trgHeight&&(i.trgHeight=i.optHeight),f=document.createElement("canvas"),e=f.getContext("2d"),f.width=i.trgWidth,f.height=i.trgHeight,s(e,u,null!=(h=i.srcX)?h:0,null!=(c=i.srcY)?c:0,i.srcWidth,i.srcHeight,null!=(l=i.trgX)?l:0,null!=(a=i.trgY)?a:0,i.trgWidth,i.trgHeight),o=f.toDataURL("image/png"),r.emit("thumbnail",n,o),null!=t?t():void 0},u.src=i.result}}(this),i.readAsDataURL(n)},t.prototype.processQueue=function(){var r,t,i,n;if(t=this.options.parallelUploads,i=this.getUploadingFiles().length,r=i,!(i>=t)&&(n=this.getQueuedFiles(),n.length>0)){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,t-i));for(;t>r;){if(!n.length)return;this.processFile(n.shift());r++}}},t.prototype.processFile=function(n){return this.processFiles([n])},t.prototype.processFiles=function(n){for(var i,r=0,u=n.length;u>r;r++)i=n[r],i.processing=!0,i.status=t.UPLOADING,this.emit("processing",i);return this.options.uploadMultiple&&this.emit("processingmultiple",n),this.uploadFiles(n)},t.prototype._getFilesWithXhr=function(n){var t;return function(){var i,f,r,u;for(r=this.files,u=[],i=0,f=r.length;f>i;i++)t=r[i],t.xhr===n&&u.push(t);return u}.call(this)},t.prototype.cancelUpload=function(n){var r,i,u,f,e,o,s;if(n.status===t.UPLOADING){for(i=this._getFilesWithXhr(n.xhr),u=0,e=i.length;e>u;u++)r=i[u],r.status=t.CANCELED;for(n.xhr.abort(),f=0,o=i.length;o>f;f++)r=i[f],this.emit("canceled",r);this.options.uploadMultiple&&this.emit("canceledmultiple",i)}else((s=n.status)===t.ADDED||s===t.QUEUED)&&(n.status=t.CANCELED,this.emit("canceled",n),this.options.uploadMultiple&&this.emit("canceledmultiple",[n]));if(this.options.autoProcessQueue)return this.processQueue()},t.prototype.uploadFile=function(n){return this.uploadFiles([n])},t.prototype.uploadFiles=function(n){var u,f,w,b,ft,l,s,e,k,d,g,nt,et,o,tt,ot,r,a,v,y,p,st,ht,ct,lt,h,at,it,rt,ut,vt,c;for(r=new XMLHttpRequest,a=0,st=n.length;st>a;a++)u=n[a],u.xhr=r;r.open(this.options.method,this.options.url,!0);r.withCredentials=!!this.options.withCredentials;o=null;w=function(t){return function(){var i,e,f;for(f=[],i=0,e=n.length;e>i;i++)u=n[i],f.push(t._errorProcessing(n,o||t.options.dictResponseError.replace("{{statusCode}}",r.status),r));return f}}(this);tt=function(t){return function(i){var s,r,f,e,o,c,l,a,h;if(null!=i)for(r=100*i.loaded/i.total,f=0,c=n.length;c>f;f++)u=n[f],u.upload={progress:r,total:i.total,bytesSent:i.loaded};else{for(s=!0,r=100,e=0,l=n.length;l>e;e++)u=n[e],(100!==u.upload.progress||u.upload.bytesSent!==u.upload.total)&&(s=!1),u.upload.progress=r,u.upload.bytesSent=u.upload.total;if(s)return}for(h=[],o=0,a=n.length;a>o;o++)u=n[o],h.push(t.emit("uploadprogress",u,r,u.upload.bytesSent));return h}}(this);r.onload=function(i){return function(u){var f;if(n[0].status!==t.CANCELED&&4===r.readyState){if(o=r.responseText,r.getResponseHeader("content-type")&&~r.getResponseHeader("content-type").indexOf("application/json"))try{o=JSON.parse(o)}catch(e){u=e;o="Invalid JSON response from server."}return tt(),200<=(f=r.status)&&300>f?i._finished(n,o,u):w()}}}(this);r.onerror=function(){return function(){if(n[0].status!==t.CANCELED)return w()}}(this);et=null!=(at=r.upload)?at:r;et.onprogress=tt;l={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};this.options.headers&&i(l,this.options.headers);for(b in l)ft=l[b],r.setRequestHeader(b,ft);if(f=new FormData,this.options.params){it=this.options.params;for(g in it)ot=it[g],f.append(g,ot)}for(v=0,ht=n.length;ht>v;v++)u=n[v],this.emit("sending",u,r,f);if(this.options.uploadMultiple&&this.emit("sendingmultiple",n,r,f),"FORM"===this.element.tagName)for(rt=this.element.querySelectorAll("input, textarea, select, button"),y=0,ct=rt.length;ct>y;y++)if(e=rt[y],k=e.getAttribute("name"),d=e.getAttribute("type"),"SELECT"===e.tagName&&e.hasAttribute("multiple"))for(ut=e.options,p=0,lt=ut.length;lt>p;p++)nt=ut[p],nt.selected&&f.append(k,nt.value);else(!d||"checkbox"!==(vt=d.toLowerCase())&&"radio"!==vt||e.checked)&&f.append(k,e.value);for(s=h=0,c=n.length-1;c>=0?c>=h:h>=c;s=c>=0?++h:--h)f.append(this._getParamName(s),n[s],n[s].name);return r.send(f)},t.prototype._finished=function(n,i,r){for(var u,f=0,e=n.length;e>f;f++)u=n[f],u.status=t.SUCCESS,this.emit("success",u,i,r),this.emit("complete",u);return this.options.uploadMultiple&&(this.emit("successmultiple",n,i,r),this.emit("completemultiple",n)),this.options.autoProcessQueue?this.processQueue():void 0},t.prototype._errorProcessing=function(n,i,r){for(var u,f=0,e=n.length;e>f;f++)u=n[f],u.status=t.ERROR,this.emit("error",u,i,r),this.emit("complete",u);return this.options.uploadMultiple&&(this.emit("errormultiple",n,i,r),this.emit("completemultiple",n)),this.options.autoProcessQueue?this.processQueue():void 0},t}(u);t.version="3.10.2";t.options={};t.optionsForElement=function(n){if(n.getAttribute("id"))return t.options[f(n.getAttribute("id"))]};t.instances=[];t.forElement=function(n){if("string"==typeof n&&(n=document.querySelector(n)),null==(null!=n?n.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return n.dropzone};t.autoDiscover=!0;t.discover=function(){var r,u,n,i,e,f;for(document.querySelectorAll?n=document.querySelectorAll(".dropzone"):(n=[],r=function(t){var r,i,f,u;for(u=[],i=0,f=t.length;f>i;i++)r=t[i],u.push(/(^| )dropzone($| )/.test(r.className)?n.push(r):void 0);return u},r(document.getElementsByTagName("div")),r(document.getElementsByTagName("form"))),f=[],i=0,e=n.length;e>i;i++)u=n[i],f.push(t.optionsForElement(u)!==!1?new t(u):void 0);return f};t.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i];t.isBrowserSupported=function(){var n,u,i,f,r;if(n=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(r=t.blacklistedBrowsers,i=0,f=r.length;f>i;i++)u=r[i],u.test(navigator.userAgent)&&(n=!1);else n=!1;else n=!1;return n};h=function(n,t){var r,i,f,u;for(u=[],i=0,f=n.length;f>i;i++)r=n[i],r!==t&&u.push(r);return u};f=function(n){return n.replace(/[\-_](\w)/g,function(n){return n.charAt(1).toUpperCase()})};t.createElement=function(n){var t;return t=document.createElement("div"),t.innerHTML=n,t.childNodes[0]};t.elementInside=function(n,t){if(n===t)return!0;for(;n=n.parentNode;)if(n===t)return!0;return!1};t.getElement=function(n,t){var i;if("string"==typeof n?i=document.querySelector(n):null!=n.nodeType&&(i=n),null==i)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector or a plain HTML element.");return i};t.getElements=function(n,t){var h,r,i,u,f,o,s,e;if(n instanceof Array){i=[];try{for(u=0,o=n.length;o>u;u++)r=n[u],i.push(this.getElement(r,t))}catch(c){h=c;i=null}}else if("string"==typeof n)for(i=[],e=document.querySelectorAll(n),f=0,s=e.length;s>f;f++)r=e[f],i.push(r);else null!=n.nodeType&&(i=[n]);if(null==i||!i.length)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return i};t.confirm=function(n,t,i){return window.confirm(n)?t():null!=i?i():void 0};t.isValidFile=function(n,t){var f,u,i,r,e;if(!t)return!0;for(t=t.split(","),u=n.type,f=u.replace(/\/.*$/,""),r=0,e=t.length;e>r;r++)if(i=t[r],i=i.trim(),"."===i.charAt(0)){if(-1!==n.name.toLowerCase().indexOf(i.toLowerCase(),n.name.length-i.length))return!0}else if(/\/\*$/.test(i)){if(f===i.replace(/\/.*$/,""))return!0}else if(u===i)return!0;return!1};"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(n){return this.each(function(){return new t(this,n)})});"undefined"!=typeof i&&null!==i?i.exports=t:window.Dropzone=t;t.ADDED="added";t.QUEUED="queued";t.ACCEPTED=t.QUEUED;t.UPLOADING="uploading";t.PROCESSING=t.UPLOADING;t.CANCELED="canceled";t.ERROR="error";t.SUCCESS="success";o=function(n){var s,r,f,h,e,i,c,t,o,u;for(c=n.naturalWidth,i=n.naturalHeight,r=document.createElement("canvas"),r.width=1,r.height=i,f=r.getContext("2d"),f.drawImage(n,0,0),h=f.getImageData(0,0,1,i).data,u=0,e=i,t=i;t>u;)s=h[4*(t-1)+3],0===s?e=t:u=t,t=e+u>>1;return o=t/i,0===o?1:o};s=function(n,t,i,r,u,f,e,s,h,c){var l;return l=o(t),n.drawImage(t,i,r,u,f,e,s,h,c/l)};e=function(n,t){var f,i,e,r,o,u,c,s,h;if(e=!1,h=!0,i=n.document,s=i.documentElement,f=i.addEventListener?"addEventListener":"attachEvent",c=i.addEventListener?"removeEventListener":"detachEvent",u=i.addEventListener?"":"on",r=function(f){if("readystatechange"!==f.type||"complete"===i.readyState)return(("load"===f.type?n:i)[c](u+f.type,r,!1),!e&&(e=!0)?t.call(n,f.type||f):void 0)},o=function(){var n;try{s.doScroll("left")}catch(t){return n=t,void setTimeout(o,50)}return r("poll")},"complete"!==i.readyState){if(i.createEventObject&&s.doScroll){try{h=!n.frameElement}catch(l){}h&&o()}return i[f](u+"DOMContentLoaded",r,!1),i[f](u+"readystatechange",r,!1),n[f](u+"load",r,!1)}};t._autoDiscoverFunction=function(){if(t.autoDiscover)return t.discover()};e(window,t._autoDiscoverFunction)}).call(this)});"object"==typeof exports?module.exports=n("dropzone"):"function"==typeof define&&define.amd?define([],function(){return n("dropzone")}):this.Dropzone=n("dropzone")}(),typeof jQuery=="undefined")throw new Error("Bootstrap requires jQuery");+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(i.style[t]!==undefined)return{end:n[t]}}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one(n.support.transition.end,function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){n.support.transition=t()})}(jQuery);+function(n){"use strict";var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.prototype.close=function(t){function f(){i.trigger("closed.bs.alert").remove()}var u=n(this),r=u.attr("data-target"),i;(r||(r=u.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=n(r),t&&t.preventDefault(),i.length||(i=u.hasClass("alert")?u:u.parent()),i.trigger(t=n.Event("close.bs.alert")),t.isDefaultPrevented())||(i.removeClass("in"),n.support.transition&&i.hasClass("fade")?i.one(n.support.transition.end,f).emulateTransitionEnd(150):f())};r=n.fn.alert;n.fn.alert=function(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));typeof i=="string"&&u[i].call(r)})};n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r)},i;t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(n){var i="disabled",t=this.$element,r=t.is("input")?"val":"html",u=t.data();n=n+"Text";u.resetText||t.data("resetText",t[r]());t[r](u[n]||this.options[n]);setTimeout(function(){n=="loadingText"?t.addClass(i).attr(i,i):t.removeClass(i).removeAttr(i)},0)};t.prototype.toggle=function(){var i=this.$element.closest('[data-toggle="buttons"]'),t=!0,n;i.length&&(n=this.$element.find("input"),n.prop("type")==="radio"&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:i.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change"));t&&this.$element.toggleClass("active")};i=n.fn.button;n.fn.button=function(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f=typeof i=="object"&&i;r||u.data("bs.button",r=new t(this,f));i=="toggle"?r.toggle():i&&r.setState(i)})};n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=i,this};n(document).on("click.bs.button.data-api","[data-toggle^=button]",function(t){var i=n(t.target);i.hasClass("btn")||(i=i.closest(".btn"));i.button("toggle");t.preventDefault()})}(jQuery);+function(n){"use strict";var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=this.sliding=this.interval=this.$active=this.$items=null;this.options.pause=="hover"&&this.$element.on("mouseenter",n.proxy(this.pause,this)).on("mouseleave",n.proxy(this.cycle,this))},i;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)};t.prototype.to=function(t){var r=this,i=this.getActiveIndex();if(!(t>this.$items.length-1)&&!(t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){r.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",n(this.$items[t]))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition.end&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(t,i){var u=this.$element.find(".item.active"),r=i||u[t](),s=this.interval,f=t=="next"?"left":"right",h=t=="next"?"first":"last",o=this,e;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[h]()}if(this.sliding=!0,s&&this.pause(),e=n.Event("slide.bs.carousel",{relatedTarget:r[0],direction:f}),!r.hasClass("active")){if(this.$indicators.length){this.$indicators.find(".active").removeClass("active");this.$element.one("slid.bs.carousel",function(){var t=n(o.$indicators.children()[o.getActiveIndex()]);t&&t.addClass("active")})}if(n.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;r.addClass(t);r[0].offsetWidth;u.addClass(f);r.addClass(f);u.one(n.support.transition.end,function(){r.removeClass([t,f].join(" ")).addClass("active");u.removeClass(["active",f].join(" "));o.sliding=!1;setTimeout(function(){o.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;u.removeClass("active");r.addClass("active");this.sliding=!1;this.$element.trigger("slid.bs.carousel")}return s&&this.cycle(),this}};i=n.fn.carousel;n.fn.carousel=function(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),typeof i=="object"&&i),e=typeof i=="string"?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));typeof i=="number"?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})};n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=i,this};n(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var i=n(this),f,r=n(i.attr("data-target")||(f=i.attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")),e=n.extend({},r.data(),i.data()),u=i.attr("data-slide-to");u&&(e.interval=!1);r.carousel(e);(u=i.attr("data-slide-to"))&&r.data("bs.carousel").to(u);t.preventDefault()});n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);t.carousel(t.data())})})}(jQuery);+function(n){"use strict";var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.transitioning=null;this.options.parent&&(this.$parent=n(this.options.parent));this.options.toggle&&this.toggle()},i;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var u,t,r,i,f,e;if(!this.transitioning&&!this.$element.hasClass("in")&&(u=n.Event("show.bs.collapse"),this.$element.trigger(u),!u.isDefaultPrevented())){if(t=this.$parent&&this.$parent.find("> .panel > .in"),t&&t.length){if(r=t.data("bs.collapse"),r&&r.transitioning)return;t.collapse("hide");r||t.data("bs.collapse",null)}if(i=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[i](0),this.transitioning=1,f=function(){this.$element.removeClass("collapsing").addClass("in")[i]("auto");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return f.call(this);e=n.camelCase(["scroll",i].join("-"));this.$element.one(n.support.transition.end,n.proxy(f,this)).emulateTransitionEnd(350)[i](this.$element[0][e])}};t.prototype.hide=function(){var i,t,r;if(!this.transitioning&&this.$element.hasClass("in")&&(i=n.Event("hide.bs.collapse"),this.$element.trigger(i),!i.isDefaultPrevented())){if(t=this.dimension(),this.$element[t](this.$element[t]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1,r=function(){this.transitioning=0;this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")},!n.support.transition)return r.call(this);this.$element[t](0).one(n.support.transition.end,n.proxy(r,this)).emulateTransitionEnd(350)}};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};i=n.fn.collapse;n.fn.collapse=function(i){return this.each(function(){var r=n(this),u=r.data("bs.collapse"),f=n.extend({},t.DEFAULTS,r.data(),typeof i=="object"&&i);u||r.data("bs.collapse",u=new t(this,f));typeof i=="string"&&u[i]()})};n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=i,this};n(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(t){var i=n(this),e,s=i.attr("data-target")||t.preventDefault()||(e=i.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,""),r=n(s),u=r.data("bs.collapse"),h=u?"toggle":i.data(),f=i.attr("data-parent"),o=f&&n(f);u&&u.transitioning||(o&&o.find('[data-toggle=collapse][data-parent="'+f+'"]').not(i).addClass("collapsed"),i[r.hasClass("in")?"addClass":"removeClass"]("collapsed"));r.collapse(h)})}(jQuery);+function(n){"use strict";function r(){n(e).remove();n(i).each(function(t){var i=u(n(this));i.hasClass("open")&&((i.trigger(t=n.Event("hide.bs.dropdown")),t.isDefaultPrevented())||i.removeClass("open").trigger("hidden.bs.dropdown"))})}function u(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}var e=".dropdown-backdrop",i="[data-toggle=dropdown]",t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.prototype.toggle=function(t){var f=n(this),i,e;if(!f.is(".disabled, :disabled")){if(i=u(f),e=i.hasClass("open"),r(),!e){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length)n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click",r);if(i.trigger(t=n.Event("show.bs.dropdown")),t.isDefaultPrevented())return;i.toggleClass("open").trigger("shown.bs.dropdown");f.focus()}return!1}};t.prototype.keydown=function(t){var e,o,s,f,r;if(/(38|40|27)/.test(t.keyCode)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=u(e),s=o.hasClass("open"),!s||s&&t.keyCode==27)return t.which==27&&o.find(i).focus(),e.click();(f=n("[role=menu] li:not(.divider):visible a",o),f.length)&&(r=f.index(f.filter(":focus")),t.keyCode==38&&r>0&&r--,t.keyCode==40&&r<f.length-1&&r++,~r||(r=0),f.eq(r).focus())}};f=n.fn.dropdown;n.fn.dropdown=function(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));typeof i=="string"&&u[i].call(r)})};n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",r).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i+", [role=menu]",t.prototype.keydown)}(jQuery);+function(n){"use strict";var t=function(t,i){this.options=i;this.$element=n(t);this.$backdrop=this.isShown=null;this.options.remote&&this.$element.load(this.options.remote)},i;t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this[this.isShown?"hide":"show"](n)};t.prototype.show=function(t){var i=this,r=n.Event("show.bs.modal",{relatedTarget:t});if(this.$element.trigger(r),!this.isShown&&!r.isDefaultPrevented()){this.isShown=!0;this.escape();this.$element.on("click.dismiss.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this));this.backdrop(function(){var u=n.support.transition&&i.$element.hasClass("fade"),r;i.$element.parent().length||i.$element.appendTo(document.body);i.$element.show();u&&i.$element[0].offsetWidth;i.$element.addClass("in").attr("aria-hidden",!1);i.enforceFocus();r=n.Event("shown.bs.modal",{relatedTarget:t});u?i.$element.find(".modal-dialog").one(n.support.transition.end,function(){i.$element.focus().trigger(r)}).emulateTransitionEnd(300):i.$element.focus().trigger(r)})}};t.prototype.hide=function(t){(t&&t.preventDefault(),t=n.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented())&&(this.isShown=!1,this.escape(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one(n.support.transition.end,n.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.focus()},this))};t.prototype.escape=function(){if(this.isShown&&this.options.keyboard)this.$element.on("keyup.dismiss.bs.modal",n.proxy(function(n){n.which==27&&this.hide()},this));else this.isShown||this.$element.off("keyup.dismiss.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.removeBackdrop();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(t){var u=this,r=this.$element.hasClass("fade")?"fade":"",i;if(this.isShown&&this.options.backdrop){i=n.support.transition&&r;this.$backdrop=n('<div class="modal-backdrop '+r+'" />').appendTo(document.body);this.$element.on("click.dismiss.modal",n.proxy(function(n){n.target===n.currentTarget&&(this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this));if(i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;i?this.$backdrop.one(n.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(n.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};i=n.fn.modal;n.fn.modal=function(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),typeof i=="object"&&i);u||f.data("bs.modal",u=new t(this,e));typeof i=="string"?u[i](r):e.show&&u.show(r)})};n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=i,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var i=n(this),r=i.attr("href"),u=n(i.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),f=u.data("modal")?"toggle":n.extend({remote:!/#/.test(r)&&r},u.data(),i.data());t.preventDefault();u.modal(f,this).one("hide",function(){i.is(":visible")&&i.focus()})});n(document).on("show.bs.modal",".modal",function(){n(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){n(document.body).removeClass("modal-open")})}(jQuery);+function(n){"use strict";var t=function(n,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null;this.init("tooltip",n,t)},i;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1};t.prototype.init=function(t,i,r){var f,e,u,o,s;for(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],u=="click")this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else if(u!="manual"){o=u=="hover"?"mouseenter":"focus";s=u=="hover"?"mouseleave":"blur";this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this));this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this))}this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);if(clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);if(clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){i.hoverState=="out"&&i.hide()},i.options.delay.hide)};t.prototype.show=function(){var o=n.Event("show.bs."+this.type),i,l;if(this.hasContent()&&this.enabled){if(this.$element.trigger(o),o.isDefaultPrevented())return;i=this.tip();this.setContent();this.options.animation&&i.addClass("fade");var t=typeof this.options.placement=="function"?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,s=/\s?auto?\s?/i,h=s.test(t);h&&(t=t.replace(s,"")||"top");i.detach().css({top:0,left:0,display:"block"}).addClass(t);this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var r=this.getPosition(),u=i[0].offsetWidth,f=i[0].offsetHeight;if(h){var e=this.$element.parent(),a=t,c=document.documentElement.scrollTop||document.body.scrollTop,v=this.options.container=="body"?window.innerWidth:e.outerWidth(),y=this.options.container=="body"?window.innerHeight:e.outerHeight(),p=this.options.container=="body"?0:e.offset().left;t=t=="bottom"&&r.top+r.height+f-c>y?"top":t=="top"&&r.top-c-f<0?"bottom":t=="right"&&r.right+u>v?"left":t=="left"&&r.left-u<p?"right":t;i.removeClass(a).addClass(t)}l=this.getCalculatedOffset(t,r,u,f);this.applyPlacement(l,t);this.$element.trigger("shown.bs."+this.type)}};t.prototype.applyPlacement=function(n,t){var h,i=this.tip(),c=i[0].offsetWidth,f=i[0].offsetHeight,e=parseInt(i.css("margin-top"),10),o=parseInt(i.css("margin-left"),10),u,r,s;isNaN(e)&&(e=0);isNaN(o)&&(o=0);n.top=n.top+e;n.left=n.left+o;i.offset(n).addClass("in");u=i[0].offsetWidth;r=i[0].offsetHeight;t=="top"&&r!=f&&(h=!0,n.top=n.top+f-r);/bottom|top/.test(t)?(s=0,n.left<0&&(s=n.left*-2,n.left=0,i.offset(n),u=i[0].offsetWidth,r=i[0].offsetHeight),this.replaceArrow(s-c+u,u,"left")):this.replaceArrow(r-f,r,"top");h&&i.offset(n)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i,n?50*(1-n/t)+"%":"")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(){function r(){u.hoverState!="in"&&t.detach()}var u=this,t=this.tip(),i=n.Event("hide.bs."+this.type);if(this.$element.trigger(i),!i.isDefaultPrevented())return t.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?t.one(n.support.transition.end,r).emulateTransitionEnd(150):r(),this.$element.trigger("hidden.bs."+this.type),this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||typeof n.attr("data-original-title")!="string")&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(){var t=this.$element[0];return n.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())};t.prototype.getCalculatedOffset=function(n,t,i,r){return n=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-i/2}:n=="top"?{top:t.top-r,left:t.left+t.width/2-i/2}:n=="left"?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title)};t.prototype.tip=function(){return this.$tip=this.$tip||n(this.options.template)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=t?n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};i=n.fn.tooltip;n.fn.tooltip=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f=typeof i=="object"&&i;r||u.data("bs.tooltip",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle(),i=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](t);n.find(".popover-content")[this.options.html?"html":"text"](i);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};t.prototype.tip=function(){return this.$tip||(this.$tip=n(this.options.template)),this.$tip};i=n.fn.popover;n.fn.popover=function(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f=typeof i=="object"&&i;r||u.data("bs.popover",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";function t(i,r){var u,f=n.proxy(this.process,this);this.$element=n(i).is("body")?n(window):n(i);this.$body=n("body");this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||(u=n(i).attr("href"))&&u.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a";this.offsets=n([]);this.targets=n([]);this.activeTarget=null;this.refresh();this.process()}t.DEFAULTS={offset:10};t.prototype.refresh=function(){var i=this.$element[0]==window?"offset":"position",t,r;this.offsets=n([]);this.targets=n([]);t=this;r=this.$body.find(this.selector).map(function(){var f=n(this),r=f.data("target")||f.attr("href"),u=/^#\w/.test(r)&&n(r);return u&&u.length&&[[u[i]().top+(!n.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var i=this.$scrollElement.scrollTop()+this.options.offset,f=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,e=f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget,n;if(i>=e)return u!=(n=r.last()[0])&&this.activate(n);for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(!t[n+1]||i<=t[n+1])&&this.activate(r[n])};t.prototype.activate=function(t){this.activeTarget=t;n(this.selector).parents(".active").removeClass("active");var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};var i=n.fn.scrollspy;n.fn.scrollspy=function(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f=typeof i=="object"&&i;r||u.data("bs.scrollspy",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=i,this};n(window).on("load",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);t.scrollspy(t.data())})})}(jQuery);+function(n){"use strict";var t=function(t){this.element=n(t)},i;t.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),r,u,f;(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),t.parent("li").hasClass("active"))||(r=e.find(".active:last a")[0],u=n.Event("show.bs.tab",{relatedTarget:r}),t.trigger(u),u.isDefaultPrevented())||(f=n(i),this.activate(t.parent("li"),e),this.activate(f,f.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:r})}))};t.prototype.activate=function(t,i,r){function e(){u.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");t.addClass("active");f?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade");t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active");r&&r()}var u=i.find("> .active"),f=r&&n.support.transition&&u.hasClass("fade");f?u.one(n.support.transition.end,e).emulateTransitionEnd(150):e();u.removeClass("in")};i=n.fn.tab;n.fn.tab=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));typeof i=="string"&&r[i]()})};n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=i,this};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault();n(this).tab("show")})}(jQuery);+function(n){"use strict";var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$window=n(window).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=this.unpin=null;this.checkPosition()},i;t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i;if(this.$element.is(":visible")){var s=n(document).height(),e=this.$window.scrollTop(),o=this.$element.offset(),r=this.options.offset,f=r.top,u=r.bottom;(typeof r!="object"&&(u=f=r),typeof f=="function"&&(f=r.top()),typeof u=="function"&&(u=r.bottom()),i=this.unpin!=null&&e+this.unpin<=o.top?!1:u!=null&&o.top+this.$element.height()>=s-u?"bottom":f!=null&&e<=f?"top":!1,this.affixed!==i)&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin=i=="bottom"?o.top-e:null,this.$element.removeClass(t.RESET).addClass("affix"+(i?"-"+i:"")),i=="bottom"&&this.$element.offset({top:document.body.offsetHeight-u-this.$element.height()}))}};i=n.fn.affix;n.fn.affix=function(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f=typeof i=="object"&&i;r||u.data("bs.affix",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=i,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var i=n(this),t=i.data();t.offset=t.offset||{};t.offsetBottom&&(t.offset.bottom=t.offsetBottom);t.offsetTop&&(t.offset.top=t.offsetTop);i.affix(t)})})}(jQuery),function(n){typeof define=="function"&&define.amd?define(["jquery"],n):n(jQuery)}(function(n){function i(n){return t.raw?n:encodeURIComponent(n)}function f(n){return t.raw?n:decodeURIComponent(n)}function e(n){return i(t.json?JSON.stringify(n):String(n))}function o(n){n.indexOf('"')===0&&(n=n.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return n=decodeURIComponent(n.replace(u," ")),t.json?JSON.parse(n):n}catch(i){}}function r(i,r){var u=t.raw?i:o(i);return n.isFunction(r)?r(u):u}var u=/\+/g,t=n.cookie=function(u,o,s){var y,a,h,v,c,p;if(o!==undefined&&!n.isFunction(o))return s=n.extend({},t.defaults,s),typeof s.expires=="number"&&(y=s.expires,a=s.expires=new Date,a.setTime(+a+y*864e5)),document.cookie=[i(u),"=",e(o),s.expires?"; expires="+s.expires.toUTCString():"",s.path?"; path="+s.path:"",s.domain?"; domain="+s.domain:"",s.secure?"; secure":""].join("");for(h=u?undefined:{},v=document.cookie?document.cookie.split("; "):[],c=0,p=v.length;c<p;c++){var w=v[c].split("="),b=f(w.shift()),l=w.join("=");if(u&&u===b){h=r(l,o);break}u||(l=r(l))===undefined||(h[b]=l)}return h};t.defaults={};n.removeCookie=function(t,i){return n.cookie(t)===undefined?!1:(n.cookie(t,"",n.extend({},i,{expires:-1})),!n.cookie(t))}}),function(n){var t={isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(n){return!n||/^\s*$/.test(n)},escapeRegExChars:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(n){return typeof n=="string"},isNumber:function(n){return typeof n=="number"},isArray:n.isArray,isFunction:n.isFunction,isObject:n.isPlainObject,isUndefined:function(n){return typeof n=="undefined"},bind:n.proxy,each:function(t,i){function r(n,t){return i(t,n)}n.each(t,r)},map:n.map,filter:n.grep,every:function(t,i){var r=!0;return t?(n.each(t,function(n,u){if(!(r=i.call(null,u,n,t)))return!1}),!!r):r},some:function(t,i){var r=!1;return t?(n.each(t,function(n,u){if(r=i.call(null,u,n,t))return!1}),!!r):r},mixin:n.extend,getUniqueId:function(){var n=0;return function(){return n++}}(),templatify:function(t){function i(){return String(t)}return n.isFunction(t)?t:i},defer:function(n){setTimeout(n,0)},debounce:function(n,t,i){var r,u;return function(){var f=this,e=arguments,o,s;return o=function(){r=null;i||(u=n.apply(f,e))},s=i&&!r,clearTimeout(r),r=setTimeout(o,t),s&&(u=n.apply(f,e)),u}},throttle:function(n,t){var u,f,i,e,r,o;return r=0,o=function(){r=new Date;i=null;e=n.apply(u,f)},function(){var s=new Date,h=t-(s-r);return u=this,f=arguments,h<=0?(clearTimeout(i),i=null,r=s,e=n.apply(u,f)):i||(i=setTimeout(o,h)),e}},noop:function(){}},l="0.10.2",a=function(){function n(n){return n.split(/\s+/)}function t(n){return n.split(/\W+/)}function i(n){return function(t){return function(i){return n(i[t])}}}return{nonword:t,whitespace:n,obj:{nonword:i(t),whitespace:i(n)}}}(),o=function(){function n(n){this.maxSize=n||100;this.size=0;this.hash={};this.list=new i}function i(){this.head=this.tail=null}function r(n,t){this.key=n;this.val=t;this.prev=this.next=null}return t.mixin(n.prototype,{set:function(n,t){var u=this.list.tail,i;this.size>=this.maxSize&&(this.list.remove(u),delete this.hash[u.key]);(i=this.hash[n])?(i.val=t,this.list.moveToFront(i)):(i=new r(n,t),this.list.add(i),this.hash[n]=i,this.size++)},get:function(n){var t=this.hash[n];if(t)return this.list.moveToFront(t),t.val}}),t.mixin(i.prototype,{add:function(n){this.head&&(n.next=this.head,this.head.prev=n);this.head=n;this.tail=this.tail||n},remove:function(n){n.prev?n.prev.next=n.next:this.head=n.next;n.next?n.next.prev=n.prev:this.tail=n.prev},moveToFront:function(n){this.remove(n);this.add(n)}}),n}(),v=function(){function r(n){this.prefix=["__",n,"__"].join("");this.ttlKey="__ttl__";this.keyMatcher=new RegExp("^"+this.prefix)}function u(){return(new Date).getTime()}function f(n){return JSON.stringify(t.isUndefined(n)?null:n)}function e(n){return JSON.parse(n)}var n,i;try{n=window.localStorage;n.setItem("~~~","!");n.removeItem("~~~")}catch(o){n=null}return i=n&&window.JSON?{_prefix:function(n){return this.prefix+n},_ttlKey:function(n){return this._prefix(n)+this.ttlKey},get:function(t){return this.isExpired(t)&&this.remove(t),e(n.getItem(this._prefix(t)))},set:function(i,r,e){return t.isNumber(e)?n.setItem(this._ttlKey(i),f(u()+e)):n.removeItem(this._ttlKey(i)),n.setItem(this._prefix(i),f(r))},remove:function(t){return n.removeItem(this._ttlKey(t)),n.removeItem(this._prefix(t)),this},clear:function(){for(var r,i=[],u=n.length,t=0;t<u;t++)(r=n.key(t)).match(this.keyMatcher)&&i.push(r.replace(this.keyMatcher,""));for(t=i.length;t--;)this.remove(i[t]);return this},isExpired:function(i){var r=e(n.getItem(this._ttlKey(i)));return t.isNumber(r)&&u()>r?!0:!1}}:{get:t.noop,set:t.noop,remove:t.noop,clear:t.noop,isExpired:t.noop},t.mixin(r.prototype,i),r}(),s=function(){function i(t){t=t||{};this._send=t.transport?s(t.transport):n.ajax;this._get=t.rateLimiter?t.rateLimiter(this._get):this._get}function s(i){return function(r,u){function e(n){t.defer(function(){f.resolve(n)})}function o(n){t.defer(function(){f.reject(n)})}var f=n.Deferred();return i(r,u,e,o),f}}var r=0,u={},e=6,f=new o(10);return i.setMaxPendingRequests=function(n){e=n},i.resetCache=function(){f=new o(10)},t.mixin(i.prototype,{_get:function(n,t,i){function h(t){i&&i(null,t);f.set(n,t)}function c(){i&&i(!0)}function l(){r--;delete u[n];o.onDeckRequestArgs&&(o._get.apply(o,o.onDeckRequestArgs),o.onDeckRequestArgs=null)}var o=this,s;(s=u[n])?s.done(h).fail(c):r<e?(r++,u[n]=this._send(n,t).done(h).fail(c).always(l)):this.onDeckRequestArgs=[].slice.call(arguments,0)},get:function(n,i,r){var u;return t.isFunction(i)&&(r=i,i={}),(u=f.get(n))?t.defer(function(){r&&r(null,u)}):this._get(n,i,r),!!u}}),i}(),y=function(){function i(t){t=t||{};t.datumTokenizer&&t.queryTokenizer||n.error("datumTokenizer and queryTokenizer are both required");this.datumTokenizer=t.datumTokenizer;this.queryTokenizer=t.queryTokenizer;this.reset()}function r(n){return n=t.filter(n,function(n){return!!n}),t.map(n,function(n){return n.toLowerCase()})}function u(){return{ids:[],children:{}}}function f(n){for(var i={},r=[],t=0;t<n.length;t++)i[n[t]]||(i[n[t]]=!0,r.push(n[t]));return r}function e(n,t){function f(n,t){return n-t}var i=0,r=0,u=[];for(n=n.sort(f),t=t.sort(f);i<n.length&&r<t.length;)n[i]<t[r]?i++:n[i]>t[r]?r++:(u.push(n[i]),i++,r++);return u}return t.mixin(i.prototype,{bootstrap:function(n){this.datums=n.datums;this.trie=n.trie},add:function(n){var i=this;n=t.isArray(n)?n:[n];t.each(n,function(n){var f,e;f=i.datums.push(n)-1;e=r(i.datumTokenizer(n));t.each(e,function(n){for(var r,t=i.trie,e=n.split("");r=e.shift();)t=t.children[r]||(t.children[r]=u()),t.ids.push(f)})})},get:function(n){var u=this,o,i;return o=r(this.queryTokenizer(n)),t.each(o,function(n){var t,r,o,f;if(i&&i.length===0)return!1;for(t=u.trie,r=n.split("");t&&(o=r.shift());)t=t.children[o];if(t&&r.length===0)f=t.ids.slice(0),i=i?e(i,f):f;else return i=[],!1}),i?t.map(f(i),function(n){return u.datums[n]}):[]},reset:function(){this.datums=[];this.trie=u()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),i}(),f=function(){function i(n){return n.local||null}function r(i){var r,u;return u={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}},(r=i.prefetch||null)&&(r=t.isString(r)?{url:r}:r,r=t.mixin(u,r),r.thumbprint=l+r.thumbprint,r.ajax.type=r.ajax.type||"GET",r.ajax.dataType=r.ajax.dataType||"json",r.url||n.error("prefetch requires url to be set")),r}function u(i){function f(n){return function(i){return t.debounce(i,n)}}function e(n){return function(i){return t.throttle(i,n)}}var r,u;return u={url:null,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}},(r=i.remote||null)&&(r=t.isString(r)?{url:r}:r,r=t.mixin(u,r),r.rateLimiter=/^throttle$/i.test(r.rateLimitBy)?e(r.rateLimitWait):f(r.rateLimitWait),r.ajax.type=r.ajax.type||"GET",r.ajax.dataType=r.ajax.dataType||"json",delete r.rateLimitBy,delete r.rateLimitWait,r.url||n.error("remote requires url to be set")),r}return{local:i,prefetch:r,remote:u}}(),r,i;(function(i){function u(t){t&&(t.local||t.prefetch||t.remote)||n.error("one of local, prefetch, or remote is required");this.limit=t.limit||5;this.sorter=o(t.sorter);this.dupDetector=t.dupDetector||h;this.local=f.local(t);this.prefetch=f.prefetch(t);this.remote=f.remote(t);this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null;this.index=new y({datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer});this.storage=this.cacheKey?new v(this.cacheKey):null}function o(n){function i(t){return t.sort(n)}function r(n){return n}return t.isFunction(n)?i:r}function h(){return!1}var e,r;return e=i.Bloodhound,r={data:"data",protocol:"protocol",thumbprint:"thumbprint"},i.Bloodhound=u,u.noConflict=function(){return i.Bloodhound=e,u},u.tokenizers=a,t.mixin(u.prototype,{_loadPrefetch:function(t){function f(n){i.clear();i.add(t.filter?t.filter(n):n);i._saveToStorage(i.index.serialize(),t.thumbprint,t.ttl)}var i=this,u,r;return(u=this._readFromStorage(t.thumbprint))?(this.index.bootstrap(u),r=n.Deferred().resolve()):r=n.ajax(t.url,t.ajax).done(f),r},_getFromRemote:function(n,t){function f(n,r){n?t([]):t(i.remote.filter?i.remote.filter(r):r)}var i=this,r,u;return n=n||"",u=encodeURIComponent(n),r=this.remote.replace?this.remote.replace(this.remote.url,n):this.remote.url.replace(this.remote.wildcard,u),this.transport.get(r,this.remote.ajax,f)},_saveToStorage:function(n,t,i){this.storage&&(this.storage.set(r.data,n,i),this.storage.set(r.protocol,location.protocol,i),this.storage.set(r.thumbprint,t,i))},_readFromStorage:function(n){var t={},i;return this.storage&&(t.data=this.storage.get(r.data),t.protocol=this.storage.get(r.protocol),t.thumbprint=this.storage.get(r.thumbprint)),i=t.thumbprint!==n||t.protocol!==location.protocol,t.data&&!i?t.data:null},_initialize:function(){function f(){u.add(t.isFunction(i)?i():i)}var u=this,i=this.local,r;return r=this.prefetch?this._loadPrefetch(this.prefetch):n.Deferred().resolve(),i&&r.done(f),this.transport=this.remote?new s(this.remote):null,this.initPromise=r.promise()},initialize:function(n){return!this.initPromise||n?this._initialize():this.initPromise},add:function(n){this.index.add(n)},get:function(n,i){function e(n){var f=r.slice(0);t.each(n,function(n){var i;return i=t.some(f,function(t){return u.dupDetector(n,t)}),i||f.push(n),f.length<u.limit});i&&i(u.sorter(f))}var u=this,r=[],f=!1;r=this.index.get(n);r=this.sorter(r).slice(0,this.limit);r.length<this.limit&&this.transport&&(f=this._getFromRemote(n,e));f||(r.length>0||!this.transport)&&i&&i(r)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&s.resetCache()},ttAdapter:function(){return t.bind(this.get,this)}}),u})(this);r={wrapper:'<span class="twitter-typeahead"><\/span>',dropdown:'<span class="tt-dropdown-menu"><\/span>',dataset:'<div class="tt-dataset-%CLASS%"><\/div>',suggestions:'<span class="tt-suggestions"><\/span>',suggestion:'<div class="tt-suggestion"><\/div>'};i={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};t.isMsie()&&t.mixin(i.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"});t.isMsie()&&t.isMsie()<=7&&t.mixin(i.input,{marginTop:"-1px"});var h=function(){function i(t){t&&t.el||n.error("EventBus initialized without el");this.$el=n(t.el)}var r="typeahead:";return t.mixin(i.prototype,{trigger:function(n){var t=[].slice.call(arguments,1);this.$el.trigger(r+n,t)}}),i}(),e=function(){function t(t,i,r,u){var f;if(!r)return this;for(i=i.split(n),r=u?h(r,u):r,this._callbacks=this._callbacks||{};f=i.shift();)this._callbacks[f]=this._callbacks[f]||{sync:[],async:[]},this._callbacks[f][t].push(r);return this}function u(n,i,r){return t.call(this,"async",n,i,r)}function f(n,i,r){return t.call(this,"sync",n,i,r)}function e(t){var i;if(!this._callbacks)return this;for(t=t.split(n);i=t.shift();)delete this._callbacks[i];return this}function o(t){var u,f,e,o,s;if(!this._callbacks)return this;for(t=t.split(n),e=[].slice.call(arguments,1);(u=t.shift())&&(f=this._callbacks[u]);)o=i(f.sync,this,[u].concat(e)),s=i(f.async,this,[u].concat(e)),o()&&r(s);return this}function i(n,t,i){function r(){for(var r,u=0;!r&&u<n.length;u+=1)r=n[u].apply(t,i)===!1;return!r}return r}function s(){return window.setImmediate?function(n){setImmediate(function(){n()})}:function(n){setTimeout(function(){n()},0)}}function h(n,t){return n.bind?n.bind(t):function(){n.apply(t,[].slice.call(arguments,0))}}var n=/\s+/,r=s();return{onSync:f,onAsync:u,off:e,trigger:o}}(),p=function(n){function r(n,i,r){for(var u=[],f,e=0;e<n.length;e++)u.push(t.escapeRegExChars(n[e]));return f=r?"\\b("+u.join("|")+")\\b":"("+u.join("|")+")",i?new RegExp(f):new RegExp(f,"i")}var i={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(u){function o(t){var i,r;return(i=f.exec(t.data))&&(wrapperNode=n.createElement(u.tagName),u.className&&(wrapperNode.className=u.className),r=t.splitText(i.index),r.splitText(i[0].length),wrapperNode.appendChild(r.cloneNode(!0)),t.parentNode.replaceChild(wrapperNode,r)),!!i}function e(n,t){for(var i,r=0;r<n.childNodes.length;r++)i=n.childNodes[r],i.nodeType===3?r+=t(i)?1:0:e(i,t)}var f;(u=t.mixin({},i,u),u.node&&u.pattern)&&(u.pattern=t.isArray(u.pattern)?u.pattern:[u.pattern],f=r(u.pattern,u.caseSensitive,u.wordsOnly),e(u.node,o))}}(window.document),c=function(){function i(i){var u=this,e,o,s,h;if(i=i||{},i.input||n.error("input is missing"),e=t.bind(this._onBlur,this),o=t.bind(this._onFocus,this),s=t.bind(this._onKeydown,this),h=t.bind(this._onInput,this),this.$hint=n(i.hint),this.$input=n(i.input).on("blur.tt",e).on("focus.tt",o).on("keydown.tt",s),this.$hint.length===0&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop),t.isMsie())this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(n){r[n.which||n.keyCode]||t.defer(t.bind(u._onInput,u,n))});else this.$input.on("input.tt",h);this.query=this.$input.val();this.$overflowHelper=f(this.$input)}function f(t){return n('<pre aria-hidden="true"><\/pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function o(n,t){return i.normalizeQuery(n)===i.normalizeQuery(t)}function u(n){return n.altKey||n.ctrlKey||n.metaKey||n.shiftKey}var r;return r={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},i.normalizeQuery=function(n){return(n||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(i.prototype,e,{_onBlur:function(){this.resetInputValue();this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(n){var t=r[n.which||n.keyCode];this._managePreventDefault(t,n);t&&this._shouldTrigger(t,n)&&this.trigger(t+"Keyed",n)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(n,t){var i,r,f;switch(n){case"tab":r=this.getHint();f=this.getInputValue();i=r&&r!==f&&!u(t);break;case"up":case"down":i=!u(t);break;default:i=!1}i&&t.preventDefault()},_shouldTrigger:function(n,t){var i;switch(n){case"tab":i=!u(t);break;default:i=!0}return i},_checkInputValue:function(){var n,t,i;n=this.getInputValue();t=o(n,this.query);i=t?this.query.length!==n.length:!1;t?i&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query=n)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(n){this.query=n},getInputValue:function(){return this.$input.val()},setInputValue:function(n,t){this.$input.val(n);t?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(n){this.$hint.val(n)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var n,t,i,r;n=this.getInputValue();t=this.getHint();i=n!==t&&t.indexOf(n)===0;r=n!==""&&i&&!this.hasOverflow();r||this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var n=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=n},isCursorAtEnd:function(){var n,i,r;return(n=this.$input.val().length,i=this.$input[0].selectionStart,t.isNumber(i))?i===n:document.selection?(r=document.selection.createRange(),r.moveStart("character",-n),n===r.text.length):!0},destroy:function(){this.$hint.off(".tt");this.$input.off(".tt");this.$hint=this.$input=this.$overflowHelper=null}}),i}(),u=function(){function u(i){i=i||{};i.templates=i.templates||{};i.source||n.error("missing source");i.name&&!l(i.name)&&n.error("invalid dataset name: "+i.name);this.query=null;this.highlight=!!i.highlight;this.name=i.name||t.getUniqueId();this.source=i.source;this.displayFn=h(i.display||i.displayKey);this.templates=c(i.templates,this.displayFn);this.$el=n(r.dataset.replace("%CLASS%",this.name))}function h(n){function i(t){return t[n]}return n=n||"value",t.isFunction(n)?n:i}function c(n,i){function r(n){return"<p>"+i(n)+"<\/p>"}return{empty:n.empty&&t.templatify(n.empty),header:n.header&&t.templatify(n.header),footer:n.footer&&t.templatify(n.footer),suggestion:n.suggestion||r}}function l(n){return/^[_a-zA-Z0-9-]+$/.test(n)}var f="ttDataset",o="ttValue",s="ttDatum";return u.extractDatasetName=function(t){return n(t).data(f)},u.extractValue=function(t){return n(t).data(o)},u.extractDatum=function(t){return n(t).data(s)},t.mixin(u.prototype,e,{_render:function(u,e){function v(){return h.templates.empty({query:u,isEmpty:!0})}function y(){function a(t){var u;return u=n(r.suggestion).append(h.templates.suggestion(t)).data(f,h.name).data(o,h.displayFn(t)).data(s,t),u.children().each(function(){n(this).css(i.suggestionChild)}),u}var c,l;return c=n(r.suggestions).css(i.suggestions),l=t.map(e,a),c.append.apply(c,l),h.highlight&&p({node:c[0],pattern:u}),c}function l(){return h.templates.header({query:u,isEmpty:!c})}function a(){return h.templates.footer({query:u,isEmpty:!c})}if(this.$el){var h=this,c;this.$el.empty();c=e&&e.length;!c&&this.templates.empty?this.$el.html(v()).prepend(h.templates.header?l():null).append(h.templates.footer?a():null):c&&this.$el.html(y()).prepend(h.templates.header?l():null).append(h.templates.footer?a():null);this.trigger("rendered")}},getRoot:function(){return this.$el},update:function(n){function i(i){t.canceled||n!==t.query||t._render(n,i)}var t=this;this.query=n;this.canceled=!1;this.source(n,i)},cancel:function(){this.canceled=!0},clear:function(){this.cancel();this.$el.empty();this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),u}(),w=function(){function r(i){var r=this,u,e,o;i=i||{};i.menu||n.error("menu is required");this.isOpen=!1;this.isEmpty=!0;this.datasets=t.map(i.datasets,f);u=t.bind(this._onSuggestionClick,this);e=t.bind(this._onSuggestionMouseEnter,this);o=t.bind(this._onSuggestionMouseLeave,this);this.$menu=n(i.menu).on("click.tt",".tt-suggestion",u).on("mouseenter.tt",".tt-suggestion",e).on("mouseleave.tt",".tt-suggestion",o);t.each(this.datasets,function(n){r.$menu.append(n.getRoot());n.onSync("rendered",r._onRendered,r)})}function f(n){return new u(n)}return t.mixin(r.prototype,e,{_onSuggestionClick:function(t){this.trigger("suggestionClicked",n(t.currentTarget))},_onSuggestionMouseEnter:function(t){this._removeCursor();this._setCursor(n(t.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function n(n){return n.isEmpty()}this.isEmpty=t.every(this.datasets,n);this.isEmpty?this._hide():this.isOpen&&this._show();this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(n,t){n.first().addClass("tt-cursor");t||this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(n){var i,r,t,u;if(this.isOpen){if(r=this._getCursor(),i=this._getSuggestions(),this._removeCursor(),t=i.index(r)+n,t=(t+1)%(i.length+1)-1,t===-1){this.trigger("cursorRemoved");return}t<-1&&(t=i.length-1);this._setCursor(u=i.eq(t));this._ensureVisible(u)}},_ensureVisible:function(n){var t,i,r,u;t=n.position().top;i=t+n.outerHeight(!0);r=this.$menu.scrollTop();u=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10);t<0?this.$menu.scrollTop(r+t):u<i&&this.$menu.scrollTop(r+(i-u))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,this.isEmpty||this._show(),this.trigger("opened"))},setLanguageDirection:function(n){this.$menu.css(n==="ltr"?i.ltr:i.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(n){var t=null;return n.length&&(t={raw:u.extractDatum(n),value:u.extractValue(n),datasetName:u.extractDatasetName(n)}),t},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(n){function i(t){t.update(n)}t.each(this.datasets,i)},empty:function(){function n(n){n.clear()}t.each(this.datasets,n);this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function n(n){n.destroy()}this.$menu.off(".tt");this.$menu=null;t.each(this.datasets,n)}}),r}(),b=function(){function f(i){var r,u,f;i=i||{};i.input||n.error("missing input");this.isActivated=!1;this.autoselect=!!i.autoselect;this.minLength=t.isNumber(i.minLength)?i.minLength:1;this.$node=e(i.input,i.withHint);r=this.$node.find(".tt-dropdown-menu");u=this.$node.find(".tt-input");f=this.$node.find(".tt-hint");u.on("blur.tt",function(n){var i,f,e;i=document.activeElement;f=r.is(i);e=r.has(i).length>0;t.isMsie()&&(f||e)&&(n.preventDefault(),n.stopImmediatePropagation(),t.defer(function(){u.focus()}))});r.on("mousedown.tt",function(n){n.preventDefault()});this.eventBus=i.eventBus||new h({el:u});this.dropdown=new w({menu:r,datasets:i.datasets}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this);this.input=new c({input:u,hint:f}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this);this._setLanguageDirection()}function e(t,f){var e,h,c,s;e=n(t);h=n(r.wrapper).css(i.wrapper);c=n(r.dropdown).css(i.dropdown);s=e.clone().css(i.hint).css(o(e));s.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder").prop("disabled",!0).attr({autocomplete:"off",spellcheck:"false"});e.data(u,{dir:e.attr("dir"),autocomplete:e.attr("autocomplete"),spellcheck:e.attr("spellcheck"),style:e.attr("style")});e.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(f?i.input:i.inputWithNoHint);try{e.attr("dir")||e.attr("dir","auto")}catch(l){}return e.wrap(h).parent().prepend(f?s:null).append(c)}function o(n){return{backgroundAttachment:n.css("background-attachment"),backgroundClip:n.css("background-clip"),backgroundColor:n.css("background-color"),backgroundImage:n.css("background-image"),backgroundOrigin:n.css("background-origin"),backgroundPosition:n.css("background-position"),backgroundRepeat:n.css("background-repeat"),backgroundSize:n.css("background-size")}}function s(n){var i=n.find(".tt-input");t.each(i.data(u),function(n,r){t.isUndefined(n)?i.removeAttr(r):i.attr(r,n)});i.detach().removeData(u).removeClass("tt-input").insertAfter(n);n.remove()}var u="ttAttrs";return t.mixin(f.prototype,{_onSuggestionClicked:function(n,t){var i;(i=this.dropdown.getDatumForSuggestion(t))&&this._select(i)},_onCursorMoved:function(){var n=this.dropdown.getDatumForCursor();this.input.setInputValue(n.value,!0);this.eventBus.trigger("cursorchanged",n.raw,n.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue();this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint();this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint();this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0;this.dropdown.open()},_onBlurred:function(){this.isActivated=!1;this.dropdown.empty();this.dropdown.close()},_onEnterKeyed:function(n,t){var i,r;i=this.dropdown.getDatumForCursor();r=this.dropdown.getDatumForTopSuggestion();i?(this._select(i),t.preventDefault()):this.autoselect&&r&&(this._select(r),t.preventDefault())},_onTabKeyed:function(n,t){var i;(i=this.dropdown.getDatumForCursor())?(this._select(i),t.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close();this.input.resetInputValue()},_onUpKeyed:function(){var n=this.input.getQuery();this.dropdown.isEmpty&&n.length>=this.minLength?this.dropdown.update(n):this.dropdown.moveCursorUp();this.dropdown.open()},_onDownKeyed:function(){var n=this.input.getQuery();this.dropdown.isEmpty&&n.length>=this.minLength?this.dropdown.update(n):this.dropdown.moveCursorDown();this.dropdown.open()},_onLeftKeyed:function(){this.dir==="rtl"&&this._autocomplete()},_onRightKeyed:function(){this.dir==="ltr"&&this._autocomplete()},_onQueryChanged:function(n,t){this.input.clearHintIfInvalid();t.length>=this.minLength?this.dropdown.update(t):this.dropdown.empty();this.dropdown.open();this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint();this.dropdown.open()},_setLanguageDirection:function(){var n;this.dir!==(n=this.input.getLanguageDirection())&&(this.dir=n,this.$node.css("direction",n),this.dropdown.setLanguageDirection(n))},_updateHint:function(){var n,i,u,f,e,r;n=this.dropdown.getDatumForTopSuggestion();n&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(i=this.input.getInputValue(),u=c.normalizeQuery(i),f=t.escapeRegExChars(u),e=new RegExp("^(?:"+f+")(.+$)","i"),r=e.exec(n.value),r?this.input.setHint(i+r[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(n){var i,r,u,t;i=this.input.getHint();r=this.input.getQuery();u=n||this.input.isCursorAtEnd();i&&r!==i&&u&&(t=this.dropdown.getDatumForTopSuggestion(),t&&this.input.setInputValue(t.value),this.eventBus.trigger("autocompleted",t.raw,t.datasetName))},_select:function(n){this.input.setQuery(n.value);this.input.setInputValue(n.value,!0);this._setLanguageDirection();this.eventBus.trigger("selected",n.raw,n.datasetName);this.dropdown.close();t.defer(t.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(n){this.isActivated?this.input.setInputValue(n):(this.input.setQuery(n),this.input.setInputValue(n,!0));this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy();this.dropdown.destroy();s(this.$node);this.$node=null}}),f}();(function(){var u,i,r;u=n.fn.typeahead;i="ttTypeahead";r={initialize:function(r,u){function f(){var f=n(this),o,e;t.each(u,function(n){n.highlight=!!r.highlight});e=new b({input:f,eventBus:o=new h({el:f}),withHint:t.isUndefined(r.hint)?!0:!!r.hint,minLength:r.minLength,autoselect:r.autoselect,datasets:u});f.data(i,e)}return u=t.isArray(u)?u:[].slice.call(arguments,1),r=r||{},this.each(f)},open:function(){function t(){var r=n(this),t;(t=r.data(i))&&t.open()}return this.each(t)},close:function(){function t(){var r=n(this),t;(t=r.data(i))&&t.close()}return this.each(t)},val:function(t){function r(){var u=n(this),r;(r=u.data(i))&&r.setVal(t)}function u(n){var t,r;return(t=n.data(i))&&(r=t.getVal()),r}return arguments.length?this.each(r):u(this.first())},destroy:function(){function t(){var t=n(this),r;(r=t.data(i))&&(r.destroy(),t.removeData(i))}return this.each(t)}};n.fn.typeahead=function(n){return r[n]?r[n].apply(this,[].slice.call(arguments,1)):r.initialize.apply(this,arguments)};n.fn.typeahead.noConflict=function(){return n.fn.typeahead=u,this}})()}(window.jQuery);Handlebars=function(){var r=function(){"use strict";function n(n){this.string=n}return n.prototype.toString=function(){return""+this.string},n}(),t=function(n){"use strict";function h(n){return e[n]||"&amp;"}function c(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}function l(n){return n instanceof f?n.toString():!n&&n!==0?"":(n=""+n,!s.test(n))?n:n.replace(o,h)}function a(n){return n||n===0?u(n)&&n.length===0?!0:!1:!0}var t={},f=n,e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},o=/[&<>"'`]/g,s=/[&<>"'`]/,i,r,u;return t.extend=c,i=Object.prototype.toString,t.toString=i,r=function(n){return typeof n=="function"},r(/x/)&&(r=function(n){return typeof n=="function"&&i.call(n)==="[object Function]"}),t.isFunction=r,u=Array.isArray||function(n){return n&&typeof n=="object"?i.call(n)==="[object Array]":!1},t.isArray=u,t.escapeExpression=l,t.isEmpty=a,t}(r),n=function(){"use strict";function t(t,i){var u,f,r;for(i&&i.firstLine&&(u=i.firstLine,t+=" - "+u+":"+i.firstColumn),f=Error.prototype.constructor.call(this,t),r=0;r<n.length;r++)this[n[r]]=f[n[r]];u&&(this.lineNumber=u,this.column=i.firstColumn)}var n=["description","fileName","lineNumber","message","name","number","stack"];return t.prototype=new Error,t}(),i=function(n,t){"use strict";function e(n,t){this.helpers=n||{};this.partials=t||{};p(this)}function p(n){n.registerHelper("helperMissing",function(n){if(arguments.length===2)return undefined;throw new s("Missing helper: '"+n+"'");});n.registerHelper("blockHelperMissing",function(t,i){var r=i.inverse||function(){},u=i.fn;return f(t)&&(t=t.call(this)),t===!0?u(this):t===!1||t==null?r(this):l(t)?t.length>0?n.helpers.each(t,i):r(this):u(t)});n.registerHelper("each",function(n,t){var s=t.fn,c=t.inverse,r=0,u="",i,h,e;if(f(n)&&(n=n.call(this)),t.data&&(i=o(t.data)),n&&typeof n=="object")if(l(n))for(h=n.length;r<h;r++)i&&(i.index=r,i.first=r===0,i.last=r===n.length-1),u=u+s(n[r],{data:i});else for(e in n)n.hasOwnProperty(e)&&(i&&(i.key=e,i.index=r,i.first=r===0),u=u+s(n[e],{data:i}),r++);return r===0&&(u=c(this)),u});n.registerHelper("if",function(n,t){return f(n)&&(n=n.call(this)),(t.hash.includeZero||n)&&!r.isEmpty(n)?t.fn(this):t.inverse(this)});n.registerHelper("unless",function(t,i){return n.helpers["if"].call(this,t,{fn:i.inverse,inverse:i.fn,hash:i.hash})});n.registerHelper("with",function(n,t){return f(n)&&(n=n.call(this)),r.isEmpty(n)?void 0:t.fn(n)});n.registerHelper("log",function(t,i){var r=i.data&&i.data.level!=null?parseInt(i.data.level,10):1;n.log(r,t)})}function y(n,t){u.log(n,t)}var i={},r=n,s=t,h,c,u,o;i.VERSION="1.3.0";h=4;i.COMPILER_REVISION=h;c={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};i.REVISION_CHANGES=c;var l=r.isArray,f=r.isFunction,a=r.toString,v="[object Object]";return i.HandlebarsEnvironment=e,e.prototype={constructor:e,logger:u,log:y,registerHelper:function(n,t,i){if(a.call(n)===v){if(i||t)throw new s("Arg not supported with multiple helpers");r.extend(this.helpers,n)}else i&&(t.not=i),this.helpers[n]=t},registerPartial:function(n,t){a.call(n)===v?r.extend(this.partials,n):this.partials[n]=t}},u={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(n,t){if(u.level<=n){var i=u.methodMap[n];typeof console!="undefined"&&console[i]&&console[i].call(console,t)}}},i.logger=u,i.log=y,o=function(n){var t={};return r.extend(t,n),t},i.createFrame=o,i}(t,n),f=function(n,t,i){"use strict";function h(n){var t=n&&n[0]||1,i=s,r,f;if(t!==i)if(t<i){r=o[i];f=o[t];throw new u("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+f+").");}else throw new u("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+n[1]+").");}function c(n,t){if(!t)throw new u("No environment passed to template");var r=function(n,i,r,f,e,o){var s=t.VM.invokePartial.apply(this,arguments),h;if(s!=null)return s;if(t.compile)return h={helpers:f,partials:e,data:o},e[i]=t.compile(n,{data:o!==undefined},t),e[i](r,h);throw new u("The partial "+i+" could not be compiled when running in runtime-only mode");},i={escapeExpression:f.escapeExpression,invokePartial:r,programs:[],program:function(n,t,i){var r=this.programs[n];return i?r=e(n,t,i):r||(r=this.programs[n]=e(n,t)),r},merge:function(n,t){var i=n||t;return n&&t&&n!==t&&(i={},f.extend(i,t),f.extend(i,n)),i},programWithDepth:t.VM.programWithDepth,noop:t.VM.noop,compilerInfo:null};return function(r,u){var f,e,o,s;return u=u||{},f=u.partial?u:t,u.partial||(e=u.helpers,o=u.partials),s=n.call(i,f,r,e,o,u.data),u.partial||t.VM.checkRevision(i.compilerInfo),s}}function l(n,t,i){var u=Array.prototype.slice.call(arguments,3),r=function(n,r){return r=r||{},t.apply(this,[n,r.data||i].concat(u))};return r.program=n,r.depth=u.length,r}function e(n,t,i){var r=function(n,r){return r=r||{},t(n,r.data||i)};return r.program=n,r.depth=0,r}function a(n,t,i,r,f,e){var o={partial:!0,helpers:r,partials:f,data:e};if(n===undefined)throw new u("The partial "+t+" could not be found");else if(n instanceof Function)return n(i,o)}function v(){return""}var r={},f=n,u=t,s=i.COMPILER_REVISION,o=i.REVISION_CHANGES;return r.checkRevision=h,r.template=c,r.programWithDepth=l,r.program=e,r.invokePartial=a,r.noop=v,r}(t,n,i),e=function(n,t,i,r,u){"use strict";var f=n,c=t,l=i,e=r,o=u,s=function(){var n=new f.HandlebarsEnvironment;return e.extend(n,f),n.SafeString=c,n.Exception=l,n.Utils=e,n.VM=o,n.template=function(t){return o.template(t,n)},n},h=s();return h.create=s,h}(i,r,n,t,f),u=function(n){"use strict";function t(n){n=n||{};this.firstLine=n.first_line;this.firstColumn=n.first_column;this.lastColumn=n.last_column;this.lastLine=n.last_line}var r=n,i={ProgramNode:function(n,r,u,f){var o,e;arguments.length===3?(f=u,u=null):arguments.length===2&&(f=r,r=null);t.call(this,f);this.type="program";this.statements=n;this.strip={};u?(e=u[0],e?(o={first_line:e.firstLine,last_line:e.lastLine,last_column:e.lastColumn,first_column:e.firstColumn},this.inverse=new i.ProgramNode(u,r,o)):this.inverse=new i.ProgramNode(u,r),this.strip.right=r.left):r&&(this.strip.left=r.right)},MustacheNode:function(n,r,u,f,e){if(t.call(this,e),this.type="mustache",this.strip=f,u!=null&&u.charAt){var o=u.charAt(3)||u.charAt(2);this.escaped=o!=="{"&&o!=="&"}else this.escaped=!!u;this.sexpr=n instanceof i.SexprNode?n:new i.SexprNode(n,r);this.sexpr.isRoot=!0;this.id=this.sexpr.id;this.params=this.sexpr.params;this.hash=this.sexpr.hash;this.eligibleHelper=this.sexpr.eligibleHelper;this.isHelper=this.sexpr.isHelper},SexprNode:function(n,i,r){t.call(this,r);this.type="sexpr";this.hash=i;var u=this.id=n[0],f=this.params=n.slice(1),e=this.eligibleHelper=u.isSimple;this.isHelper=e&&(f.length||i)},PartialNode:function(n,i,r,u){t.call(this,u);this.type="partial";this.partialName=n;this.context=i;this.strip=r},BlockNode:function(n,i,u,f,e){if(t.call(this,e),n.sexpr.id.original!==f.path.original)throw new r(n.sexpr.id.original+" doesn't match "+f.path.original,this);this.type="block";this.mustache=n;this.program=i;this.inverse=u;this.strip={left:n.strip.left,right:f.strip.right};(i||u).strip.left=n.strip.right;(u||i).strip.right=f.strip.left;u&&!i&&(this.isInverse=!0)},ContentNode:function(n,i){t.call(this,i);this.type="content";this.string=n},HashNode:function(n,i){t.call(this,i);this.type="hash";this.pairs=n},IdNode:function(n,i){var f,h,u;t.call(this,i);this.type="ID";var o="",e=[],s=0;for(f=0,h=n.length;f<h;f++)if(u=n[f].part,o+=(n[f].separator||"")+u,u===".."||u==="."||u==="this")if(e.length>0)throw new r("Invalid path: "+o,this);else u===".."?s++:this.isScoped=!0;else e.push(u);this.original=o;this.parts=e;this.string=e.join(".");this.depth=s;this.isSimple=n.length===1&&!this.isScoped&&s===0;this.stringModeValue=this.string},PartialNameNode:function(n,i){t.call(this,i);this.type="PARTIAL_NAME";this.name=n.original},DataNode:function(n,i){t.call(this,i);this.type="DATA";this.id=n},StringNode:function(n,i){t.call(this,i);this.type="STRING";this.original=this.string=this.stringModeValue=n},IntegerNode:function(n,i){t.call(this,i);this.type="INTEGER";this.original=this.integer=n;this.stringModeValue=Number(n)},BooleanNode:function(n,i){t.call(this,i);this.type="BOOLEAN";this.bool=n;this.stringModeValue=n==="true"},CommentNode:function(n,i){t.call(this,i);this.type="comment";this.comment=n}};return i}(n),o=function(){"use strict";return function(){function n(n,t){return{left:n.charAt(2)==="~",right:t.charAt(0)==="~"||t.charAt(1)==="~"}}function i(){this.yy={}}var t={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(t,i,r,u,f,e){var o=e.length-1;switch(f){case 1:return new u.ProgramNode(e[o-1],this._$);case 2:return new u.ProgramNode([],this._$);case 3:this.$=new u.ProgramNode([],e[o-1],e[o],this._$);break;case 4:this.$=new u.ProgramNode(e[o-2],e[o-1],e[o],this._$);break;case 5:this.$=new u.ProgramNode(e[o-1],e[o],[],this._$);break;case 6:this.$=new u.ProgramNode(e[o],this._$);break;case 7:this.$=new u.ProgramNode([],this._$);break;case 8:this.$=new u.ProgramNode([],this._$);break;case 9:this.$=[e[o]];break;case 10:e[o-1].push(e[o]);this.$=e[o-1];break;case 11:this.$=new u.BlockNode(e[o-2],e[o-1].inverse,e[o-1],e[o],this._$);break;case 12:this.$=new u.BlockNode(e[o-2],e[o-1],e[o-1].inverse,e[o],this._$);break;case 13:this.$=e[o];break;case 14:this.$=e[o];break;case 15:this.$=new u.ContentNode(e[o],this._$);break;case 16:this.$=new u.CommentNode(e[o],this._$);break;case 17:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 18:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 19:this.$={path:e[o-1],strip:n(e[o-2],e[o])};break;case 20:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 21:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 22:this.$=new u.PartialNode(e[o-2],e[o-1],n(e[o-3],e[o]),this._$);break;case 23:this.$=n(e[o-1],e[o]);break;case 24:this.$=new u.SexprNode([e[o-2]].concat(e[o-1]),e[o],this._$);break;case 25:this.$=new u.SexprNode([e[o]],null,this._$);break;case 26:this.$=e[o];break;case 27:this.$=new u.StringNode(e[o],this._$);break;case 28:this.$=new u.IntegerNode(e[o],this._$);break;case 29:this.$=new u.BooleanNode(e[o],this._$);break;case 30:this.$=e[o];break;case 31:e[o-1].isHelper=!0;this.$=e[o-1];break;case 32:this.$=new u.HashNode(e[o],this._$);break;case 33:this.$=[e[o-2],e[o]];break;case 34:this.$=new u.PartialNameNode(e[o],this._$);break;case 35:this.$=new u.PartialNameNode(new u.StringNode(e[o],this._$),this._$);break;case 36:this.$=new u.PartialNameNode(new u.IntegerNode(e[o],this._$));break;case 37:this.$=new u.DataNode(e[o],this._$);break;case 38:this.$=new u.IdNode(e[o],this._$);break;case 39:e[o-2].push({part:e[o],separator:e[o-1]});this.$=e[o-2];break;case 40:this.$=[{part:e[o]}];break;case 43:this.$=[];break;case 44:e[o-1].push(e[o]);break;case 47:this.$=[e[o]];break;case 48:e[o-1].push(e[o])}},table:[{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],defaultActions:{3:[2,2],16:[2,1],50:[2,42]},parseError:function(n){throw new Error(n);},parse:function(n){function it(){var n;return n=k.lexer.lex()||1,typeof n!="number"&&(n=k.symbols_[n]||n),n}var k=this,r=[0],f=[null],t=[],h=this.table,d="",c=0,g=0,y=0,l,nt,i,p,o,u,w,s,a,e,tt,v,b;for(this.lexer.setInput(n),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={}),l=this.lexer.yylloc,t.push(l),nt=this.lexer.options&&this.lexer.options.ranges,typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError),s={};;){if(o=r[r.length-1],this.defaultActions[o]?u=this.defaultActions[o]:((i===null||typeof i=="undefined")&&(i=it()),u=h[o]&&h[o][i]),(typeof u=="undefined"||!u.length||!u[0])&&(b="",!y)){v=[];for(a in h[o])this.terminals_[a]&&a>2&&v.push("'"+this.terminals_[a]+"'");b=this.lexer.showPosition?"Parse error on line "+(c+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[i]||i)+"'":"Parse error on line "+(c+1)+": Unexpected "+(i==1?"end of input":"'"+(this.terminals_[i]||i)+"'");this.parseError(b,{text:this.lexer.match,token:this.terminals_[i]||i,line:this.lexer.yylineno,loc:l,expected:v})}if(u[0]instanceof Array&&u.length>1)throw new Error("Parse Error: multiple actions possible at state: "+o+", token: "+i);switch(u[0]){case 1:r.push(i);f.push(this.lexer.yytext);t.push(this.lexer.yylloc);r.push(u[1]);i=null;p?(i=p,p=null):(g=this.lexer.yyleng,d=this.lexer.yytext,c=this.lexer.yylineno,l=this.lexer.yylloc,y>0&&y--);break;case 2:if(e=this.productions_[u[1]][1],s.$=f[f.length-e],s._$={first_line:t[t.length-(e||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(e||1)].first_column,last_column:t[t.length-1].last_column},nt&&(s._$.range=[t[t.length-(e||1)].range[0],t[t.length-1].range[1]]),w=this.performAction.call(s,d,g,c,this.yy,u[1],f,t),typeof w!="undefined")return w;e&&(r=r.slice(0,-2*e),f=f.slice(0,-1*e),t=t.slice(0,-1*e));r.push(this.productions_[u[1]][0]);f.push(s.$);t.push(s._$);tt=h[r[r.length-2]][r[r.length-1]];r.push(tt);break;case 3:return!0}}return!0}},r=function(){var n={EOF:1,parseError:function(n,t){if(this.yy.parser)this.yy.parser.parseError(n,t);else throw new Error(n);},setInput:function(n){return this._input=n,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0],t;return this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n,t=n.match(/(?:\r\n?|\n).*/g),t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var i=n.length,t=n.split(/(?:\r\n?|\n)/g),r,u;return this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i-1),this.offset-=i,r=this.match.split(/(?:\r\n?|\n)/g),this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1),u=this.yylloc.range,this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===r.length?this.yylloc.first_column:0)+r[r.length-t.length].length-t[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this},more:function(){return this._more=!0,this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),t=new Array(n.length+1).join("-");return n+this.upcomingInput()+"\n"+t+"^"},next:function(){var f,n,r,e,t,u,i;if(this.done)return this.EOF;for(this._input||(this.done=!0),this._more||(this.yytext="",this.match=""),u=this._currentRules(),i=0;i<u.length;i++)if(r=this._input.match(this.rules[u[i]]),r&&(!n||r[0].length>n[0].length)&&(n=r,e=i,!this.options.flex))break;return n?(t=n[0].match(/(?:\r\n?|\n).*/g),t&&(this.yylineno+=t.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:t?t[t.length-1].length-t[t.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],f=this.performAction.call(this,this.yy,this,u[e],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)?f:void 0:this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var n=this.next();return typeof n!="undefined"?n:this.lex()},begin:function(n){this.conditionStack.push(n)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(n){this.begin(n)}};return n.options={},n.performAction=function(n,t,i,r){function u(n,i){return t.yytext=t.yytext.substr(n,t.yyleng-i)}var f=r;switch(i){case 0:if(t.yytext.slice(-2)==="\\\\"?(u(0,1),this.begin("mu")):t.yytext.slice(-1)==="\\"?(u(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return u(0,4),this.popState(),15;case 4:return 35;case 5:return 36;case 6:return 25;case 7:return 16;case 8:return 20;case 9:return 19;case 10:return 19;case 11:return 23;case 12:return 22;case 13:this.popState();this.begin("com");break;case 14:return u(3,5),this.popState(),15;case 15:return 22;case 16:return 41;case 17:return 40;case 18:return 40;case 19:return 44;case 21:return this.popState(),24;case 22:return this.popState(),18;case 23:return t.yytext=u(1,2).replace(/\\"/g,'"'),32;case 24:return t.yytext=u(1,2).replace(/\\'/g,"'"),32;case 25:return 42;case 26:return 34;case 27:return 34;case 28:return 33;case 29:return 40;case 30:return t.yytext=u(1,2),40;case 31:return"INVALID";case 32:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},n}();return t.lexer=r,i.prototype=t,t.Parser=i,new i}()}(),s=function(n,t){"use strict";function f(n){return n.constructor===u.ProgramNode?n:(r.yy=u,r.parse(n))}var i={},r=n,u=t;return i.parser=r,i.parse=f,i}(o,u),h=function(n){"use strict";function r(){}function u(n,t,r){if(n==null||typeof n!="string"&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+n);t=t||{};"data"in t||(t.data=!0);var u=r.parse(n),f=(new r.Compiler).compile(u,t);return(new r.JavaScriptCompiler).compile(f,t)}function f(n,t,r){function f(){var i=r.parse(n),u=(new r.Compiler).compile(i,t),f=(new r.JavaScriptCompiler).compile(u,t,undefined,!0);return r.template(f)}if(n==null||typeof n!="string"&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+n);t=t||{};"data"in t||(t.data=!0);var u;return function(n,t){return u||(u=f()),u.call(this,n,t)}}var t={},i=n;return t.Compiler=r,r.prototype={compiler:r,disassemble:function(){for(var i,e=this.opcodes,n,r=[],u,t,f=0,o=e.length;f<o;f++)if(n=e[f],n.opcode==="DECLARE")r.push("DECLARE "+n.name+"="+n.value);else{for(u=[],i=0;i<n.args.length;i++)t=n.args[i],typeof t=="string"&&(t='"'+t.replace("\n","\\n")+'"'),u.push(t);r.push(n.opcode+" "+u.join(" "))}return r.join("\n")},equals:function(n){var i=this.opcodes.length,t,r,f,u;if(n.opcodes.length!==i)return!1;for(t=0;t<i;t++){if(r=this.opcodes[t],f=n.opcodes[t],r.opcode!==f.opcode||r.args.length!==f.args.length)return!1;for(u=0;u<r.args.length;u++)if(r.args[u]!==f.args[u])return!1}if(i=this.children.length,n.children.length!==i)return!1;for(t=0;t<i;t++)if(!this.children[t].equals(n.children[t]))return!1;return!0},guid:0,compile:function(n,t){var i,r;if(this.opcodes=[],this.children=[],this.depths={list:[]},this.options=t,i=this.options.knownHelpers,this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0},i)for(r in i)this.options.knownHelpers[r]=i[r];return this.accept(n)},accept:function(n){var t=n.strip||{},i;return t.left&&this.opcode("strip"),i=this[n.type](n),t.right&&this.opcode("strip"),i},program:function(n){for(var i=n.statements,t=0,r=i.length;t<r;t++)this.accept(i[t]);return this.isSimple=r===1,this.depths.list=this.depths.list.sort(function(n,t){return n-t}),this},compileProgram:function(n){var t=(new this.compiler).compile(n,this.options),u=this.guid++,r,i,f;for(this.usePartial=this.usePartial||t.usePartial,this.children[u]=t,i=0,f=t.depths.list.length;i<f;i++)if(r=t.depths.list[i],r<2)continue;else this.addDepth(r-1);return u},block:function(n){var f=n.mustache,t=n.program,i=n.inverse,r,u;t&&(t=this.compileProgram(t));i&&(i=this.compileProgram(i));r=f.sexpr;u=this.classifySexpr(r);u==="helper"?this.helperSexpr(r,t,i):u==="simple"?(this.simpleSexpr(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousSexpr(r,t,i),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue"));this.opcode("append")},hash:function(n){var u=n.pairs,r,t,i,f;for(this.opcode("pushHash"),i=0,f=u.length;i<f;i++)r=u[i],t=r[1],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),t.type==="sexpr"&&this.sexpr(t)):this.accept(t),this.opcode("assignToHash",r[0]);this.opcode("popHash")},partial:function(n){var t=n.partialName;this.usePartial=!0;n.context?this.ID(n.context):this.opcode("push","depth0");this.opcode("invokePartial",t.name);this.opcode("append")},content:function(n){this.opcode("appendContent",n.string)},mustache:function(n){this.sexpr(n.sexpr);n.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(n,t,i){var r=n.id,u=r.parts[0],f=t!=null||i!=null;this.opcode("getContext",r.depth);this.opcode("pushProgram",t);this.opcode("pushProgram",i);this.opcode("invokeAmbiguous",u,f)},simpleSexpr:function(n){var t=n.id;t.type==="DATA"?this.DATA(t):t.parts.length?this.ID(t):(this.addDepth(t.depth),this.opcode("getContext",t.depth),this.opcode("pushContext"));this.opcode("resolvePossibleLambda")},helperSexpr:function(n,t,r){var f=this.setupFullMustacheParams(n,t,r),u=n.id.parts[0];if(this.options.knownHelpers[u])this.opcode("invokeKnownHelper",f.length,u);else if(this.options.knownHelpersOnly)throw new i("You specified knownHelpersOnly, but used the unknown helper "+u,n);else this.opcode("invokeHelper",f.length,u,n.isRoot)},sexpr:function(n){var t=this.classifySexpr(n);t==="simple"?this.simpleSexpr(n):t==="helper"?this.helperSexpr(n):this.ambiguousSexpr(n)},ID:function(n){var i,t,r;for(this.addDepth(n.depth),this.opcode("getContext",n.depth),i=n.parts[0],i?this.opcode("lookupOnContext",n.parts[0]):this.opcode("pushContext"),t=1,r=n.parts.length;t<r;t++)this.opcode("lookup",n.parts[t])},DATA:function(n){var r,t,u;if(this.options.data=!0,n.id.isScoped||n.id.depth)throw new i("Scoped data references are not supported: "+n.original,n);for(this.opcode("lookupData"),r=n.id.parts,t=0,u=r.length;t<u;t++)this.opcode("lookup",r[t])},STRING:function(n){this.opcode("pushString",n.string)},INTEGER:function(n){this.opcode("pushLiteral",n.integer)},BOOLEAN:function(n){this.opcode("pushLiteral",n.bool)},comment:function(){},opcode:function(n){this.opcodes.push({opcode:n,args:[].slice.call(arguments,1)})},declare:function(n,t){this.opcodes.push({opcode:"DECLARE",name:n,value:t})},addDepth:function(n){n!==0&&(this.depths[n]||(this.depths[n]=!0,this.depths.list.push(n)))},classifySexpr:function(n){var t=n.isHelper,i=n.eligibleHelper,r=this.options,u;return i&&!t&&(u=n.id.parts[0],r.knownHelpers[u]?t=!0:r.knownHelpersOnly&&(i=!1)),t?"helper":i?"ambiguous":"simple"},pushParams:function(n){for(var i=n.length,t;i--;)t=n[i],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),t.type==="sexpr"&&this.sexpr(t)):this[t.type](t)},setupFullMustacheParams:function(n,t,i){var r=n.params;return this.pushParams(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),n.hash?this.hash(n.hash):this.opcode("emptyHash"),r}},t.precompile=u,t.compile=f,t}(n),c=function(n,t){"use strict";function r(n){this.value=n}function i(){}var c=n.COMPILER_REVISION,l=n.REVISION_CHANGES,e=n.log,o=t,f,s,u,h;for(i.prototype={nameLookup:function(n,t){var u,r;return n.indexOf("depth")===0&&(u=!0),r=/^[0-9]+$/.test(t)?n+"["+t+"]":i.isValidJavaScriptVariableName(t)?n+"."+t:n+"['"+t+"']",u?"("+n+" && "+r+")":r},compilerInfo:function(){var n=c,t=l[n];return"this.compilerInfo = ["+n+",'"+t+"'];\n"},appendToBuffer:function(n){return this.environment.isSimple?"return "+n+";":{appendToBuffer:!0,content:n,toString:function(){return"buffer += "+n+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(n,t,i,r){var f,u,s;for(this.environment=n,this.options=t||{},e("debug",this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!i,this.context=i||{programs:[],environments:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(n,t),f=n.opcodes,this.i=0,s=f.length;this.i<s;this.i++)u=f[this.i],u.opcode==="DECLARE"?this[u.name]=u.value:this[u.opcode].apply(this,u.args),u.opcode!==this.stripNext&&(this.stripNext=!1);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new o("Compile completed with content left on stack");return this.createFunctionContext(r)},preamble:function(){var t=[],i,n;this.isChild?t.push(""):(i=this.namespace,n="helpers = this.merge(helpers, "+i+".helpers);",this.environment.usePartial&&(n=n+" partials = this.merge(partials, "+i+".partials);"),this.options.data&&(n=n+" data = data || {};"),t.push(n));this.environment.isSimple?t.push(""):t.push(", buffer = "+this.initializeBuffer());this.lastContext=0;this.source=t},createFunctionContext:function(n){var o=this.stackVars.concat(this.registers.list),r,t,u,s,i,f;if(o.length>0&&(this.source[1]=this.source[1]+", "+o.join(", ")),!this.isChild)for(r in this.context.aliases)this.context.aliases.hasOwnProperty(r)&&(this.source[1]=this.source[1]+", "+r+"="+this.context.aliases[r]);for(this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.pushSource("return buffer;"),t=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"],u=0,s=this.environment.depths.list.length;u<s;u++)t.push("depth"+this.environment.depths.list[u]);return i=this.mergeSource(),this.isChild||(i=this.compilerInfo()+i),n?(t.push(i),Function.apply(this,t)):(f="function "+(this.name||"")+"("+t.join(",")+") {\n  "+i+"}",e("debug",f+"\n\n"),f)},mergeSource:function(){for(var t,i="",n,r=0,u=this.source.length;r<u;r++)t=this.source[r],t.appendToBuffer?n=n?n+"\n    + "+t.content:t.content:(n&&(i+="buffer += "+n+";\n  ",n=undefined),i+=t+"\n  ");return i},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var n=["depth0"];this.setupParams(0,n);this.replaceStack(function(t){return n.splice(1,0,t),"blockHelperMissing.call("+n.join(", ")+")"})},ambiguousBlockValue:function(){var n,t;this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";n=["depth0"];this.setupParams(0,n);t=this.topStack();n.splice(1,0,t);this.pushSource("if (!"+this.lastHelper+") { "+t+" = blockHelperMissing.call("+n.join(", ")+"); }")},appendContent:function(n){this.pendingContent&&(n=this.pendingContent+n);this.stripNext&&(n=n.replace(/^\s+/,""));this.pendingContent=n},strip:function(){this.pendingContent&&(this.pendingContent=this.pendingContent.replace(/\s+$/,""));this.stripNext="strip"},append:function(){this.flushInline();var n=this.popStack();this.pushSource("if("+n+" || "+n+" === 0) { "+this.appendToBuffer(n)+" }");this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression";this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(n){this.lastContext!==n&&(this.lastContext=n)},lookupOnContext:function(n){this.push(this.nameLookup("depth"+this.lastContext,n,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"';this.replaceStack(function(n){return"typeof "+n+" === functionType ? "+n+".apply(depth0) : "+n})},lookup:function(n){this.replaceStack(function(t){return t+" == null || "+t+" === false ? "+t+" : "+this.nameLookup(t,n,"context")})},lookupData:function(){this.pushStackLiteral("data")},pushStringParam:function(n,t){this.pushStackLiteral("depth"+this.lastContext);this.pushString(t);t!=="sexpr"&&(typeof n=="string"?this.pushString(n):this.pushStackLiteral(n))},emptyHash:function(){this.pushStackLiteral("{}");this.options.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash);this.hash={values:[],types:[],contexts:[]}},popHash:function(){var n=this.hash;this.hash=this.hashes.pop();this.options.stringParams&&(this.push("{"+n.contexts.join(",")+"}"),this.push("{"+n.types.join(",")+"}"));this.push("{\n    "+n.values.join(",\n    ")+"\n  }")},pushString:function(n){this.pushStackLiteral(this.quotedString(n))},push:function(n){return this.inlineStack.push(n),n},pushLiteral:function(n){this.pushStackLiteral(n)},pushProgram:function(n){n!=null?this.pushStackLiteral(this.programExpression(n)):this.pushStackLiteral(null)},invokeHelper:function(n,t,i){this.context.aliases.helperMissing="helpers.helperMissing";this.useRegister("helper");var r=this.lastHelper=this.setupHelper(n,t,!0),f=this.nameLookup("depth"+this.lastContext,t,"context"),u="helper = "+r.name+" || "+f;r.paramsInit&&(u+=","+r.paramsInit);this.push("("+u+",helper ? helper.call("+r.callParams+") : helperMissing.call("+r.helperMissingParams+"))");i||this.flushInline()},invokeKnownHelper:function(n,t){var i=this.setupHelper(n,t);this.push(i.name+".call("+i.callParams+")")},invokeAmbiguous:function(n,t){this.context.aliases.functionType='"function"';this.useRegister("helper");this.emptyHash();var i=this.setupHelper(0,n,t),u=this.lastHelper=this.nameLookup("helpers",n,"helper"),f=this.nameLookup("depth"+this.lastContext,n,"context"),r=this.nextStack();i.paramsInit&&this.pushSource(i.paramsInit);this.pushSource("if (helper = "+u+") { "+r+" = helper.call("+i.callParams+"); }");this.pushSource("else { helper = "+f+"; "+r+" = typeof helper === functionType ? helper.call("+i.callParams+") : helper; }")},invokePartial:function(n){var t=[this.nameLookup("partials",n,"partial"),"'"+n+"'",this.popStack(),"helpers","partials"];this.options.data&&t.push("data");this.context.aliases.self="this";this.push("self.invokePartial("+t.join(", ")+")")},assignToHash:function(n){var u=this.popStack(),i,r,t;this.options.stringParams&&(r=this.popStack(),i=this.popStack());t=this.hash;i&&t.contexts.push("'"+n+"': "+i);r&&t.types.push("'"+n+"': "+r);t.values.push("'"+n+"': ("+u+")")},compiler:i,compileChildren:function(n,t){for(var i,f=n.children,r,e,u=0,o=f.length;u<o;u++)r=f[u],e=new this.compiler,i=this.matchExistingProgram(r),i==null?(this.context.programs.push(""),i=this.context.programs.length,r.index=i,r.name="program"+i,this.context.programs[i]=e.compile(r,t,this.context),this.context.environments[i]=r):(r.index=i,r.name="program"+i)},matchExistingProgram:function(n){for(var i,t=0,r=this.context.environments.length;t<r;t++)if(i=this.context.environments[t],i&&i.equals(n))return t},programExpression:function(n){var t,e;if(this.context.aliases.self="this",n==null)return"self.noop";var i=this.environment.children[n],r=i.depths.list,u,f=[i.index,i.name,"data"];for(t=0,e=r.length;t<e;t++)u=r[t],u===1?f.push("depth0"):f.push("depth"+(u-1));return(r.length===0?"self.program(":"self.programWithDepth(")+f.join(", ")+")"},register:function(n,t){this.useRegister(n);this.pushSource(n+" = "+t+";")},useRegister:function(n){this.registers[n]||(this.registers[n]=!0,this.registers.list.push(n))},pushStackLiteral:function(n){return this.push(new r(n))},pushSource:function(n){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=undefined);n&&this.source.push(n)},pushStack:function(n){this.flushInline();var t=this.incrStack();return n&&this.pushSource(t+" = "+n+";"),this.compileStack.push(t),t},replaceStack:function(n){var u="",o=this.isInline(),t,f,s,i,h,e;return o?(i=this.popStack(!0),i instanceof r?(t=i.value,s=!0):(f=!this.stackSlot,h=f?this.incrStack():this.topStackName(),u="("+this.push(h)+" = "+i+"),",t=this.topStack())):t=this.topStack(),e=n.call(this,t),o?(s||this.popStack(),f&&this.stackSlot--,this.push("("+u+e+")")):(/^stack/.test(t)||(t=this.nextStack()),this.pushSource(t+" = ("+u+e+");")),t},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var i=this.inlineStack,n,u,t;if(i.length)for(this.inlineStack=[],n=0,u=i.length;n<u;n++)t=i[n],t instanceof r?this.compileStack.push(t):this.pushStack(t)},isInline:function(){return this.inlineStack.length},popStack:function(n){var i=this.isInline(),t=(i?this.inlineStack:this.compileStack).pop();if(!n&&t instanceof r)return t.value;if(!i){if(!this.stackSlot)throw new o("Invalid stack pop");this.stackSlot--}return t},topStack:function(n){var i=this.isInline()?this.inlineStack:this.compileStack,t=i[i.length-1];return!n&&t instanceof r?t.value:t},quotedString:function(n){return'"'+n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(n,t,i){var r=[],u=this.setupParams(n,r,i),f=this.nameLookup("helpers",t,"helper");return{params:r,paramsInit:u,name:f,callParams:["depth0"].concat(r).join(", "),helperMissingParams:i&&["depth0",this.quotedString(t)].concat(r).join(", ")}},setupOptions:function(n,t){var i=[],e=[],o=[],s,r,u,f;for(i.push("hash:"+this.popStack()),this.options.stringParams&&(i.push("hashTypes:"+this.popStack()),i.push("hashContexts:"+this.popStack())),r=this.popStack(),u=this.popStack(),(u||r)&&(u||(this.context.aliases.self="this",u="self.noop"),r||(this.context.aliases.self="this",r="self.noop"),i.push("inverse:"+r),i.push("fn:"+u)),f=0;f<n;f++)s=this.popStack(),t.push(s),this.options.stringParams&&(o.push(this.popStack()),e.push(this.popStack()));return this.options.stringParams&&(i.push("contexts:["+e.join(",")+"]"),i.push("types:["+o.join(",")+"]")),this.options.data&&i.push("data:data"),i},setupParams:function(n,t,i){var r="{"+this.setupOptions(n,t).join(",")+"}";return i?(this.useRegister("options"),t.push("options"),"options="+r):(t.push(r),"")}},f="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),s=i.RESERVED_WORDS={},u=0,h=f.length;u<h;u++)s[f[u]]=!0;return i.isValidJavaScriptVariableName=function(n){return!i.RESERVED_WORDS[n]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(n)?!0:!1},i}(i,n);return function(n,t,i,r,u){"use strict";var f=n,o=t,s=i.parser,h=i.parse,c=r.Compiler,l=r.compile,a=r.precompile,v=u,y=f.create,e=function(){var n=y();return n.compile=function(t,i){return l(t,i,n)},n.precompile=function(t,i){return a(t,i,n)},n.AST=o,n.Compiler=c,n.JavaScriptCompiler=v,n.Parser=s,n.parse=h,n};return f=e(),f.create=e,f}(e,u,s,h,c)}();!function(n){"use strict";n.matchMedia=n.matchMedia||function(n){var u,i=n.documentElement,f=i.firstElementChild||i.firstChild,r=n.createElement("body"),t=n.createElement("div");return t.id="mq-test-1",t.style.cssText="position:absolute;top:-100em",r.style.background="none",r.appendChild(t),function(n){return t.innerHTML='&shy;<style media="'+n+'"> #mq-test-1 { width: 42px; }<\/style>',i.insertBefore(r,f),u=42===t.offsetWidth,i.removeChild(r),{matches:u,media:n}}}(n.document)}(this),function(n){"use strict";function p(){y(!0)}var t={};n.respond=t;t.update=function(){};var f=[],tt=function(){var t=!1;try{t=new n.XMLHttpRequest}catch(i){t=new n.ActiveXObject("Microsoft.XMLHTTP")}return function(){return t}}(),w=function(n,t){var i=tt();i&&(i.open("GET",n,!0),i.onreadystatechange=function(){4!==i.readyState||200!==i.status&&304!==i.status||t(i.responseText)},4!==i.readyState&&i.send(null))};if(t.ajax=w,t.queue=f,t.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},t.mediaQueriesSupported=n.matchMedia&&null!==n.matchMedia("only all")&&n.matchMedia("only all").matches,!t.mediaQueriesSupported){var c,b,l,i=n.document,r=i.documentElement,e=[],o=[],u=[],a={},k=30,s=i.getElementsByTagName("head")[0]||r,it=i.getElementsByTagName("base")[0],h=s.getElementsByTagName("link"),v=function(){var u,t=i.createElement("div"),n=i.body,o=r.style.fontSize,e=n&&n.style.fontSize,f=!1;return t.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=f=i.createElement("body"),n.style.background="none"),r.style.fontSize="100%",n.style.fontSize="100%",n.appendChild(t),f&&r.insertBefore(n,r.firstChild),u=t.offsetWidth,f?r.removeChild(n):n.removeChild(t),r.style.fontSize=o,e&&(n.style.fontSize=e),u=l=parseFloat(u)},y=function(t){var rt="clientWidth",ut=r[rt],ft="CSS1Compat"===i.compatMode&&ut||i.body[rt]||ut,p={},ct=h[h.length-1],et=(new Date).getTime(),tt,g,nt,f,it;if(t&&c&&k>et-c)return n.clearTimeout(b),b=n.setTimeout(y,k),void 0;c=et;for(tt in e)if(e.hasOwnProperty(tt)){var a=e[tt],w=a.minw,d=a.maxw,ot=null===w,st=null===d,ht="em";w&&(w=parseFloat(w)*(w.indexOf(ht)>-1?l||v():1));d&&(d=parseFloat(d)*(d.indexOf(ht)>-1?l||v():1));a.hasquery&&(ot&&st||!(ot||ft>=w)||!(st||d>=ft))||(p[a.media]||(p[a.media]=[]),p[a.media].push(o[a.rules]))}for(g in u)u.hasOwnProperty(g)&&u[g]&&u[g].parentNode===s&&s.removeChild(u[g]);u.length=0;for(nt in p)p.hasOwnProperty(nt)&&(f=i.createElement("style"),it=p[nt].join("\n"),f.type="text/css",f.media=nt,s.insertBefore(f,ct.nextSibling),f.styleSheet?f.styleSheet.cssText=it:f.appendChild(i.createTextNode(it)),u.push(f))},d=function(n,i,r){var h=n.replace(t.regex.keyframes,"").match(t.regex.media),c=h&&h.length||0,l,a,f,v,u,p,w,s;for(i=i.substring(0,i.lastIndexOf("/")),l=function(n){return n.replace(t.regex.urls,"$1"+i+"$2$3")},a=!c&&r,i.length&&(i+="/"),a&&(c=1),f=0;c>f;f++)for(a?(v=r,o.push(l(n))):(v=h[f].match(t.regex.findStyles)&&RegExp.$1,o.push(RegExp.$2&&l(RegExp.$2))),p=v.split(","),w=p.length,s=0;w>s;s++)u=p[s],e.push({media:u.split("(")[0].match(t.regex.only)&&RegExp.$2||"all",rules:o.length-1,hasquery:u.indexOf("(")>-1,minw:u.match(t.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:u.match(t.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")});y()},g=function(){if(f.length){var t=f.shift();w(t.href,function(i){d(i,t.href,t.media);a[t.href]=!0;n.setTimeout(function(){g()},0)})}},nt=function(){for(var r=0;r<h.length;r++){var i=h[r],t=i.href,u=i.media,e=i.rel&&"stylesheet"===i.rel.toLowerCase();t&&e&&!a[t]&&(i.styleSheet&&i.styleSheet.rawCssText?(d(i.styleSheet.rawCssText,t,u),a[t]=!0):(!/^([a-zA-Z:]*\/\/)/.test(t)&&!it||t.replace(RegExp.$1,"").split("/")[0]===n.location.host)&&("//"===t.substring(0,2)&&(t=n.location.protocol+t),f.push({href:t,media:u})))}g()};nt();t.update=nt;t.getEmValue=v;n.addEventListener?n.addEventListener("resize",p,!1):n.attachEvent&&n.attachEvent("onresize",p)}}(this);!function(n,t){function v(n,t){var i=n.createElement("p"),r=n.getElementsByTagName("head")[0]||n.documentElement;return i.innerHTML="x<style>"+t+"<\/style>",r.insertBefore(i.lastChild,r.firstChild)}function h(){var n=i.elements;return"string"==typeof n?n.split(" "):n}function y(n,t){var r=i.elements;"string"!=typeof r&&(r=r.join(" "));"string"!=typeof n&&(n=n.join(" "));i.elements=r+" "+n;f(t)}function u(n){var t=a[n[l]];return t||(t={},s++,n[l]=s,a[s]=t),t}function c(n,i,f){if(i||(i=t),r)return i.createElement(n);f||(f=u(i));var e;return e=f.cache[n]?f.cache[n].cloneNode():k.test(n)?(f.cache[n]=f.createElem(n)).cloneNode():f.createElem(n),!e.canHaveChildren||b.test(n)||e.tagUrn?e:f.frag.appendChild(e)}function p(n,i){if(n||(n=t),r)return n.createDocumentFragment();i=i||u(n);for(var e=i.frag.cloneNode(),f=0,o=h(),s=o.length;s>f;f++)e.createElement(o[f]);return e}function w(n,t){t.cache||(t.cache={},t.createElem=n.createElement,t.createFrag=n.createDocumentFragment,t.frag=t.createFrag());n.createElement=function(r){return i.shivMethods?c(r,n,t):t.createElem(r)};n.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+h().join().replace(/[\w\-:]+/g,function(n){return t.createElem(n),t.frag.createElement(n),'c("'+n+'")'})+");return n}")(i,t.frag)}function f(n){n||(n=t);var f=u(n);return!i.shivCSS||e||f.hasCSS||(f.hasCSS=!!v(n,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),r||w(n,f),n}var e,r,o=n.html5||{},b=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,k=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,l="_html5shiv",s=0,a={},i;!function(){try{var n=t.createElement("a");n.innerHTML="<xyz><\/xyz>";e="hidden"in n;r=1==n.childNodes.length||function(){t.createElement("a");var n=t.createDocumentFragment();return"undefined"==typeof n.cloneNode||"undefined"==typeof n.createDocumentFragment||"undefined"==typeof n.createElement}()}catch(i){e=!0;r=!0}}();i={elements:o.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:"3.7.2",shivCSS:o.shivCSS!==!1,supportsUnknownElements:r,shivMethods:o.shivMethods!==!1,type:"default",shivDocument:f,createElement:c,createDocumentFragment:p,addElements:y};n.html5=i;f(t)}(this,document),function(n){n.fn.unveil=function(t,i){function o(){var t=u.filter(function(){var t=n(this);if(!t.is(":hidden")){var i=r.scrollTop(),e=i+r.height(),u=t.offset().top,o=u+t.height();return o>=i-f&&u<=e+f}});e=t.trigger("unveil");u=u.not(e)}var r=n(window),f=t||0,s=window.devicePixelRatio>1,h=s?"data-src-retina":"data-src",u=this,e;this.one("unveil",function(){var n=this.getAttribute(h);n=n||this.getAttribute("data-src");n&&(this.setAttribute("src",n),typeof i=="function"&&i.call(this))});r.on("scroll.unveil resize.unveil lookup.unveil",o);return o(),this}}(window.jQuery||window.Zepto);BST={contentColumn:$("#content-column"),sidebarColumn:$("#sidebar-column"),Init:function(){BST.SiteNavigation.Init();BST.Search.Init();BST.Effects.Init();BST.BindSuddenLinks()},BindSuddenLinks:function(){$(".sudden-link").click(function(){window.location.href=$(this).data("href")})},Print:function(){window.print()},IsValidEmail:function(n){return/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(n)},ShrinkText:function(n,t){$(n).each(function(){var n=$(this).html().trim();n.length>t&&(n=n.substring(0,t)+" ...",$(this).html(n))})},ShrinkTextRead:function(n,t){$(n).each(function(){var r=$(this).next(".read-more-less-hidden-text"),i,f;if($(r).html()==""&&(i=$(this).html().trim(),i.length>t)){var u=$('<a class="shrink-text-read" href="javascript:void(0);">read more<\/a>'),e=$('<a class="shrink-text-read" href="javascript:void(0);">read less<\/a>'),o={element:this,selector:n};$(u).click(o,function(n){BST.ShrinkTextReadHandler(n.data.element,n.data.selector)});f=i.substring(0,t)+" ";i=i+" ";$(this).html(f);$(this).append(u);$(r).html(i);$(r).append(e)}})},ShrinkTextReadHandler:function(n,t){var i=$(n),r=$(i).next(".read-more-less-hidden-text"),u=$(i).html().trim(),f=$(r).html().trim(),e={element:n,selector:t};$(i).html(f);$(r).html(u);$(i).find("a.shrink-text-read").click(e,function(n){BST.ShrinkTextReadHandler(n.data.element,n.data.selector)})},StringFormat:function(){for(var i,t=arguments[0],n=1;n<arguments.length;n++)i=new RegExp("\\{"+(n-1)+"\\}","gm"),t=t.replace(i,arguments[n]);return t},LoadSiteFooter:function(n){var t=$("#site-footer");t.length&&t.load(n)}};$(document).ready(function(){BST.Init()}),function(n){n.fn.persistNavigation=function(){var t=this,i=function(){var i=window.location.hash,r=i?'a[href="'+i+'"]':"li.active > a";n(r,t).tab("show")};window.addEventListener("hashchange",i,!1);n("a",t).on("click",function(){history.pushState(null,null,this.href)});return i(t),this}}(jQuery);jQuery.extend({highlight:function(n,t,i,r){var e,o,u,s,f;if(n.nodeType===3){if(e=n.data.match(t),e)return o=document.createElement(i||"span"),o.className=r||"highlight",u=n.splitText(e.index),u.splitText(e[0].length),s=u.cloneNode(!0),o.appendChild(s),u.parentNode.replaceChild(o,u),1}else if(n.nodeType===1&&n.childNodes&&!/(script|style)/i.test(n.tagName)&&!(n.tagName===i.toUpperCase()&&n.className===r))for(f=0;f<n.childNodes.length;f++)f+=jQuery.highlight(n.childNodes[f],t,i,r);return 0}});jQuery.fn.unhighlight=function(n){var t={className:"highlight",element:"span"};return jQuery.extend(t,n),this.find(t.element+"."+t.className).each(function(){var n=this.parentNode;n.replaceChild(this.firstChild,this);n.normalize()}).end()};jQuery.fn.highlight=function(n,t){var i={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1},u,r,f;return(jQuery.extend(i,t),n.constructor===String&&(n=[n]),n=jQuery.grep(n,function(n){return n!=""}),n=jQuery.map(n,function(n){return n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}),n.length==0)?this:(u=i.caseSensitive?"":"i",r="("+n.join("|")+")",i.wordsOnly&&(r="\\b"+r+"\\b"),f=new RegExp(r,u),this.each(function(){jQuery.highlight(this,f,i.element,i.className)}))};BST.SiteNavigation={Init:function(){BST.SiteNavigation.InitPopupLoginControls();BST.SiteNavigation.TruncateEmail()},InitPopupLoginControls:function(){$(".ajax-login-submit").click(function(){var t=$(this).data("href"),n=$(this).closest("form"),i=n.find(".email-ajax").val(),r=n.find(".password-ajax").val();BST.Effects.ToggleModal(!0);$.post(t,{email:i,password:r},function(t){var i,r;if(BST.Effects.ToggleModal(!1),t)if(t.success===!0)window.location.reload(!0);else{for(i=n.find(".ajax-error-list"),i.html(""),r=0;r<t.messages.length;r++)i.append("<p>"+t.messages[r]+"<\/p>");i.parent().fadeIn()}})});$(".password-ajax").keydown(function(n){var t=$(this).closest("form");n.keyCode==13&&t.find(".ajax-login-submit").click()});$(".ajax-login-register").click(function(){var n=$(this).data("href");window.location.href=n});$(".change-photo").click(function(){if(BST.SiteNavigation.Dropzone==""){var n=$(this).attr("data-url");BST.SiteNavigation.SetDropzone(n)}BST.SiteNavigation.Dropzone.removeAllFiles();$(".change-photo-modal .modal").modal({show:!0})});$("#ajax-login-viewprofile").click(function(){var n=$(this).data("href");window.location.href=n});$("#ajax-login-signout").click(function(){BST.Effects.ToggleModal(!0);document.cookie="_buac=12345678; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/";window.location.reload(!0);BST.Cookie.EraseCookie(BST.Cookie.UserPreferencesCookieName);BST.Cookie.EraseCookie(BST.Cookie.SessionCookieName)})},TruncateEmail:function(){var n=$(".account-dropdown .email-address");typeof n!="undefined"&&n.html(n.text().replace("@","<\/br>@"))},ScrollTo:function(n){if(n!=undefined){var t=0;t=$(n).offset().top>$(document).height()-$(window).height()?$(document).height()-$(window).height():$(n).offset().top;$("html,body").animate({scrollTop:t-10-($("nav").height()+$("mobile-quick-bar").height())},1e3,"swing")}},Dropzone:"",SetDropzone:function(n){BST.SiteNavigation.Dropzone=new Dropzone(".drag-drop-container",{url:n,maxFilesize:1,paramName:"profile-pic",autoProcessQueue:!1,autoDiscover:!1,init:function(){var n=$(".submit-file"),i=$(".remove-files"),t=this;n.click(function(){t.processQueue()});this.on("addedfile",function(t){this.files[1]!=null&&this.removeFile(this.files[0]);t.size<1048576?n.show():n.hide()});this.on("success",function(t,i){var r=$(t.previewElement),f,u;if(i.success===!0)r.addClass("dz-success"),r.find(".dz-success-mark span").show(),location.reload(!0);else{for(r.addClass("dz-error span"),f=r.find(".dz-error-message span"),u=0;u<i.messages.length;u++)f.append("<p>"+i.messages[u]+"<\/p>");r.find(".dz-details .dz-filename").hide();r.find(".dz-error-mark span").show()}n.hide()});this.on("dragstart",function(){alert("tets")})}})}};BST.Search={BibleBrowseChaptersUrl:"",BibleBrowseBooksUrl:"",LibrarySubcategoriesUrl:"",BibleBrowseChaptersPartUrl:"",SelectBookText:"Select Book",SelectChapterText:"Select Chapter",Init:function(){BST.Search.SetupActiveTab();BST.Search.BindTabControls();BST.Search.BindInputKeyDown();BST.Search.BindBibleBrowseControls();BST.Search.BindLibraryCategoryControl();BST.Search.BindLibrarySubcategoryControl();BST.Search.BindParallelSearchSelects();BST.Search.BindBrowseBibleControls()},SetBibleBrowseChaptersUrl:function(n){BST.Search.BibleBrowseChaptersUrl=n},SetBibleBrowseBooksUrl:function(n){BST.Search.BibleBrowseBooksUrl=n},SetLibrarySubcategoriesUrl:function(n){BST.Search.LibrarySubcategoriesUrl=n},SetBibleBrowseChaptersPartUrl:function(n){BST.Search.BibleBrowseChaptersPartUrl=n},SetLocalizedTexts:function(n,t){BST.Search.SelectBookText=n;BST.Search.SelectChapterText=t},BindLibraryCategoryControl:function(){$("#filter-references .library-category").change(function(){var i=$("#filter-references li.library-subcategory"),n=i.find("select"),t=$(this).val(),r;i.fadeOut(function(){n.find("option").remove();t!=""&&$.getJSON(BST.Search.LibrarySubcategoriesUrl,{directoryCode:t}).done(function(t){if(t&&t.success){n.append('<option value="">All Subcategories<\/option>');for(var r=0;r<t.subcategories.length;r++)n.append('<option value="'+t.subcategories[r].DirectoryCode+'">'+t.subcategories[r].Title+"<\/option>")}n.find("option").length>0&&i.fadeIn().css("display","inline-block")})});r=t!=""?$(this).find("option[value="+t+"]").text():"References";BST.Search.UpdateSearchPlaceholder(r)})},BindLibrarySubcategoryControl:function(){$("#filter-references li.library-subcategory select").change(function(){var t=$("#filter-references .library-category"),i=$(this).val(),n,r;i!=""?n=$(this).find("option[value="+i+"]").text():(r=t.val(),n=t.find("option[value="+r+"]").text());BST.Search.UpdateSearchPlaceholder(n)})},BindInputKeyDown:function(){$("#headerSearchBox").keypress(function(n){return n.which==13?($(this).closest("form").submit(),!1):!0})},UpdateSearchPlaceholder:function(n){$("#headerSearchBox").attr("placeholder","Search "+n)},BindTypeahead:function(n){var t=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("Title"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:n});t.initialize();$("#headerSearchBox").typeahead(null,{name:"search",displayKey:"Title",source:t.ttAdapter(),templates:{suggestion:Handlebars.compile('<p class="tt-x"><strong>{{Title}}<\/strong> {{Description}}<\/p>')}}).on("typeahead:selected",function(){var n=$("#headerSearchBox");n.closest("form").submit()})},SetupActiveTab:function(){$("#advanced-search-panel-x, #advanced-search-tabs").find("input, select").attr("disabled","disabled");$(".tab-control:has(.active) a").each(function(){var n=$(this).attr("href");$(this).find("input").removeAttr("disabled");$(n).find("input, select").removeAttr("disabled");$(n).addClass("active")})},BindTabControls:function(){$("#advanced-search").click(function(n){n.preventDefault();$("#browse-bible-tabs").is(":visible")&&BST.Search.ToggleBrowseBibleTabs();BST.Search.ToggleAdvancedSearchTabs()});$(".tab-control a").click(function(n){var t=$(this).attr("href");n.preventDefault();$(this).tab("show");$(this).find("input").removeAttr("disabled");$(t).find("input, select").removeAttr("disabled");$(".tab-pane").not(t).find("input, select").attr("disabled","disabled")})},BindBibleBrowseControls:function(){$("#browse-bible").click(function(n){n.preventDefault();$("#advanced-search-panel").is(":visible")&&BST.Search.ToggleAdvancedSearchTabs();BST.Search.ToggleBrowseBibleTabs()});$("#browse-bible-tabs .select-version").click(function(){var n=$("#browse-bible-panel .panel-item.versions");BST.Search.SwitchBibleSearchTabs(n)});$("#browse-bible-tabs .select-book").click(function(){var n=$("#browse-bible-panel .panel-item.books");BST.Search.SwitchBibleSearchTabs(n)});$("#browse-bible-tabs .select-chapter").click(function(){var n=$("#browse-bible-panel .panel-item.chapters");BST.Search.SwitchBibleSearchTabs(n)});$("#browse-bible-panel .panel-item.versions li").click(function(){var i=$(this).closest(".panel-item.versions"),n=$("#browse-bible-tabs .select-version"),t=$(this).attr("data-version-code");$("#browse-bible-tabs .select-chapter").hide();n.find("span").text($(this).text());n.attr("data-version-code",t);n.toggleClass("active");t&&i.fadeOut(400,function(){var u=$("#browse-bible-tabs .select-book"),i=$("#browse-bible-panel .panel-item.books"),n,r;u.toggleClass("active");u.find("span").text("Pick a book");i.fadeIn(400);n=i.find("li.loading");r=i.find("ul");r.find("li").not(".loading").remove();n.toggleClass("hidden");$.getJSON(BST.Search.BibleBrowseBooksUrl,{versionCode:t}).done(function(t){if(t&&t.success){for(var i=0;i<t.books.length;i++)r.append('<li data-book-slug="'+t.books[i].Slug+'" class="btn btn-lg bst-button-white" >'+t.books[i].Name+"<\/li>");return n.toggleClass("hidden"),!0}return n.toggleClass("hidden"),!1})})});$(document).on("click","#browse-bible-panel .panel-item.books li",function(){var i=$(this).closest(".panel-item.books"),n=$("#browse-bible-tabs .select-book"),t=$(this).attr("data-book-slug");n.find("span").text($(this).text());n.attr("data-book-slug",t);i.fadeOut(400,function(){var i,r,f,u;$("#browse-bible-tabs .select-chapter").fadeIn(200);i=$("#browse-bible-panel .panel-item.chapters");r=i.find("li.loading");i.fadeIn(400);n.toggleClass("active");$("#browse-bible-tabs .select-chapter").toggleClass("active");t&&(f=$("#browse-bible-tabs .select-version").attr("data-version-code"),u=i.find("ul"),u.find("li").not(".loading").remove(),r.toggleClass("hidden"),$.getJSON(BST.Search.BibleBrowseChaptersUrl,{version:f,slug:t}).done(function(n){if(n&&n.success){for(var t=0;t<n.links.length;t++)u.append('<li><a class="btn btn-lg bst-button-white" href="'+n.links[t].Href+'">'+n.links[t].Text+"<\/a><\/li>");return r.toggleClass("hidden"),!0}return r.toggleClass("hidden"),!1}))})})},SwitchBibleSearchTabs:function(n){var t=n.closest("#browse-bible-panel");n.is(":visible")?($("#browse-bible-tabs li.active").removeClass("active"),t.fadeOut(400,function(){n.hide()})):t.fadeIn(200,function(){$("#browse-bible-panel .panel-item").not(n).hide();n.show()})},ToggleBrowseBibleTabs:function(){var n=$("#browse-bible-tabs");$("#browse-bible-panel").fadeOut(100,function(){n.is(":visible")?($("#browse-bible span").removeClass("fa-caret-left").addClass("fa-caret-down"),$("#advanced-search").data("sticky")?BST.Search.ToggleAdvancedSearchTabs():BST.Search.ToggleTodaysReading()):($("#browse-bible span").removeClass("fa-caret-down").addClass("fa-caret-left"),BST.Search.ToggleTodaysReading());n.slideToggle(100,function(){BST.Search.ToggleTodaysReading()});n.find("li.active").removeClass("active")})},ChangeFormUrl:function(n,t){$(n).closest("form").attr("action",t)},ToggleAdvancedSearchTabs:function(){$("#advanced-search-panel-x, #advanced-search-tabs").fadeToggle(100,function(){$("#advanced-search-panel-x").is(":visible")?($("#advanced-search-panel-x, #advanced-search-tabs").find("input, select").removeAttr("disabled"),$("#advanced-search span").removeClass("fa-caret-down").addClass("fa-caret-left"),BST.Search.SetupActiveTab()):($("#advanced-search-panel-x, #advanced-search-tabs").find("input, select").attr("disabled","disabled"),$("#advanced-search span").removeClass("fa-caret-left").addClass("fa-caret-down"));BST.Search.ToggleTodaysReading()})},ToggleTodaysReading:function(){$("#browse-bible-tabs").is(":visible")||$("#advanced-search-tabs").is(":visible")?$(".todays-bible-reading").hide():$(".todays-bible-reading").fadeIn(300)},BindParallelSearchSelects:function(){$(".parallel-bible-search select").change(function(){$("#headerSearchBox").val()!==""&&$("#headerSearchBox").closest("form").submit()})},BindBrowseBibleControls:function(){$("#browse-version a").click(function(){var n=$(this).data("version-code-url"),t=$(this).data("version-code"),i=$(this).data("version-title"),r=$(this).data("version-abbr");$.ajax({url:n}).done(function(n){var e=t,o=n.firstBookSlug,s=i,h=r,u,f;$("#browse-book").empty().html(n.view);u=' <i class="fa fa-caret-down"><\/i>';$("#browse-version-link").html('<span class="full-title">'+s+'<\/span><span class="abv">'+h+"<\/span>"+u).removeClass("active");$("#browse-book-link").html(BST.Search.SelectBookText+u).addClass("active");$("#browse-version").removeClass("active");$("#browse-book").addClass("active");$("#browse-chapter-link").html(BST.Search.SelectChapterText+u).addClass("hidden");f=BST.Search.BibleBrowseChaptersPartUrl.replace("verep",e).replace("bcrep",o);$.ajax({url:f}).done(function(n){$("#browse-chapter").empty().html(n.view)})})})},LoadSearchPartial:function(n,t){$.ajax({type:"POST",url:t,dataType:"html",cache:!1,success:function(t){$(n).html(t);BST.Search.SetupActiveTab();BST.Effects.BindAnchorClicks()},error:function(){}})}};BST.Bible={jPlayerAudio:null,CurrentTranslationCode:"",CurrentBookCode:"",CurrentBookName:"",CurrentBookAbbrev:"",CurrentChapterId:"",CurrentTranslationCodeParallel:"",CurrentBookCodeParallel:"",CurrentBookNameParallel:"",CurrentBookAbbrevParallel:"",CurrentChapterIdParallel:"",CurrentTestament:"",CurrentTestamentParallel:"",Verses:"",SelectedVerses:[],StartVerse:0,EndVerse:0,VersesParallel:"",SelectedVersesParallel:[],StartVerseParallel:0,EndVerseParallel:0,IsParallelBible:"False",SearchUrl:"",StrongsNumbersUrl:"",ActiveAudioItemIndex:0,BibleVerseReferenceType:{Unspecified:0,CrossReference:1,Footnote:2,SubjectHeading:3},BibleContainerType:{ParallelContainer:".parallel-container ",BibleContainer:".bible-container "},Init:function(n){BST.Bible.IsParallelBible=n;BST.Bible.SetVerses();BST.Bible.ResetVerseReferences();BST.Bible.ProcessTooltips();BST.Bible.ControlPreferences();BST.Bible.InitControls();BST.Bible.BindStrongsNumbers()},GetContainerPrefix:function(){return BST.Bible.GetIsParallelBible()?BST.Bible.BibleContainerType.ParallelContainer:BST.Bible.BibleContainerType.BibleContainer},GetContainerPrefixByElement:function(n){return BST.Bible.GetIsRightPanelByElement(n)?BST.Bible.BibleContainerType.ParallelContainer:BST.Bible.BibleContainerType.BibleContainer},GetContainerPreFixByIsRightPanel:function(n){return n?BST.Bible.BibleContainerType.ParallelContainer:BST.Bible.BibleContainerType.BibleContainer},GetIsRightPanelByElement:function(n){return $(n).closest(BST.Bible.BibleContainerType.ParallelContainer).length>0},GetIsParallelBible:function(){return BST.Bible.IsParallelBible=="True"},InitParameters:function(n,t,i,r,u,f){BST.Bible.CurrentTranslationCode=n;BST.Bible.CurrentBookCode=t;BST.Bible.CurrentBookName=i;BST.Bible.CurrentBookAbbrev=r;BST.Bible.CurrentChapterId=u;BST.Bible.CurrentTestament=f},InitParametersParallel:function(n,t,i,r,u,f){BST.Bible.CurrentTranslationCodeParallel=n;BST.Bible.CurrentBookCodeParallel=t;BST.Bible.CurrentBookNameParallel=i;BST.Bible.CurrentBookAbbrevParallel=r;BST.Bible.CurrentChapterIdParallel=u;BST.Bible.CurrentTestamentParallel=f},InitVerses:function(){BST.Bible.GetIsParallelBible()?(BST.Bible.StartVerseParallel=parseInt($(BST.Bible.VersesParallel).first().find("strong").html()),BST.Bible.EndVerseParallel=parseInt($(BST.Bible.VersesParallel).last().find("strong").html()),$(BST.Bible.VersesParallel).each(function(){var n=parseInt($(this).find("strong").html());BST.Bible.SelectedVersesParallel[n]=!1})):(BST.Bible.StartVerse=parseInt($(BST.Bible.Verses).first().find("strong").html()),BST.Bible.EndVerse=parseInt($(BST.Bible.Verses).last().find("strong").html()),$(BST.Bible.Verses).each(function(){var n=parseInt($(this).find("strong").html());BST.Bible.SelectedVerses[n]=!1}))},SetVerses:function(){BST.Bible.Verses=BST.Bible.GetContainerPreFixByIsRightPanel(!1)+".scripture .verse";BST.Bible.GetIsParallelBible()&&(BST.Bible.VersesParallel=BST.Bible.GetContainerPreFixByIsRightPanel(!0)+".scripture .verse")},ControlPreferences:function(){var n,t,i,r,u,f,e,o,s,h,c,l,a,v;BST.Bible.GetIsParallelBible()?(n=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.RedLetterParallel),BST.Bible.SetControlPreferences(n,".verse-control-buttons input[type=checkbox].checkbox-verse-redletter",BST.Bible.ToggleVerseRedLetter),t=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.OneVersePerLineParallel),BST.Bible.SetControlPreferences(t,".verse-control-buttons input[type=checkbox].checkbox-verse-inline",BST.Bible.ToggleVersePerLine),i=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.VerseCrossReferencesParallel),BST.Bible.SetControlPreferences(i,".verse-control-buttons input[type=checkbox].checkbox-verse-versereferences",BST.Bible.ToggleShowVerseReferenceNumbers),r=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.VerseFootnotesParallel),BST.Bible.SetControlPreferences(r,".verse-control-buttons input[type=checkbox].checkbox-verse-footnotes",BST.Bible.ToggleShowVerseFootnoteNumbers),u=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.StrongNumbersParallel),BST.Bible.SetControlPreferences(u,".verse-control-buttons input[type=checkbox].checkbox-verse-strongs",BST.Bible.ToggleStrongsNumbers),f=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.HideVerseNumbers),BST.Bible.SetControlPreferences(f,".verse-control-buttons input[type=checkbox].checkbox-verse-hidenumbers",BST.Bible.ToggleVerseNumbers)):(e=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.RedLetter),BST.Bible.SetControlPreferences(e,".verse-control-buttons input[type=checkbox].checkbox-verse-redletter",BST.Bible.ToggleVerseRedLetter),o=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.OneVersePerLine),BST.Bible.SetControlPreferences(o,".verse-control-buttons input[type=checkbox].checkbox-verse-inline",BST.Bible.ToggleVersePerLine),s=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.VerseCrossReferences),BST.Bible.SetControlPreferences(s,".verse-control-buttons input[type=checkbox].checkbox-verse-versereferences",BST.Bible.ToggleShowVerseReferenceNumbers),h=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.VerseFootnotes),BST.Bible.SetControlPreferences(h,".verse-control-buttons input[type=checkbox].checkbox-verse-footnotes",BST.Bible.ToggleShowVerseFootnoteNumbers),c=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.StrongsNumbers),BST.Bible.SetControlPreferences(c,".verse-control-buttons input[type=checkbox].checkbox-verse-strongs",BST.Bible.ToggleStrongsNumbers),l=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.HideVerseNumbers),BST.Bible.SetControlPreferences(l,".verse-control-buttons input[type=checkbox].checkbox-verse-hidenumbers",BST.Bible.ToggleVerseNumbers));a=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.VerseFontStyle);BST.Bible.SetFontStylePreferences(a,".font-style-buttons input[name=style-options]:radio",BST.Bible.ChangeFontStyle);v=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.VerseFontSize);BST.Bible.SetFontSizePreferences(v,".font-size-buttons input[name=size-options]:radio",BST.Bible.ChangeFontSize)},SetControlPreferences:function(n,t,i){var r=$(BST.Bible.GetContainerPrefix()+t);n!=null&&n=="true"?($(r).prop("checked",!0),i(!0,r)):($(r).prop("checked",!1),i(!1,r))},SetFontStylePreferences:function(n,t,i){if(n!=null)switch(n){case"font-opensans":$("input.radio-font-opensans").prop("checked",!0);i(n);break;case"font-merriweather":$("input.radio-font-merriweather").prop("checked",!0);i(n);break;default:$("input.radio-font-helvetica").prop("checked",!0);i(n)}else $("input.radio-font-helvetica").prop("checked",!0),i("font-helvetica")},SetFontSizePreferences:function(n,t,i){if(n!=null)switch(n){case"font-xs":$("input.radio-font-xs").prop("checked",!0);i(n);break;case"font-medium":$("input.radio-font-medium").prop("checked",!0);i(n);break;case"font-large":$("input.radio-font-large").prop("checked",!0);i(n);break;default:$("input.radio-font-small").prop("checked",!0);i(n)}else $("input.radio-font-small").prop("checked",!0),i(n)},SetActiveAudioItemIndex:function(n){BST.Bible.ActiveAudioItemIndex=parseInt(n)},InitControls:function(){var n=BST.Bible.GetContainerPrefix();BST.Bible.GetIsParallelBible()==!1&&$('.bible-container[data-init="1"]').length>0||($(n+".verse-control-buttons input[type=checkbox].checkbox-verse-inline").click(function(){var t=BST.Bible.GetIsRightPanelByElement(this)?BST.User.UserPreferenceType.OneVersePerLineParallel:BST.User.UserPreferenceType.OneVersePerLine,n=$(this).is(":checked");BST.Bible.ToggleVersePerLine(n,this);BST.User.AddOrEditUserPreference(t,n.toString())}),$(n+".verse-control-buttons input[type=checkbox].checkbox-verse-redletter").click(function(){var t=BST.Bible.GetIsRightPanelByElement(this)?BST.User.UserPreferenceType.RedLetterParallel:BST.User.UserPreferenceType.RedLetter,n=$(this).is(":checked");BST.Bible.ToggleVerseRedLetter(n,this);BST.User.AddOrEditUserPreference(t,n.toString())}),$(n+".verse-control-buttons input[type=checkbox].checkbox-verse-versereferences").click(function(){var t=BST.Bible.GetIsRightPanelByElement(this)?BST.User.UserPreferenceType.VerseCrossReferencesParallel:BST.User.UserPreferenceType.VerseCrossReferences,n=$(this).is(":checked");BST.Bible.ToggleShowVerseReferenceNumbers(n,this);BST.User.AddOrEditUserPreference(t,n.toString())}),$(n+".verse-control-buttons input[type=checkbox].checkbox-verse-footnotes").click(function(){var t=BST.Bible.GetIsRightPanelByElement(this)?BST.User.UserPreferenceType.VerseFootnotesParallel:BST.User.UserPreferenceType.VerseFootnotes,n=$(this).is(":checked");BST.Bible.ToggleShowVerseFootnoteNumbers(n,this);BST.User.AddOrEditUserPreference(t,n.toString())}),$(n+".verse-control-buttons input[type=checkbox].checkbox-verse-strongs").click(function(){var t=BST.Bible.GetIsRightPanelByElement(this)?BST.User.UserPreferenceType.StrongNumbersParallel:BST.User.UserPreferenceType.StrongsNumbers,n=$(this).is(":checked");BST.Bible.ToggleStrongsNumbers(n,this);BST.User.AddOrEditUserPreference(t,n.toString())}),$(n+".verse-control-buttons input[type=checkbox].checkbox-verse-hidenumbers").click(function(){var t=BST.Bible.GetIsRightPanelByElement(this)?BST.User.UserPreferenceType.HideVerseNumbers:BST.User.UserPreferenceType.HideVerseNumbers,n=$(this).is(":checked");BST.Bible.ToggleVerseNumbers(n,this);BST.User.AddOrEditUserPreference(t,n.toString())}),$(n+".font-control-buttons input[name=size-options]:radio").change(function(){var n=$(this).val(),t=$(this).prop("checked");$("."+$(this).prop("class")).each(function(){$(this).prop("checked",t)});BST.Bible.ChangeFontSize(n);BST.User.AddOrEditUserPreference(BST.User.UserPreferenceType.VerseFontSize,n)}),$(n+".font-style-buttons input[name=style-options]:radio").change(function(){var n=$(this).val(),t=$(this).prop("checked");$("."+$(this).prop("class")).each(function(){$(this).prop("checked",t)});BST.Bible.ChangeFontStyle(n);BST.User.AddOrEditUserPreference(BST.User.UserPreferenceType.VerseFontStyle,n)}),$(n+".audio-player .close, "+n+".bible-controls .audio-player-toggle").click(function(n){n.preventDefault();BST.Bible.ToggleAudioPlayer(this)}),$(n+".bible-controls .bible-print").click(function(n){n.preventDefault();BST.Print()}),$(n+".scripture .verse").each(function(){var n=$(this).find("strong").html();$(this).click(function(){var t=$(this).hasClass("selected-verse");t?$(this).removeClass("selected-verse"):$(this).addClass("selected-verse");BST.Bible.AddRemoveSelectionControl(t,parseInt(n,10),this);BST.Bible.ToggleVerseReference(n,$(this))})}),n==BST.Bible.BibleContainerType.ParallelContainer&&$(n+".bible-controls .bible-navigator-book, "+n+".bible-controls .bible-navigator-chapter").click(function(n){n.preventDefault();var t=$(this).attr("href");BST.BibleSideBar.SetBibleSidebarViewUrlParallel(t);BST.User.AddOrEditUserPreference(BST.User.UserPreferenceType.ParallelBible,BST.BibleSideBar.GetParallelBibleCookieValue(t));BST.BibleSideBar.BibleSidebarLoad()}),$("#preferred-translation").change(function(){var f=$(this).val(),n,u,e,o,r,t,i;if(BST.User.AddOrEditUserPreference(BST.User.UserPreferenceType.PreferredTranslation,f),n=window.location.pathname,n.substring(0,1)=="/"&&(n=n.substring(1)),n.substring(n.length-1,n.length)=="/"&&(n=n.substring(0,n.length-1)),u=window.location.protocol+"//"+window.location.host+"/",n.indexOf("bible-reading-plan/passage")>-1){for(e=window.location.search.split("&"),o="",i=0;i<e.length;i++)e[i].indexOf("t=")===-1&&(o=o+e[i]);window.location.href=u+"bible-reading-plan/passage/"+o;return}for(r=n.split("/"),n.indexOf("passage")>-1?r.length>1?r[0]=f:r.unshift(f):r.length>2?r[0]=f:r.unshift(f),t="",i=0;i<r.length;i++)t=t+r[i],r[i].indexOf(".html")==-1&&(t=t,t.substring(t.length-1,t.length)!=="/"&&(t=t+"/"));t.indexOf("niv/")>-1&&(t=t.replace("niv/",""));u=u+t;n.indexOf("passage")>-1&&(u=u+window.location.search);window.location.href=u}))},QuickbarMyBible:function(){return BST.SiteNavigation.ScrollTo(this.hash),!1},QuickbarMyTags:function(){var n=$("#mobile-quick-bar .tag-control");return $(n).hasClass("hidden")?$(n).removeClass("hidden"):$(n).addClass("hidden"),!1},AddRemoveSelectionControl:function(n,t,i){var f="",e='<div class="selection-title text-left">Selections: <\/div>',r=BST.Bible.GetIsRightPanelByElement(i),u;n?r?BST.Bible.SelectedVersesParallel[t]=!1:BST.Bible.SelectedVerses[t]=!1:r?BST.Bible.SelectedVersesParallel[t]=!0:BST.Bible.SelectedVerses[t]=!0;f=BST.Bible.GetIsParallelBible()?BST.Bible.CreateSelectionControlForParallel(e,r):BST.Bible.CreateSelectionControlForBible(e,r);u=$(".selection-control div");$(u).empty();$(u).append(f);BST.Bible.ShowHideSelectionControl()},CreateSelectionControlForParallel:function(n,t){var i,e;n=n+'<div class="left-panel-title text-left">Left Panel<\/div>';n=n+BST.Bible.CreateSelectionControlForBible("");n=n+'<div class="right-panel-title text-left">Right Panel<\/div>';n=n+'<ul class="right-panel-list">';var r=!1,f=0,u=0;for(i=BST.Bible.StartVerseParallel;i<=BST.Bible.EndVerseParallel;i++)r==!1&&BST.Bible.SelectedVersesParallel[i]==!0&&(r=!0,f=i),r==!0&&(i<BST.Bible.EndVerseParallel&&BST.Bible.SelectedVersesParallel[i+1]==!1&&(u=i,r=!1,n=n+"<li>"+BST.Bible.GetSelectionControlLink(f,u,!0)+"<\/li>"),i==BST.Bible.EndVerseParallel&&(u=i,r=!1,n=n+"<li>"+BST.Bible.GetSelectionControlLink(f,u,!0)+"<\/li>"));return e=t?'<li><a href="javascript:void(0);" onclick="BST.Bible.DeselectAllVersesByContainer(true);">[deselect all]<\/a><\/li><\/ul>':'<li><a href="javascript:void(0);" onclick="BST.Bible.DeselectAllVersesByContainer(false);">[deselect all]<\/a><\/li><\/ul>',n=n+e,n+'<div class="clearfix"><\/div>'},CreateSelectionControlForBible:function(n,t){var i,e;n=n+'<ul class="left-panel-list">';var r=!1,f=0,u=0;for(i=BST.Bible.StartVerse;i<=BST.Bible.EndVerse;i++)r==!1&&BST.Bible.SelectedVerses[i]==!0&&(r=!0,f=i),r==!0&&(i<BST.Bible.EndVerse&&BST.Bible.SelectedVerses[i+1]==!1&&(u=i,r=!1,n=n+"<li>"+BST.Bible.GetSelectionControlLink(f,u,!1)+"<\/li>"),i==BST.Bible.EndVerse&&(u=i,r=!1,n=n+"<li>"+BST.Bible.GetSelectionControlLink(f,u,!1)+"<\/li>"));return e=t?'<li><a href="javascript:void(0);" onclick="BST.Bible.DeselectAllVersesByContainer(true);">[deselect all]<\/a><\/li>':'<li><a href="javascript:void(0);" onclick="BST.Bible.DeselectAllVersesByContainer(false);">[deselect all]<\/a><\/li>',n=n+e,n=n+"<\/ul>",n+'<div class="clearfix"><\/div>'},GetSelectionControlLink:function(n,t,i){var r=n==t?n.toString():n.toString()+"-"+t.toString(),u="<a href='javascript:void(0);' onclick='BST.Bible.RemoveSelectionControl(this, "+n+", "+t+", "+i+");'>[X]<\/a>",f=i?BST.Bible.CurrentBookAbbrevParallel+" "+BST.Bible.CurrentChapterIdParallel+":"+r:BST.Bible.CurrentBookAbbrev+" "+BST.Bible.CurrentChapterId+":"+r;return f+u},RemoveSelectionControl:function(n,t,i,r){var u,s,f,e,h,o;if(r)if(u=t-BST.Bible.StartVerseParallel,s=i-BST.Bible.StartVerseParallel,u==s)$(BST.Bible.VersesParallel).eq(u).removeClass("selected-verse"),BST.Bible.SelectedVersesParallel[u+1]=!1;else for(f=u;f<=s;f++)$(BST.Bible.VersesParallel).eq(f).removeClass("selected-verse"),BST.Bible.SelectedVersesParallel[f+1]=!1;else if(e=t-BST.Bible.StartVerse,h=i-BST.Bible.StartVerse,e==h)$(BST.Bible.Verses).eq(e).removeClass("selected-verse"),BST.Bible.SelectedVerses[e+1]=!1;else for(o=e;o<=h;o++)$(BST.Bible.Verses).eq(o).removeClass("selected-verse"),BST.Bible.SelectedVerses[o+1]=!1;$(n).closest("li").remove();BST.Bible.ShowHideSelectionControl()},DeselectAllVerses:function(){for(var t,n=0;n<BST.Bible.SelectedVerses.length;n++)BST.Bible.SelectedVerses[n]!=="undefined"&&(BST.Bible.SelectedVerses[n]=!1);for(t=0;t<BST.Bible.SelectedVersesParallel.length;t++)BST.Bible.SelectedVersesParallel[t]!=="undefined"&&(BST.Bible.SelectedVersesParallel[t]=!1);$(".selection-control").addClass("hidden");$(".verse").removeClass("selected-verse")},DeselectAllVersesByContainer:function(n){var t,i;if(n){for(t=0;t<BST.Bible.SelectedVersesParallel.length;t++)BST.Bible.SelectedVersesParallel[t]!=="undefined"&&(BST.Bible.SelectedVersesParallel[t]=!1);$(".selection-control .right-panel-title, .selection-control .right-panel-list").addClass("hidden")}else{for(i=0;i<BST.Bible.SelectedVerses.length;i++)BST.Bible.SelectedVerses[i]!=="undefined"&&(BST.Bible.SelectedVerses[i]=!1);$(".selection-control .left-panel-title, .selection-control .left-panel-list").addClass("hidden")}$(BST.Bible.GetContainerPreFixByIsRightPanel(n)+".verse").removeClass("selected-verse");$(".selection-control .right-panel-title").hasClass("hidden")&&$(".selection-control .left-panel-title").hasClass("hidden")&&$(".selection-control").addClass("hidden")},ShowHideSelectionControl:function(){var t=!1,n=$(".selection-control"),e=$(n).find(".left-panel-list li"),i=$(n).find(".left-panel-title"),r=$(n).find(".left-panel-list");if($(e).length<=1?($(i).addClass("hidden"),$(r).addClass("hidden")):($(i).removeClass("hidden"),$(r).removeClass("hidden"),t=!0),BST.Bible.GetIsParallelBible()){var o=$(n).find(".right-panel-list li"),u=$(n).find(".right-panel-title"),f=$(n).find(".right-panel-list");$(o).length<=1?($(u).addClass("hidden"),$(f).addClass("hidden")):($(u).removeClass("hidden"),$(f).removeClass("hidden"),t=!0)}t?$(n).removeClass("hidden"):$(n).addClass("hidden")},InitAudioPlayer:function(n,t,i,r,u,f,e,o){$.jPlayer.timeFormat.showHour=!1;var s=new jPlayerPlaylist({jPlayer:n,cssSelectorAncestor:"#"+t},i,{swfPath:r,solution:"html, flash",supplied:"mp3",wmode:"window",smoothPlayBar:!0,keyEnabled:!0,preload:"none",ended:o,ready:function(){u&&s.play(BST.Bible.ActiveAudioItemIndex);n.bind($.jPlayer.event.play,function(){var i=t,n=s;$.each(n.playlist,function(t,r){t==n.current&&$("#"+i+" .audio-title").html("Now playing "+r.title)})})}});BST.Bible.jPlayerAudio=s},ProcessTooltips:function(){$(BST.Bible.GetContainerPrefix()+".tooltip-link").tooltip()},ResetVerseReferences:function(){$(BST.Bible.GetContainerPrefix()+".verse-references").hide()},ToggleVerseReference:function(n,t){var i=$(BST.Bible.GetContainerPrefixByElement(t)+".verse-references[data-referenceid='"+n+"']"),r=$(BST.Bible.GetContainerPrefixByElement(t)+".reference-control[data-referenceid='"+n+"']");i.css("display")=="none"?(i.slideDown(400),r.children(".fa").removeClass("fa-plus-square-o").addClass("fa-minus-square-o")):(i.slideUp(400),r.children(".fa").removeClass("fa-minus-square-o").addClass("fa-plus-square-o"))},ToggleVersePerLine:function(n,t){$(BST.Bible.GetContainerPrefixByElement(t)+".verse").each(function(){n?$(this).addClass("verse-block"):$(this).removeClass("verse-block")})},ToggleVerseRedLetter:function(n,t){var i=BST.Bible.GetContainerPrefixByElement(t);n?$(i+".verse .red-letter").switchClass("no-red","red",500):$(i+".verse .red-letter").switchClass("red","no-red",500)},ToggleVerseNumbers:function(n,t){var i=BST.Bible.GetContainerPrefixByElement(t);n?$(i+".verse .verse-number").addClass("hide-verse"):$(i+".verse .verse-number").removeClass("hide-verse")},ChangeFontSize:function(n){var t=$(".verse");t.removeClass("font-xs").removeClass("font-small").removeClass("font-medium").removeClass("font-large");t.addClass(n)},ChangeFontStyle:function(n){var t=$(".verse");t.removeClass("font-helvetica").removeClass("font-opensans").removeClass("font-merriweather");t.addClass(n)},ToggleShowVerseReferenceNumbers:function(n,t){var i=BST.Bible.GetContainerPrefixByElement(t);n?$(i+".verse .verse-crossreference").fadeIn(500):$(i+".verse .verse-crossreference").fadeOut(500)},ToggleShowVerseFootnoteNumbers:function(n,t){var i=BST.Bible.GetContainerPrefixByElement(t);n?$(i+".verse .verse-footnote").fadeIn(500):$(i+".verse .verse-footnote").fadeOut(500)},ToggleAudioPlayer:function(n){var t=$(BST.Bible.GetContainerPrefixByElement(n)+".audio-player");t&&(t.is(":visible")?t.fadeOut(100):t.fadeIn())},EnableAudioBibleControlButton:function(){$(BST.Bible.GetContainerPrefix()+".bible-controls .audio-player-toggle").removeClass("disabled")},SetSearchUrl:function(n){BST.Bible.SearchUrl=n},SetStrongsNumbersUrl:function(n){BST.Bible.StrongsNumbersUrl=n;$("a.strongs").each(function(){var i=$(this).data("strongs-number"),t=BST.Bible.CurrentTranslationCode,n=BST.Bible.CurrentTestament;BST.Bible.GetIsParallelBible()&&(t=BST.Bible.CurrentTranslationCodeParallel,n=BST.Bible.CurrentTestamentParallel);n=n=="o"||n=="O"?"h":"g";$(this).attr("href",BST.Bible.StrongsNumbersUrl+"?t="+t+"&ll="+n+"&sn="+i)})},ToggleStrongsNumbers:function(n,t){var i=BST.Bible.GetContainerPrefixByElement(t);n?$(i+"a.strongs").removeClass("disabled-link"):$(i+"a.strongs").removeClass("disabled-link").addClass("disabled-link")},GetVerseReferenceLinks:function(n){for(var r,i="",t=0;t<n.length;t++)n[t].Href==null?i=i+n[t].Text:(r=BST.Bible.SearchUrl,r=r.replace("QUERY",n[t].Href),i=i+'<a href="'+r+'">'+n[t].Text+"<\/a>");return i},ToggleCommentaries:function(n){var t=$(n).find("span"),i=$(n).next("ul");$(t).hasClass("fa-plus-square-o")?($(t).removeClass("fa-plus-square-o").addClass("fa-minus-square-o"),$(i).removeClass("hidden")):($(t).removeClass("fa-minus-square-o").addClass("fa-plus-square-o"),$(i).addClass("hidden"))},LoadStudyTools:function(n,t){$(n).load(t,null,function(){BST.Effects.BindAnchorClicks()})},BindAddRecentTranslation:function(){$("a.log-translation, button.log-translation, .breadcrumbs option.log-translation").click(function(){BST.Bible.AddRecentTranslation($(this).data("extra"))});$(".bible-search-panel option.log-translation").click(function(){BST.Bible.AddRecentTranslation($(this).val())})},AddRecentTranslation:function(n){var r=BST.Cookie.ReadCookieValue(BST.Cookie.GlobalCookieName,BST.Cookie.GlobalCookieKeys.RecentTranslations),t,i;if(r==null){BST.Cookie.AddCreateCookieValue(BST.Cookie.GlobalCookieName,BST.Cookie.GlobalCookieKeys.RecentTranslations,n,BST.Cookie.CookieExpirationTime.FiveYears);return}t=BST.Cookie.ReadCookieValue(BST.Cookie.GlobalCookieName,BST.Cookie.GlobalCookieKeys.RecentTranslations);t.indexOf(n)==-1&&(i=t.split("$"),i.length<5?t=n+"$"+t:(t=t.substr(0,t.lastIndexOf("$")),t=n+"$"+t),BST.Cookie.EditCookieValue(BST.Cookie.GlobalCookieName,BST.Cookie.GlobalCookieKeys.RecentTranslations,t,BST.Cookie.CookieExpirationTime.FiveYears))},BindStrongsNumbers:function(){$("a.strongs").on("click",function(n){if($(this).hasClass("disabled-link"))return n.preventDefault(),!1})}};BST.User={UserPreferenceUrl:"",UserPreferenceType:{PreferredTranslation:1,SearchTranslation:2,DefaultTextSize:3,DefaultHighlightColor:4,SystemName:5,DefaultTextColor:6,ReadingPlanTextSize:7,RedLetter:8,OneVersePerLine:9,VerseCrossReferences:10,VerseFootnotes:11,ParallelBible:12,RedLetterParallel:13,OneVersePerLineParallel:14,VerseCrossReferencesParallel:15,VerseFootnotesParallel:16,VerseFontStyle:17,VerseFontSize:18,StrongsNumbers:19,StrongNumbersParallel:20,CommentariesUri:22,HideVerseNumbers:23},Init:function(){BST.User.InitControls()},InitControls:function(){$("#ajax-profile-submit").click(function(){var t=$(this),r=t.data("href"),i=$(this).closest("form"),n=i.serializeArray();t.toggleClass("loading");$.post(r,n).done(function(r){var u,f;if(r){if(u=i.find(".ajax-error-list"),r.success===!0)u.parent().hide(),$("#user-first-name").text(n[1].value),$("#user-last-name").text(n[2].value),$("#user-email-Address").text(n[3].value),$("#user-address1").text(n[4].value),$("#user-address2").text(n[5].value),$("#user-city").text(n[6].value),$("#user-state").text(n[7].value),$("#user-postal-code").text(n[8].value),$("#user-country").text(n[9].value),$("#user-home-phone").text(n[10].value),BST.User.ToggleProfileForm(t,!1);else{for(u.empty(),f=0;f<r.messages.length;f++)u.append("<p>"+r.messages[f]+"<\/p>");u.parent().fadeIn()}t.toggleClass("loading")}})});$("#ajax-password-submit").click(function(){var n=$(this),i=n.data("href"),t=n.closest("form");n.toggleClass("loading");$.post(i,t.serializeArray()).done(function(i){var r,u;if(i){if(r=t.find(".ajax-error-list"),i.success===!0)r.parent().hide(),BST.User.ToggleProfileForm(n,!1);else{for(r.empty(),u=0;u<i.messages.length;u++)r.append("<p>"+i.messages[u]+"<\/p>");r.parent().fadeIn()}t.find("input").val("");n.toggleClass("loading")}})});$("#ajax-demographics-submit").click(function(){var n=$("form#user-demographics"),i=[],r,t,u;n.find("div[data-type=M]").each(function(){var n="",t=0;$(this).find("input[type=checkbox]:checked").each(function(){t==0?(n=$(this).val(),t++):n=n+"|"+$(this).val()});$(this).find("input[type=hidden]").val(n)});n.find("div[data-type=B]").each(function(){$(this).find("input[type=hidden]").val($(this).find("input[type=radio]:checked").val())});r=n.serializeArray();$(r).each(function(){var n={};n.UserQuestionCode=this.name;n.ResponseValue=this.value;i.push(n)});t=$(this);u=t.data("href");t.toggleClass("loading");$.ajax({url:u,type:"POST",data:JSON.stringify(i),dataType:"json",contentType:"application/json"}).done(function(i){var r,u;if(i){if(r=n.find(".ajax-error-list"),i.success===!0)r.parent().hide(),BST.User.ToggleProfileForm(t,!1);else{for(r.empty(),u=0;u<i.messages.length;u++)r.append("<p>"+i.messages[u]+"<\/p>");r.parent().fadeIn()}n.find("input").val("");t.toggleClass("loading")}})});$(".user-profile .button.toggle").click(function(){BST.User.ToggleProfileForm($(this),!0)});$(".user-profile .button.cancel").click(function(){BST.User.ToggleProfileForm($(this),!1)});$("#ForgotPasswordBox .send-button").click(function(){var n=$(this).closest(".modal-dialog"),i=n.find("input[type=email]").val(),r=$(this).attr("data-url"),t=n.find(".alert-danger");if(!BST.IsValidEmail(i)){t.html("Please enter a valid email address.").fadeIn("slow");return}t.fadeOut("slow");BST.Effects.ToggleModal(!0);$.post(r,{email:i},function(i){BST.Effects.ToggleModal(!1);i?i.success?n.find(".form-container").fadeOut("slow",function(){n.find(".alert-success").html(i.message).fadeIn("slow")}):t.html(i.message).fadeIn("slow"):t.html("Unexpected error. Please try again later.").fadeIn("slow")})});$("#ForgotPasswordBox").on("hidden.bs.modal",function(){$(this).find("input[type=email]").val("");$(this).find(".form-container").show();$(this).find(".alert").hide()});$("#ResetPasswordBox .change-password").click(function(){var n=$(this).closest("#ResetPasswordBox"),i=n.find("#NewPassword").val(),r=n.find("#ConfirmPassword").val(),u=n.find(".alert-danger"),t="";if(i==""||r==""?t="You must enter both password and confirmation.":i!=r?t="Your passwords do not match.":i.length<6&&(t="Your password must be at least 6 characters long."),t.length>0)u.fadeOut("fast",function(){u.html(t).fadeIn("slow")});else{BST.Effects.ToggleModal(!0);var f=$(this).attr("data-url"),e=n.find("#UserName").val(),o=n.find("#ConfirmationCode").val();$.post(f,{UserName:e,ConfirmCode:o,NewPassword:i,PasswordConfirmation:r},function(t){BST.Effects.ToggleModal(!1);var i="Unexpected error. Please try again later.";if(t){if(t.success){n.find(".form-container").fadeOut("slow",function(){n.find(".alert-success").fadeIn("slow")});return}i=t.message}u.html(i).fadeIn("slow")})}})},ToggleProfileForm:function(n,t){var i=n.closest(".panel"),r=i.find(".form-view"),u=i.find(".form-edit"),f=i.find(".button.toggle"),e=i.find(".button.cancel");t?(r.fadeOut(function(){u.fadeIn()}),f.fadeOut(function(){e.fadeIn()})):(u.fadeOut(function(){r.fadeIn()}),e.fadeOut(function(){f.fadeIn()}))},SetUserPreferenceUrl:function(n){BST.User.UserPreferenceUrl=n},AddOrEditUserPreference:function(n,t){BST.Cookie.AddCreateCookieValue(BST.Cookie.UserPreferencesCookieName,n,t,BST.Cookie.CookieExpirationTime.FiveYears);var i=JSON.stringify({PreferenceId:n,TextValue:t});$.ajax({url:BST.User.UserPreferenceUrl,type:"POST",data:i,contentType:"application/json",dataType:"json"}).done(function(i){var r=n,u=t;i>0&&BST.Cookie.AddCreateCookieValue(BST.Cookie.UserPreferencesCookieName,r,u,BST.Cookie.CookieExpirationTime.FiveYears)})}};$(document).ready(function(){BST.User.Init()});BST.ReadingPlan={TranslationSelect:{},DaysSelect:{},CompletedCheck:{},FinishReadingPlanButton:{},ResetReadingPlanLink:{},StartTodayButton:{},ZoomTextButton:{},ReadingContainer:{},CompletedDetailButton:{},ReadingPlanDetailsStatusUrl:"",FinishReadingPlanUrl:"",StartReadingPlanUrl:"",UpdateReadingPlanDateUrl:"",ResetReadingPlanUrl:"",SelectedDate:"",PassageTextSize:15,CurrentReadingPlanDetailsId:0,CurrentUserReadingPlanId:0,CurrentPassageReadingPlanId:0,CurrentReadingPlanId:0,Init:function(){var n=new Date;BST.ReadingPlan.SelectedDate=n.getMonth()+1+"/"+n.getDate()+"/"+n.getFullYear();BST.ReadingPlan.AttachEvents()},LoadSelectors:function(){BST.ReadingPlan.TranslationSelect=$("select.translation");BST.ReadingPlan.DaysSelect=$(".sidebar-reading-plan select.pick-days");BST.ReadingPlan.CompletedCheckButton=$(".sidebar-reading-plan .check-button");BST.ReadingPlan.FinishReadingPlanButton=$(".finish-plan");BST.ReadingPlan.ResetReadingPlanLink=$(".reset-plan");BST.ReadingPlan.StartTodayButton=$("button.start-today");BST.ReadingPlan.ZoomTextButton=$(".zoom-text");BST.ReadingPlan.ReadingContainer=$(".current-reading");BST.ReadingPlan.CompletedDetailButton=$(".finished-reading");BST.ReadingPlan.PrintButton=$(".print-button")},AttachEvents:function(){BST.ReadingPlan.LoadSelectors();BST.ReadingPlan.TranslationSelect.change(function(){BST.ReadingPlan.LoadReadingDetails(BST.ReadingPlan.CurrentReadingPlanDetailsId)});BST.ReadingPlan.DaysSelect.change(function(){var n=$(this).find("option:selected").data("dropdown-id");$("ul.reading-schedule").each(function(){$(this).addClass("hidden")});$(".reading-container").find("[data-result-id='"+n+"']").removeClass("hidden")});BST.ReadingPlan.CompletedCheckButton.click(function(){var t=$(this).hasClass("active"),n=$(this).closest("li").attr("data-reading-plan-id");$(this).toggleClass("active");BST.ReadingPlan.ChangeReadingStatus(n,!t);BST.ReadingPlan.CurrentPassagePlanDetailsId==n&&$(".finished-reading").toggleClass("hidden")});BST.ReadingPlan.CompletedDetailButton.click(function(){BST.ReadingPlan.ChangeReadingStatus(BST.ReadingPlan.CurrentReadingPlanDetailsId,!0);$(this).addClass("hidden");$("[data-reading-plan-id="+BST.ReadingPlan.CurrentReadingPlanDetailsId+"] .check-button").addClass("active")});BST.ReadingPlan.FinishReadingPlanButton.click(function(){confirm("This will complete your current reading plan. Are you sure?")&&BST.ReadingPlan.FinishReadingPlan()});BST.ReadingPlan.ResetReadingPlanLink.click(function(){confirm("This will restart your reading plan. Are you sure?")&&BST.ReadingPlan.ResetReadingPlan()});BST.ReadingPlan.PrintButton.click(function(n){n.preventDefault();BST.Print()});BST.ReadingPlan.ZoomTextButton.click(function(){var n=$(this).attr("data-action");n=="zoomin"?BST.ReadingPlan.PassageTextSize<26&&(BST.ReadingPlan.PassageTextSize=BST.ReadingPlan.PassageTextSize+1):BST.ReadingPlan.PassageTextSize>10&&(BST.ReadingPlan.PassageTextSize=BST.ReadingPlan.PassageTextSize-1);BST.ReadingPlan.ReadingContainer.css("font-size",BST.ReadingPlan.PassageTextSize,"important")})},SetReadingPlanDetailsStatusUrl:function(n){BST.ReadingPlan.ReadingPlanDetailsStatusUrl=n},SetFinishReadingPlanUrl:function(n){BST.ReadingPlan.FinishReadingPlanUrl=n},SetStartReadingPlanUrl:function(n){BST.ReadingPlan.StartReadingPlanUrl=n},SetResetReadingPlanUrl:function(n){BST.ReadingPlan.ResetReadingPlanUrl=n},SetUpdateReadingPlanDateUrl:function(n){BST.ReadingPlan.UpdateReadingPlanDateUrl=n},SetCurrentReadingPlanDetailsId:function(n){BST.ReadingPlan.CurrentReadingPlanDetailsId=n},SetCurrentPassagePlanDetailsId:function(n){BST.ReadingPlan.CurrentPassagePlanDetailsId=n},SetCurrentUserReadingPlanId:function(n){BST.ReadingPlan.CurrentUserReadingPlanId=n},SetCurrentReadingPlanId:function(n){BST.ReadingPlan.CurrentReadingPlanId=n},LoadReadingDetails:function(n){var t=$(".loading-passage");t.toggleClass("hidden");BST.ReadingPlan.ReadingContainer.toggleClass("loading");$.get(BST.ReadingPlan.ReadingPlanDetailsUrl,{readingPlanDetailId:n,preferredTranslationCode:BST.ReadingPlan.TranslationSelect.val()}).done(function(n){BST.ReadingPlan.ReadingContainer.html(n)}).always(function(){t.toggleClass("hidden");BST.ReadingPlan.ReadingContainer.toggleClass("loading")})},ChangeReadingStatus:function(n,t){$.post(BST.ReadingPlan.ReadingPlanDetailsStatusUrl,{readingPlanDetailId:n,userReadingPlanId:BST.ReadingPlan.CurrentUserReadingPlanId,isComplete:t})},FinishReadingPlan:function(){$.post(BST.ReadingPlan.FinishReadingPlanUrl,{userReadingPlanId:BST.ReadingPlan.CurrentUserReadingPlanId}).done(function(n){n&&n.success===!0&&(window.location=n.url)})},UpdateStartDate:function(){var n={};n.UserReadingPlanId=BST.ReadingPlan.CurrentUserReadingPlanId;n.NewStartDate=BST.ReadingPlan.SelectedDate;$.ajax({url:BST.ReadingPlan.UpdateReadingPlanDateUrl,type:"POST",data:JSON.stringify(n),dataType:"json",contentType:"application/json"}).done(function(n){n&&n.success===!0&&location.reload(!0)})},StartReadingPlan:function(n,t){var i={};i.ReadingPlanId=n;$.ajax({url:BST.ReadingPlan.StartReadingPlanUrl,type:"POST",data:JSON.stringify(i),dataType:"json",contentType:"application/json"}).done(function(n){var i,r;if(n)if(i=$(".ajax-error-list"),n.success===!1){for(i.empty(),r=0;r<n.messages.length;r++)i.append("<p>"+n.messages[r]+"<\/p>");i.parent().fadeIn()}else t&&(window.location.href=window.location.href)})},ResetReadingPlan:function(){var n={};n.UserReadingPlanId=BST.ReadingPlan.CurrentUserReadingPlanId;$.ajax({url:BST.ReadingPlan.ResetReadingPlanUrl,type:"POST",data:JSON.stringify(n),dataType:"json",contentType:"application/json"}).done(function(n){n&&n.success===!0&&location.reload(!0)})},ToggleFinishedReadingPlanDetailButton:function(){var n=$("[data-reading-plan-id="+BST.ReadingPlan.CurrentPassagePlanDetailsId+"] .check-button").hasClass("active");n&&$("button.finished-reading").addClass("hidden")}};$(document).ready(function(){BST.ReadingPlan.Init()});BST.Effects={Init:function(){BST.Effects.BindAnchorClicks();BST.Effects.SetupModal();BST.Effects.SetupTooltips()},BindAnchorClicks:function(){$("a.smooth-scroll").click(function(n){n.preventDefault();BST.Effects.SmoothScroll($($(this).attr("href")))})},SmoothScroll:function(n){$("html,body").animate({scrollTop:n.offset().top-screen.height/2},500);n.effect("highlight",1e4)},SetupModal:function(){$("#loading-modal").modal({show:!1})},SetupTooltips:function(){$(".bst-tooltip").tooltip()},ToggleModal:function(n){var t=$("#loading-modal");n?t.modal("show"):t.modal("hide")}};BST.BibleSideBar={contentLink:"",communityLink:"",parallelLink:"",readingLink:"",contentNotesLink:"",contentHighlightsLink:"",contentBookmarksLink:"",contentTagsLink:"",referenceBibleLink:"",referenceRelatedCommentariesLink:"",referenceAllCommentariesLink:"",referenceCommentaryLink:"",referenceCommentaryUri:"",communityAllNotesLink:"",communityTagsLink:"",BibleSidebarViewUrl:"",BibleSidebarViewUrlParallel:"",BibleSidebarView:{AllNotes:0,AllTags:1,MyBookmarks:2,MyHighlights:3,MyNotes:4,MyTags:5,MyReadingPlan:6,ParallelBible:7,Commentaries:8},UrlParallelParamType:{Translation:0,Book:1,Chapter:2,Verse:3},Init:function(){BST.BibleSideBar.contentLink=$("#bible-sidebar-content-link");BST.BibleSideBar.communityLink=$("#bible-sidebar-community-link");BST.BibleSideBar.parallelLink=$("#bible-sidebar-parallel-link");BST.BibleSideBar.readingLink=$("#bible-sidebar-reading-link");BST.BibleSideBar.contentNotesLink=$("#bible-sidebar-content-notes-link");BST.BibleSideBar.contentHighlightsLink=$("#bible-sidebar-content-highlights-link");BST.BibleSideBar.contentBookmarksLink=$("#bible-sidebar-content-bookmarks-link");BST.BibleSideBar.contentTagsLink=$("#bible-sidebar-content-tags-link");BST.BibleSideBar.referenceBibleLink=$("#bible-sidebar-reference-bible-link");BST.BibleSideBar.referenceRelatedCommentariesLink=$(".bible-sidebar-reference-menu #bible-sidebar-reference-related-commentaries-link");BST.BibleSideBar.referenceAllCommentariesLink=$(".bible-sidebar-reference-menu  #bible-sidebar-reference-all-commentaries-link");BST.BibleSideBar.referenceCommentaryLink=$("#reference-commentaries-container a.commentary-link");BST.BibleSideBar.communityAllNotesLink=$("#bible-sidebar-community-all-notes-link");BST.BibleSideBar.communityTagsLink=$("#bible-sidebar-community-tags-link");BST.BibleSideBar.AttachClick();BST.BibleSideBar.InitCookie();BST.BibleSideBarMyTags.LoadTags(!0);BST.BibleSideBar.TagSort="scripture"},InitCookie:function(){BST.Cookie.ReadCookie(BST.Cookie.BibleSidebarCookieName)==null&&BST.Cookie.CreateCookie(BST.Cookie.BibleSidebarCookieName,"SidebarView=4",BST.Cookie.CookieExpirationTime.FiveYears)},FixHeight:function(){var n=$("div.bible-sidebar-img-button"),t=0,i=36;$(n).each(function(){$(this).height("auto")});$(n).each(function(){var n=$(this).find("div").height()+2;n>t&&(t=n)});$(n).each(function(){$(this).height(t+i+5)})},PreventDefault:function(n){var t=!1;return $(n).parent().hasClass("bible-sidebar-img-button-active")&&(t=!0),$(n).parent().hasClass("bible-sidebar-img-button-active-left")&&(t=!0),$(n).parent().hasClass("bible-sidebar-img-button-active-right")&&(t=!0),$(n).parent().hasClass("bible-sidebar-submenu-active")&&(t=!0),t},SelectSubMenuActive:function(n,t){var i=$(n),r=$(i).find("div");$(r).each(function(){$(this).removeClass("bible-sidebar-submenu-active")});$(i).find(t).addClass("bible-sidebar-submenu-active")},SelectSubMenuActiveFirstLoad:function(){var t=parseInt(BST.BibleSideBar.GetBibleSideView(),10),n;switch(t){case BST.BibleSideBar.BibleSidebarView.AllNotes:BST.BibleSideBar.SubMenu("community");BST.BibleSideBar.SelectSubMenuActive(".bible-sidebar-community-menu",".bible-sidebar-sub-menu-all-notes");break;case BST.BibleSideBar.BibleSidebarView.AllTags:BST.BibleSideBar.SubMenu("community");BST.BibleSideBar.SelectSubMenuActive(".bible-sidebar-community-menu",".bible-sidebar-sub-menu-all-tags");break;case BST.BibleSideBar.BibleSidebarView.MyBookmarks:BST.BibleSideBar.SubMenu("content");BST.BibleSideBar.SelectSubMenuActive(".bible-sidebar-content-menu",".bible-sidebar-sub-menu-bookmarks");break;case BST.BibleSideBar.BibleSidebarView.MyHighlights:BST.BibleSideBar.SubMenu("content");BST.BibleSideBar.SelectSubMenuActive(".bible-sidebar-content-menu",".bible-sidebar-sub-menu-highlights");break;case BST.BibleSideBar.BibleSidebarView.MyNotes:BST.BibleSideBar.SubMenu("content");BST.BibleSideBar.SelectSubMenuActive(".bible-sidebar-content-menu",".bible-sidebar-sub-menu-notes");break;case BST.BibleSideBar.BibleSidebarView.MyTags:BST.BibleSideBar.SubMenu("content");BST.BibleSideBar.SelectSubMenuActive(".bible-sidebar-content-menu",".bible-sidebar-sub-menu-tags");break;case BST.BibleSideBar.BibleSidebarView.ParallelBible:BST.BibleSideBar.SubMenu("reference");BST.BibleSideBar.SelectSubMenuActive(".bible-sidebar-refernce-menu",".bible-sidebar-sub-menu-parallel-bible");break;case BST.BibleSideBar.BibleSidebarView.Commentaries:BST.BibleSideBar.SubMenu("reference");n=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.CommentariesUri);BST.BibleSideBar.referenceCommentaryUri=n==null?"":n;BST.BibleSideBar.referenceCommentaryUri==""?BST.BibleSideBar.SelectSubMenuActive(".bible-sidebar-reference-menu",".bible-sidebar-sub-menu-related-commentaries"):BST.BibleSideBar.SelectSubMenuActive(".bible-sidebar-reference-menu",".bible-sidebar-sub-menu-all-commentaries");break;default:$(".bible-sidebar-content-menu, .bible-sidebar-community-menu, .bible-sidebar-reference-menu").addClass("hidden")}},InitMainMenu:function(n,t,i,r){BST.Cookie.EditCookieValue(BST.Cookie.BibleSidebarCookieName,"SidebarView",n.toString(),BST.Cookie.CookieExpirationTime.FiveYears);BST.BibleSideBar.SelectMainMenuActive(t);BST.BibleSideBar.ToggleScreenSize(i);BST.BibleSideBar.SubMenu(r)},SelectMainMenuActive:function(n){for(var t,r=$("div.bible-sidebar-main-menu div"),i=0;i<r.length;i++)t=$(r).eq(i),$(t).removeClass("bible-sidebar-img-button-active").removeClass("bible-sidebar-img-button-active-left").removeClass("bible-sidebar-img-button-active-right"),$(t).hasClass(n.replace(".",""))&&(i==0?$(t).addClass("bible-sidebar-img-button-active-left"):i==r.length-1?$(t).addClass("bible-sidebar-img-button-active-right"):$(t).addClass("bible-sidebar-img-button-active"))},ToggleScreenSize:function(n){var t=$("div#content-column"),i=$("div#sidebar-column");n?($(t).switchClass("col-md-6","col-md-5",500),$(i).switchClass("col-md-4","col-md-5",500)):($(t).switchClass("col-md-5","col-md-6",500),$(i).switchClass("col-md-5","col-md-4",500))},SetMainMenu:function(){var n=parseInt(BST.BibleSideBar.GetBibleSideView(),10);if(n==BST.BibleSideBar.BibleSidebarView.MyNotes||n==BST.BibleSideBar.BibleSidebarView.MyTags||n==BST.BibleSideBar.BibleSidebarView.MyBookmarks||n==BST.BibleSideBar.BibleSidebarView.MyHighlights){BST.BibleSideBar.SelectMainMenuActive(".bible-sidebar-main-menu-content");return}if(n==BST.BibleSideBar.BibleSidebarView.AllNotes||n==BST.BibleSideBar.BibleSidebarView.AllTags){BST.BibleSideBar.SelectMainMenuActive(".bible-sidebar-main-menu-community");return}if(n==BST.BibleSideBar.BibleSidebarView.MyReadingPlan){BST.BibleSideBar.SelectMainMenuActive(".bible-sidebar-main-menu-plan");return}if(n==BST.BibleSideBar.BibleSidebarView.ParallelBible||n==BST.BibleSideBar.BibleSidebarView.Commentaries){BST.BibleSideBar.SelectMainMenuActive(".bible-sidebar-main-menu-parallel");return}},SubMenu:function(n){var t=$("div.bible-sidebar-content-menu").addClass("hidden"),i=$("div.bible-sidebar-reference-menu").addClass("hidden"),r=$("div.bible-sidebar-community-menu").addClass("hidden");n=="content"&&$(t).removeClass("hidden");n=="reference"&&$(i).removeClass("hidden");n=="community"&&$(r).removeClass("hidden")},SetBibleSidebarViewUrl:function(n){BST.BibleSideBar.BibleSidebarViewUrl=n},GetBibleSidebarViewUrl:function(){var n=BST.BibleSideBar.BibleSidebarViewUrl;return n.replace(new RegExp("/([0-9]+).part"),function(n,t){return n.replace(t,BST.BibleSideBar.GetBibleSideView())})},SetBibleSidebarViewUrlParallel:function(n){BST.BibleSideBar.BibleSidebarViewUrlParallel=n},GetBibleSideView:function(){var n=BST.Cookie.ReadCookieValue(BST.Cookie.BibleSidebarCookieName,"SidebarView");return n==null?BST.BibleSideBar.BibleSidebarView.MyNotes.toString():n},BibleSidebarLoad:function(){BST.BibleSideBar.BibleSidebarViewPreCall();var t=parseInt(BST.BibleSideBar.GetBibleSideView(),10),n="";t==BST.BibleSideBar.BibleSidebarView.ParallelBible||t==BST.BibleSideBar.BibleSidebarView.Commentaries?(BST.BibleSideBar.ToggleScreenSize(!0),n=t==BST.BibleSideBar.BibleSidebarView.ParallelBible?BST.BibleSideBar.GetParallelBibleUrl():BST.BibleSideBar.GetBibleSidebarViewUrl()+"?referenceUri="+BST.BibleSideBar.referenceCommentaryUri):n=BST.BibleSideBar.GetBibleSidebarViewUrl();n=n.replace(".part/","/"+BST.BibleSideBar.TagSort+".part/");$("#bible-sidebar-container").empty().load(n,BST.BibleSideBar.BibleSidebarViewPostCall)},GetParallelBibleUrl:function(){var n=BST.BibleSideBar.BibleSidebarViewUrlParallel,t=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.ParallelBible);return t==null?(BST.User.AddOrEditUserPreference(BST.User.UserPreferenceType.ParallelBible,BST.BibleSideBar.GetParallelBibleCookieValue(n)),n):BST.BibleSideBar.GetParallelBibleUrlWithParams(n,t)},ParallelBibleNavigation:function(n,t){var e=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.ParallelBible),i,o,f,r,u;if(e!=null){if(i=e.split("$"),i.length<5)return;o=parseInt(t);switch(o){case BST.BibleSideBar.UrlParallelParamType.Translation:i[0]=n;break;case BST.BibleSideBar.UrlParallelParamType.Book:if(f=n.split("$"),f.length<2)return;i[1]=f[0];i[2]=f[1];i[3]="1";i[4]="0";break;case BST.BibleSideBar.UrlParallelParamType.Chapter:i[3]=n;i[4]="0";break;case BST.BibleSideBar.UrlParallelParamType.Verse:i[4]=n}for(r="",u=0;u<i.length;u++)r=r+i[u],u<i.length-1&&(r=r+"$");BST.User.AddOrEditUserPreference(BST.User.UserPreferenceType.ParallelBible,r);BST.BibleSideBar.BibleSidebarLoad()}},GetParallelBibleCookieValue:function(n){var i=new RegExp("bible-versions/(.+)/(.+)-(.+)/([0-9]+)-([0-9]+)/([0-9]+).part","g"),t=i.exec(n);return t[1]+"$"+t[2]+"$"+t[3]+"$"+t[4]+"$"+t[5]},GetParallelBibleUrlWithParams:function(n,t){var f;n=n.substr(n.length-1,1)=="/"?n.substr(0,n.length-1):n;n=n.substr(0,1)=="/"?n.substr(1,n.length-1):n;var i=t.split("$"),r=n.split("/"),u="";for(r[r.length-2]=i[i.length-2]+"-"+i[i.length-1],r[r.length-3]=i[i.length-4]+"-"+i[i.length-3],r[r.length-4]=i[i.length-5],f=0;f<r.length;f++)f>0&&(u=u+"/"),u=u+r[f];return u},BibleSidebarViewPreCall:function(){var n=$("#bible-sidebar-container");$(n).empty();$("div.bible-sidebar-loading").removeClass("hidden")},BibleSidebarViewPostCall:function(){$("div.bible-sidebar-loading").addClass("hidden")},BibleSidebarLoadContainer:function(n,t,i){if(n!="undefined"&&t!="undefined"&&BST.BibleSideBar.SelectSubMenuActive(n,t),BST.BibleSideBar.BibleSidebarViewPreCall(),BST.Cookie.EditCookieValue(BST.Cookie.BibleSidebarCookieName,"SidebarView",i.toString(),BST.Cookie.CookieExpirationTime.FiveYears),i==BST.BibleSideBar.BibleSidebarView.Commentaries){var r=BST.BibleSideBar.GetBibleSidebarViewUrl()+"?referenceUri="+BST.BibleSideBar.referenceCommentaryUri;$("#bible-sidebar-container").load(r,BST.BibleSideBar.BibleSidebarViewPostCall)}else $("#bible-sidebar-container").load(BST.BibleSideBar.GetBibleSidebarViewUrl(),BST.BibleSideBar.BibleSidebarViewPostCall)},AttachClick:function(){$(BST.BibleSideBar.contentLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.InitMainMenu(BST.BibleSideBar.BibleSidebarView.MyNotes,".bible-sidebar-main-menu-content",!1,"content");BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-content-menu",".bible-sidebar-sub-menu-notes",BST.BibleSideBar.BibleSidebarView.MyNotes)});$(BST.BibleSideBar.communityLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.InitMainMenu(BST.BibleSideBar.BibleSidebarView.AllNotes,".bible-sidebar-main-menu-community",!1,"community");BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-community-menu",".bible-sidebar-sub-menu-all-notes",BST.BibleSideBar.BibleSidebarView.AllNotes)});$(BST.BibleSideBar.parallelLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.InitMainMenu(BST.BibleSideBar.BibleSidebarView.ParallelBible,".bible-sidebar-main-menu-parallel",!0,"reference");BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-reference-menu",".bible-sidebar-sub-menu-parallel-bible",BST.BibleSideBar.BibleSidebarView.ParallelBible)});$(BST.BibleSideBar.readingLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.InitMainMenu(BST.BibleSideBar.BibleSidebarView.MyReadingPlan,".bible-sidebar-main-menu-plan",!1,"");BST.BibleSideBar.BibleSidebarLoadContainer("undefined","undefined",BST.BibleSideBar.BibleSidebarView.MyReadingPlan)});$(BST.BibleSideBar.contentNotesLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-content-menu",".bible-sidebar-sub-menu-notes",BST.BibleSideBar.BibleSidebarView.MyNotes)});$(BST.BibleSideBar.contentHighlightsLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-content-menu",".bible-sidebar-sub-menu-highlights",BST.BibleSideBar.BibleSidebarView.MyHighlights)});$(BST.BibleSideBar.contentBookmarksLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-content-menu",".bible-sidebar-sub-menu-bookmarks",BST.BibleSideBar.BibleSidebarView.MyBookmarks)});$(BST.BibleSideBar.contentTagsLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-content-menu",".bible-sidebar-sub-menu-tags",BST.BibleSideBar.BibleSidebarView.MyTags)});$(BST.BibleSideBar.referenceBibleLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-reference-menu",".bible-sidebar-sub-menu-parallel-bible",BST.BibleSideBar.BibleSidebarView.ParallelBible)});$(BST.BibleSideBar.referenceRelatedCommentariesLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.referenceCommentaryUri="";BST.User.AddOrEditUserPreference(BST.User.UserPreferenceType.CommentariesUri,BST.BibleSideBar.referenceCommentaryUri);BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-reference-menu",".bible-sidebar-sub-menu-related-commentaries",BST.BibleSideBar.BibleSidebarView.Commentaries)});$(BST.BibleSideBar.referenceAllCommentariesLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.referenceCommentaryUri=$(this).data("uri");BST.User.AddOrEditUserPreference(BST.User.UserPreferenceType.CommentariesUri,BST.BibleSideBar.referenceCommentaryUri);BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-reference-menu",".bible-sidebar-sub-menu-all-commentaries",BST.BibleSideBar.BibleSidebarView.Commentaries)});$(BST.BibleSideBar.communityAllNotesLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-community-menu",".bible-sidebar-sub-menu-all-notes",BST.BibleSideBar.BibleSidebarView.AllNotes)});$(BST.BibleSideBar.communityTagsLink).click(function(n){if(BST.BibleSideBar.PreventDefault(this)){n.preventDefault();return}BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-community-menu",".bible-sidebar-sub-menu-all-tags",BST.BibleSideBar.BibleSidebarView.AllTags)})},CommentariesLinkClick:function(n){var t=$(n).data("uri");BST.BibleSideBar.referenceCommentaryUri=t==null?"":t;BST.User.AddOrEditUserPreference(BST.User.UserPreferenceType.CommentariesUri,BST.BibleSideBar.referenceCommentaryUri);BST.BibleSideBar.BibleSidebarLoadContainer(".bible-sidebar-reference-menu",".bible-sidebar-sub-menu-all-commentaries",BST.BibleSideBar.BibleSidebarView.Commentaries)},STCommentariesLinkClick:function(n){var t=$(n).data("st-uri");BST.BibleSideBar.referenceCommentaryUri=t==null?"":t;BST.Cookie.EditCookieValue(BST.Cookie.BibleSidebarCookieName,"SidebarView",BST.BibleSideBar.BibleSidebarView.Commentaries.toString(),BST.Cookie.CookieExpirationTime.FiveYears);BST.User.AddOrEditUserPreference(BST.User.UserPreferenceType.CommentariesUri,BST.BibleSideBar.referenceCommentaryUri);BST.BibleSideBar.SetMainMenu();BST.BibleSideBar.SelectSubMenuActiveFirstLoad();BST.BibleSideBar.BibleSidebarLoad()}};BST.BibleSideBarMyNotes={Init:function(){BST.BibleSideBarMyNotes.InitScriptureCategoryDropdown();BST.BibleSideBarMyNotes.InitCategoryDropdown()},InitScriptureCategoryDropdown:function(){$("div.scripture-category-dropdown a.dropdown-scripture-link").click(function(){$("div.scripture-category-dropdown button.dropdown-selected").html($(this).html());$("div.scripture-container").removeClass("hidden");$("div.category-container").addClass("hidden");$("#bible-sidebar-print-all-scriptures").removeClass("hidden");$("#bible-sidebar-print-all-categories").addClass("hidden");$("#bible-sidebar-export-all-scriptures").removeClass("hidden");$("#bible-sidebar-export-all-categories").addClass("hidden")});$("div.scripture-category-dropdown a.dropdown-category-link").click(function(){$("div.scripture-category-dropdown button.dropdown-selected").html($(this).html());$("div.category-container").removeClass("hidden");$("div.scripture-container").addClass("hidden");$("#bible-sidebar-print-all-categories").removeClass("hidden");$("#bible-sidebar-print-all-scriptures").addClass("hidden");$("#bible-sidebar-export-all-categories").removeClass("hidden");$("#bible-sidebar-export-all-scriptures").addClass("hidden")})},ToggleNotes:function(n){var t=$(n).find("span"),i=$(n).closest("div.bible-sidebar-sub-title").next("ul.bible-sidebar-notes");$(t).hasClass("fa-chevron-right")?($(i).removeClass("hidden"),$(t).removeClass("fa-chevron-right").addClass("fa-chevron-down")):($(i).addClass("hidden"),$(t).removeClass("fa-chevron-down").addClass("fa-chevron-right"))},InitCategoryDropdown:function(){$(".add-note-container .add-note-container-category-select").change(function(){var n=$(".add-note-container .add-note-container-category-select");$(n).find('option[selected="selected"]').removeAttr("selected");$(n).val()==-1&&($(n).addClass("hidden"),$(".add-note-container .add-note-container-category").removeClass("hidden"),$(".add-note-container .add-note-container-category-text").val(""))});$("#my-notes-for-container .add-note-container-category-select").each(function(){$(this).change(function(){var n='div[data-note-for-update-id="'+$(this).closest("div.edit-note-container").attr("data-note-for-update-id")+'"] ',t=$(n+".add-note-container-category-select");$(t).find('option[selected="selected"]').removeAttr("selected");$(t).val()==-1&&($(t).addClass("hidden"),$(n+".add-note-container-category").removeClass("hidden"),$(n+".add-note-container-category-text").val(""))})});$("#my-notes-container .scripture-container .add-note-container-category-select").each(function(){$(this).change(function(){var n='div[data-note-scripture-update-id="'+$(this).closest("div.edit-note-container").attr("data-note-scripture-update-id")+'"] ',t=$(n+".add-note-container-category-select");$(t).find('option[selected="selected"]').removeAttr("selected");$(t).val()==-1&&($(t).addClass("hidden"),$(n+".add-note-container-category").removeClass("hidden"),$(n+".add-note-container-category-text").val(""))})});$("#my-notes-container .category-container .add-note-container-category-select").each(function(){$(this).change(function(){var n='div[data-note-category-update-id="'+$(this).closest("div.edit-note-container").attr("data-note-category-update-id")+'"] ',t=$(n+".add-note-container-category-select");$(t).find('option[selected="selected"]').removeAttr("selected");$(t).val()==-1&&($(t).addClass("hidden"),$(n+".add-note-container-category").removeClass("hidden"),$(n+".add-note-container-category-text").val(""))})})},SelectCategoryDropdown:function(){$(".add-note-container-category-select").each(function(){$(this).val($(this).attr("data-value"))})},DeleteNote:function(n,t){var i=window.confirm("This operation will delete this note.");i&&$.ajax({url:t}).done(function(n){n>0&&($('a[data-note-id="'+n+'"]').closest("li").remove(),alert("The note has been successfully deleted."))})},DeleteCategory:function(n,t){var i=window.confirm("This operation will delete this category.");i&&$.ajax({url:t}).done(function(n){if(n.categoryId>0){$('a[data-category-id="'+n.categoryId+'"]').closest("div.bible-sidebar-sub-title").remove();for(var t=0;t<n.notes.length;t++)$('a[data-note-id="'+n.notes[t]+'"]').closest("li").remove();alert("The category and its notes have been successfully deleted.")}})},EditNote:function(n,t,i){var r=$("div["+i+'="'+n+'"]'),u,f,e,o;$("div["+t+'="'+n+'"]').addClass("hidden").parent().removeClass("bible-sidebar-note").addClass("bible-sidebar-notes-edit");u=$(r).find(".add-note-container-title");$(u).val($(u).attr("data-value"));f=$(r).find(".add-note-container-hide-community");$(f).prop("checked",$(f).attr("data-value"));e=$(r).find(".add-note-container-text");$(e).val($(e).attr("data-value"));o=$(r).find(".add-note-container-category-select");$(o).val($(o).attr("data-value"));$(r).removeClass("hidden")},SubmitEditNote:function(n,t,i){var r=$("div["+n+'="'+t+'"]'),u=$(r).find(".add-note-container-title"),e;if($(u).val()==""){alert("Invalid Note Title");$(u).focus();return}var o=$(r).find(".add-note-container-hide-community").is(":checked"),s=parseInt($(r).find(".add-note-container-category-select").val(),10),f=$(r).find(".add-note-container-text").val();f==""&&(f=null);e=e=JSON.stringify({Note:{NoteId:t,LabelText:$(u).val(),NoteText:f,NoteCategoryId:s,Private:o}});$.ajax({url:i,type:"POST",data:e,contentType:"application/json",dataType:"json"}).done(function(){BST.BibleSideBarMyNotes.CancelAddNote();BST.BibleSideBar.BibleSidebarLoad()})},CancelEditNote:function(n,t,i){$("div["+t+'="'+n+'"]').removeClass("hidden").parent().addClass("bible-sidebar-note").removeClass("bible-sidebar-notes-edit");$("div["+i+'="'+n+'"]').addClass("hidden")},EditCategory:function(n){var t=$('a[data-category-id="'+n+'"]'),r=$(t).closest("div.row"),i=$('div[data-update-category-id="'+n+'"]');$(r).addClass("hidden");$(i).removeClass("hidden");$(i).find('input[type="text"]').val($(t).html())},SubmitEditCategory:function(n,t){var i='div[data-update-category-id="'+n+'"] input[type="text"]',r;BST.BibleSideBarMyNotes.ValidateCategory(i)&&(r=JSON.stringify({CategoryId:n,CategoryTitle:$(i).val()}),$.ajax({url:t,type:"POST",data:r,contentType:"application/json",dataType:"json"}).done(function(t){var r=n,u=i;t>0&&$('a[data-category-id="'+r+'"]').html($(u).val());BST.BibleSideBarMyNotes.CancelEditCategory(r)}))},CancelEditCategory:function(n){$('a[data-category-id="'+n+'"]').closest("div.row").removeClass("hidden");$('div[data-update-category-id="'+n+'"]').addClass("hidden")},ValidateCategory:function(n){var i=$(n),r=$(i).val(),t;if(r==""){alert("Invalid Category Name");$(i).focus();return}return t=!0,$(".add-note-container-category-select option").each(function(){r.toLowerCase()==$(this).text().toLowerCase()&&(alert("Category Name already exists"),t=!1)}),t==!1&&$(i).focus(),t},AddCategory:function(n,t,i,r){var u="",f,e;u=i=="noteContainer"?".add-note-container ":"div["+i+'="'+r+'"] ';f=u+".add-note-container-category-text";BST.BibleSideBarMyNotes.ValidateCategory(f)&&(e=JSON.stringify({CategoryTitle:$(f).val()}),$.ajax({url:n,type:"POST",data:e,contentType:"application/json",dataType:"json"}).done(function(n){var f=t,r=u,i=$(r+".add-note-container-category-select");n>0?($(i).attr("data-value",n),BST.BibleSideBarMyNotes.FillCategoryDropdown(f)):$(i).val(0);$(i).removeClass("hidden");$(r+".add-note-container-category").addClass("hidden")}))},CancelAddCategory:function(n,t){var r="",i;r=n=="noteContainer"?".add-note-container ":"div["+n+'="'+t+'"] ';i=$(r+".add-note-container-category-select");$(i).val($(i).attr("data-value"));$(i).removeClass("hidden");$(r+".add-note-container-category").addClass("hidden")},AddNote:function(){$(".add-note-container a#add-note-button").addClass("hidden");$("div.add-note-container").removeClass("hidden")},SubmitNote:function(n,t,i,r,u){var e=$(".add-note-container .add-note-container-title").val(),o;if(e==""){alert("Invalid Note Title");$(".add-note-container .add-note-container-title").focus();return}var s=$(".add-note-container .add-note-container-hide-community").is(":checked"),h=parseInt($(".add-note-container .add-note-container-category-select").val(),10),f=$(".add-note-container .add-note-container-text").val();f==""&&(f=null);o=JSON.stringify({Note:{LabelText:e,NoteText:f,NoteCategoryId:h,Private:s,UserNoteReference:{TranslationCode:n,BookCode:t,ChapterId:parseInt(i,10),VerseId:parseInt(r,10)}}});$.ajax({url:u,type:"POST",data:o,contentType:"application/json",dataType:"json"}).done(function(){BST.BibleSideBarMyNotes.CancelAddNote();BST.BibleSideBar.BibleSidebarLoad()})},CancelAddNote:function(){$(".add-note-container a#add-note-button").removeClass("hidden");$("div.add-note-container").addClass("hidden")},FillCategoryDropdown:function(n){$.ajax({url:n}).done(function(n){for(var r,t='<option value="0" selected="selected">Uncategorized<\/option>',i=0;i<n.length;i++)r='<option value="'+n[i].NoteCategoryId+'">'+n[i].Title+"<\/option>",t=t+r;t=t+'<optgroup label="----------------------"><\/optgroup>';t=t+'<option value="-1">Add New Category<\/option>';$(".add-note-container-category-select").empty().html(t);BST.BibleSideBarMyNotes.SelectCategoryDropdown()})}};BST.BibleSideBarMyHighlights={Init:function(){BST.ShrinkText("#bible-sidebar-container .bible-sidebar-highlight-text",30)},AddHighlights:function(n){var u=$(".scripture .selected-verse"),t,i,r;if($(u).length<=0){alert("Please select one or more verses to highlight.");return}if(t=$("div.selected-verse > span:not(.highlighted-verse)"),$(t).length<=0){BST.Bible.DeselectAllVerses();return}i=[];$(t).each(function(){var n,t;BST.Bible.GetContainerPrefixByElement(this)==BST.Bible.BibleContainerType.ParallelContainer?(n={TranslationCode:BST.Bible.CurrentTranslationCodeParallel,BookCode:BST.Bible.CurrentBookCodeParallel,ChapterId:parseInt(BST.Bible.CurrentChapterIdParallel,10),VerseId:parseInt($(this).closest("div.verse").find("strong").html(),10)},i.push(n)):(t={TranslationCode:BST.Bible.CurrentTranslationCode,BookCode:BST.Bible.CurrentBookCode,ChapterId:parseInt(BST.Bible.CurrentChapterId,10),VerseId:parseInt($(this).closest("div.verse").find("strong").html(),10)},i.push(t))});r=JSON.stringify({Highlights:i});$.ajax({url:n,type:"POST",data:r,contentType:"application/json",dataType:"json"}).done(function(n){var i=t;n.length>0&&($("div.bible-sidebar-sub-menu-highlights").hasClass("bible-sidebar-submenu-active")&&BST.BibleSideBar.BibleSidebarLoad(),$(i).addClass("highlighted-verse"),BST.BibleSideBarMyHighlights.HighlightVerses(),BST.Bible.DeselectAllVerses())})},HighlightVerses:function(){var n=BST.Cookie.ReadCookieValue(BST.Cookie.UserPreferencesCookieName,BST.User.UserPreferenceType.DefaultHighlightColor);n=n!=null?n:"#f6f698";$(".scripture .highlighted-verse").css("background-color",n)},DeleteHighlight:function(n){var t=window.confirm("This operation will delete this highlight.");t&&$.ajax({url:n}).done(function(n){var t,i,r,u;n!=""&&($("div#"+n).remove(),t=n.split("-"),t.length==3&&(i=BST.Bible.CurrentBookCode==t[0],r=BST.Bible.CurrentChapterId==t[1],i&&r&&(u=".verse-"+t[2],$(u).removeClass("highlighted-verse").css("background-color",""))))})}};BST.BibleSideBarMyBookmarks={Init:function(){BST.ShrinkText("#bible-sidebar-container .bible-sidebar-bookmark-text",30)},AddBookmarks:function(n){var i=$(".scripture .selected-verse"),t,r;if($(i).length<=0){alert("Please select one or more verses to bookmark.");return}t=[];$(i).each(function(){var n,i;BST.Bible.GetContainerPrefixByElement(this)==BST.Bible.BibleContainerType.ParallelContainer?(n={TranslationCode:BST.Bible.CurrentTranslationCodeParallel,BookCode:BST.Bible.CurrentBookCodeParallel,ChapterId:parseInt(BST.Bible.CurrentChapterIdParallel,10),VerseStart:parseInt($(this).closest("div.verse").find("strong").html(),10)},t.push(n)):(i={TranslationCode:BST.Bible.CurrentTranslationCode,BookCode:BST.Bible.CurrentBookCode,ChapterId:parseInt(BST.Bible.CurrentChapterId,10),VerseStart:parseInt($(this).closest("div.verse").find("strong").html(),10)},t.push(i))});r=JSON.stringify({Bookmarks:t});$.ajax({url:n,type:"POST",data:r,contentType:"application/json",dataType:"json"}).done(function(n){n.length>0&&($("div.bible-sidebar-sub-menu-bookmarks").hasClass("bible-sidebar-submenu-active")&&BST.BibleSideBar.BibleSidebarLoad(),alert("All selected verses have been bookmarked successfully"),BST.Bible.DeselectAllVerses())})},DeleteBookmark:function(n){var t=window.confirm("This operation will delete this bookmark.");t&&$.ajax({url:n}).done(function(n){n!=""&&$("div#"+n).remove()})}};BST.BibleSideBarMyTags={TagControl:"div.tag-control div",LoadTagsUrl:"",Init:function(){BST.BibleSideBarMyTags.InitScriptureTagDropdown()},InitScriptureTagDropdown:function(){$("div.scripture-tag-dropdown a.dropdown-scripture-link").click(function(){$("div.scripture-tag-dropdown button.dropdown-selected").html($(this).html());$("#tags-by-scripture-container").removeClass("hidden");$("#tags-by-tag-id-container").addClass("hidden");BST.BibleSideBar.TagSort="scripture"});$("div.scripture-tag-dropdown a.dropdown-category-link").click(function(){$("div.scripture-tag-dropdown button.dropdown-selected").html($(this).html());$("#tags-by-tag-id-container").removeClass("hidden");$("#tags-by-scripture-container").addClass("hidden");BST.BibleSideBar.TagSort="category"})},SetLoadTagsUrl:function(n){BST.BibleSideBarMyTags.LoadTagsUrl=n},ToggleTags:function(n){var t=$(n).find("span"),i=$(n).closest("div.bible-sidebar-sub-title").next("ul.bible-sidebar-notes");$(t).hasClass("fa-chevron-right")?($(i).removeClass("hidden"),$(t).removeClass("fa-chevron-right").addClass("fa-chevron-down")):($(i).addClass("hidden"),$(t).removeClass("fa-chevron-down").addClass("fa-chevron-right"))},AddTag:function(n,t){var i=window.prompt(n),r;i!=null&&i!=""&&(BST.BibleSideBarMyTags.PreLoadTags(),r=JSON.stringify({tagText:i}),$.ajax({url:t,type:"POST",data:r,contentType:"application/json",dataType:"json"}).done(function(n){n>0&&BST.BibleSideBarMyTags.LoadTags(!1)}))},AddTagReference:function(n){var r=$(BST.Bible.BibleContainerType.BibleContainer+".scripture .selected-verse"),u=$(BST.Bible.BibleContainerType.ParallelContainer+".scripture .selected-verse"),i,f,e;if($(r).length<=0&&$(u).length<=0){alert("Please select one or more verses to highlight.");return}var t=[],o="tag-"+BST.Bible.CurrentTranslationCode+"-"+BST.Bible.CurrentBookCode+"-"+BST.Bible.CurrentChapterId+"-",s="tag-"+BST.Bible.CurrentTranslationCodeParallel+"-"+BST.Bible.CurrentBookCodeParallel+"-"+BST.Bible.CurrentChapterIdParallel+"-";if($(r).each(function(){var n=o+$(this).closest("div.verse").find("strong").html();t.push(n)}),$(u).each(function(){var n=s+$(this).closest("div.verse").find("strong").html();$.inArray(n,t)<=-1&&t.push(n)}),i=[],f=$('div.tag-control input[type="checkbox"]').each(function(){this.checked&&i.push($(this).val())}),i.length<=0){alert("Please select one or more tags.");return}BST.BibleSideBarMyTags.PreLoadTags();e=JSON.stringify({tagIds:i,verseIds:t});$.ajax({url:n,type:"POST",data:e,contentType:"application/json",dataType:"json"}).done(function(n){var t=f;n&&($("div.bible-sidebar-sub-menu-tags").hasClass("bible-sidebar-submenu-active")&&BST.BibleSideBar.BibleSidebarLoad(),$(t).each(function(){$(this).attr("checked",!1)}),alert("All selected verses have been tagged successfully"),BST.Bible.DeselectAllVerses(),$(".tag-control-loading").addClass("hidden"))})},PreLoadTags:function(){$(".tag-control").addClass("hidden");$(".tag-control-loading").removeClass("hidden")},PostLoadTags:function(){setTimeout(function(){$(".tag-control").removeClass("hidden");$(".tag-control-loading").addClass("hidden")},1e3)},LoadTags:function(n){$(BST.BibleSideBarMyTags.TagControl).empty().load(BST.BibleSideBarMyTags.LoadTagsUrl);n||BST.BibleSideBarMyTags.PostLoadTags()},GetMaxTags:function(){var n=0;$("#tags-cloud a").each(function(){var r=$(this).attr("id"),i=r.split("-"),t;i.length==2&&(t=parseInt(i[1],10),t>n&&(n=t));$(this).removeClass("max-items")});$('#tags-cloud a[id$="-'+n+'"]').each(function(){$(this).addClass("max-items")})},ShowAllTags:function(){$(".bible-sidebar-container-title span.show-all").addClass("hidden");$("#tags-by-tag-id-container div.bible-sidebar-sub-title").each(function(){$(this).removeClass("hidden");$(this).next("ul").addClass("hidden")});$("#tags-by-scripture-container span.tag").each(function(){$(this).removeClass("hidden");$(this).closest("div.row").removeClass("hidden")})},FilterTags:function(n){var t,i,r;BST.BibleSideBarMyTags.ShowAllTags();$(".bible-sidebar-container-title span.show-all").removeClass("hidden");t=$("#tags-by-tag-id-container #tag-row-"+n);i=$("#tags-by-tag-id-container div.bible-sidebar-sub-title").not(t);$(i).each(function(){$(this).next("ul").addClass("hidden");$(this).find("div.scripture-category-title span").removeClass("fa-chevron-down").addClass("fa-chevron-right");$(this).addClass("hidden")});r=$("#tags-by-scripture-container span.tag").not("#tags-by-scripture-container span.tag-item-"+n);$(r).each(function(){$(this).addClass("hidden");var n=$(this).closest("div.row");$(n).find("span.tag").not("span.hidden").length<=0&&$(n).addClass("hidden")})},DeleteTagAndVerses:function(n){var t=window.confirm("This operation will delete this tag.");t&&$.ajax({url:n}).done(function(n){n>0&&BST.BibleSideBar.BibleSidebarLoad()})},DeleteVerseAndTags:function(n){var t=window.confirm("This operation will delete this verse.");t&&$.ajax({url:n}).done(function(n){n!=""&&BST.BibleSideBar.BibleSidebarLoad()})},DeleteTagReference:function(n){var t=window.confirm("This operation will delete this item.");t&&$.ajax({url:n}).done(function(n){n.tagId>0&&n.tagReferenceId>0&&BST.BibleSideBar.BibleSidebarLoad()})}};BST.BibleSideBarCommunityNotes={SortBy:{Popular:0,Newest:1},Init:function(){BST.BibleSideBarCommunityNotes.InitSortByDropdown()},InitSortByDropdown:function(){$("div.sort-by-dropdown a.dropdown-popular-link").click(function(){$("div.sort-by-dropdown button.dropdown-selected").html($(this).html());$("#community-notes-by-popularity").removeClass("hidden");$("#community-notes-by-newest").addClass("hidden")});$("div.sort-by-dropdown a.dropdown-newest-link").click(function(){$("div.sort-by-dropdown button.dropdown-selected").html($(this).html());$("#community-notes-by-newest").removeClass("hidden");$("#community-notes-by-popularity").addClass("hidden")})},ShowMore:function(n,t){BST.BibleSideBarCommunityNotes.PreShowMore();$.ajax({url:n,cache:!1,success:function(n){t==BST.BibleSideBarCommunityNotes.SortBy.Popular?($("#community-notes-by-popularity ul").append(n),BST.ShrinkTextRead("#community-notes-by-popularity div.community-note-text",120),BST.BibleSideBarCommunityNotes.IncrementNextPage($("#community-notes-by-popularity div.show-more a"))):t==BST.BibleSideBarCommunityNotes.SortBy.Newest&&($("#community-notes-by-newest ul").append(n),BST.ShrinkTextRead("#community-notes-by-newest div.community-note-text",120),BST.BibleSideBarCommunityNotes.IncrementNextPage($("#community-notes-by-newest div.show-more a")));BST.BibleSideBarCommunityNotes.PostShowMore()}})},IncrementNextPage:function(n){var t=$(n).attr("onclick"),i=new RegExp("/get-more-[A-Za-z]+-([0-9]+)/","g"),r=i.exec(t),u=parseInt(r[1])+1;t=t.replace(i,function(n){var t=new RegExp("[0-9]+","g");return n.replace(t,u)});$(n).attr("onclick",t)},PreShowMore:function(){$("#community-notes-by-popularity div.show-more, #community-notes-by-newest div.show-more").addClass("hidden");$("#community-notes-loading").removeClass("hidden")},PostShowMore:function(){$("#community-notes-by-popularity div.show-more, #community-notes-by-newest div.show-more").removeClass("hidden");$("#community-notes-loading").addClass("hidden")}};BST.BibleSideBarCommunityTags={ShowMore:function(n){BST.BibleSideBarCommunityTags.PreShowMore();$.ajax({url:n,cache:!1,success:function(n){$("#community-tags-container ul").append(n);BST.BibleSideBarCommunityTags.IncrementNextPage($("#community-tags-container div.show-more a"));BST.BibleSideBarCommunityTags.PostShowMore()}})},IncrementNextPage:function(n){var t=$(n).attr("onclick"),i=new RegExp("/get-more-([0-9]+)/","g"),r=i.exec(t),u=parseInt(r[1])+1;t=t.replace(i,function(n){var t=new RegExp("[0-9]+","g");return n.replace(t,u)});$(n).attr("onclick",t)},PreShowMore:function(){$("#community-tags-container div.show-more").addClass("hidden");$("#community-tags-loading").removeClass("hidden")},PostShowMore:function(){$("#community-tags-container div.show-more").removeClass("hidden");$("#community-tags-loading").addClass("hidden")}};BST.Cookie={UserPreferencesCookieName:"_bupc",BibleSidebarCookieName:"_bupcc",GlobalCookieName:"_bupccc",SessionCookieName:"_bupcs",CookieExpirationTime:{FiveYears:1825},GlobalCookieKeys:{CommunitySubNavigation:0,SortBy:1,RecentTranslations:2},CreateCookie:function(n,t,i){var r,u;i?(r=new Date,r.setTime(r.getTime()+i*864e5),u="; expires="+r.toGMTString()):u="";document.cookie=n+"="+t+u+"; path=/"},ReadCookie:function(n){for(var t,r=n+"=",u=document.cookie.split(";"),i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1,t.length);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return null},ReadCookieValue:function(n,t){var e=BST.Cookie.ReadCookie(n),u,f,r,i;if(e!=null)for(u=t+"=",f=e.split("&"),r=0;r<f.length;r++){for(i=f[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(u)==0)return i.substring(u.length,i.length)}return null},AddCreateCookieValue:function(n,t,i,r){var u=BST.Cookie.ReadCookie(n),f=t+"="+i;u==null?BST.Cookie.CreateCookie(n,f,r):BST.Cookie.ReadCookieValue(n,t)!=null?BST.Cookie.EditCookieValue(n,t,i,r):(f="&"+f,u=u+f,BST.Cookie.CreateCookie(n,u,r))},EditCookieValue:function(n,t,i,r){var s=BST.Cookie.ReadCookie(n),h=t+"=",o,f,e,u,c;if(s!=null){for(o=s.split("&"),f="",e=0;e<o.length;e++){for(u=o[e];u.charAt(0)==" ";)u=u.substring(1,u.length);u.indexOf(h)==0&&(c=u.substring(h.length,u.length),u=u.replace(c,i));f=f+u;e<o.length-1&&(f=f+"&")}BST.Cookie.CreateCookie(n,f,r)}},EraseCookie:function(n){BST.Cookie.CreateCookie(n,"",-1)}};BST.VerseOfTheDay={Init:function(){BST.VerseOfTheDay.SetUpPageControls()},SetUpPageControls:function(){$(".verse-of-the-day-pager").click(function(n){n.preventDefault();var t=$(this).data("href");$("#verse-of-the-day-canvas").load(t,BST.VerseOfTheDay.SetUpPageControls)})}};BST.Community={CommunitySubNavigation:{CommunityNotes:0,MyNotes:1,MyGroupsNotes:2,AllGroups:3,MyGroups:4,CreateGroup:5},SortBy:{Newest:0,MostParticipants:1,MostPopular:2,ThisMonth:3,LatestActivity:4},UpdateLikeCountUrl:{},SetSubMenuCookieValue:function(n){var t=BST.Cookie.ReadCookieValue(BST.Cookie.GlobalCookieName,BST.Cookie.GlobalCookieKeys.CommunitySubNavigation);t==null?BST.Cookie.AddCreateCookieValue(BST.Cookie.GlobalCookieName,BST.Cookie.GlobalCookieKeys.CommunitySubNavigation,n,BST.Cookie.CookieExpirationTime.FiveYears):BST.Cookie.EditCookieValue(BST.Cookie.GlobalCookieName,BST.Cookie.GlobalCookieKeys.CommunitySubNavigation,n,BST.Cookie.CookieExpirationTime.FiveYears)},AjaxPagination:function(n,t){$(t).siblings("div.loading").removeClass("hidden");$(t).addClass("hidden");$(t).load(n,function(){var n=t;$(n).removeClass("hidden");$(n).siblings("div.loading").addClass("hidden")})}};BST.Community.Notes={Init:function(){BST.Community.Notes.SetSubMenu();BST.Community.Notes.SetOrderBy()},SetSubMenu:function(){var n=BST.Cookie.ReadCookieValue(BST.Cookie.GlobalCookieName,BST.Cookie.GlobalCookieKeys.CommunitySubNavigation);if(n!=null&&$("div.community-sub-menu li.my-notes").length>0){n=parseInt(n);switch(n){case BST.Community.CommunitySubNavigation.CommunityNotes:$("div.community-sub-menu li.all-notes").addClass("active");break;case BST.Community.CommunitySubNavigation.MyNotes:$("div.community-sub-menu li.my-notes").addClass("active");break;case BST.Community.CommunitySubNavigation.MyGroupsNotes:$("div.community-sub-menu li.my-groups-notes").addClass("active");break;default:$("div.community-sub-menu li.all-notes").addClass("active")}}else $("div.community-sub-menu li.all-notes").addClass("active")},SetOrderBy:function(){var i=$("div.community-sub-menu div.sort-by a.this-month"),t=$("div.community-sub-menu div.sort-by a.newest"),n=BST.Cookie.ReadCookieValue(BST.Cookie.GlobalCookieName,BST.Cookie.GlobalCookieKeys.SortBy);n!=null?(n=parseInt(n),n==BST.Community.SortBy.ThisMonth?$(i).addClass("active").attr("href","javascript:void(0);"):$(t).addClass("active").attr("href","javascript:void(0);")):$(t).addClass("active").attr("href","javascript:void(0);")},SubMenuCommunityNotes:function(n,t){$(n).closest("li").hasClass("active")||(BST.Community.SetSubMenuCookieValue(BST.Community.CommunitySubNavigation.CommunityNotes),window.location.href=t)},SubMenuMyNotes:function(n,t){$(n).closest("li").hasClass("active")||(BST.Community.SetSubMenuCookieValue(BST.Community.CommunitySubNavigation.MyNotes),window.location.href=t)},SubMenuMyGroupsNotes:function(n,t){$(n).closest("li").hasClass("active")||(BST.Community.SetSubMenuCookieValue(BST.Community.CommunitySubNavigation.MyGroupsNotes),window.location.href=t)},UpdateLikeCountClick:function(n,t,i){$.ajax({url:t,type:"POST",data:JSON.stringify({noteId:i}),contentType:"application/json",dataType:"json"}).done(function(t){var i=n;$(i).closest("div").next("div").find("span").text(t.result+" Likes")})}};BST.Community.Groups={CheckGroupAliasAvailabilityUrl:"",Init:function(){BST.Community.Groups.SetSubMenu();BST.Community.Groups.SetOrderBy()},SetSubMenu:function(){var n=BST.Cookie.ReadCookieValue(BST.Cookie.GlobalCookieName,BST.Cookie.GlobalCookieKeys.CommunitySubNavigation);if(n!=null&&$("div.community-sub-menu li.my-groups").length>0){n=parseInt(n);switch(n){case BST.Community.CommunitySubNavigation.MyGroups:$("div.community-sub-menu li.my-groups").addClass("active");break;case BST.Community.CommunitySubNavigation.AllGroups:$("div.community-sub-menu li.all-groups").addClass("active");break;case BST.Community.CommunitySubNavigation.CreateGroup:$("div.community-sub-menu li.create-group").addClass("active")}}else $("div.community-sub-menu li.all-groups").addClass("active")},SetOrderBy:function(){var i=$("div.community-sub-menu div.sort-by a.latest-activity"),t=$("div.community-sub-menu div.sort-by a.newest"),n=BST.Cookie.ReadCookieValue(BST.Cookie.GlobalCookieName,BST.Cookie.GlobalCookieKeys.SortBy);n!=null?(n=parseInt(n),n==BST.Community.SortBy.LatestActivity?$(i).addClass("active").attr("href","javascript:void(0);"):$(t).addClass("active").attr("href","javascript:void(0);")):$(t).addClass("active").attr("href","javascript:void(0);")},SubMenuAllGroups:function(n,t){$(n).closest("li").hasClass("active")||(window.location.href=t)},SubMenuMyGroups:function(n,t){$(n).closest("li").hasClass("active")||(window.location.href=t)},SubMenuCreateGroup:function(n,t){$(n).closest("li").hasClass("active")||(window.location.href=t)},SetDefaultSlug:function(n,t,i){var r=BST.Community.Groups.GetDefaultSlug(n,t);typeof i!="undefined"?i.toLowerCase()=="val"?t.val(r):t.html(r):t.html(r)},GetDefaultSlug:function(n){var t=n.val();return String.prototype.removeDiacritics=function(){for(var t=[[/[\300-\306]/g,"A"],[/[\340-\346]/g,"a"],[/[\310-\313]/g,"E"],[/[\350-\353]/g,"e"],[/[\314-\317]/g,"I"],[/[\354-\357]/g,"i"],[/[\322-\330]/g,"O"],[/[\362-\370]/g,"o"],[/[\331-\334]/g,"U"],[/[\371-\374]/g,"u"],[/[\321]/g,"N"],[/[\361]/g,"n"]],i=this,n=0;n<t.length;n++)i=i.replace(t[n][0],t[n][1]);return i},t=t.removeDiacritics(),t=t.replace(/ +/g,"-"),t=t.replace(/[^\w-]/g,""),t=t.toLowerCase(),t=t.replace(/-+/g,"-"),t=t.replace(/-$/,""),t.replace(/^-/,"")},SetCheckGroupAliasAvailabilityUrl:function(n){BST.Community.Groups.CheckGroupAliasAvailabilityUrl=n},CheckGroupAliasAvailability:function(){var n=$("span.aliasDisplay").html(),t=$('input[name="alias"]').val(),i=BST.Community.Groups.GetDefaultSlug($('input[name="title"]'));return n!==t?!1:n!==i?!1:i===""?!1:($.ajax({url:BST.Community.Groups.CheckGroupAliasAvailabilityUrl,type:"POST",data:JSON.stringify({alias:t}),contentType:"application/json",dataType:"json"}).done(function(n){var t=$("div.create-group-availability span.available"),i=$("div.create-group-availability span.unavailable-container");n.isAliasAvailable===!0?($(t).removeClass("hidden"),$(i).addClass("hidden")):($(t).addClass("hidden"),$(i).removeClass("hidden").find("span.alias").text(n.alias))}),!0)},InitAutoAlias:function(){$('input[name="title"]').keyup(function(){BST.Community.Groups.SetDefaultSlug($(this),$("span.aliasDisplay"));BST.Community.Groups.SetDefaultSlug($(this),$('input[name="alias"]'),"val")}).blur(function(){BST.Community.Groups.CheckGroupAliasAvailability();var n=$('input[name="title"]');$(n).removeClass("invalid");$(n).val()===""?$("div.create-group-availability").addClass("hidden"):$("div.create-group-availability").removeClass("hidden")});$("#createGroupSubmit").click(function(n){n.preventDefault();var t=$('input[name="title"]');t.val()===""&&$(t).addClass("invalid").focus();$("#createGroupForm").submit()})},CancelCreateGroup:function(n){window.location.href=n},SetGroupTypeDD:function(n,t){$('.create-group-row input[name="groupType"]').val(n);$(".create-group-row button.dropdown-toggle span.groupTypeTitleDD").text(t)}};BST.Home={Width:320,SearchUrl:"",SearchBoxTitle:"",SearchBoxLogo:"",SearchBoxUrl:"",SearchBoxText:"",BibleCategories:"",Badges:"",BadgesIndex:0,BadgesPagination:"",SearchProviderUrl:"",ShortUrl:"",Init:function(){$("#CustomSearchWidgetLink").click(function(){var n=$("#CustomSearchWidgetContainer");$(n).hasClass("hidden")?($(n).removeClass("hidden"),BST.Home.UpdateCustomSearchCode()):$(n).addClass("hidden")});$("#CustomSearchWidgetWidth").keydown(function(n){!n.shiftKey&&!n.ctrlKey&&!n.altKey&&(n.keyCode>=48&&n.keyCode<=57||n.keyCode>=96&&n.keyCode<=105||n.keyCode>=37&&n.keyCode<=40||n.keyCode==8||n.keyCode==9||n.keyCode==46)||n.preventDefault()});$("#CustomSearchWidgetWidth").blur(function(){var n=parseInt($(this).val());n<255||n>600?($(this).val("320"),BST.Home.Width=320):BST.Home.Width=n;BST.Home.UpdateCustomSearchCode()});$('#CustomSearchWidgetContainer input[type="checkbox"]').each(function(){$(this).click(function(){BST.Home.UpdateCustomSearchCode()})});$("#BadgesLink").click(function(){var n=$("#BadgesContainer");$(n).hasClass("hidden")?$(n).removeClass("hidden"):$(n).addClass("hidden")});BST.Home.Badges=$("#BadgesContainer div.badgeItem");$(BST.Home.Badges).each(function(){var n=$(this).find("img"),t,i;$(n).css("border","0");t=$(this).find("textarea");i=BST.StringFormat('<a href="{0}">{1}<\/a>',BST.Home.SearchUrl,$(n)[0].outerHTML);$(t).text(i)});$(BST.Home.Badges).eq(0).removeClass("hidden");BST.Home.BadgesPagination=$("#BadgesContainer ul.pagination li");$("#SearchProviderLink").click(function(n){n.preventDefault();window.external.AddSearchProvider(BST.Home.SearchProviderUrl)});$("#ShortUrlServiceLink").click(function(){var n=$("#ShortUrlServiceContainer");$(n).hasClass("hidden")?$(n).removeClass("hidden"):$(n).addClass("hidden")});$("#ShortUrlServiceTwitter").click(function(){var n=$("#ShortUrlServiceQuery"),t,i;$(n).val()==""?($(n).focus(),$(n).css("border","1px solid red")):(t=$("#ShortUrlServiceUrl"),$(t).val()==""?$("#LinkToBSTCreate").focus().css("border","1px solid red"):(i=$(n).val()+" - "+$(t).val(),window.open("http://twitter.com?status="+i,"_blank")))});$("#LinkToBSTCreate").click(function(){var t,n;$("#ShortUrlServiceUrl").val("");t=$("#ShortUrlServiceQuery");$(t).val()==""?($(t).focus(),$(t).css("border","1px solid red")):(n=BST.Home.ShortUrl,n=n.replace("lookuptext",$(t).val()),n=n.replace("translationcode",$("#ShortUrlServiceDdlHidden").val()),$.ajax({url:n,cache:!1,success:function(n){n=n.replace("~",$("#ShortUrlDdlHidden").val());$("#ShortUrlServiceUrl").val(n);$("#ShortUrlServiceTwitter").removeClass("hidden")}}))})},SetVariables:function(n,t,i,r,u,f,e,o){BST.Home.SearchUrl=n;BST.Home.SearchBoxUrl=t;BST.Home.SearchBoxLogo=i;BST.Home.SearchBoxTitle=r;BST.Home.SearchBoxText=u;BST.Home.BibleCategories=f;BST.Home.SearchProviderUrl=e;BST.Home.ShortUrl=o},SelectPreferredTranslation:function(n){var i=$(n).text(),t=$(n).next('input[type="hidden"]').val();$("#CustomSearchWidgetDdlSelected").text(i);$("#CustomSearchWidgetDdlHidden").val(t);$("#"+t).prop("checked",!0);BST.Home.UpdateCustomSearchCode()},SelectAllTranslations:function(){$('#CustomSearchWidgetTranslationsContainer input[type="checkbox"]').each(function(){$(this).prop("checked",!0);BST.Home.UpdateCustomSearchCode()})},DeselectAllTranslations:function(){$('#CustomSearchWidgetTranslationsContainer input[type="checkbox"]').each(function(){$(this).val()==$("#CustomSearchWidgetDdlHidden").val()?$(this).prop("checked",!0):$(this).prop("checked",!1);BST.Home.UpdateCustomSearchCode()})},UpdateCustomSearchCode:function(){var f=$("#CustomSearchWidgetDdlHidden").val(),n='<form id="bstSearchBox" target="_blank" method="get" action="'+BST.Home.SearchBoxUrl+'"><div style="width:'+BST.Home.Width+'px;"><div style="overflow:hidden; width:'+BST.Home.Width+'px;">',r,t,i,u;for($("#CustomSearchWidgetImg").prop("checked")&&(n+=BST.StringFormat('<a href="{0}" style="float:left; margin:0px 3px;"><img src="{1}" alt="{2}" style="border:0;" /><\/a>',BST.Home.SearchUrl,BST.Home.SearchBoxLogo,BST.Home.SearchBoxTitle)),n+=BST.StringFormat('<div class="title" style="float:left; margin:0px 3px; height:42px; display:block; line-height:45px;"><a href="{0}" style="color:#9d3300 !important;font-weight:bold;font-size:12pt;text-decoration:none;">{1}<\/a><\/div><\/div>',BST.Home.SearchBoxUrl,BST.Home.SearchBoxTitle),n+=BST.StringFormat('<div style="overflow:hidden; width:'+BST.Home.Width+'px;"><input type="text" value="{0}" onfocus="if (this.value == \'{0}\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'{0}\';" name="q" id="q" style="width:150px; margin:5px 5px 5px 0;"/>',BST.Home.SearchBoxText),n+='<select name="c" id="c" style="width:150px; margin:5px 5px 5px 0;">',r=BST.Home.BibleCategories.split("|"),i=0;i<r.length;i++)t=r[i].split(","),n+=t.length==1?BST.StringFormat('<option value="{0}">{1}<\/option>',t[0],t[0]):BST.StringFormat('<option value="{0}">{1}<\/option>',t[0],t[1]);n+="<\/select>";n+='<select name="t" id="t" style="width:200px; margin:5px 5px 5px 0;">';u=!1;$("#CustomSearchWidgetTranslationsContainer input[type=checkbox]").each(function(){$(this).prop("checked")&&(u=f==$(this).val(),n+=BST.StringFormat('<option value="{0}"{1}>{2}<\/option>',$(this).val(),u?' selected="selected"':"",$(this).next().text()))});n+="<\/select>";n+=BST.StringFormat('&nbsp;<input type="submit" value="{0}" id="search" style="width:100px; margin:5px 5px 5px 0;"/><\/div>',BST.Home.SearchBoxText);n+="<\/div><\/form>";$("#CustomSearchWidgetCode").val(n);$("#CustomSearchWidgetPreview").html(n);$("#CustomSearchWidgetPreview").css("width",BST.Home.Width);$("#CustomSearchWidgetPreview *").attr("readonly",!0);$("#CustomSearchWidgetPreview a").click(function(){return!1});$("#CustomSearchWidgetPreview input[type=submit]").click(function(){return!1})},BadgeFirstImage:function(n){$(n).closest("li").hasClass("disabled")||($(BST.Home.Badges).eq(BST.Home.BadgesIndex).addClass("hidden"),$(BST.Home.Badges).eq(0).removeClass("hidden"),BST.Home.BadgesIndex=0,$(BST.Home.BadgesPagination).eq(0).addClass("disabled"),$(BST.Home.BadgesPagination).eq(1).addClass("disabled"),$(BST.Home.BadgesPagination).eq(2).removeClass("disabled"),$(BST.Home.BadgesPagination).eq(3).removeClass("disabled"))},BadgePreviousImage:function(n){$(n).closest("li").hasClass("disabled")||BST.Home.BadgesIndex==0||($(BST.Home.Badges).eq(BST.Home.BadgesIndex).addClass("hidden"),BST.Home.BadgesIndex=BST.Home.BadgesIndex-1,$(BST.Home.Badges).eq(BST.Home.BadgesIndex).removeClass("hidden"),BST.Home.BadgesIndex==0?($(BST.Home.BadgesPagination).eq(0).addClass("disabled"),$(BST.Home.BadgesPagination).eq(1).addClass("disabled")):($(BST.Home.BadgesPagination).eq(0).removeClass("disabled"),$(BST.Home.BadgesPagination).eq(1).removeClass("disabled")),$(BST.Home.BadgesPagination).eq(2).removeClass("disabled"),$(BST.Home.BadgesPagination).eq(3).removeClass("disabled"))},BadgeNextImage:function(n){$(n).closest("li").hasClass("disabled")||BST.Home.BadgesIndex==BST.Home.Badges.length-1||($(BST.Home.Badges).eq(BST.Home.BadgesIndex).addClass("hidden"),BST.Home.BadgesIndex=BST.Home.BadgesIndex+1,$(BST.Home.Badges).eq(BST.Home.BadgesIndex).removeClass("hidden"),BST.Home.BadgesIndex==BST.Home.Badges.length-1?($(BST.Home.BadgesPagination).eq(2).addClass("disabled"),$(BST.Home.BadgesPagination).eq(3).addClass("disabled")):($(BST.Home.BadgesPagination).eq(2).removeClass("disabled"),$(BST.Home.BadgesPagination).eq(3).removeClass("disabled")),$(BST.Home.BadgesPagination).eq(0).removeClass("disabled"),$(BST.Home.BadgesPagination).eq(1).removeClass("disabled"))},BadgeLastImage:function(n){$(n).closest("li").hasClass("disabled")||($(BST.Home.Badges).eq(BST.Home.BadgesIndex).addClass("hidden"),$(BST.Home.Badges).eq(BST.Home.Badges.length-1).removeClass("hidden"),BST.Home.BadgesIndex=BST.Home.Badges.length-1,$(BST.Home.BadgesPagination).eq(0).removeClass("disabled"),$(BST.Home.BadgesPagination).eq(1).removeClass("disabled"),$(BST.Home.BadgesPagination).eq(2).addClass("disabled"),$(BST.Home.BadgesPagination).eq(3).addClass("disabled"))},SelectPreferredTranslationShortUrl:function(n){var i=$(n).text(),t=$(n).next('input[type="hidden"]').val();$("#ShortUrlServiceSelected").text(i);$("#ShortUrlServiceDdlHidden").val(t);$("#"+t).prop("checked",!0)},SelectShortUrl:function(n){var i=$(n).text(),t=$(n).next('input[type="hidden"]').val();$("#ShortUrlSelected").text(i);$("#ShortUrlDdlHidden").val(t);$("#"+t).prop("checked",!0)}};BST.Library={Init:function(){$("#LexiconPlayControl").on("click",function(){var n=$("#LexiconAudio");n.trigger("play")})}};$(document).ready(function(){BST.Library.Init()});BST.Breadcrums={BreadCrumbItems:"",Init:function(){BST.Breadcrums.BreadCrumbItems=$("#site-breadcrumbs ul.dropdown-menu");BST.Bible.BindAddRecentTranslation();BST.Breadcrums.AddTypeAhead();BST.Breadcrums.QuickNavigation();BST.Breadcrums.BindDropdownButtons()},AddTypeAhead:function(){var n=function(n){return function(t,i){var r,u;r=[];u=new RegExp(t,"i");$.each(n,function(n,t){u.test(t)&&r.push({value:t})});i(r)}};$(BST.Breadcrums.BreadCrumbItems).each(function(){var r=[],t=$(this),i;if($(t).length>0){$(t).prepend('<li><input class="typeahead filter" type="text" placeholder="Filter"/><\/li><li class="divider"><\/li>');$(t).find("input").click(function(){return!1});i=$(t).find("button");$(i).each(function(){r.push($(this).text().trim())});$(t).find(".typeahead").typeahead({hint:!1,minLength:1},{name:"data",displayKey:"value",source:n(r)}).on("typeahead:selected",function(n,t){var r=$(i).filter(function(){return $(this).text().trim()==t.value}).data("href");r!="undefined"&&r!=""&&(window.location=r)})}})},QuickNavigation:function(){$(".breadcrumbs select").change(function(){window.location=this.value})},BindDropdownButtons:function(){$("#site-breadcrumbs ul.dropdown-menu button.btn").click(function(){window.location=$(this).data("href")})}}