!function(){for(var e,t=function(){},n=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeline","timelineEnd","timeStamp","trace","warn"],r=n.length,i=window.console=window.console||{};r--;)e=n[r],i[e]||(i[e]=t)}(),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}return"function"==typeof window.CustomEvent?!1:(e.prototype=window.Event.prototype,void(window.CustomEvent=e))}(),function($){var e=$.event,t,n={_:0},r=0,i,o;t=e.special.throttledresize={setup:function(){$(this).on("resize",t.handler)},teardown:function(){$(this).off("resize",t.handler)},handler:function(a,s){var u=this,l=arguments;i=!0,o||(setInterval(function(){r++,(r>t.threshold&&i||s)&&(a.type="throttledresize",e.dispatch.apply(u,l),i=!1,r=0),r>9&&($(n).stop(),o=!1,r=0)},30),o=!0)},threshold:0}}(jQuery),function(e){var t;if("function"==typeof define&&define.amd&&(define(e),t=!0),"object"==typeof exports&&(module.exports=e(),t=!0),!t){var n=window.Cookies,r=window.Cookies=e();r.noConflict=function(){return window.Cookies=n,r}}}(function(){function e(){for(var e=0,t={};ep;p++)if(g=e[p],v=I.style[g],l(g,"-")&&(g=u(g)),I.style[g]!==n){if(o||r(i,"undefined"))return a(),"pfx"==t?g:!0;try{I.style[g]=i}catch(y){}if(I.style[g]!=v)return a(),"pfx"==t?g:!0}return a(),!1}function v(e,t){return function(){return e.apply(t,arguments)}}function m(e,t,n){var i;for(var o in e)if(e[o]in t)return n===!1?e[o]:(i=t[e[o]],r(i,"function")?v(i,n||t):i);return!1}function y(e,t,n,i,o){var a=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+N.join(a+" ")+a).split(" ");return r(t,"string")||r(t,"undefined")?g(s,t,i,o):(s=(e+" "+O.join(a+" ")+a).split(" "),m(s,t,n))}function w(e,t,r){return y(e,n,n,t,r)}var b=[],T=[],x={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){T.push({name:e,fn:t,options:n})},addAsyncTest:function(e){T.push({name:null,fn:e})}},E=function(){};E.prototype=x,E=new E,E.addTest("svg",!!t.createElementNS&&!!t.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect);var S=x._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];x._prefixes=S;var C=t.documentElement,k="svg"===C.nodeName.toLowerCase();k||!function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=w.elements;return"string"==typeof e?e.split(" "):e}function i(e,t){var n=w.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),w.elements=n+" "+e,l(t)}function o(e){var t=y[e[v]];return t||(t={},m++,e[v]=m,y[m]=t),t}function a(e,n,r){if(n||(n=t),f)return n.createElement(e);r||(r=o(n));var i;return i=r.cache[e]?r.cache[e].cloneNode():g.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!i.canHaveChildren||h.test(e)||i.tagUrn?i:r.frag.appendChild(i)}function s(e,n){if(e||(e=t),f)return e.createDocumentFragment();n=n||o(e);for(var i=n.frag.cloneNode(),a=0,s=r(),u=s.length;u>a;a++)i.createElement(s[a]);return i}function u(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return w.shivMethods?a(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(w,t.frag)}function l(e){e||(e=t);var r=o(e);return!w.shivCSS||c||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),f||u(e,r),e}var c,f,p="3.7.3",d=e.html5||{},h=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,g=/^(?: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,v="_html5shiv",m=0,y={};!function(){try{var e=t.createElement("a");e.innerHTML="",c="hidden"in e,f=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){c=!0,f=!0}}();var w={elements:d.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:p,shivCSS:d.shivCSS!==!1,supportsUnknownElements:f,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:l,createElement:a,createDocumentFragment:s,addElements:i};e.html5=w,l(t),"object"==typeof module&&module.exports&&(module.exports=w)}("undefined"!=typeof e?e:this,t);var _="Moz O ms Webkit",O=x._config.usePrefixes?_.toLowerCase().split(" "):[];x._domPrefixes=O;var j;!function(){var e={}.hasOwnProperty;j=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),x._l={},x.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),E.hasOwnProperty(e)&&setTimeout(function(){E._trigger(e,E[e])},0)},x._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e-1});var P="CSS"in e&&"supports"in e.CSS,U="supportsCSS"in e;E.addTest("supports",P||U);var M=x.testStyles=f;E.addTest("touchevents",function(){var n;if("ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch)n=!0;else{var r=["@media (",S.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");M(r,function(e){n=9===e.offsetTop})}return n});var D=function(){var e=navigator.userAgent,t=e.match(/w(eb)?osbrowser/gi),n=e.match(/windows phone/gi)&&e.match(/iemobile\/([0-9])+/gi)&&parseFloat(RegExp.$1)>=9;return t||n}();D?E.addTest("fontface",!1):M('@font-face {font-family:"font";src:url("https://")}',function(e,n){var r=t.getElementById("smodernizr"),i=r.sheet||r.styleSheet,o=i?i.cssRules&&i.cssRules[0]?i.cssRules[0].cssText:i.cssText||"":"",a=/src/i.test(o)&&0===o.indexOf(n.split(" ")[0]);E.addTest("fontface",a)}),M("#modernizr div {width:1px} #modernizr div:nth-child(2n) {width:2px;}",function(e){for(var t=e.getElementsByTagName("div"),n=!0,r=0;5>r;r++)n=n&&t[r].offsetWidth===r%2+1;E.addTest("nthchild",n)},5);var A=function(){var t=e.matchMedia||e.msMatchMedia;return t?function(e){var n=t(e);return n&&n.matches||!1}:function(t){var n=!1;return f("@media "+t+" { #modernizr { position: absolute; } }",function(t){n="absolute"==(e.getComputedStyle?e.getComputedStyle(t,null):t.currentStyle).position}),n}}();x.mq=A;var N=x._config.usePrefixes?_.split(" "):[];x._cssomPrefixes=N;var z=function(t){var r,i=S.length,o=e.CSSRule;if("undefined"==typeof o)return n;if(!t)return!1;if(t=t.replace(/^@/,""),r=t.replace(/-/g,"_").toUpperCase()+"_RULE",r in o)return"@"+t;for(var a=0;i>a;a++){var s=S[a],u=s.toUpperCase()+"_"+r;if(u in o)return"@-"+s.toLowerCase()+"-"+t}return!1};x.atRule=z;var L={elem:s("modernizr")};E._q.push(function(){delete L.elem});var I={style:L.elem.style};E._q.unshift(function(){delete I.style}),x.testProp=function(e,t,r){return g([e],n,t,r)},x.testAllProps=y;var F=x.prefixed=function(e,t,n){return 0===e.indexOf("@")?z(e):(-1!=e.indexOf("-")&&(e=u(e)),t?y(e,t,n):y(e,"pfx"))};E.addTest("objectfit",!!F("objectFit"),{aliases:["object-fit"]}),x.testAllProps=w,E.addTest("cssanimations",w("animationName","a",!0)),E.addTest("backgroundsize",w("backgroundSize","100%",!0)),E.addTest("borderradius",w("borderRadius","0px",!0)),function(){E.addTest("csscolumns",function(){var e=!1,t=w("columnCount");try{e=!!t,e&&(e=new Boolean(e))}catch(n){}return e});for(var e,t,n=["Width","Span","Fill","Gap","Rule","RuleColor","RuleStyle","RuleWidth","BreakBefore","BreakAfter","BreakInside"],r=0;r0)){var n=e.originalEvent?e.originalEvent:e;if(!n.pointerType||"mouse"!=n.pointerType||0!=t.fallbackToMouseEvents){var r,i=n.touches,o=i?i[0]:n;return $e=T,i?Qe=i.length:t.preventDefaultEvents!==!1&&e.preventDefault(),Ae=0,Ne=null,ze=null,Be=null,Le=0,Ie=0,Fe=0,He=1,qe=0,Ve=ve(),se(),fe(0,o),!i||Qe===t.fingers||t.fingers===w||q()?(Xe=Ce(),2==Qe&&(fe(1,i[1]),Ie=Fe=we(Je[0].start,Je[1].start)),(t.swipeStatus||t.pinchStatus)&&(r=D(n,$e))):r=!1,r===!1?($e=S,D(n,$e),r):(t.hold&&(tt=setTimeout($.proxy(function(){We.trigger("hold",[n.target]),t.hold&&(r=t.hold.call(We,n,n.target))},this),t.longTapThreshold)),ce(!0),null)}}}function v(e){var n=e.originalEvent?e.originalEvent:e;if($e!==E&&$e!==S&&!ue()){var r,i=n.touches,o=i?i[0]:n,a=pe(o);if(Ye=Ce(),i&&(Qe=i.length),t.hold&&clearTimeout(tt),$e=x,2==Qe&&(0==Ie?(fe(1,i[1]),Ie=Fe=we(Je[0].start,Je[1].start)):(pe(i[1]),Fe=we(Je[0].end,Je[1].end),Be=Te(Je[0].end,Je[1].end)),He=be(Ie,Fe),qe=Math.abs(Ie-Fe)),Qe===t.fingers||t.fingers===w||!i||q()){if(Ne=Se(a.start,a.end),ze=Se(a.last,a.end),F(e,ze),Ae=xe(a.start,a.end),Le=ye(),he(Ne,Ae),r=D(n,$e),!t.triggerOnTouchEnd||t.triggerOnTouchLeave){var s=!0;if(t.triggerOnTouchLeave){var u=ke(this);s=_e(a.end,u)}!t.triggerOnTouchEnd&&s?$e=M(x):t.triggerOnTouchLeave&&!s&&($e=M(E)),($e==S||$e==E)&&D(n,$e)}}else $e=S,D(n,$e);r===!1&&($e=S,D(n,$e))}}function j(e){var n=e.originalEvent?e.originalEvent:e,r=n.touches;if(r){if(r.length&&!ue())return ae(n),!0;if(r.length&&ue())return!0}return ue()&&(Qe=Ze),Ye=Ce(),Le=ye(),z()||!N()?($e=S,D(n,$e)):t.triggerOnTouchEnd||t.triggerOnTouchEnd===!1&&$e===x?(t.preventDefaultEvents!==!1&&e.preventDefault(),$e=E,D(n,$e)):!t.triggerOnTouchEnd&&Y()?($e=E,A(n,$e,d)):$e===x&&($e=S,D(n,$e)),ce(!1),null}function R(){Qe=0,Ye=0,Xe=0,Ie=0,Fe=0,He=1,se(),ce(!1)}function P(e){var n=e.originalEvent?e.originalEvent:e;t.triggerOnTouchLeave&&($e=M(E),D(n,$e))}function U(){We.unbind(Re,n),We.unbind(De,R),We.unbind(Pe,v),We.unbind(Ue,j),Me&&We.unbind(Me,P),ce(!1)}function M(e){var n=e,r=I(),i=N(),o=z();return!r||o?n=S:!i||e!=x||t.triggerOnTouchEnd&&!t.triggerOnTouchLeave?!i&&e==E&&t.triggerOnTouchLeave&&(n=S):n=E,n}function D(e,t){var n,r=e.touches;return(Q()||W())&&(n=A(e,t,f)),(B()||q())&&n!==!1&&(n=A(e,t,p)),ie()&&n!==!1?n=A(e,t,h):oe()&&n!==!1?n=A(e,t,g):re()&&n!==!1&&(n=A(e,t,d)),t===S&&R(e),t===E&&(r?r.length||R(e):R(e)),n}function A(e,n,l){var c;if(l==f){if(We.trigger("swipeStatus",[n,Ne||null,Ae||0,Le||0,Qe,Je,ze]),t.swipeStatus&&(c=t.swipeStatus.call(We,e,n,Ne||null,Ae||0,Le||0,Qe,Je,ze),c===!1))return!1;if(n==E&&V()){if(clearTimeout(et),clearTimeout(tt),We.trigger("swipe",[Ne,Ae,Le,Qe,Je,ze]),t.swipe&&(c=t.swipe.call(We,e,Ne,Ae,Le,Qe,Je,ze),c===!1))return!1;switch(Ne){case r:We.trigger("swipeLeft",[Ne,Ae,Le,Qe,Je,ze]),t.swipeLeft&&(c=t.swipeLeft.call(We,e,Ne,Ae,Le,Qe,Je,ze));break;case i:We.trigger("swipeRight",[Ne,Ae,Le,Qe,Je,ze]),t.swipeRight&&(c=t.swipeRight.call(We,e,Ne,Ae,Le,Qe,Je,ze));break;case o:We.trigger("swipeUp",[Ne,Ae,Le,Qe,Je,ze]),t.swipeUp&&(c=t.swipeUp.call(We,e,Ne,Ae,Le,Qe,Je,ze));break;case a:We.trigger("swipeDown",[Ne,Ae,Le,Qe,Je,ze]),t.swipeDown&&(c=t.swipeDown.call(We,e,Ne,Ae,Le,Qe,Je,ze))}}}if(l==p){if(We.trigger("pinchStatus",[n,Be||null,qe||0,Le||0,Qe,He,Je]),t.pinchStatus&&(c=t.pinchStatus.call(We,e,n,Be||null,qe||0,Le||0,Qe,He,Je),c===!1))return!1;if(n==E&&H())switch(Be){case s:We.trigger("pinchIn",[Be||null,qe||0,Le||0,Qe,He,Je]),t.pinchIn&&(c=t.pinchIn.call(We,e,Be||null,qe||0,Le||0,Qe,He,Je));break;case u:We.trigger("pinchOut",[Be||null,qe||0,Le||0,Qe,He,Je]),t.pinchOut&&(c=t.pinchOut.call(We,e,Be||null,qe||0,Le||0,Qe,He,Je))}}return l==d?(n===S||n===E)&&(clearTimeout(et),clearTimeout(tt),G()&&!ee()?(Ke=Ce(),et=setTimeout($.proxy(function(){Ke=null,We.trigger("tap",[e.target]),t.tap&&(c=t.tap.call(We,e,e.target))},this),t.doubleTapThreshold)):(Ke=null,We.trigger("tap",[e.target]),t.tap&&(c=t.tap.call(We,e,e.target)))):l==h?(n===S||n===E)&&(clearTimeout(et),clearTimeout(tt),Ke=null,We.trigger("doubletap",[e.target]),t.doubleTap&&(c=t.doubleTap.call(We,e,e.target))):l==g&&(n===S||n===E)&&(clearTimeout(et),Ke=null,We.trigger("longtap",[e.target]),t.longTap&&(c=t.longTap.call(We,e,e.target))),c}function N(){var e=!0;return null!==t.threshold&&(e=Ae>=t.threshold),e}function z(){var e=!1;return null!==t.cancelThreshold&&null!==Ne&&(e=ge(Ne)-Ae>=t.cancelThreshold),e}function L(){return null!==t.pinchThreshold?qe>=t.pinchThreshold:!0}function I(){var e;return e=t.maxTimeThreshold&&Le>=t.maxTimeThreshold?!1:!0}function F(e,n){if(t.preventDefaultEvents!==!1)if(t.allowPageScroll===l)e.preventDefault();else{var s=t.allowPageScroll===c;switch(n){case r:(t.swipeLeft&&s||!s&&t.allowPageScroll!=m)&&e.preventDefault();break;case i:(t.swipeRight&&s||!s&&t.allowPageScroll!=m)&&e.preventDefault();break;case o:(t.swipeUp&&s||!s&&t.allowPageScroll!=y)&&e.preventDefault();break;case a:(t.swipeDown&&s||!s&&t.allowPageScroll!=y)&&e.preventDefault();break;case l:}}}function H(){var e=J(),t=X(),n=L();return e&&t&&n}function q(){return!!(t.pinchStatus||t.pinchIn||t.pinchOut)}function B(){return!(!H()||!q())}function V(){var e=I(),t=N(),n=J(),r=X(),i=z(),o=!i&&r&&n&&t&&e;return o}function W(){return!!(t.swipe||t.swipeStatus||t.swipeLeft||t.swipeRight||t.swipeUp||t.swipeDown)}function Q(){return!(!V()||!W())}function J(){return Qe===t.fingers||t.fingers===w||!C}function X(){return 0!==Je[0].end.x}function Y(){return!!t.tap}function G(){return!!t.doubleTap}function Z(){return!!t.longTap}function K(){if(null==Ke)return!1;var e=Ce();return G()&&e-Ke<=t.doubleTapThreshold}function ee(){return K()}function te(){return(1===Qe||!C)&&(isNaN(Ae)||Aet.longTapThreshold&&b>Ae}function re(){return!(!te()||!Y())}function ie(){return!(!K()||!G())}function oe(){return!(!ne()||!Z())}function ae(e){Ge=Ce(),Ze=e.touches.length+1}function se(){Ge=0,Ze=0}function ue(){var e=!1;if(Ge){var n=Ce()-Ge;n<=t.fingerReleaseThreshold&&(e=!0)}return e}function le(){return!(We.data(O+"_intouch")!==!0)}function ce(e){We&&(e===!0?(We.bind(Pe,v),We.bind(Ue,j),Me&&We.bind(Me,P)):(We.unbind(Pe,v,!1),We.unbind(Ue,j,!1),Me&&We.unbind(Me,P,!1)),We.data(O+"_intouch",e===!0))}function fe(e,t){var n={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return n.start.x=n.last.x=n.end.x=t.pageX||t.clientX,n.start.y=n.last.y=n.end.y=t.pageY||t.clientY,Je[e]=n,n}function pe(e){var t=void 0!==e.identifier?e.identifier:0,n=de(t);return null===n&&(n=fe(t,e)),n.last.x=n.end.x,n.last.y=n.end.y,n.end.x=e.pageX||e.clientX,n.end.y=e.pageY||e.clientY,n}function de(e){return Je[e]||null}function he(e,t){e!=l&&(t=Math.max(t,ge(e)),Ve[e].distance=t)}function ge(e){return Ve[e]?Ve[e].distance:void 0}function ve(){var e={};return e[r]=me(r),e[i]=me(i),e[o]=me(o),e[a]=me(a),e}function me(e){return{direction:e,distance:0}}function ye(){return Ye-Xe}function we(e,t){var n=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);return Math.round(Math.sqrt(n*n+r*r))}function be(e,t){var n=t/e*1;return n.toFixed(2)}function Te(){return 1>He?u:s}function xe(e,t){return Math.round(Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)))}function Ee(e,t){var n=e.x-t.x,r=t.y-e.y,i=Math.atan2(r,n),o=Math.round(180*i/Math.PI);return 0>o&&(o=360-Math.abs(o)),o}function Se(e,t){if(Oe(e,t))return l;var n=Ee(e,t);return 45>=n&&n>=0?r:360>=n&&n>=315?r:n>=135&&225>=n?i:n>45&&135>n?a:o}function Ce(){var e=new Date;return e.getTime()}function ke(e){e=$(e);var t=e.offset(),n={left:t.left,right:t.left+e.outerWidth(),top:t.top,bottom:t.top+e.outerHeight()};return n}function _e(e,t){return e.x>t.left&&e.xt.top&&e.y0?o[o.length-1]:null;null===a?o.push(e):Math.floor(Math.abs(i-r))<=t?o[o.length-1]=a.add(e):o.push(e),i=r}),o},i=function(e){var t={byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof e?$.extend(t,e):("boolean"==typeof e?t.byRow=e:"remove"===e&&(t.remove=!0),t)},o=$.fn.matchHeight=function(e){var t=i(e);if(t.remove){var n=this;return this.css(t.property,""),$.each(o._groups,function(e,t){t.elements=t.elements.not(n)}),this}return this.length<=1&&!t.target?this:(o._groups.push({elements:this,options:t}),o._apply(this,t),this)};o.version="master",o._groups=[],o._throttle=80,o._maintainScroll=!1,o._beforeUpdate=null,o._afterUpdate=null,o._rows=r,o._parse=n,o._parseOptions=i,o._apply=function(e,t){var a=i(t),s=$(e),u=[s],l=$(window).scrollTop(),c=$("html").outerHeight(!0),f=s.parents().filter(":hidden");return f.each(function(){var e=$(this);e.data("style-cache",e.attr("style"))}),f.css("display","block"),a.byRow&&!a.target&&(s.each(function(){var e=$(this),t=e.css("display");"inline-block"!==t&&"flex"!==t&&"inline-flex"!==t&&(t="block"),e.data("style-cache",e.attr("style")),e.css({display:t,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),u=r(s),s.each(function(){var e=$(this);e.attr("style",e.data("style-cache")||"")})),$.each(u,function(e,t){var r=$(t),i=0;if(a.target)i=a.target.outerHeight(!1);else{if(a.byRow&&r.length<=1)return void r.css(a.property,"");r.each(function(){var e=$(this),t=e.attr("style"),n=e.css("display");"inline-block"!==n&&"flex"!==n&&"inline-flex"!==n&&(n="block");var r={display:n};r[a.property]="",e.css(r),e.outerHeight(!1)>i&&(i=e.outerHeight(!1)),t?e.attr("style",t):e.css("display","")})}r.each(function(){var e=$(this),t=0;a.target&&e.is(a.target)||("border-box"!==e.css("box-sizing")&&(t+=n(e.css("border-top-width"))+n(e.css("border-bottom-width")),t+=n(e.css("padding-top"))+n(e.css("padding-bottom"))),e.css(a.property,i-t+"px"))})}),f.each(function(){var e=$(this);e.attr("style",e.data("style-cache")||null)}),o._maintainScroll&&$(window).scrollTop(l/c*$("html").outerHeight(!0)),this},o._applyDataApi=function(){var e={};$("[data-match-height], [data-mh]").each(function(){var t=$(this),n=t.attr("data-mh")||t.attr("data-match-height");n in e?e[n]=e[n].add(t):e[n]=t}),$.each(e,function(){this.matchHeight(!0)})};var a=function(e){o._beforeUpdate&&o._beforeUpdate(e,o._groups),$.each(o._groups,function(){o._apply(this.elements,this.options)}),o._afterUpdate&&o._afterUpdate(e,o._groups)};o._update=function(n,r){if(r&&"resize"===r.type){var i=$(window).width();if(i===e)return;e=i}n?-1===t&&(t=setTimeout(function(){a(r),t=-1},o._throttle)):a(r)},$(o._applyDataApi);var s=$.fn.on?"on":"bind";$(window)[s]("load",function(e){o._update(!1,e)}),$(window)[s]("resize orientationchange",function(e){o._update(!0,e)})}),function e(t,n){"object"==typeof exports&&exports&&"string"!=typeof exports.nodeName?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):(t.Mustache={},n(t.Mustache))}(this,function t(e){function t(e){return"function"==typeof e}function n(e){return g(e)?"array":typeof e}function r(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(e,t){return null!=e&&"object"==typeof e&&t in e}function o(e,t){return v.call(e,t)}function a(e){return!o(m,e)}function s(e){return String(e).replace(/[&<>"'`=\/]/g,function t(e){return y[e]})}function u(t,n){function i(){if(d&&!h)for(;p.length;)delete u[p.pop()];else p=[];d=!1,h=!1}function o(e){if("string"==typeof e&&(e=e.split(b,2)),!g(e)||2!==e.length)throw new Error("Invalid tags: "+e);v=new RegExp(r(e[0])+"\\s*"),m=new RegExp("\\s*"+r(e[1])),y=new RegExp("\\s*"+r("}"+e[1]))}if(!t)return[];var s=[],u=[],p=[],d=!1,h=!1,v,m,y;o(n||e.tags);for(var S=new f(t),C,k,_,O,j,R;!S.eos();){if(C=S.pos,_=S.scanUntil(v))for(var P=0,U=_.length;U>P;++P)O=_.charAt(P),a(O)?p.push(u.length):h=!0,u.push(["text",O,C,C+1]),C+=1,"\n"===O&&i();if(!S.scan(v))break;if(d=!0,k=S.scan(E)||"name",S.scan(w),"="===k?(_=S.scanUntil(T),S.scan(T),S.scanUntil(m)):"{"===k?(_=S.scanUntil(y),S.scan(x),S.scanUntil(m),k="&"):_=S.scanUntil(m),!S.scan(m))throw new Error("Unclosed tag at "+S.pos);if(j=[k,_,C,S.pos],u.push(j),"#"===k||"^"===k)s.push(j);else if("/"===k){if(R=s.pop(),!R)throw new Error('Unopened section "'+_+'" at '+C);if(R[1]!==_)throw new Error('Unclosed section "'+R[1]+'" at '+C)}else"name"===k||"{"===k||"&"===k?h=!0:"="===k&&o(_)}if(R=s.pop())throw new Error('Unclosed section "'+R[1]+'" at '+S.pos);return c(l(u))}function l(e){for(var t=[],n,r,i=0,o=e.length;o>i;++i)n=e[i],n&&("text"===n[0]&&r&&"text"===r[0]?(r[1]+=n[1],r[3]=n[3]):(t.push(n),r=n));return t}function c(e){for(var t=[],n=t,r=[],i,o,a=0,s=e.length;s>a;++a)switch(i=e[a],i[0]){case"#":case"^":n.push(i),r.push(i),n=i[4]=[];break;case"/":o=r.pop(),o[5]=i[2],n=r.length>0?r[r.length-1][4]:t;break;default:n.push(i)}return t}function f(e){this.string=e,this.tail=e,this.pos=0}function p(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function d(){this.cache={}}var h=Object.prototype.toString,g=Array.isArray||function C(e){return"[object Array]"===h.call(e)},v=RegExp.prototype.test,m=/\S/,y={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},w=/\s*/,b=/\s+/,T=/\s*=/,x=/\s*\}/,E=/#|\^|\/|>|\{|&|=|!/;f.prototype.eos=function k(){return""===this.tail},f.prototype.scan=function _(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},f.prototype.scanUntil=function O(e){var t=this.tail.search(e),n;switch(t){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=n.length,n},p.prototype.push=function j(e){return new p(e,this)},p.prototype.lookup=function R(e){var n=this.cache,r;if(n.hasOwnProperty(e))r=n[e];else{for(var o=this,a,s,u=!1;o;){if(e.indexOf(".")>0)for(r=o.view,a=e.split("."),s=0;null!=r&&su;++u)s=void 0,o=e[u],a=o[0],"#"===a?s=this.renderSection(o,t,n,r):"^"===a?s=this.renderInverted(o,t,n,r):">"===a?s=this.renderPartial(o,t,n,r):"&"===a?s=this.unescapedValue(o,t):"name"===a?s=this.escapedValue(o,t):"text"===a&&(s=this.rawValue(o)),void 0!==s&&(i+=s);return i},d.prototype.renderSection=function A(e,n,r,i){function o(e){return a.render(e,n,r)}var a=this,s="",u=n.lookup(e[1]);if(u){if(g(u))for(var l=0,c=u.length;c>l;++l)s+=this.renderTokens(e[4],n.push(u[l]),r,i);else if("object"==typeof u||"string"==typeof u||"number"==typeof u)s+=this.renderTokens(e[4],n.push(u),r,i);else if(t(u)){if("string"!=typeof i)throw new Error("Cannot use higher-order sections without the original template");u=u.call(n.view,i.slice(e[3],e[5]),o),null!=u&&(s+=u)}else s+=this.renderTokens(e[4],n,r,i);return s}},d.prototype.renderInverted=function N(e,t,n,r){var i=t.lookup(e[1]);return!i||g(i)&&0===i.length?this.renderTokens(e[4],t,n,r):void 0},d.prototype.renderPartial=function z(e,n,r){if(r){var i=t(r)?r(e[1]):r[e[1]];return null!=i?this.renderTokens(this.parse(i),n,r,i):void 0}},d.prototype.unescapedValue=function L(e,t){var n=t.lookup(e[1]);return null!=n?n:void 0},d.prototype.escapedValue=function I(t,n){var r=n.lookup(t[1]);return null!=r?e.escape(r):void 0},d.prototype.rawValue=function F(e){return e[1]},e.name="mustache.js",e.version="2.3.0",e.tags=["{{","}}"];var S=new d;return e.clearCache=function H(){return S.clearCache()},e.parse=function q(e,t){return S.parse(e,t)},e.render=function B(e,t,r){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return S.render(e,t,r)},e.to_html=function V(n,r,i,o){var a=e.render(n,r,i);return t(o)?void o(a):a},e.escape=s,e.Scanner=f,e.Context=p,e.Writer=d,e});; /*! jPlayer 2.9.2 for jQuery ~ (c) 2009-2014 Happyworm Ltd ~ MIT License */ !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):b("object"==typeof exports?require("jquery"):a.jQuery?a.jQuery:a.Zepto)}(this,function(a,b){a.fn.jPlayer=function(c){var d="jPlayer",e="string"==typeof c,f=Array.prototype.slice.call(arguments,1),g=this;return c=!e&&f.length?a.extend.apply(null,[!0,c].concat(f)):c,e&&"_"===c.charAt(0)?g:(this.each(e?function(){var e=a(this).data(d),h=e&&a.isFunction(e[c])?e[c].apply(e,f):e;return h!==e&&h!==b?(g=h,!1):void 0}:function(){var b=a(this).data(d);b?b.option(c||{}):a(this).data(d,new a.jPlayer(c,this))}),g)},a.jPlayer=function(b,c){if(arguments.length){this.element=a(c),this.options=a.extend(!0,{},this.options,b);var d=this;this.element.bind("remove.jPlayer",function(){d.destroy()}),this._init()}},"function"!=typeof a.fn.stop&&(a.fn.stop=function(){}),a.jPlayer.emulateMethods="load play pause",a.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate",a.jPlayer.emulateOptions="muted volume",a.jPlayer.reservedEvent="ready flashreset resize repeat error warning",a.jPlayer.event={},a.each(["ready","setmedia","flashreset","resize","repeat","click","error","warning","loadstart","progress","suspend","abort","emptied","stalled","play","pause","loadedmetadata","loadeddata","waiting","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange"],function(){a.jPlayer.event[this]="jPlayer_"+this}),a.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","canplay","canplaythrough"],a.jPlayer.pause=function(){a.jPlayer.prototype.destroyRemoved(),a.each(a.jPlayer.prototype.instances,function(a,b){b.data("jPlayer").status.srcSet&&b.jPlayer("pause")})},a.jPlayer.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};var c=function(){this.init()};c.prototype={init:function(){this.options={timeFormat:a.jPlayer.timeFormat}},time:function(a){a=a&&"number"==typeof a?a:0;var b=new Date(1e3*a),c=b.getUTCHours(),d=this.options.timeFormat.showHour?b.getUTCMinutes():b.getUTCMinutes()+60*c,e=this.options.timeFormat.showMin?b.getUTCSeconds():b.getUTCSeconds()+60*d,f=this.options.timeFormat.padHour&&10>c?"0"+c:c,g=this.options.timeFormat.padMin&&10>d?"0"+d:d,h=this.options.timeFormat.padSec&&10>e?"0"+e:e,i="";return i+=this.options.timeFormat.showHour?f+this.options.timeFormat.sepHour:"",i+=this.options.timeFormat.showMin?g+this.options.timeFormat.sepMin:"",i+=this.options.timeFormat.showSec?h+this.options.timeFormat.sepSec:""}};var d=new c;a.jPlayer.convertTime=function(a){return d.time(a)},a.jPlayer.uaBrowser=function(a){var b=a.toLowerCase(),c=/(webkit)[ \/]([\w.]+)/,d=/(opera)(?:.*version)?[ \/]([\w.]+)/,e=/(msie) ([\w.]+)/,f=/(mozilla)(?:.*? rv:([\w.]+))?/,g=c.exec(b)||d.exec(b)||e.exec(b)||b.indexOf("compatible")<0&&f.exec(b)||[];return{browser:g[1]||"",version:g[2]||"0"}},a.jPlayer.uaPlatform=function(a){var b=a.toLowerCase(),c=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/,d=/(ipad|playbook)/,e=/(android)/,f=/(mobile)/,g=c.exec(b)||[],h=d.exec(b)||!f.exec(b)&&e.exec(b)||[];return g[1]&&(g[1]=g[1].replace(/\s/g,"_")),{platform:g[1]||"",tablet:h[1]||""}},a.jPlayer.browser={},a.jPlayer.platform={};var e=a.jPlayer.uaBrowser(navigator.userAgent);e.browser&&(a.jPlayer.browser[e.browser]=!0,a.jPlayer.browser.version=e.version);var f=a.jPlayer.uaPlatform(navigator.userAgent);f.platform&&(a.jPlayer.platform[f.platform]=!0,a.jPlayer.platform.mobile=!f.tablet,a.jPlayer.platform.tablet=!!f.tablet),a.jPlayer.getDocMode=function(){var b;return a.jPlayer.browser.msie&&(document.documentMode?b=document.documentMode:(b=5,document.compatMode&&"CSS1Compat"===document.compatMode&&(b=7))),b},a.jPlayer.browser.documentMode=a.jPlayer.getDocMode(),a.jPlayer.nativeFeatures={init:function(){var a,b,c,d=document,e=d.createElement("video"),f={w3c:["fullscreenEnabled","fullscreenElement","requestFullscreen","exitFullscreen","fullscreenchange","fullscreenerror"],moz:["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror"],webkit:["","webkitCurrentFullScreenElement","webkitRequestFullScreen","webkitCancelFullScreen","webkitfullscreenchange",""],webkitVideo:["webkitSupportsFullscreen","webkitDisplayingFullscreen","webkitEnterFullscreen","webkitExitFullscreen","",""],ms:["","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError"]},g=["w3c","moz","webkit","webkitVideo","ms"];for(this.fullscreen=a={support:{w3c:!!d[f.w3c[0]],moz:!!d[f.moz[0]],webkit:"function"==typeof d[f.webkit[3]],webkitVideo:"function"==typeof e[f.webkitVideo[2]],ms:"function"==typeof e[f.ms[2]]},used:{}},b=0,c=g.length;c>b;b++){var h=g[b];if(a.support[h]){a.spec=h,a.used[h]=!0;break}}if(a.spec){var i=f[a.spec];a.api={fullscreenEnabled:!0,fullscreenElement:function(a){return a=a?a:d,a[i[1]]},requestFullscreen:function(a){return a[i[2]]()},exitFullscreen:function(a){return a=a?a:d,a[i[3]]()}},a.event={fullscreenchange:i[4],fullscreenerror:i[5]}}else a.api={fullscreenEnabled:!1,fullscreenElement:function(){return null},requestFullscreen:function(){},exitFullscreen:function(){}},a.event={}}},a.jPlayer.nativeFeatures.init(),a.jPlayer.focus=null,a.jPlayer.keyIgnoreElementNames="A INPUT TEXTAREA SELECT BUTTON";var g=function(b){var c,d=a.jPlayer.focus;d&&(a.each(a.jPlayer.keyIgnoreElementNames.split(/\s+/g),function(a,d){return b.target.nodeName.toUpperCase()===d.toUpperCase()?(c=!0,!1):void 0}),c||a.each(d.options.keyBindings,function(c,e){return e&&a.isFunction(e.fn)&&("number"==typeof e.key&&b.which===e.key||"string"==typeof e.key&&b.key===e.key)?(b.preventDefault(),e.fn(d),!1):void 0}))};a.jPlayer.keys=function(b){var c="keydown.jPlayer";a(document.documentElement).unbind(c),b&&a(document.documentElement).bind(c,g)},a.jPlayer.keys(!0),a.jPlayer.prototype={count:0,version:{script:"2.9.2",needFlash:"2.9.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",auroraFormats:"wav",preload:"metadata",volume:.8,muted:!1,remainingDuration:!1,toggleDuration:!1,captureDuration:!0,playbackRate:1,defaultPlaybackRate:1,minPlaybackRate:.5,maxPlaybackRate:4,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",playbackRateBar:".jp-playback-rate-bar",playbackRateBarValue:".jp-playback-rate-bar-value",currentTime:".jp-current-time",duration:".jp-duration",title:".jp-title",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},stateClass:{playing:"jp-state-playing",seeking:"jp-state-seeking",muted:"jp-state-muted",looped:"jp-state-looped",fullScreen:"jp-state-full-screen",noVolume:"jp-state-no-volume"},useStateClassSkin:!1,autoBlur:!0,smoothPlayBar:!1,fullScreen:!1,fullWindow:!1,autohide:{restored:!1,full:!0,fadeIn:200,fadeOut:600,hold:1e3},loop:!1,repeat:function(b){b.jPlayer.options.loop?a(this).unbind(".jPlayerRepeat").bind(a.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){a(this).jPlayer("play")}):a(this).unbind(".jPlayerRepeat")},nativeVideoControls:{},noFullWindow:{msie:/msie [0-6]\./,ipad:/ipad.*?os [0-4]\./,iphone:/iphone/,ipod:/ipod/,android_pad:/android [0-3]\.(?!.*?mobile)/,android_phone:/(?=.*android)(?!.*chrome)(?=.*mobile)/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/,playbook:/playbook/},timeFormat:{},keyEnabled:!1,audioFullScreen:!1,keyBindings:{play:{key:80,fn:function(a){a.status.paused?a.play():a.pause()}},fullScreen:{key:70,fn:function(a){(a.status.video||a.options.audioFullScreen)&&a._setOption("fullScreen",!a.options.fullScreen)}},muted:{key:77,fn:function(a){a._muted(!a.options.muted)}},volumeUp:{key:190,fn:function(a){a.volume(a.options.volume+.1)}},volumeDown:{key:188,fn:function(a){a.volume(a.options.volume-.1)}},loop:{key:76,fn:function(a){a._loop(!a.options.loop)}}},verticalVolume:!1,verticalPlaybackRate:!1,globalVolume:!1,idPrefix:"jp",noConflict:"jQuery",emulateHtml:!1,consoleAlerts:!0,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,remaining:0,videoWidth:0,videoHeight:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:!1},solution:{html:!0,aurora:!0,flash:!0},format:{mp3:{codec:"audio/mpeg",flashCanPlay:!0,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},m3u8a:{codec:'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',flashCanPlay:!1,media:"audio"},m3ua:{codec:"audio/mpegurl",flashCanPlay:!1,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis, opus"',flashCanPlay:!1,media:"audio"},flac:{codec:"audio/x-flac",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"},m3u8v:{codec:'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!1,media:"video"},m3uv:{codec:"audio/mpegurl",flashCanPlay:!1,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 c=this;if(this.element.empty(),this.status=a.extend({},this.status),this.internal=a.extend({},this.internal),this.options.timeFormat=a.extend({},a.jPlayer.timeFormat,this.options.timeFormat),this.internal.cmdsIgnored=a.jPlayer.platform.ipad||a.jPlayer.platform.iphone||a.jPlayer.platform.ipod,this.internal.domNode=this.element.get(0),this.options.keyEnabled&&!a.jPlayer.focus&&(a.jPlayer.focus=this),this.androidFix={setMedia:!1,play:!1,pause:!1,time:0/0},a.jPlayer.platform.android&&(this.options.preload="auto"!==this.options.preload?"metadata":"auto"),this.formats=[],this.solutions=[],this.require={},this.htmlElement={},this.html={},this.html.audio={},this.html.video={},this.aurora={},this.aurora.formats=[],this.aurora.properties=[],this.flash={},this.css={},this.css.cs={},this.css.jq={},this.ancestorJq=[],this.options.volume=this._limitValue(this.options.volume,0,1),a.each(this.options.supplied.toLowerCase().split(","),function(b,d){var e=d.replace(/^\s+|\s+$/g,"");if(c.format[e]){var f=!1;a.each(c.formats,function(a,b){return e===b?(f=!0,!1):void 0}),f||c.formats.push(e)}}),a.each(this.options.solution.toLowerCase().split(","),function(b,d){var e=d.replace(/^\s+|\s+$/g,"");if(c.solution[e]){var f=!1;a.each(c.solutions,function(a,b){return e===b?(f=!0,!1):void 0}),f||c.solutions.push(e)}}),a.each(this.options.auroraFormats.toLowerCase().split(","),function(b,d){var e=d.replace(/^\s+|\s+$/g,"");if(c.format[e]){var f=!1;a.each(c.aurora.formats,function(a,b){return e===b?(f=!0,!1):void 0}),f||c.aurora.formats.push(e)}}),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=a.extend({},{id:this.element.attr("id"),jq:this.element}),this.internal.audio=a.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:b}),this.internal.video=a.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:b}),this.internal.flash=a.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:b,swf:this.options.swfPath+(".swf"!==this.options.swfPath.toLowerCase().slice(-4)?(this.options.swfPath&&"/"!==this.options.swfPath.slice(-1)?"/":"")+"jquery.jplayer.swf":"")}),this.internal.poster=a.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:b}),a.each(a.jPlayer.event,function(a,d){c.options[a]!==b&&(c.element.bind(d+".jPlayer",c.options[a]),c.options[a]=b)}),this.require.audio=!1,this.require.video=!1,a.each(this.formats,function(a,b){c.require[c.format[b].media]=!0}),this.options=this.require.video?a.extend(!0,{},this.optionsVideo,this.options):a.extend(!0,{},this.optionsAudio,this.options),this._setSize(),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow),this.status.noVolume=this._uaBlocklist(this.options.noVolume),a.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled&&this._fullscreenAddEventListeners(),this._restrictNativeVideoControls(),this.htmlElement.poster=document.createElement("img"),this.htmlElement.poster.id=this.internal.poster.id,this.htmlElement.poster.onload=function(){(!c.status.video||c.status.waitForPlay)&&c.internal.poster.jq.show()},this.element.append(this.htmlElement.poster),this.internal.poster.jq=a("#"+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(){c._trigger(a.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.1),this.html.canPlay={},this.aurora.canPlay={},this.flash.canPlay={},a.each(this.formats,function(b,d){c.html.canPlay[d]=c.html[c.format[d].media].available&&""!==c.htmlElement[c.format[d].media].canPlayType(c.format[d].codec),c.aurora.canPlay[d]=a.inArray(d,c.aurora.formats)>-1,c.flash.canPlay[d]=c.format[d].flashCanPlay&&c.flash.available}),this.html.desired=!1,this.aurora.desired=!1,this.flash.desired=!1,a.each(this.solutions,function(b,d){if(0===b)c[d].desired=!0;else{var e=!1,f=!1;a.each(c.formats,function(a,b){c[c.solutions[0]].canPlay[b]&&("video"===c.format[b].media?f=!0:e=!0)}),c[d].desired=c.require.audio&&!e||c.require.video&&!f}}),this.html.support={},this.aurora.support={},this.flash.support={},a.each(this.formats,function(a,b){c.html.support[b]=c.html.canPlay[b]&&c.html.desired,c.aurora.support[b]=c.aurora.canPlay[b]&&c.aurora.desired,c.flash.support[b]=c.flash.canPlay[b]&&c.flash.desired}),this.html.used=!1,this.aurora.used=!1,this.flash.used=!1,a.each(this.solutions,function(b,d){a.each(c.formats,function(a,b){return c[d].support[b]?(c[d].used=!0,!1):void 0})}),this._resetActive(),this._resetGate(),this._cssSelectorAncestor(this.options.cssSelectorAncestor),this.html.used||this.aurora.used||this.flash.used?this.css.jq.noSolution.length&&this.css.jq.noSolution.hide():(this._error({type:a.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:a.jPlayer.errorMsg.NO_SOLUTION,hint:a.jPlayer.errorHint.NO_SOLUTION}),this.css.jq.noSolution.length&&this.css.jq.noSolution.show()),this.flash.used){var d,e="jQuery="+encodeURI(this.options.noConflict)+"&id="+encodeURI(this.internal.self.id)+"&vol="+this.options.volume+"&muted="+this.options.muted;if(a.jPlayer.browser.msie&&(Number(a.jPlayer.browser.version)<9||a.jPlayer.browser.documentMode<9)){var f='',g=['','','','',''];d=document.createElement(f);for(var h=0;h0&&(d.internal.cmdsIgnored=!1),d._getHtmlStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.progress))},!1),b.addEventListener("loadeddata",function(){c.gate&&(d.androidFix.setMedia=!1,d.androidFix.play&&(d.androidFix.play=!1,d.play(d.androidFix.time)),d.androidFix.pause&&(d.androidFix.pause=!1,d.pause(d.androidFix.time)),d._trigger(a.jPlayer.event.loadeddata))},!1),b.addEventListener("timeupdate",function(){c.gate&&(d._getHtmlStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.timeupdate))},!1),b.addEventListener("durationchange",function(){c.gate&&(d._getHtmlStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.durationchange))},!1),b.addEventListener("play",function(){c.gate&&(d._updateButtons(!0),d._html_checkWaitForPlay(),d._trigger(a.jPlayer.event.play))},!1),b.addEventListener("playing",function(){c.gate&&(d._updateButtons(!0),d._seeked(),d._trigger(a.jPlayer.event.playing))},!1),b.addEventListener("pause",function(){c.gate&&(d._updateButtons(!1),d._trigger(a.jPlayer.event.pause))},!1),b.addEventListener("waiting",function(){c.gate&&(d._seeking(),d._trigger(a.jPlayer.event.waiting))},!1),b.addEventListener("seeking",function(){c.gate&&(d._seeking(),d._trigger(a.jPlayer.event.seeking))},!1),b.addEventListener("seeked",function(){c.gate&&(d._seeked(),d._trigger(a.jPlayer.event.seeked))},!1),b.addEventListener("volumechange",function(){c.gate&&(d.options.volume=b.volume,d.options.muted=b.muted,d._updateMute(),d._updateVolume(),d._trigger(a.jPlayer.event.volumechange))},!1),b.addEventListener("ratechange",function(){c.gate&&(d.options.defaultPlaybackRate=b.defaultPlaybackRate,d.options.playbackRate=b.playbackRate,d._updatePlaybackRate(),d._trigger(a.jPlayer.event.ratechange))},!1),b.addEventListener("suspend",function(){c.gate&&(d._seeked(),d._trigger(a.jPlayer.event.suspend))},!1),b.addEventListener("ended",function(){c.gate&&(a.jPlayer.browser.webkit||(d.htmlElement.media.currentTime=0),d.htmlElement.media.pause(),d._updateButtons(!1),d._getHtmlStatus(b,!0),d._updateInterface(),d._trigger(a.jPlayer.event.ended))},!1),b.addEventListener("error",function(){c.gate&&(d._updateButtons(!1),d._seeked(),d.status.srcSet&&(clearTimeout(d.internal.htmlDlyCmdId),d.status.waitForLoad=!0,d.status.waitForPlay=!0,d.status.video&&!d.status.nativeVideoControls&&d.internal.video.jq.css({width:"0px",height:"0px"}),d._validString(d.status.media.poster)&&!d.status.nativeVideoControls&&d.internal.poster.jq.show(),d.css.jq.videoPlay.length&&d.css.jq.videoPlay.show(),d._error({type:a.jPlayer.error.URL,context:d.status.src,message:a.jPlayer.errorMsg.URL,hint:a.jPlayer.errorHint.URL})))},!1),a.each(a.jPlayer.htmlEvent,function(e,f){b.addEventListener(this,function(){c.gate&&d._trigger(a.jPlayer.event[f])},!1)})},_addAuroraEventListeners:function(b,c){var d=this;b.volume=100*this.options.volume,b.on("progress",function(){c.gate&&(d.internal.cmdsIgnored&&this.readyState>0&&(d.internal.cmdsIgnored=!1),d._getAuroraStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.progress),b.duration>0&&d._trigger(a.jPlayer.event.timeupdate))},!1),b.on("ready",function(){c.gate&&d._trigger(a.jPlayer.event.loadeddata)},!1),b.on("duration",function(){c.gate&&(d._getAuroraStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.durationchange))},!1),b.on("end",function(){c.gate&&(d._updateButtons(!1),d._getAuroraStatus(b,!0),d._updateInterface(),d._trigger(a.jPlayer.event.ended))},!1),b.on("error",function(){c.gate&&(d._updateButtons(!1),d._seeked(),d.status.srcSet&&(d.status.waitForLoad=!0,d.status.waitForPlay=!0,d.status.video&&!d.status.nativeVideoControls&&d.internal.video.jq.css({width:"0px",height:"0px"}),d._validString(d.status.media.poster)&&!d.status.nativeVideoControls&&d.internal.poster.jq.show(),d.css.jq.videoPlay.length&&d.css.jq.videoPlay.show(),d._error({type:a.jPlayer.error.URL,context:d.status.src,message:a.jPlayer.errorMsg.URL,hint:a.jPlayer.errorHint.URL})))},!1)},_getHtmlStatus:function(a,b){var c=0,d=0,e=0,f=0;isFinite(a.duration)&&(this.status.duration=a.duration),c=a.currentTime,d=this.status.duration>0?100*c/this.status.duration:0,"object"==typeof a.seekable&&a.seekable.length>0?(e=this.status.duration>0?100*a.seekable.end(a.seekable.length-1)/this.status.duration:100,f=this.status.duration>0?100*a.currentTime/a.seekable.end(a.seekable.length-1):0):(e=100,f=d),b&&(c=0,f=0,d=0),this.status.seekPercent=e,this.status.currentPercentRelative=f,this.status.currentPercentAbsolute=d,this.status.currentTime=c,this.status.remaining=this.status.duration-this.status.currentTime,this.status.videoWidth=a.videoWidth,this.status.videoHeight=a.videoHeight,this.status.readyState=a.readyState,this.status.networkState=a.networkState,this.status.playbackRate=a.playbackRate,this.status.ended=a.ended},_getAuroraStatus:function(a,b){var c=0,d=0,e=0,f=0;this.status.duration=a.duration/1e3,c=a.currentTime/1e3,d=this.status.duration>0?100*c/this.status.duration:0,a.buffered>0?(e=this.status.duration>0?a.buffered*this.status.duration/this.status.duration:100,f=this.status.duration>0?c/(a.buffered*this.status.duration):0):(e=100,f=d),b&&(c=0,f=0,d=0),this.status.seekPercent=e,this.status.currentPercentRelative=f,this.status.currentPercentAbsolute=d,this.status.currentTime=c,this.status.remaining=this.status.duration-this.status.currentTime,this.status.readyState=4,this.status.networkState=0,this.status.playbackRate=1,this.status.ended=!1},_resetStatus:function(){this.status=a.extend({},this.status,a.jPlayer.prototype.status)},_trigger:function(b,c,d){var e=a.Event(b);e.jPlayer={},e.jPlayer.version=a.extend({},this.version),e.jPlayer.options=a.extend(!0,{},this.options),e.jPlayer.status=a.extend(!0,{},this.status),e.jPlayer.html=a.extend(!0,{},this.html),e.jPlayer.aurora=a.extend(!0,{},this.aurora),e.jPlayer.flash=a.extend(!0,{},this.flash),c&&(e.jPlayer.error=a.extend({},c)),d&&(e.jPlayer.warning=a.extend({},d)),this.element.trigger(e)},jPlayerFlashEvent:function(b,c){if(b===a.jPlayer.event.ready)if(this.internal.ready){if(this.flash.gate){if(this.status.srcSet){var d=this.status.currentTime,e=this.status.paused;this.setMedia(this.status.media),this.volumeWorker(this.options.volume),d>0&&(e?this.pause(d):this.play(d))}this._trigger(a.jPlayer.event.flashreset)}}else this.internal.ready=!0,this.internal.flash.jq.css({width:"0px",height:"0px"}),this.version.flash=c.version,this.version.needFlash!==this.version.flash&&this._error({type:a.jPlayer.error.VERSION,context:this.version.flash,message:a.jPlayer.errorMsg.VERSION+this.version.flash,hint:a.jPlayer.errorHint.VERSION}),this._trigger(a.jPlayer.event.repeat),this._trigger(b);if(this.flash.gate)switch(b){case a.jPlayer.event.progress:this._getFlashStatus(c),this._updateInterface(),this._trigger(b);break;case a.jPlayer.event.timeupdate:this._getFlashStatus(c),this._updateInterface(),this._trigger(b);break;case a.jPlayer.event.play:this._seeked(),this._updateButtons(!0),this._trigger(b);break;case a.jPlayer.event.pause:this._updateButtons(!1),this._trigger(b);break;case a.jPlayer.event.ended:this._updateButtons(!1),this._trigger(b);break;case a.jPlayer.event.click:this._trigger(b);break;case a.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:a.jPlayer.error.URL,context:c.src,message:a.jPlayer.errorMsg.URL,hint:a.jPlayer.errorHint.URL});break;case a.jPlayer.event.seeking:this._seeking(),this._trigger(b);break;case a.jPlayer.event.seeked:this._seeked(),this._trigger(b);break;case a.jPlayer.event.ready:break;default:this._trigger(b)}return!1},_getFlashStatus:function(a){this.status.seekPercent=a.seekPercent,this.status.currentPercentRelative=a.currentPercentRelative,this.status.currentPercentAbsolute=a.currentPercentAbsolute,this.status.currentTime=a.currentTime,this.status.duration=a.duration,this.status.remaining=a.duration-a.currentTime,this.status.videoWidth=a.videoWidth,this.status.videoHeight=a.videoHeight,this.status.readyState=4,this.status.networkState=0,this.status.playbackRate=1,this.status.ended=!1},_updateButtons:function(a){a===b?a=!this.status.paused:this.status.paused=!a,a?this.addStateClass("playing"):this.removeStateClass("playing"),!this.status.noFullWindow&&this.options.fullWindow?this.addStateClass("fullScreen"):this.removeStateClass("fullScreen"),this.options.loop?this.addStateClass("looped"):this.removeStateClass("looped"),this.css.jq.play.length&&this.css.jq.pause.length&&(a?(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.noFullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.hide()):this.options.fullWindow?(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.options.smoothPlayBar?this.css.jq.playBar.stop().animate({width:this.status.currentPercentAbsolute+"%"},250,"linear"):this.css.jq.playBar.width(this.status.currentPercentRelative+"%"));var a="";this.css.jq.currentTime.length&&(a=this._convertTime(this.status.currentTime),a!==this.css.jq.currentTime.text()&&this.css.jq.currentTime.text(this._convertTime(this.status.currentTime)));var b="",c=this.status.duration,d=this.status.remaining;this.css.jq.duration.length&&("string"==typeof this.status.media.duration?b=this.status.media.duration:("number"==typeof this.status.media.duration&&(c=this.status.media.duration,d=c-this.status.currentTime),b=this.options.remainingDuration?(d>0?"-":"")+this._convertTime(d):this._convertTime(c)),b!==this.css.jq.duration.text()&&this.css.jq.duration.text(b))},_convertTime:c.prototype.time,_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg"),this.addStateClass("seeking")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg"),this.removeStateClass("seeking")},_resetGate:function(){this.html.audio.gate=!1,this.html.video.gate=!1,this.aurora.gate=!1,this.flash.gate=!1},_resetActive:function(){this.html.active=!1,this.aurora.active=!1,this.flash.active=!1},_escapeHtml:function(a){return a.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""")},_qualifyURL:function(a){var b=document.createElement("div"); return b.innerHTML='x',b.firstChild.href},_absoluteMediaUrls:function(b){var c=this;return a.each(b,function(a,d){d&&c.format[a]&&"data:"!==d.substr(0,5)&&(b[a]=c._qualifyURL(d))}),b},addStateClass:function(a){this.ancestorJq.length&&this.ancestorJq.addClass(this.options.stateClass[a])},removeStateClass:function(a){this.ancestorJq.length&&this.ancestorJq.removeClass(this.options.stateClass[a])},setMedia:function(b){var c=this,d=!1,e=this.status.media.poster!==b.poster;this._resetMedia(),this._resetGate(),this._resetActive(),this.androidFix.setMedia=!1,this.androidFix.play=!1,this.androidFix.pause=!1,b=this._absoluteMediaUrls(b),a.each(this.formats,function(e,f){var g="video"===c.format[f].media;return a.each(c.solutions,function(e,h){if(c[h].support[f]&&c._validString(b[f])){var i="html"===h,j="aurora"===h;return g?(i?(c.html.video.gate=!0,c._html_setVideo(b),c.html.active=!0):(c.flash.gate=!0,c._flash_setVideo(b),c.flash.active=!0),c.css.jq.videoPlay.length&&c.css.jq.videoPlay.show(),c.status.video=!0):(i?(c.html.audio.gate=!0,c._html_setAudio(b),c.html.active=!0,a.jPlayer.platform.android&&(c.androidFix.setMedia=!0)):j?(c.aurora.gate=!0,c._aurora_setAudio(b),c.aurora.active=!0):(c.flash.gate=!0,c._flash_setAudio(b),c.flash.active=!0),c.css.jq.videoPlay.length&&c.css.jq.videoPlay.hide(),c.status.video=!1),d=!0,!1}}),d?!1:void 0}),d?(this.status.nativeVideoControls&&this.html.video.gate||this._validString(b.poster)&&(e?this.htmlElement.poster.src=b.poster:this.internal.poster.jq.show()),"string"==typeof b.title&&(this.css.jq.title.length&&this.css.jq.title.html(b.title),this.htmlElement.audio&&this.htmlElement.audio.setAttribute("title",b.title),this.htmlElement.video&&this.htmlElement.video.setAttribute("title",b.title)),this.status.srcSet=!0,this.status.media=a.extend({},b),this._updateButtons(!1),this._updateInterface(),this._trigger(a.jPlayer.event.setmedia)):this._error({type:a.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:a.jPlayer.errorMsg.NO_SUPPORT,hint:a.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.aurora.active?this._aurora_resetMedia():this.flash.active&&this._flash_resetMedia()},clearMedia:function(){this._resetMedia(),this.html.active?this._html_clearMedia():this.aurora.active?this._aurora_clearMedia():this.flash.active&&this._flash_clearMedia(),this._resetGate(),this._resetActive()},load:function(){this.status.srcSet?this.html.active?this._html_load():this.aurora.active?this._aurora_load():this.flash.active&&this._flash_load():this._urlNotSetError("load")},focus:function(){this.options.keyEnabled&&(a.jPlayer.focus=this)},play:function(a){var b="object"==typeof a;b&&this.options.useStateClassSkin&&!this.status.paused?this.pause(a):(a="number"==typeof a?a:0/0,this.status.srcSet?(this.focus(),this.html.active?this._html_play(a):this.aurora.active?this._aurora_play(a):this.flash.active&&this._flash_play(a)):this._urlNotSetError("play"))},videoPlay:function(){this.play()},pause:function(a){a="number"==typeof a?a:0/0,this.status.srcSet?this.html.active?this._html_pause(a):this.aurora.active?this._aurora_pause(a):this.flash.active&&this._flash_pause(a):this._urlNotSetError("pause")},tellOthers:function(b,c){var d=this,e="function"==typeof c,f=Array.prototype.slice.call(arguments);"string"==typeof b&&(e&&f.splice(1,1),a.jPlayer.prototype.destroyRemoved(),a.each(this.instances,function(){d.element!==this&&(!e||c.call(this.data("jPlayer"),d))&&this.jPlayer.apply(this,f)}))},pauseOthers:function(a){this.tellOthers("pause",function(){return this.status.srcSet},a)},stop:function(){this.status.srcSet?this.html.active?this._html_pause(0):this.aurora.active?this._aurora_pause(0):this.flash.active&&this._flash_pause(0):this._urlNotSetError("stop")},playHead:function(a){a=this._limitValue(a,0,100),this.status.srcSet?this.html.active?this._html_playHead(a):this.aurora.active?this._aurora_playHead(a):this.flash.active&&this._flash_playHead(a):this._urlNotSetError("playHead")},_muted:function(a){this.mutedWorker(a),this.options.globalVolume&&this.tellOthers("mutedWorker",function(){return this.options.globalVolume},a)},mutedWorker:function(b){this.options.muted=b,this.html.used&&this._html_setProperty("muted",b),this.aurora.used&&this._aurora_mute(b),this.flash.used&&this._flash_mute(b),this.html.video.gate||this.html.audio.gate||(this._updateMute(b),this._updateVolume(this.options.volume),this._trigger(a.jPlayer.event.volumechange))},mute:function(a){var c="object"==typeof a;c&&this.options.useStateClassSkin&&this.options.muted?this._muted(!1):(a=a===b?!0:!!a,this._muted(a))},unmute:function(a){a=a===b?!0:!!a,this._muted(!a)},_updateMute:function(a){a===b&&(a=this.options.muted),a?this.addStateClass("muted"):this.removeStateClass("muted"),this.css.jq.mute.length&&this.css.jq.unmute.length&&(this.status.noVolume?(this.css.jq.mute.hide(),this.css.jq.unmute.hide()):a?(this.css.jq.mute.hide(),this.css.jq.unmute.show()):(this.css.jq.mute.show(),this.css.jq.unmute.hide()))},volume:function(a){this.volumeWorker(a),this.options.globalVolume&&this.tellOthers("volumeWorker",function(){return this.options.globalVolume},a)},volumeWorker:function(b){b=this._limitValue(b,0,1),this.options.volume=b,this.html.used&&this._html_setProperty("volume",b),this.aurora.used&&this._aurora_volume(b),this.flash.used&&this._flash_volume(b),this.html.video.gate||this.html.audio.gate||(this._updateVolume(b),this._trigger(a.jPlayer.event.volumechange))},volumeBar:function(b){if(this.css.jq.volumeBar.length){var c=a(b.currentTarget),d=c.offset(),e=b.pageX-d.left,f=c.width(),g=c.height()-b.pageY+d.top,h=c.height();this.volume(this.options.verticalVolume?g/h:e/f)}this.options.muted&&this._muted(!1)},_updateVolume:function(a){a===b&&(a=this.options.volume),a=this.options.muted?0:a,this.status.noVolume?(this.addStateClass("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.removeStateClass("noVolume"),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"](100*a+"%")),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.show())},volumeMax:function(){this.volume(1),this.options.muted&&this._muted(!1)},_cssSelectorAncestor:function(b){var c=this;this.options.cssSelectorAncestor=b,this._removeUiClass(),this.ancestorJq=b?a(b):[],b&&1!==this.ancestorJq.length&&this._warning({type:a.jPlayer.warning.CSS_SELECTOR_COUNT,context:b,message:a.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:a.jPlayer.warningHint.CSS_SELECTOR_COUNT}),this._addUiClass(),a.each(this.options.cssSelector,function(a,b){c._cssSelector(a,b)}),this._updateInterface(),this._updateButtons(),this._updateAutohide(),this._updateVolume(),this._updateMute()},_cssSelector:function(b,c){var d=this;if("string"==typeof c)if(a.jPlayer.prototype.options.cssSelector[b]){if(this.css.jq[b]&&this.css.jq[b].length&&this.css.jq[b].unbind(".jPlayer"),this.options.cssSelector[b]=c,this.css.cs[b]=this.options.cssSelectorAncestor+" "+c,this.css.jq[b]=c?a(this.css.cs[b]):[],this.css.jq[b].length&&this[b]){var e=function(c){c.preventDefault(),d[b](c),d.options.autoBlur?a(this).blur():a(this).focus()};this.css.jq[b].bind("click.jPlayer",e)}c&&1!==this.css.jq[b].length&&this._warning({type:a.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[b],message:a.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[b].length+" found for "+b+" method.",hint:a.jPlayer.warningHint.CSS_SELECTOR_COUNT})}else this._warning({type:a.jPlayer.warning.CSS_SELECTOR_METHOD,context:b,message:a.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:a.jPlayer.warningHint.CSS_SELECTOR_METHOD});else this._warning({type:a.jPlayer.warning.CSS_SELECTOR_STRING,context:c,message:a.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:a.jPlayer.warningHint.CSS_SELECTOR_STRING})},duration:function(a){this.options.toggleDuration&&(this.options.captureDuration&&a.stopPropagation(),this._setOption("remainingDuration",!this.options.remainingDuration))},seekBar:function(b){if(this.css.jq.seekBar.length){var c=a(b.currentTarget),d=c.offset(),e=b.pageX-d.left,f=c.width(),g=100*e/f;this.playHead(g)}},playbackRate:function(a){this._setOption("playbackRate",a)},playbackRateBar:function(b){if(this.css.jq.playbackRateBar.length){var c,d,e=a(b.currentTarget),f=e.offset(),g=b.pageX-f.left,h=e.width(),i=e.height()-b.pageY+f.top,j=e.height();c=this.options.verticalPlaybackRate?i/j:g/h,d=c*(this.options.maxPlaybackRate-this.options.minPlaybackRate)+this.options.minPlaybackRate,this.playbackRate(d)}},_updatePlaybackRate:function(){var a=this.options.playbackRate,b=(a-this.options.minPlaybackRate)/(this.options.maxPlaybackRate-this.options.minPlaybackRate);this.status.playbackRateEnabled?(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.show(),this.css.jq.playbackRateBarValue.length&&(this.css.jq.playbackRateBarValue.show(),this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate?"height":"width"](100*b+"%"))):(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.hide(),this.css.jq.playbackRateBarValue.length&&this.css.jq.playbackRateBarValue.hide())},repeat:function(a){var b="object"==typeof a;this._loop(b&&this.options.useStateClassSkin&&this.options.loop?!1:!0)},repeatOff:function(){this._loop(!1)},_loop:function(b){this.options.loop!==b&&(this.options.loop=b,this._updateButtons(),this._trigger(a.jPlayer.event.repeat))},option:function(c,d){var e=c;if(0===arguments.length)return a.extend(!0,{},this.options);if("string"==typeof c){var f=c.split(".");if(d===b){for(var g=a.extend(!0,{},this.options),h=0;h0||Math.floor(d)>0):e=!0,a.internal.mouse={x:b.pageX,y:b.pageY},e&&a.css.jq.gui.fadeIn(a.options.autohide.fadeIn,function(){clearTimeout(a.internal.autohideId),a.internal.autohideId=setTimeout(function(){a.css.jq.gui.fadeOut(a.options.autohide.fadeOut)},a.options.autohide.hold)})};this.css.jq.gui.length&&(this.css.jq.gui.stop(!0,!0),clearTimeout(this.internal.autohideId),delete this.internal.mouse,this.element.unbind(c),this.css.jq.gui.unbind(c),this.status.nativeVideoControls?this.css.jq.gui.hide():this.options.fullWindow&&this.options.autohide.full||!this.options.fullWindow&&this.options.autohide.restored?(this.element.bind(d,e),this.css.jq.gui.bind(d,e),this.css.jq.gui.hide()):this.css.jq.gui.show())},fullScreen:function(a){var b="object"==typeof a;b&&this.options.useStateClassSkin&&this.options.fullScreen?this._setOption("fullScreen",!1):this._setOption("fullScreen",!0)},restoreScreen:function(){this._setOption("fullScreen",!1)},_fullscreenAddEventListeners:function(){var b=this,c=a.jPlayer.nativeFeatures.fullscreen;c.api.fullscreenEnabled&&c.event.fullscreenchange&&("function"!=typeof this.internal.fullscreenchangeHandler&&(this.internal.fullscreenchangeHandler=function(){b._fullscreenchange()}),document.addEventListener(c.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1))},_fullscreenRemoveEventListeners:function(){var b=a.jPlayer.nativeFeatures.fullscreen;this.internal.fullscreenchangeHandler&&document.removeEventListener(b.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1)},_fullscreenchange:function(){this.options.fullScreen&&!a.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()&&this._setOption("fullScreen",!1)},_requestFullscreen:function(){var b=this.ancestorJq.length?this.ancestorJq[0]:this.element[0],c=a.jPlayer.nativeFeatures.fullscreen;c.used.webkitVideo&&(b=this.htmlElement.video),c.api.fullscreenEnabled&&c.api.requestFullscreen(b)},_exitFullscreen:function(){var b,c=a.jPlayer.nativeFeatures.fullscreen;c.used.webkitVideo&&(b=this.htmlElement.video),c.api.fullscreenEnabled&&c.api.exitFullscreen(b)},_html_initMedia:function(b){var c=a(this.htmlElement.media).empty();a.each(b.track||[],function(a,b){var d=document.createElement("track");d.setAttribute("kind",b.kind?b.kind:""),d.setAttribute("src",b.src?b.src:""),d.setAttribute("srclang",b.srclang?b.srclang:""),d.setAttribute("label",b.label?b.label:""),b.def&&d.setAttribute("default",b.def),c.append(d)}),this.htmlElement.media.src=this.status.src,"none"!==this.options.preload&&this._html_load(),this._trigger(a.jPlayer.event.timeupdate)},_html_setFormat:function(b){var c=this;a.each(this.formats,function(a,d){return c.html.support[d]&&b[d]?(c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1):void 0})},_html_setAudio:function(a){this._html_setFormat(a),this.htmlElement.media=this.htmlElement.audio,this._html_initMedia(a)},_html_setVideo:function(a){this._html_setFormat(a),this.status.nativeVideoControls&&(this.htmlElement.video.poster=this._validString(a.poster)?a.poster:""),this.htmlElement.media=this.htmlElement.video,this._html_initMedia(a)},_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="about:blank",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(a){var b=this,c=this.htmlElement.media;if(this.androidFix.pause=!1,this._html_load(),this.androidFix.setMedia)this.androidFix.play=!0,this.androidFix.time=a;else if(isNaN(a))c.play();else{this.internal.cmdsIgnored&&c.play();try{if(c.seekable&&!("object"==typeof c.seekable&&c.seekable.length>0))throw 1;c.currentTime=a,c.play()}catch(d){return void(this.internal.htmlDlyCmdId=setTimeout(function(){b.play(a)},250))}}this._html_checkWaitForPlay()},_html_pause:function(a){var b=this,c=this.htmlElement.media;if(this.androidFix.play=!1,a>0?this._html_load():clearTimeout(this.internal.htmlDlyCmdId),c.pause(),this.androidFix.setMedia)this.androidFix.pause=!0,this.androidFix.time=a;else if(!isNaN(a))try{if(c.seekable&&!("object"==typeof c.seekable&&c.seekable.length>0))throw 1;c.currentTime=a}catch(d){return void(this.internal.htmlDlyCmdId=setTimeout(function(){b.pause(a)},250))}a>0&&this._html_checkWaitForPlay()},_html_playHead:function(a){var b=this,c=this.htmlElement.media;this._html_load();try{if("object"==typeof c.seekable&&c.seekable.length>0)c.currentTime=a*c.seekable.end(c.seekable.length-1)/100;else{if(!(c.duration>0)||isNaN(c.duration))throw"e";c.currentTime=a*c.duration/100}}catch(d){return void(this.internal.htmlDlyCmdId=setTimeout(function(){b.playHead(a)},250))}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_setProperty:function(a,b){this.html.audio.available&&(this.htmlElement.audio[a]=b),this.html.video.available&&(this.htmlElement.video[a]=b)},_aurora_setAudio:function(b){var c=this;a.each(this.formats,function(a,d){return c.aurora.support[d]&&b[d]?(c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1):void 0}),this.aurora.player=new AV.Player.fromURL(this.status.src),this._addAuroraEventListeners(this.aurora.player,this.aurora),"auto"===this.options.preload&&(this._aurora_load(),this.status.waitForLoad=!1)},_aurora_resetMedia:function(){this.aurora.player&&this.aurora.player.stop()},_aurora_clearMedia:function(){},_aurora_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.aurora.player.preload())},_aurora_play:function(b){this.status.waitForLoad||isNaN(b)||this.aurora.player.seek(b),this.aurora.player.playing||this.aurora.player.play(),this.status.waitForLoad=!1,this._aurora_checkWaitForPlay(),this._updateButtons(!0),this._trigger(a.jPlayer.event.play)},_aurora_pause:function(b){isNaN(b)||this.aurora.player.seek(1e3*b),this.aurora.player.pause(),b>0&&this._aurora_checkWaitForPlay(),this._updateButtons(!1),this._trigger(a.jPlayer.event.pause)},_aurora_playHead:function(a){this.aurora.player.duration>0&&this.aurora.player.seek(a*this.aurora.player.duration/100),this.status.waitForLoad||this._aurora_checkWaitForPlay()},_aurora_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1)},_aurora_volume:function(a){this.aurora.player.volume=100*a},_aurora_mute:function(a){a?(this.aurora.properties.lastvolume=this.aurora.player.volume,this.aurora.player.volume=0):this.aurora.player.volume=this.aurora.properties.lastvolume,this.aurora.properties.muted=a},_flash_setAudio:function(b){var c=this;try{a.each(this.formats,function(a,d){if(c.flash.support[d]&&b[d]){switch(d){case"m4a":case"fla":c._getMovie().fl_setAudio_m4a(b[d]);break;case"mp3":c._getMovie().fl_setAudio_mp3(b[d]);break;case"rtmpa":c._getMovie().fl_setAudio_rtmp(b[d])}return c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1}}),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(d){this._flashError(d)}},_flash_setVideo:function(b){var c=this;try{a.each(this.formats,function(a,d){if(c.flash.support[d]&&b[d]){switch(d){case"m4v":case"flv":c._getMovie().fl_setVideo_m4v(b[d]);break;case"rtmpv":c._getMovie().fl_setVideo_rtmp(b[d])}return c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1}}),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(d){this._flashError(d)}},_flash_resetMedia:function(){this.internal.flash.jq.css({width:"0px",height:"0px"}),this._flash_pause(0/0)},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia()}catch(a){this._flashError(a)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(a){this._flashError(a)}this.status.waitForLoad=!1},_flash_play:function(a){try{this._getMovie().fl_play(a)}catch(b){this._flashError(b)}this.status.waitForLoad=!1,this._flash_checkWaitForPlay()},_flash_pause:function(a){try{this._getMovie().fl_pause(a)}catch(b){this._flashError(b)}a>0&&(this.status.waitForLoad=!1,this._flash_checkWaitForPlay())},_flash_playHead:function(a){try{this._getMovie().fl_play_head(a)}catch(b){this._flashError(b)}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(a){try{this._getMovie().fl_volume(a)}catch(b){this._flashError(b)}},_flash_mute:function(a){try{this._getMovie().fl_mute(a)}catch(b){this._flashError(b)}},_getMovie:function(){return document[this.internal.flash.id]},_getFlashPluginVersion:function(){var a,b=0;if(window.ActiveXObject)try{if(a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")){var c=a.GetVariable("$version");c&&(c=c.split(" ")[1].split(","),b=parseInt(c[0],10)+"."+parseInt(c[1],10))}}catch(d){}else navigator.plugins&&navigator.mimeTypes.length>0&&(a=navigator.plugins["Shockwave Flash"],a&&(b=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1")));return 1*b},_checkForFlash:function(a){var b=!1;return this._getFlashPluginVersion()>=a&&(b=!0),b},_validString:function(a){return a&&"string"==typeof a},_limitValue:function(a,b,c){return b>a?b:a>c?c:a},_urlNotSetError:function(b){this._error({type:a.jPlayer.error.URL_NOT_SET,context:b,message:a.jPlayer.errorMsg.URL_NOT_SET,hint:a.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(b){var c;c=this.internal.ready?"FLASH_DISABLED":"FLASH",this._error({type:a.jPlayer.error[c],context:this.internal.flash.swf,message:a.jPlayer.errorMsg[c]+b.message,hint:a.jPlayer.errorHint[c]}),this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(b){this._trigger(a.jPlayer.event.error,b),this.options.errorAlerts&&this._alert("Error!"+(b.message?"\n"+b.message:"")+(b.hint?"\n"+b.hint:"")+"\nContext: "+b.context)},_warning:function(c){this._trigger(a.jPlayer.event.warning,b,c),this.options.warningAlerts&&this._alert("Warning!"+(c.message?"\n"+c.message:"")+(c.hint?"\n"+c.hint:"")+"\nContext: "+c.context)},_alert:function(a){var b="jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+a;this.options.consoleAlerts?window.console&&window.console.log&&window.console.log(b):alert(b)},_emulateHtmlBridge:function(){var b=this;a.each(a.jPlayer.emulateMethods.split(/\s+/g),function(a,c){b.internal.domNode[c]=function(a){b[c](a)}}),a.each(a.jPlayer.event,function(c,d){var e=!0;a.each(a.jPlayer.reservedEvent.split(/\s+/g),function(a,b){return b===c?(e=!1,!1):void 0}),e&&b.element.bind(d+".jPlayer.jPlayerHtml",function(){b._emulateHtmlUpdate();var a=document.createEvent("Event");a.initEvent(c,!1,!0),b.internal.domNode.dispatchEvent(a)})})},_emulateHtmlUpdate:function(){var b=this;a.each(a.jPlayer.emulateStatus.split(/\s+/g),function(a,c){b.internal.domNode[c]=b.status[c]}),a.each(a.jPlayer.emulateOptions.split(/\s+/g),function(a,c){b.internal.domNode[c]=b.options[c]})},_destroyHtmlBridge:function(){var b=this;this.element.unbind(".jPlayerHtml");var c=a.jPlayer.emulateMethods+" "+a.jPlayer.emulateStatus+" "+a.jPlayer.emulateOptions;a.each(c.split(/\s+/g),function(a,c){delete b.internal.domNode[c]})}},a.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"},a.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 "+a.jPlayer.prototype.version.script+" needs Jplayer.swf version "+a.jPlayer.prototype.version.needFlash+" but found "},a.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."},a.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"},a.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."},a.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."}});; /* * Fingerprintjs2 1.8.0 - Modern & flexible browser fingerprint library v2 * https://github.com/Valve/fingerprintjs2 * Copyright (c) 2015 Valentin Vasilyev (valentin.vasilyev@outlook.com) * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL VALENTIN VASILYEV BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ (function (name, context, definition) { 'use strict' if (typeof window.define === 'function' && window.define.amd) { window.define(definition) } else if (typeof module !== 'undefined' && module.exports) { module.exports = definition() } else if (context.exports) { context.exports = definition() } else { context[name] = definition() } })('Fingerprint2', this, function () { 'use strict' /** * @constructor * @param {Object=} options */ var Fingerprint2 = function (options) { if (!(this instanceof Fingerprint2)) { return new Fingerprint2(options) } var defaultOptions = { swfContainerId: 'fingerprintjs2', swfPath: 'flash/compiled/FontList.swf', detectScreenOrientation: true, sortPluginsFor: [/palemoon/i], userDefinedFonts: [], excludeDoNotTrack: true, excludePixelRatio: true } this.options = this.extend(options, defaultOptions) this.nativeForEach = Array.prototype.forEach this.nativeMap = Array.prototype.map } Fingerprint2.prototype = { extend: function (source, target) { if (source == null) { return target } for (var k in source) { if (source[k] != null && target[k] !== source[k]) { target[k] = source[k] } } return target }, get: function (done) { var that = this var keys = { data: [], addPreprocessedComponent: function (pair) { var componentValue = pair.value if (typeof that.options.preprocessor === 'function') { componentValue = that.options.preprocessor(pair.key, componentValue) } keys.data.push({key: pair.key, value: componentValue}) } } keys = this.userAgentKey(keys) keys = this.languageKey(keys) keys = this.colorDepthKey(keys) keys = this.deviceMemoryKey(keys) keys = this.pixelRatioKey(keys) keys = this.hardwareConcurrencyKey(keys) keys = this.screenResolutionKey(keys) keys = this.availableScreenResolutionKey(keys) keys = this.timezoneOffsetKey(keys) keys = this.sessionStorageKey(keys) keys = this.localStorageKey(keys) keys = this.indexedDbKey(keys) keys = this.addBehaviorKey(keys) keys = this.openDatabaseKey(keys) keys = this.cpuClassKey(keys) keys = this.platformKey(keys) keys = this.doNotTrackKey(keys) keys = this.pluginsKey(keys) keys = this.canvasKey(keys) keys = this.webglKey(keys) keys = this.webglVendorAndRendererKey(keys) keys = this.adBlockKey(keys) keys = this.hasLiedLanguagesKey(keys) keys = this.hasLiedResolutionKey(keys) keys = this.hasLiedOsKey(keys) keys = this.hasLiedBrowserKey(keys) keys = this.touchSupportKey(keys) keys = this.customEntropyFunction(keys) this.fontsKey(keys, function (newKeys) { var values = [] that.each(newKeys.data, function (pair) { var value = pair.value if (value && typeof value.join === 'function') { value = value.join(';') } values.push(value) }) var murmur = that.x64hash128(values.join('~~~'), 31) return done(murmur, newKeys.data) }) }, customEntropyFunction: function (keys) { if (typeof this.options.customFunction === 'function') { keys.addPreprocessedComponent({key: 'custom', value: this.options.customFunction()}) } return keys }, userAgentKey: function (keys) { if (!this.options.excludeUserAgent) { keys.addPreprocessedComponent({key: 'user_agent', value: this.getUserAgent()}) } return keys }, // for tests getUserAgent: function () { return navigator.userAgent }, languageKey: function (keys) { if (!this.options.excludeLanguage) { // IE 9,10 on Windows 10 does not have the `navigator.language` property any longer keys.addPreprocessedComponent({ key: 'language', value: navigator.language || navigator.userLanguage || navigator.browserLanguage || navigator.systemLanguage || '' }) } return keys }, colorDepthKey: function (keys) { if (!this.options.excludeColorDepth) { keys.addPreprocessedComponent({key: 'color_depth', value: window.screen.colorDepth || -1}) } return keys }, deviceMemoryKey: function (keys) { if (!this.options.excludeDeviceMemory) { keys.addPreprocessedComponent({key: 'device_memory', value: this.getDeviceMemory()}) } return keys }, getDeviceMemory: function () { return navigator.deviceMemory || -1 }, pixelRatioKey: function (keys) { if (!this.options.excludePixelRatio) { keys.addPreprocessedComponent({key: 'pixel_ratio', value: this.getPixelRatio()}) } return keys }, getPixelRatio: function () { return window.devicePixelRatio || '' }, screenResolutionKey: function (keys) { if (!this.options.excludeScreenResolution) { return this.getScreenResolution(keys) } return keys }, getScreenResolution: function (keys) { var resolution if (this.options.detectScreenOrientation) { resolution = (window.screen.height > window.screen.width) ? [window.screen.height, window.screen.width] : [window.screen.width, window.screen.height] } else { resolution = [window.screen.width, window.screen.height] } keys.addPreprocessedComponent({key: 'resolution', value: resolution}) return keys }, availableScreenResolutionKey: function (keys) { if (!this.options.excludeAvailableScreenResolution) { return this.getAvailableScreenResolution(keys) } return keys }, getAvailableScreenResolution: function (keys) { var available if (window.screen.availWidth && window.screen.availHeight) { if (this.options.detectScreenOrientation) { available = (window.screen.availHeight > window.screen.availWidth) ? [window.screen.availHeight, window.screen.availWidth] : [window.screen.availWidth, window.screen.availHeight] } else { available = [window.screen.availHeight, window.screen.availWidth] } } if (typeof available !== 'undefined') { // headless browsers keys.addPreprocessedComponent({key: 'available_resolution', value: available}) } return keys }, timezoneOffsetKey: function (keys) { if (!this.options.excludeTimezoneOffset) { keys.addPreprocessedComponent({key: 'timezone_offset', value: new Date().getTimezoneOffset()}) } return keys }, sessionStorageKey: function (keys) { if (!this.options.excludeSessionStorage && this.hasSessionStorage()) { keys.addPreprocessedComponent({key: 'session_storage', value: 1}) } return keys }, localStorageKey: function (keys) { if (!this.options.excludeSessionStorage && this.hasLocalStorage()) { keys.addPreprocessedComponent({key: 'local_storage', value: 1}) } return keys }, indexedDbKey: function (keys) { if (!this.options.excludeIndexedDB && this.hasIndexedDB()) { keys.addPreprocessedComponent({key: 'indexed_db', value: 1}) } return keys }, addBehaviorKey: function (keys) { // body might not be defined at this point or removed programmatically if (!this.options.excludeAddBehavior && document.body && document.body.addBehavior) { keys.addPreprocessedComponent({key: 'add_behavior', value: 1}) } return keys }, openDatabaseKey: function (keys) { if (!this.options.excludeOpenDatabase && window.openDatabase) { keys.addPreprocessedComponent({key: 'open_database', value: 1}) } return keys }, cpuClassKey: function (keys) { if (!this.options.excludeCpuClass) { keys.addPreprocessedComponent({key: 'cpu_class', value: this.getNavigatorCpuClass()}) } return keys }, platformKey: function (keys) { if (!this.options.excludePlatform) { keys.addPreprocessedComponent({key: 'navigator_platform', value: this.getNavigatorPlatform()}) } return keys }, doNotTrackKey: function (keys) { if (!this.options.excludeDoNotTrack) { keys.addPreprocessedComponent({key: 'do_not_track', value: this.getDoNotTrack()}) } return keys }, canvasKey: function (keys) { if (!this.options.excludeCanvas && this.isCanvasSupported()) { keys.addPreprocessedComponent({key: 'canvas', value: this.getCanvasFp()}) } return keys }, webglKey: function (keys) { if (!this.options.excludeWebGL && this.isWebGlSupported()) { keys.addPreprocessedComponent({key: 'webgl', value: this.getWebglFp()}) } return keys }, webglVendorAndRendererKey: function (keys) { if (!this.options.excludeWebGLVendorAndRenderer && this.isWebGlSupported()) { keys.addPreprocessedComponent({key: 'webgl_vendor', value: this.getWebglVendorAndRenderer()}) } return keys }, adBlockKey: function (keys) { if (!this.options.excludeAdBlock) { keys.addPreprocessedComponent({key: 'adblock', value: this.getAdBlock()}) } return keys }, hasLiedLanguagesKey: function (keys) { if (!this.options.excludeHasLiedLanguages) { keys.addPreprocessedComponent({key: 'has_lied_languages', value: this.getHasLiedLanguages()}) } return keys }, hasLiedResolutionKey: function (keys) { if (!this.options.excludeHasLiedResolution) { keys.addPreprocessedComponent({key: 'has_lied_resolution', value: this.getHasLiedResolution()}) } return keys }, hasLiedOsKey: function (keys) { if (!this.options.excludeHasLiedOs) { keys.addPreprocessedComponent({key: 'has_lied_os', value: this.getHasLiedOs()}) } return keys }, hasLiedBrowserKey: function (keys) { if (!this.options.excludeHasLiedBrowser) { keys.addPreprocessedComponent({key: 'has_lied_browser', value: this.getHasLiedBrowser()}) } return keys }, fontsKey: function (keys, done) { if (this.options.excludeJsFonts) { return this.flashFontsKey(keys, done) } return this.jsFontsKey(keys, done) }, // flash fonts (will increase fingerprinting time 20X to ~ 130-150ms) flashFontsKey: function (keys, done) { if (this.options.excludeFlashFonts) { return done(keys) } // we do flash if swfobject is loaded if (!this.hasSwfObjectLoaded()) { return done(keys) } if (!this.hasMinFlashInstalled()) { return done(keys) } if (typeof this.options.swfPath === 'undefined') { return done(keys) } this.loadSwfAndDetectFonts(function (fonts) { keys.addPreprocessedComponent({key: 'swf_fonts', value: fonts.join(';')}) done(keys) }) }, // kudos to http://www.lalit.org/lab/javascript-css-font-detect/ jsFontsKey: function (keys, done) { var that = this // doing js fonts detection in a pseudo-async fashion return setTimeout(function () { // a font will be compared against all the three default fonts. // and if it doesn't match all 3 then that font is not available. var baseFonts = ['monospace', 'sans-serif', 'serif'] var fontList = [ 'Andale Mono', 'Arial', 'Arial Black', 'Arial Hebrew', 'Arial MT', 'Arial Narrow', 'Arial Rounded MT Bold', 'Arial Unicode MS', 'Bitstream Vera Sans Mono', 'Book Antiqua', 'Bookman Old Style', 'Calibri', 'Cambria', 'Cambria Math', 'Century', 'Century Gothic', 'Century Schoolbook', 'Comic Sans', 'Comic Sans MS', 'Consolas', 'Courier', 'Courier New', 'Geneva', 'Georgia', 'Helvetica', 'Helvetica Neue', 'Impact', 'Lucida Bright', 'Lucida Calligraphy', 'Lucida Console', 'Lucida Fax', 'LUCIDA GRANDE', 'Lucida Handwriting', 'Lucida Sans', 'Lucida Sans Typewriter', 'Lucida Sans Unicode', 'Microsoft Sans Serif', 'Monaco', 'Monotype Corsiva', 'MS Gothic', 'MS Outlook', 'MS PGothic', 'MS Reference Sans Serif', 'MS Sans Serif', 'MS Serif', 'MYRIAD', 'MYRIAD PRO', 'Palatino', 'Palatino Linotype', 'Segoe Print', 'Segoe Script', 'Segoe UI', 'Segoe UI Light', 'Segoe UI Semibold', 'Segoe UI Symbol', 'Tahoma', 'Times', 'Times New Roman', 'Times New Roman PS', 'Trebuchet MS', 'Verdana', 'Wingdings', 'Wingdings 2', 'Wingdings 3' ] var extendedFontList = [ 'Abadi MT Condensed Light', 'Academy Engraved LET', 'ADOBE CASLON PRO', 'Adobe Garamond', 'ADOBE GARAMOND PRO', 'Agency FB', 'Aharoni', 'Albertus Extra Bold', 'Albertus Medium', 'Algerian', 'Amazone BT', 'American Typewriter', 'American Typewriter Condensed', 'AmerType Md BT', 'Andalus', 'Angsana New', 'AngsanaUPC', 'Antique Olive', 'Aparajita', 'Apple Chancery', 'Apple Color Emoji', 'Apple SD Gothic Neo', 'Arabic Typesetting', 'ARCHER', 'ARNO PRO', 'Arrus BT', 'Aurora Cn BT', 'AvantGarde Bk BT', 'AvantGarde Md BT', 'AVENIR', 'Ayuthaya', 'Bandy', 'Bangla Sangam MN', 'Bank Gothic', 'BankGothic Md BT', 'Baskerville', 'Baskerville Old Face', 'Batang', 'BatangChe', 'Bauer Bodoni', 'Bauhaus 93', 'Bazooka', 'Bell MT', 'Bembo', 'Benguiat Bk BT', 'Berlin Sans FB', 'Berlin Sans FB Demi', 'Bernard MT Condensed', 'BernhardFashion BT', 'BernhardMod BT', 'Big Caslon', 'BinnerD', 'Blackadder ITC', 'BlairMdITC TT', 'Bodoni 72', 'Bodoni 72 Oldstyle', 'Bodoni 72 Smallcaps', 'Bodoni MT', 'Bodoni MT Black', 'Bodoni MT Condensed', 'Bodoni MT Poster Compressed', 'Bookshelf Symbol 7', 'Boulder', 'Bradley Hand', 'Bradley Hand ITC', 'Bremen Bd BT', 'Britannic Bold', 'Broadway', 'Browallia New', 'BrowalliaUPC', 'Brush Script MT', 'Californian FB', 'Calisto MT', 'Calligrapher', 'Candara', 'CaslonOpnface BT', 'Castellar', 'Centaur', 'Cezanne', 'CG Omega', 'CG Times', 'Chalkboard', 'Chalkboard SE', 'Chalkduster', 'Charlesworth', 'Charter Bd BT', 'Charter BT', 'Chaucer', 'ChelthmITC Bk BT', 'Chiller', 'Clarendon', 'Clarendon Condensed', 'CloisterBlack BT', 'Cochin', 'Colonna MT', 'Constantia', 'Cooper Black', 'Copperplate', 'Copperplate Gothic', 'Copperplate Gothic Bold', 'Copperplate Gothic Light', 'CopperplGoth Bd BT', 'Corbel', 'Cordia New', 'CordiaUPC', 'Cornerstone', 'Coronet', 'Cuckoo', 'Curlz MT', 'DaunPenh', 'Dauphin', 'David', 'DB LCD Temp', 'DELICIOUS', 'Denmark', 'DFKai-SB', 'Didot', 'DilleniaUPC', 'DIN', 'DokChampa', 'Dotum', 'DotumChe', 'Ebrima', 'Edwardian Script ITC', 'Elephant', 'English 111 Vivace BT', 'Engravers MT', 'EngraversGothic BT', 'Eras Bold ITC', 'Eras Demi ITC', 'Eras Light ITC', 'Eras Medium ITC', 'EucrosiaUPC', 'Euphemia', 'Euphemia UCAS', 'EUROSTILE', 'Exotc350 Bd BT', 'FangSong', 'Felix Titling', 'Fixedsys', 'FONTIN', 'Footlight MT Light', 'Forte', 'FrankRuehl', 'Fransiscan', 'Freefrm721 Blk BT', 'FreesiaUPC', 'Freestyle Script', 'French Script MT', 'FrnkGothITC Bk BT', 'Fruitger', 'FRUTIGER', 'Futura', 'Futura Bk BT', 'Futura Lt BT', 'Futura Md BT', 'Futura ZBlk BT', 'FuturaBlack BT', 'Gabriola', 'Galliard BT', 'Gautami', 'Geeza Pro', 'Geometr231 BT', 'Geometr231 Hv BT', 'Geometr231 Lt BT', 'GeoSlab 703 Lt BT', 'GeoSlab 703 XBd BT', 'Gigi', 'Gill Sans', 'Gill Sans MT', 'Gill Sans MT Condensed', 'Gill Sans MT Ext Condensed Bold', 'Gill Sans Ultra Bold', 'Gill Sans Ultra Bold Condensed', 'Gisha', 'Gloucester MT Extra Condensed', 'GOTHAM', 'GOTHAM BOLD', 'Goudy Old Style', 'Goudy Stout', 'GoudyHandtooled BT', 'GoudyOLSt BT', 'Gujarati Sangam MN', 'Gulim', 'GulimChe', 'Gungsuh', 'GungsuhChe', 'Gurmukhi MN', 'Haettenschweiler', 'Harlow Solid Italic', 'Harrington', 'Heather', 'Heiti SC', 'Heiti TC', 'HELV', 'Herald', 'High Tower Text', 'Hiragino Kaku Gothic ProN', 'Hiragino Mincho ProN', 'Hoefler Text', 'Humanst 521 Cn BT', 'Humanst521 BT', 'Humanst521 Lt BT', 'Imprint MT Shadow', 'Incised901 Bd BT', 'Incised901 BT', 'Incised901 Lt BT', 'INCONSOLATA', 'Informal Roman', 'Informal011 BT', 'INTERSTATE', 'IrisUPC', 'Iskoola Pota', 'JasmineUPC', 'Jazz LET', 'Jenson', 'Jester', 'Jokerman', 'Juice ITC', 'Kabel Bk BT', 'Kabel Ult BT', 'Kailasa', 'KaiTi', 'Kalinga', 'Kannada Sangam MN', 'Kartika', 'Kaufmann Bd BT', 'Kaufmann BT', 'Khmer UI', 'KodchiangUPC', 'Kokila', 'Korinna BT', 'Kristen ITC', 'Krungthep', 'Kunstler Script', 'Lao UI', 'Latha', 'Leelawadee', 'Letter Gothic', 'Levenim MT', 'LilyUPC', 'Lithograph', 'Lithograph Light', 'Long Island', 'Lydian BT', 'Magneto', 'Maiandra GD', 'Malayalam Sangam MN', 'Malgun Gothic', 'Mangal', 'Marigold', 'Marion', 'Marker Felt', 'Market', 'Marlett', 'Matisse ITC', 'Matura MT Script Capitals', 'Meiryo', 'Meiryo UI', 'Microsoft Himalaya', 'Microsoft JhengHei', 'Microsoft New Tai Lue', 'Microsoft PhagsPa', 'Microsoft Tai Le', 'Microsoft Uighur', 'Microsoft YaHei', 'Microsoft Yi Baiti', 'MingLiU', 'MingLiU_HKSCS', 'MingLiU_HKSCS-ExtB', 'MingLiU-ExtB', 'Minion', 'Minion Pro', 'Miriam', 'Miriam Fixed', 'Mistral', 'Modern', 'Modern No. 20', 'Mona Lisa Solid ITC TT', 'Mongolian Baiti', 'MONO', 'MoolBoran', 'Mrs Eaves', 'MS LineDraw', 'MS Mincho', 'MS PMincho', 'MS Reference Specialty', 'MS UI Gothic', 'MT Extra', 'MUSEO', 'MV Boli', 'Nadeem', 'Narkisim', 'NEVIS', 'News Gothic', 'News GothicMT', 'NewsGoth BT', 'Niagara Engraved', 'Niagara Solid', 'Noteworthy', 'NSimSun', 'Nyala', 'OCR A Extended', 'Old Century', 'Old English Text MT', 'Onyx', 'Onyx BT', 'OPTIMA', 'Oriya Sangam MN', 'OSAKA', 'OzHandicraft BT', 'Palace Script MT', 'Papyrus', 'Parchment', 'Party LET', 'Pegasus', 'Perpetua', 'Perpetua Titling MT', 'PetitaBold', 'Pickwick', 'Plantagenet Cherokee', 'Playbill', 'PMingLiU', 'PMingLiU-ExtB', 'Poor Richard', 'Poster', 'PosterBodoni BT', 'PRINCETOWN LET', 'Pristina', 'PTBarnum BT', 'Pythagoras', 'Raavi', 'Rage Italic', 'Ravie', 'Ribbon131 Bd BT', 'Rockwell', 'Rockwell Condensed', 'Rockwell Extra Bold', 'Rod', 'Roman', 'Sakkal Majalla', 'Santa Fe LET', 'Savoye LET', 'Sceptre', 'Script', 'Script MT Bold', 'SCRIPTINA', 'Serifa', 'Serifa BT', 'Serifa Th BT', 'ShelleyVolante BT', 'Sherwood', 'Shonar Bangla', 'Showcard Gothic', 'Shruti', 'Signboard', 'SILKSCREEN', 'SimHei', 'Simplified Arabic', 'Simplified Arabic Fixed', 'SimSun', 'SimSun-ExtB', 'Sinhala Sangam MN', 'Sketch Rockwell', 'Skia', 'Small Fonts', 'Snap ITC', 'Snell Roundhand', 'Socket', 'Souvenir Lt BT', 'Staccato222 BT', 'Steamer', 'Stencil', 'Storybook', 'Styllo', 'Subway', 'Swis721 BlkEx BT', 'Swiss911 XCm BT', 'Sylfaen', 'Synchro LET', 'System', 'Tamil Sangam MN', 'Technical', 'Teletype', 'Telugu Sangam MN', 'Tempus Sans ITC', 'Terminal', 'Thonburi', 'Traditional Arabic', 'Trajan', 'TRAJAN PRO', 'Tristan', 'Tubular', 'Tunga', 'Tw Cen MT', 'Tw Cen MT Condensed', 'Tw Cen MT Condensed Extra Bold', 'TypoUpright BT', 'Unicorn', 'Univers', 'Univers CE 55 Medium', 'Univers Condensed', 'Utsaah', 'Vagabond', 'Vani', 'Vijaya', 'Viner Hand ITC', 'VisualUI', 'Vivaldi', 'Vladimir Script', 'Vrinda', 'Westminster', 'WHITNEY', 'Wide Latin', 'ZapfEllipt BT', 'ZapfHumnst BT', 'ZapfHumnst Dm BT', 'Zapfino', 'Zurich BlkEx BT', 'Zurich Ex BT', 'ZWAdobeF'] if (that.options.extendedJsFonts) { fontList = fontList.concat(extendedFontList) } fontList = fontList.concat(that.options.userDefinedFonts) // remove duplicate fonts fontList = fontList.filter(function (font, position) { return fontList.indexOf(font) === position }) // we use m or w because these two characters take up the maximum width. // And we use a LLi so that the same matching fonts can get separated var testString = 'mmmmmmmmmmlli' // we test using 72px font size, we may use any size. I guess larger the better. var testSize = '72px' var h = document.getElementsByTagName('body')[0] // div to load spans for the base fonts var baseFontsDiv = document.createElement('div') // div to load spans for the fonts to detect var fontsDiv = document.createElement('div') var defaultWidth = {} var defaultHeight = {} // creates a span where the fonts will be loaded var createSpan = function () { var s = document.createElement('span') /* * We need this css as in some weird browser this * span elements shows up for a microSec which creates a * bad user experience */ s.style.position = 'absolute' s.style.left = '-9999px' s.style.fontSize = testSize // css font reset to reset external styles s.style.fontStyle = 'normal' s.style.fontWeight = 'normal' s.style.letterSpacing = 'normal' s.style.lineBreak = 'auto' s.style.lineHeight = 'normal' s.style.textTransform = 'none' s.style.textAlign = 'left' s.style.textDecoration = 'none' s.style.textShadow = 'none' s.style.whiteSpace = 'normal' s.style.wordBreak = 'normal' s.style.wordSpacing = 'normal' s.innerHTML = testString return s } // creates a span and load the font to detect and a base font for fallback var createSpanWithFonts = function (fontToDetect, baseFont) { var s = createSpan() s.style.fontFamily = "'" + fontToDetect + "'," + baseFont return s } // creates spans for the base fonts and adds them to baseFontsDiv var initializeBaseFontsSpans = function () { var spans = [] for (var index = 0, length = baseFonts.length; index < length; index++) { var s = createSpan() s.style.fontFamily = baseFonts[index] baseFontsDiv.appendChild(s) spans.push(s) } return spans } // creates spans for the fonts to detect and adds them to fontsDiv var initializeFontsSpans = function () { var spans = {} for (var i = 0, l = fontList.length; i < l; i++) { var fontSpans = [] for (var j = 0, numDefaultFonts = baseFonts.length; j < numDefaultFonts; j++) { var s = createSpanWithFonts(fontList[i], baseFonts[j]) fontsDiv.appendChild(s) fontSpans.push(s) } spans[fontList[i]] = fontSpans // Stores {fontName : [spans for that font]} } return spans } // checks if a font is available var isFontAvailable = function (fontSpans) { var detected = false for (var i = 0; i < baseFonts.length; i++) { detected = (fontSpans[i].offsetWidth !== defaultWidth[baseFonts[i]] || fontSpans[i].offsetHeight !== defaultHeight[baseFonts[i]]) if (detected) { return detected } } return detected } // create spans for base fonts var baseFontsSpans = initializeBaseFontsSpans() // add the spans to the DOM h.appendChild(baseFontsDiv) // get the default width for the three base fonts for (var index = 0, length = baseFonts.length; index < length; index++) { defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth // width for the default font defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight // height for the default font } // create spans for fonts to detect var fontsSpans = initializeFontsSpans() // add all the spans to the DOM h.appendChild(fontsDiv) // check available fonts var available = [] for (var i = 0, l = fontList.length; i < l; i++) { if (isFontAvailable(fontsSpans[fontList[i]])) { available.push(fontList[i]) } } // remove spans from DOM h.removeChild(fontsDiv) h.removeChild(baseFontsDiv) keys.addPreprocessedComponent({key: 'js_fonts', value: available}) done(keys) }, 1) }, pluginsKey: function (keys) { if (!this.options.excludePlugins) { if (this.isIE()) { if (!this.options.excludeIEPlugins) { keys.addPreprocessedComponent({key: 'ie_plugins', value: this.getIEPlugins()}) } } else { keys.addPreprocessedComponent({key: 'regular_plugins', value: this.getRegularPlugins()}) } } return keys }, getRegularPlugins: function () { var plugins = [] if (navigator.plugins) { // plugins isn't defined in Node envs. for (var i = 0, l = navigator.plugins.length; i < l; i++) { if (navigator.plugins[i]) { plugins.push(navigator.plugins[i]) } } } // sorting plugins only for those user agents, that we know randomize the plugins // every time we try to enumerate them if (this.pluginsShouldBeSorted()) { plugins = plugins.sort(function (a, b) { if (a.name > b.name) { return 1 } if (a.name < b.name) { return -1 } return 0 }) } return this.map(plugins, function (p) { var mimeTypes = this.map(p, function (mt) { return [mt.type, mt.suffixes].join('~') }).join(',') return [p.name, p.description, mimeTypes].join('::') }, this) }, getIEPlugins: function () { var result = [] if ((Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(window, 'ActiveXObject')) || ('ActiveXObject' in window)) { var names = [ 'AcroPDF.PDF', // Adobe PDF reader 7+ 'Adodb.Stream', 'AgControl.AgControl', // Silverlight 'DevalVRXCtrl.DevalVRXCtrl.1', 'MacromediaFlashPaper.MacromediaFlashPaper', 'Msxml2.DOMDocument', 'Msxml2.XMLHTTP', 'PDF.PdfCtrl', // Adobe PDF reader 6 and earlier, brrr 'QuickTime.QuickTime', // QuickTime 'QuickTimeCheckObject.QuickTimeCheck.1', 'RealPlayer', 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)', 'RealVideo.RealVideo(tm) ActiveX Control (32-bit)', 'Scripting.Dictionary', 'SWCtl.SWCtl', // ShockWave player 'Shell.UIHelper', 'ShockwaveFlash.ShockwaveFlash', // flash plugin 'Skype.Detection', 'TDCCtl.TDCCtl', 'WMPlayer.OCX', // Windows media player 'rmocx.RealPlayer G2 Control', 'rmocx.RealPlayer G2 Control.1' ] // starting to detect plugins in IE result = this.map(names, function (name) { try { // eslint-disable-next-line no-new new window.ActiveXObject(name) return name } catch (e) { return null } }) } if (navigator.plugins) { result = result.concat(this.getRegularPlugins()) } return result }, pluginsShouldBeSorted: function () { var should = false for (var i = 0, l = this.options.sortPluginsFor.length; i < l; i++) { var re = this.options.sortPluginsFor[i] if (navigator.userAgent.match(re)) { should = true break } } return should }, touchSupportKey: function (keys) { if (!this.options.excludeTouchSupport) { keys.addPreprocessedComponent({key: 'touch_support', value: this.getTouchSupport()}) } return keys }, hardwareConcurrencyKey: function (keys) { if (!this.options.excludeHardwareConcurrency) { keys.addPreprocessedComponent({key: 'hardware_concurrency', value: this.getHardwareConcurrency()}) } return keys }, hasSessionStorage: function () { try { return !!window.sessionStorage } catch (e) { return true // SecurityError when referencing it means it exists } }, // https://bugzilla.mozilla.org/show_bug.cgi?id=781447 hasLocalStorage: function () { try { return !!window.localStorage } catch (e) { return true // SecurityError when referencing it means it exists } }, hasIndexedDB: function () { try { return !!window.indexedDB } catch (e) { return true // SecurityError when referencing it means it exists } }, getHardwareConcurrency: function () { if (navigator.hardwareConcurrency) { return navigator.hardwareConcurrency } return 'unknown' }, getNavigatorCpuClass: function () { if (navigator.cpuClass) { return navigator.cpuClass } else { return 'unknown' } }, getNavigatorPlatform: function () { if (navigator.platform) { return navigator.platform } else { return 'unknown' } }, getDoNotTrack: function () { if (navigator.doNotTrack) { return navigator.doNotTrack } else if (navigator.msDoNotTrack) { return navigator.msDoNotTrack } else if (window.doNotTrack) { return window.doNotTrack } else { return 'unknown' } }, // This is a crude and primitive touch screen detection. // It's not possible to currently reliably detect the availability of a touch screen // with a JS, without actually subscribing to a touch event. // http://www.stucox.com/blog/you-cant-detect-a-touchscreen/ // https://github.com/Modernizr/Modernizr/issues/548 // method returns an array of 3 values: // maxTouchPoints, the success or failure of creating a TouchEvent, // and the availability of the 'ontouchstart' property getTouchSupport: function () { var maxTouchPoints = 0 var touchEvent = false if (typeof navigator.maxTouchPoints !== 'undefined') { maxTouchPoints = navigator.maxTouchPoints } else if (typeof navigator.msMaxTouchPoints !== 'undefined') { maxTouchPoints = navigator.msMaxTouchPoints } try { document.createEvent('TouchEvent') touchEvent = true } catch (_) { /* squelch */ } var touchStart = 'ontouchstart' in window return [maxTouchPoints, touchEvent, touchStart] }, // https://www.browserleaks.com/canvas#how-does-it-work getCanvasFp: function () { var result = [] // Very simple now, need to make it more complex (geo shapes etc) var canvas = document.createElement('canvas') canvas.width = 2000 canvas.height = 200 canvas.style.display = 'inline' var ctx = canvas.getContext('2d') // detect browser support of canvas winding // http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/ // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js ctx.rect(0, 0, 10, 10) ctx.rect(2, 2, 6, 6) result.push('canvas winding:' + ((ctx.isPointInPath(5, 5, 'evenodd') === false) ? 'yes' : 'no')) ctx.textBaseline = 'alphabetic' ctx.fillStyle = '#f60' ctx.fillRect(125, 1, 62, 20) ctx.fillStyle = '#069' // https://github.com/Valve/fingerprintjs2/issues/66 if (this.options.dontUseFakeFontInCanvas) { ctx.font = '11pt Arial' } else { ctx.font = '11pt no-real-font-123' } ctx.fillText('Cwm fjordbank glyphs vext quiz, \ud83d\ude03', 2, 15) ctx.fillStyle = 'rgba(102, 204, 0, 0.2)' ctx.font = '18pt Arial' ctx.fillText('Cwm fjordbank glyphs vext quiz, \ud83d\ude03', 4, 45) // canvas blending // http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/ // http://jsfiddle.net/NDYV8/16/ ctx.globalCompositeOperation = 'multiply' ctx.fillStyle = 'rgb(255,0,255)' ctx.beginPath() ctx.arc(50, 50, 50, 0, Math.PI * 2, true) ctx.closePath() ctx.fill() ctx.fillStyle = 'rgb(0,255,255)' ctx.beginPath() ctx.arc(100, 50, 50, 0, Math.PI * 2, true) ctx.closePath() ctx.fill() ctx.fillStyle = 'rgb(255,255,0)' ctx.beginPath() ctx.arc(75, 100, 50, 0, Math.PI * 2, true) ctx.closePath() ctx.fill() ctx.fillStyle = 'rgb(255,0,255)' // canvas winding // http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/ // http://jsfiddle.net/NDYV8/19/ ctx.arc(75, 75, 75, 0, Math.PI * 2, true) ctx.arc(75, 75, 25, 0, Math.PI * 2, true) ctx.fill('evenodd') if (canvas.toDataURL) { result.push('canvas fp:' + canvas.toDataURL()) } return result.join('~') }, getWebglFp: function () { var gl var fa2s = function (fa) { gl.clearColor(0.0, 0.0, 0.0, 1.0) gl.enable(gl.DEPTH_TEST) gl.depthFunc(gl.LEQUAL) gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT) return '[' + fa[0] + ', ' + fa[1] + ']' } var maxAnisotropy = function (gl) { var ext = gl.getExtension('EXT_texture_filter_anisotropic') || gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic') || gl.getExtension('MOZ_EXT_texture_filter_anisotropic') if (ext) { var anisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT) if (anisotropy === 0) { anisotropy = 2 } return anisotropy } else { return null } } gl = this.getWebglCanvas() if (!gl) { return null } // WebGL fingerprinting is a combination of techniques, found in MaxMind antifraud script & Augur fingerprinting. // First it draws a gradient object with shaders and convers the image to the Base64 string. // Then it enumerates all WebGL extensions & capabilities and appends them to the Base64 string, resulting in a huge WebGL string, potentially very unique on each device // Since iOS supports webgl starting from version 8.1 and 8.1 runs on several graphics chips, the results may be different across ios devices, but we need to verify it. var result = [] var vShaderTemplate = 'attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}' var fShaderTemplate = 'precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}' var vertexPosBuffer = gl.createBuffer() gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer) var vertices = new Float32Array([-0.2, -0.9, 0, 0.4, -0.26, 0, 0, 0.732134444, 0]) gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW) vertexPosBuffer.itemSize = 3 vertexPosBuffer.numItems = 3 var program = gl.createProgram() var vshader = gl.createShader(gl.VERTEX_SHADER) gl.shaderSource(vshader, vShaderTemplate) gl.compileShader(vshader) var fshader = gl.createShader(gl.FRAGMENT_SHADER) gl.shaderSource(fshader, fShaderTemplate) gl.compileShader(fshader) gl.attachShader(program, vshader) gl.attachShader(program, fshader) gl.linkProgram(program) gl.useProgram(program) program.vertexPosAttrib = gl.getAttribLocation(program, 'attrVertex') program.offsetUniform = gl.getUniformLocation(program, 'uniformOffset') gl.enableVertexAttribArray(program.vertexPosArray) gl.vertexAttribPointer(program.vertexPosAttrib, vertexPosBuffer.itemSize, gl.FLOAT, !1, 0, 0) gl.uniform2f(program.offsetUniform, 1, 1) gl.drawArrays(gl.TRIANGLE_STRIP, 0, vertexPosBuffer.numItems) try { result.push(gl.canvas.toDataURL()) } catch (e) { /* .toDataURL may be absent or broken (blocked by extension) */ } result.push('extensions:' + (gl.getSupportedExtensions() || []).join(';')) result.push('webgl aliased line width range:' + fa2s(gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE))) result.push('webgl aliased point size range:' + fa2s(gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE))) result.push('webgl alpha bits:' + gl.getParameter(gl.ALPHA_BITS)) result.push('webgl antialiasing:' + (gl.getContextAttributes().antialias ? 'yes' : 'no')) result.push('webgl blue bits:' + gl.getParameter(gl.BLUE_BITS)) result.push('webgl depth bits:' + gl.getParameter(gl.DEPTH_BITS)) result.push('webgl green bits:' + gl.getParameter(gl.GREEN_BITS)) result.push('webgl max anisotropy:' + maxAnisotropy(gl)) result.push('webgl max combined texture image units:' + gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS)) result.push('webgl max cube map texture size:' + gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)) result.push('webgl max fragment uniform vectors:' + gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS)) result.push('webgl max render buffer size:' + gl.getParameter(gl.MAX_RENDERBUFFER_SIZE)) result.push('webgl max texture image units:' + gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)) result.push('webgl max texture size:' + gl.getParameter(gl.MAX_TEXTURE_SIZE)) result.push('webgl max varying vectors:' + gl.getParameter(gl.MAX_VARYING_VECTORS)) result.push('webgl max vertex attribs:' + gl.getParameter(gl.MAX_VERTEX_ATTRIBS)) result.push('webgl max vertex texture image units:' + gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) result.push('webgl max vertex uniform vectors:' + gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS)) result.push('webgl max viewport dims:' + fa2s(gl.getParameter(gl.MAX_VIEWPORT_DIMS))) result.push('webgl red bits:' + gl.getParameter(gl.RED_BITS)) result.push('webgl renderer:' + gl.getParameter(gl.RENDERER)) result.push('webgl shading language version:' + gl.getParameter(gl.SHADING_LANGUAGE_VERSION)) result.push('webgl stencil bits:' + gl.getParameter(gl.STENCIL_BITS)) result.push('webgl vendor:' + gl.getParameter(gl.VENDOR)) result.push('webgl version:' + gl.getParameter(gl.VERSION)) try { // Add the unmasked vendor and unmasked renderer if the debug_renderer_info extension is available var extensionDebugRendererInfo = gl.getExtension('WEBGL_debug_renderer_info') if (extensionDebugRendererInfo) { result.push('webgl unmasked vendor:' + gl.getParameter(extensionDebugRendererInfo.UNMASKED_VENDOR_WEBGL)) result.push('webgl unmasked renderer:' + gl.getParameter(extensionDebugRendererInfo.UNMASKED_RENDERER_WEBGL)) } } catch (e) { /* squelch */ } if (!gl.getShaderPrecisionFormat) { return result.join('~') } result.push('webgl vertex shader high float precision:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).precision) result.push('webgl vertex shader high float precision rangeMin:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).rangeMin) result.push('webgl vertex shader high float precision rangeMax:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).rangeMax) result.push('webgl vertex shader medium float precision:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).precision) result.push('webgl vertex shader medium float precision rangeMin:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).rangeMin) result.push('webgl vertex shader medium float precision rangeMax:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).rangeMax) result.push('webgl vertex shader low float precision:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).precision) result.push('webgl vertex shader low float precision rangeMin:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).rangeMin) result.push('webgl vertex shader low float precision rangeMax:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).rangeMax) result.push('webgl fragment shader high float precision:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).precision) result.push('webgl fragment shader high float precision rangeMin:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).rangeMin) result.push('webgl fragment shader high float precision rangeMax:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).rangeMax) result.push('webgl fragment shader medium float precision:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).precision) result.push('webgl fragment shader medium float precision rangeMin:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).rangeMin) result.push('webgl fragment shader medium float precision rangeMax:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).rangeMax) result.push('webgl fragment shader low float precision:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).precision) result.push('webgl fragment shader low float precision rangeMin:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).rangeMin) result.push('webgl fragment shader low float precision rangeMax:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).rangeMax) result.push('webgl vertex shader high int precision:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).precision) result.push('webgl vertex shader high int precision rangeMin:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).rangeMin) result.push('webgl vertex shader high int precision rangeMax:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).rangeMax) result.push('webgl vertex shader medium int precision:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).precision) result.push('webgl vertex shader medium int precision rangeMin:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).rangeMin) result.push('webgl vertex shader medium int precision rangeMax:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).rangeMax) result.push('webgl vertex shader low int precision:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).precision) result.push('webgl vertex shader low int precision rangeMin:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).rangeMin) result.push('webgl vertex shader low int precision rangeMax:' + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).rangeMax) result.push('webgl fragment shader high int precision:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).precision) result.push('webgl fragment shader high int precision rangeMin:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).rangeMin) result.push('webgl fragment shader high int precision rangeMax:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).rangeMax) result.push('webgl fragment shader medium int precision:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).precision) result.push('webgl fragment shader medium int precision rangeMin:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).rangeMin) result.push('webgl fragment shader medium int precision rangeMax:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).rangeMax) result.push('webgl fragment shader low int precision:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).precision) result.push('webgl fragment shader low int precision rangeMin:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).rangeMin) result.push('webgl fragment shader low int precision rangeMax:' + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).rangeMax) return result.join('~') }, getWebglVendorAndRenderer: function () { /* This a subset of the WebGL fingerprint with a lot of entropy, while being reasonably browser-independent */ try { var glContext = this.getWebglCanvas() var extensionDebugRendererInfo = glContext.getExtension('WEBGL_debug_renderer_info') return glContext.getParameter(extensionDebugRendererInfo.UNMASKED_VENDOR_WEBGL) + '~' + glContext.getParameter(extensionDebugRendererInfo.UNMASKED_RENDERER_WEBGL) } catch (e) { return null } }, getAdBlock: function () { var ads = document.createElement('div') ads.innerHTML = ' ' ads.className = 'adsbox' var result = false try { // body may not exist, that's why we need try/catch document.body.appendChild(ads) result = document.getElementsByClassName('adsbox')[0].offsetHeight === 0 document.body.removeChild(ads) } catch (e) { result = false } return result }, getHasLiedLanguages: function () { // We check if navigator.language is equal to the first language of navigator.languages if (typeof navigator.languages !== 'undefined') { try { var firstLanguages = navigator.languages[0].substr(0, 2) if (firstLanguages !== navigator.language.substr(0, 2)) { return true } } catch (err) { return true } } return false }, getHasLiedResolution: function () { if (window.screen.width < window.screen.availWidth) { return true } if (window.screen.height < window.screen.availHeight) { return true } return false }, getHasLiedOs: function () { var userAgent = navigator.userAgent.toLowerCase() var oscpu = navigator.oscpu var platform = navigator.platform.toLowerCase() var os // We extract the OS from the user agent (respect the order of the if else if statement) if (userAgent.indexOf('windows phone') >= 0) { os = 'Windows Phone' } else if (userAgent.indexOf('win') >= 0) { os = 'Windows' } else if (userAgent.indexOf('android') >= 0) { os = 'Android' } else if (userAgent.indexOf('linux') >= 0) { os = 'Linux' } else if (userAgent.indexOf('iphone') >= 0 || userAgent.indexOf('ipad') >= 0) { os = 'iOS' } else if (userAgent.indexOf('mac') >= 0) { os = 'Mac' } else { os = 'Other' } // We detect if the person uses a mobile device var mobileDevice if (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)) { mobileDevice = true } else { mobileDevice = false } if (mobileDevice && os !== 'Windows Phone' && os !== 'Android' && os !== 'iOS' && os !== 'Other') { return true } // We compare oscpu with the OS extracted from the UA if (typeof oscpu !== 'undefined') { oscpu = oscpu.toLowerCase() if (oscpu.indexOf('win') >= 0 && os !== 'Windows' && os !== 'Windows Phone') { return true } else if (oscpu.indexOf('linux') >= 0 && os !== 'Linux' && os !== 'Android') { return true } else if (oscpu.indexOf('mac') >= 0 && os !== 'Mac' && os !== 'iOS') { return true } else if ((oscpu.indexOf('win') === -1 && oscpu.indexOf('linux') === -1 && oscpu.indexOf('mac') === -1) !== (os === 'Other')) { return true } } // We compare platform with the OS extracted from the UA if (platform.indexOf('win') >= 0 && os !== 'Windows' && os !== 'Windows Phone') { return true } else if ((platform.indexOf('linux') >= 0 || platform.indexOf('android') >= 0 || platform.indexOf('pike') >= 0) && os !== 'Linux' && os !== 'Android') { return true } else if ((platform.indexOf('mac') >= 0 || platform.indexOf('ipad') >= 0 || platform.indexOf('ipod') >= 0 || platform.indexOf('iphone') >= 0) && os !== 'Mac' && os !== 'iOS') { return true } else if ((platform.indexOf('win') === -1 && platform.indexOf('linux') === -1 && platform.indexOf('mac') === -1) !== (os === 'Other')) { return true } if (typeof navigator.plugins === 'undefined' && os !== 'Windows' && os !== 'Windows Phone') { // We are are in the case where the person uses ie, therefore we can infer that it's windows return true } return false }, getHasLiedBrowser: function () { var userAgent = navigator.userAgent.toLowerCase() var productSub = navigator.productSub // we extract the browser from the user agent (respect the order of the tests) var browser if (userAgent.indexOf('firefox') >= 0) { browser = 'Firefox' } else if (userAgent.indexOf('opera') >= 0 || userAgent.indexOf('opr') >= 0) { browser = 'Opera' } else if (userAgent.indexOf('chrome') >= 0) { browser = 'Chrome' } else if (userAgent.indexOf('safari') >= 0) { browser = 'Safari' } else if (userAgent.indexOf('trident') >= 0) { browser = 'Internet Explorer' } else { browser = 'Other' } if ((browser === 'Chrome' || browser === 'Safari' || browser === 'Opera') && productSub !== '20030107') { return true } // eslint-disable-next-line no-eval var tempRes = eval.toString().length if (tempRes === 37 && browser !== 'Safari' && browser !== 'Firefox' && browser !== 'Other') { return true } else if (tempRes === 39 && browser !== 'Internet Explorer' && browser !== 'Other') { return true } else if (tempRes === 33 && browser !== 'Chrome' && browser !== 'Opera' && browser !== 'Other') { return true } // We create an error to see how it is handled var errFirefox try { // eslint-disable-next-line no-throw-literal throw 'a' } catch (err) { try { err.toSource() errFirefox = true } catch (errOfErr) { errFirefox = false } } if (errFirefox && browser !== 'Firefox' && browser !== 'Other') { return true } return false }, isCanvasSupported: function () { var elem = document.createElement('canvas') return !!(elem.getContext && elem.getContext('2d')) }, isWebGlSupported: function () { // code taken from Modernizr if (!this.isCanvasSupported()) { return false } var glContext = this.getWebglCanvas() return !!window.WebGLRenderingContext && !!glContext }, isIE: function () { if (navigator.appName === 'Microsoft Internet Explorer') { return true } else if (navigator.appName === 'Netscape' && /Trident/.test(navigator.userAgent)) { // IE 11 return true } return false }, hasSwfObjectLoaded: function () { return typeof window.swfobject !== 'undefined' }, hasMinFlashInstalled: function () { return window.swfobject.hasFlashPlayerVersion('9.0.0') }, addFlashDivNode: function () { var node = document.createElement('div') node.setAttribute('id', this.options.swfContainerId) document.body.appendChild(node) }, loadSwfAndDetectFonts: function (done) { var hiddenCallback = '___fp_swf_loaded' window[hiddenCallback] = function (fonts) { done(fonts) } var id = this.options.swfContainerId this.addFlashDivNode() var flashvars = { onReady: hiddenCallback } var flashparams = { allowScriptAccess: 'always', menu: 'false' } window.swfobject.embedSWF(this.options.swfPath, id, '1', '1', '9.0.0', false, flashvars, flashparams, {}) }, getWebglCanvas: function () { var canvas = document.createElement('canvas') var gl = null try { gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl') } catch (e) { /* squelch */ } if (!gl) { gl = null } return gl }, /** * @template T * @param {T=} context */ each: function (obj, iterator, context) { if (obj === null) { return } if (this.nativeForEach && obj.forEach === this.nativeForEach) { obj.forEach(iterator, context) } else if (obj.length === +obj.length) { for (var i = 0, l = obj.length; i < l; i++) { if (iterator.call(context, obj[i], i, obj) === {}) { return } } } else { for (var key in obj) { if (obj.hasOwnProperty(key)) { if (iterator.call(context, obj[key], key, obj) === {}) { return } } } } }, /** * @template T,V * @param {T=} context * @param {function(this:T, ?, (string|number), T=):V} iterator * @return {V} */ map: function (obj, iterator, context) { var results = [] // Not using strict equality so that this acts as a // shortcut to checking for `null` and `undefined`. if (obj == null) { return results } if (this.nativeMap && obj.map === this.nativeMap) { return obj.map(iterator, context) } this.each(obj, function (value, index, list) { results[results.length] = iterator.call(context, value, index, list) }) return results }, /// MurmurHash3 related functions // // Given two 64bit ints (as an array of two 32bit ints) returns the two // added together as a 64bit int (as an array of two 32bit ints). // x64Add: function (m, n) { m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff] n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff] var o = [0, 0, 0, 0] o[3] += m[3] + n[3] o[2] += o[3] >>> 16 o[3] &= 0xffff o[2] += m[2] + n[2] o[1] += o[2] >>> 16 o[2] &= 0xffff o[1] += m[1] + n[1] o[0] += o[1] >>> 16 o[1] &= 0xffff o[0] += m[0] + n[0] o[0] &= 0xffff return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]] }, // // Given two 64bit ints (as an array of two 32bit ints) returns the two // multiplied together as a 64bit int (as an array of two 32bit ints). // x64Multiply: function (m, n) { m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff] n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff] var o = [0, 0, 0, 0] o[3] += m[3] * n[3] o[2] += o[3] >>> 16 o[3] &= 0xffff o[2] += m[2] * n[3] o[1] += o[2] >>> 16 o[2] &= 0xffff o[2] += m[3] * n[2] o[1] += o[2] >>> 16 o[2] &= 0xffff o[1] += m[1] * n[3] o[0] += o[1] >>> 16 o[1] &= 0xffff o[1] += m[2] * n[2] o[0] += o[1] >>> 16 o[1] &= 0xffff o[1] += m[3] * n[1] o[0] += o[1] >>> 16 o[1] &= 0xffff o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0]) o[0] &= 0xffff return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]] }, // // Given a 64bit int (as an array of two 32bit ints) and an int // representing a number of bit positions, returns the 64bit int (as an // array of two 32bit ints) rotated left by that number of positions. // x64Rotl: function (m, n) { n %= 64 if (n === 32) { return [m[1], m[0]] } else if (n < 32) { return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))] } else { n -= 32 return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))] } }, // // Given a 64bit int (as an array of two 32bit ints) and an int // representing a number of bit positions, returns the 64bit int (as an // array of two 32bit ints) shifted left by that number of positions. // x64LeftShift: function (m, n) { n %= 64 if (n === 0) { return m } else if (n < 32) { return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n] } else { return [m[1] << (n - 32), 0] } }, // // Given two 64bit ints (as an array of two 32bit ints) returns the two // xored together as a 64bit int (as an array of two 32bit ints). // x64Xor: function (m, n) { return [m[0] ^ n[0], m[1] ^ n[1]] }, // // Given a block, returns murmurHash3's final x64 mix of that block. // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the // only place where we need to right shift 64bit ints.) // x64Fmix: function (h) { h = this.x64Xor(h, [0, h[0] >>> 1]) h = this.x64Multiply(h, [0xff51afd7, 0xed558ccd]) h = this.x64Xor(h, [0, h[0] >>> 1]) h = this.x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]) h = this.x64Xor(h, [0, h[0] >>> 1]) return h }, // // Given a string and an optional seed as an int, returns a 128 bit // hash using the x64 flavor of MurmurHash3, as an unsigned hex. // x64hash128: function (key, seed) { key = key || '' seed = seed || 0 var remainder = key.length % 16 var bytes = key.length - remainder var h1 = [0, seed] var h2 = [0, seed] var k1 = [0, 0] var k2 = [0, 0] var c1 = [0x87c37b91, 0x114253d5] var c2 = [0x4cf5ad43, 0x2745937f] for (var i = 0; i < bytes; i = i + 16) { k1 = [((key.charCodeAt(i + 4) & 0xff)) | ((key.charCodeAt(i + 5) & 0xff) << 8) | ((key.charCodeAt(i + 6) & 0xff) << 16) | ((key.charCodeAt(i + 7) & 0xff) << 24), ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) & 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24)] k2 = [((key.charCodeAt(i + 12) & 0xff)) | ((key.charCodeAt(i + 13) & 0xff) << 8) | ((key.charCodeAt(i + 14) & 0xff) << 16) | ((key.charCodeAt(i + 15) & 0xff) << 24), ((key.charCodeAt(i + 8) & 0xff)) | ((key.charCodeAt(i + 9) & 0xff) << 8) | ((key.charCodeAt(i + 10) & 0xff) << 16) | ((key.charCodeAt(i + 11) & 0xff) << 24)] k1 = this.x64Multiply(k1, c1) k1 = this.x64Rotl(k1, 31) k1 = this.x64Multiply(k1, c2) h1 = this.x64Xor(h1, k1) h1 = this.x64Rotl(h1, 27) h1 = this.x64Add(h1, h2) h1 = this.x64Add(this.x64Multiply(h1, [0, 5]), [0, 0x52dce729]) k2 = this.x64Multiply(k2, c2) k2 = this.x64Rotl(k2, 33) k2 = this.x64Multiply(k2, c1) h2 = this.x64Xor(h2, k2) h2 = this.x64Rotl(h2, 31) h2 = this.x64Add(h2, h1) h2 = this.x64Add(this.x64Multiply(h2, [0, 5]), [0, 0x38495ab5]) } k1 = [0, 0] k2 = [0, 0] switch (remainder) { case 15: k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 14)], 48)) // fallthrough case 14: k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 13)], 40)) // fallthrough case 13: k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 12)], 32)) // fallthrough case 12: k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 11)], 24)) // fallthrough case 11: k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 10)], 16)) // fallthrough case 10: k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 9)], 8)) // fallthrough case 9: k2 = this.x64Xor(k2, [0, key.charCodeAt(i + 8)]) k2 = this.x64Multiply(k2, c2) k2 = this.x64Rotl(k2, 33) k2 = this.x64Multiply(k2, c1) h2 = this.x64Xor(h2, k2) // fallthrough case 8: k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 7)], 56)) // fallthrough case 7: k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 6)], 48)) // fallthrough case 6: k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 5)], 40)) // fallthrough case 5: k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 4)], 32)) // fallthrough case 4: k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 3)], 24)) // fallthrough case 3: k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 2)], 16)) // fallthrough case 2: k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 1)], 8)) // fallthrough case 1: k1 = this.x64Xor(k1, [0, key.charCodeAt(i)]) k1 = this.x64Multiply(k1, c1) k1 = this.x64Rotl(k1, 31) k1 = this.x64Multiply(k1, c2) h1 = this.x64Xor(h1, k1) // fallthrough } h1 = this.x64Xor(h1, [0, key.length]) h2 = this.x64Xor(h2, [0, key.length]) h1 = this.x64Add(h1, h2) h2 = this.x64Add(h2, h1) h1 = this.x64Fmix(h1) h2 = this.x64Fmix(h2) h1 = this.x64Add(h1, h2) h2 = this.x64Add(h2, h1) return ('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) + ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) + ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) + ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8) } } Fingerprint2.VERSION = '1.8.0' return Fingerprint2 }) ; !function(e){if(!e.hasInitialised){var t={escapeRegExp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},hasClass:function(e,t){var i=" ";return 1===e.nodeType&&(i+e.className+i).replace(/[\n\t]/g,i).indexOf(i+t+i)>=0},addClass:function(e,t){e.className+=" "+t},removeClass:function(e,t){var i=new RegExp("\\b"+this.escapeRegExp(t)+"\\b");e.className=e.className.replace(i,"")},interpolateString:function(e,t){var i=/{{([a-z][a-z0-9\-_]*)}}/gi;return e.replace(i,function(e){return t(arguments[1])||""})},getCookie:function(e){var t="; "+document.cookie,i=t.split("; "+e+"=");return 2!=i.length?void 0:i.pop().split(";").shift()},setCookie:function(e,t,i,n,o){var s=new Date;s.setDate(s.getDate()+(i||365));var r=[e+"="+t,"expires="+s.toUTCString(),"path="+(o||"/")];n&&r.push("domain="+n),document.cookie=r.join(";")},deepExtend:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(i in e&&this.isPlainObject(e[i])&&this.isPlainObject(t[i])?this.deepExtend(e[i],t[i]):e[i]=t[i]);return e},throttle:function(e,t){var i=!1;return function(){i||(e.apply(this,arguments),i=!0,setTimeout(function(){i=!1},t))}},hash:function(e){var t,i,n,o=0;if(0===e.length)return o;for(t=0,n=e.length;t=128?"#000":"#fff"},getLuminance:function(e){var t=parseInt(this.normaliseHex(e),16),i=38,n=(t>>16)+i,o=(t>>8&255)+i,s=(255&t)+i,r=(16777216+65536*(n<255?n<1?0:n:255)+256*(o<255?o<1?0:o:255)+(s<255?s<1?0:s:255)).toString(16).slice(1);return"#"+r},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isPlainObject:function(e){return"object"==typeof e&&null!==e&&e.constructor==Object}};e.status={deny:"deny",allow:"allow",dismiss:"dismiss"},e.transitionEnd=function(){var e=document.createElement("div"),t={t:"transitionend",OT:"oTransitionEnd",msT:"MSTransitionEnd",MozT:"transitionend",WebkitT:"webkitTransitionEnd"};for(var i in t)if(t.hasOwnProperty(i)&&"undefined"!=typeof e.style[i+"ransition"])return t[i];return""}(),e.hasTransition=!!e.transitionEnd;var i=Object.keys(e.status).map(t.escapeRegExp);e.customStyles={},e.Popup=function(){function n(){this.initialise.apply(this,arguments)}function o(e){this.openingTimeout=null,t.removeClass(e,"cc-invisible")}function s(t){t.style.display="none",t.removeEventListener(e.transitionEnd,this.afterTransition),this.afterTransition=null}function r(){var t=this.options.onInitialise.bind(this);if(!window.navigator.cookieEnabled)return t(e.status.deny),!0;if(window.CookiesOK||window.navigator.CookiesOK)return t(e.status.allow),!0;var i=Object.keys(e.status),n=this.getStatus(),o=i.indexOf(n)>=0;return o&&t(n),o}function a(){var e=this.options.position.split("-"),t=[];return e.forEach(function(e){t.push("cc-"+e)}),t}function c(){var e=this.options,i="top"==e.position||"bottom"==e.position?"banner":"floating";t.isMobile()&&(i="floating");var n=["cc-"+i,"cc-type-"+e.type,"cc-theme-"+e.theme];e["static"]&&n.push("cc-static"),n.push.apply(n,a.call(this));p.call(this,this.options.palette);return this.customStyleSelector&&n.push(this.customStyleSelector),n}function l(){var e={},i=this.options;i.showLink||(i.elements.link="",i.elements.messagelink=i.elements.message),Object.keys(i.elements).forEach(function(n){e[n]=t.interpolateString(i.elements[n],function(e){var t=i.content[e];return e&&"string"==typeof t&&t.length?t:""})});var n=i.compliance[i.type];n||(n=i.compliance.info),e.compliance=t.interpolateString(n,function(t){return e[t]});var o=i.layouts[i.layout];return o||(o=i.layouts.basic),t.interpolateString(o,function(t){return e[t]})}function u(i){var n=this.options,o=document.createElement("div"),s=n.container&&1===n.container.nodeType?n.container:document.body;o.innerHTML=i;var r=o.children[0];return r.style.display="none",t.hasClass(r,"cc-window")&&e.hasTransition&&t.addClass(r,"cc-invisible"),this.onButtonClick=h.bind(this),r.addEventListener("click",this.onButtonClick),n.autoAttach&&(s.firstChild?s.insertBefore(r,s.firstChild):s.appendChild(r)),r}function h(n){var o=n.target;if(t.hasClass(o,"cc-btn")){var s=o.className.match(new RegExp("\\bcc-("+i.join("|")+")\\b")),r=s&&s[1]||!1;r&&(this.setStatus(r),this.close(!0))}t.hasClass(o,"cc-close")&&(this.setStatus(e.status.dismiss),this.close(!0)),t.hasClass(o,"cc-revoke")&&this.revokeChoice()}function p(e){var i=t.hash(JSON.stringify(e)),n="cc-color-override-"+i,o=t.isPlainObject(e);return this.customStyleSelector=o?n:null,o&&d(i,e,"."+n),o}function d(i,n,o){if(e.customStyles[i])return void++e.customStyles[i].references;var s={},r=n.popup,a=n.button,c=n.highlight;r&&(r.text=r.text?r.text:t.getContrast(r.background),r.link=r.link?r.link:r.text,s[o+".cc-window"]=["color: "+r.text,"background-color: "+r.background],s[o+".cc-revoke"]=["color: "+r.text,"background-color: "+r.background],s[o+" .cc-link,"+o+" .cc-link:active,"+o+" .cc-link:visited"]=["color: "+r.link],a&&(a.text=a.text?a.text:t.getContrast(a.background),a.border=a.border?a.border:"transparent",s[o+" .cc-btn"]=["color: "+a.text,"border-color: "+a.border,"background-color: "+a.background],"transparent"!=a.background&&(s[o+" .cc-btn:hover, "+o+" .cc-btn:focus"]=["background-color: "+v(a.background)]),c?(c.text=c.text?c.text:t.getContrast(c.background),c.border=c.border?c.border:"transparent",s[o+" .cc-highlight .cc-btn:first-child"]=["color: "+c.text,"border-color: "+c.border,"background-color: "+c.background]):s[o+" .cc-highlight .cc-btn:first-child"]=["color: "+r.text]));var l=document.createElement("style");document.head.appendChild(l),e.customStyles[i]={references:1,element:l.sheet};var u=-1;for(var h in s)s.hasOwnProperty(h)&&l.sheet.insertRule(h+"{"+s[h].join(";")+"}",++u)}function v(e){return e=t.normaliseHex(e),"000000"==e?"#222":t.getLuminance(e)}function f(i){if(t.isPlainObject(i)){var n=t.hash(JSON.stringify(i)),o=e.customStyles[n];if(o&&!--o.references){var s=o.element.ownerNode;s&&s.parentNode&&s.parentNode.removeChild(s),e.customStyles[n]=null}}}function m(e,t){for(var i=0,n=e.length;i=0&&(this.dismissTimeout=window.setTimeout(function(){t(e.status.dismiss)},Math.floor(i)));var n=this.options.dismissOnScroll;if("number"==typeof n&&n>=0){var o=function(i){window.pageYOffset>Math.floor(n)&&(t(e.status.dismiss),window.removeEventListener("scroll",o),this.onWindowScroll=null)};this.onWindowScroll=o,window.addEventListener("scroll",o)}}function y(){if("info"!=this.options.type&&(this.options.revokable=!0),t.isMobile()&&(this.options.animateRevokable=!1),this.options.revokable){var e=a.call(this);this.options.animateRevokable&&e.push("cc-animate"),this.customStyleSelector&&e.push(this.customStyleSelector);var i=this.options.revokeBtn.replace("{{classes}}",e.join(" "));this.revokeBtn=u.call(this,i);var n=this.revokeBtn;if(this.options.animateRevokable){var o=t.throttle(function(e){var i=!1,o=20,s=window.innerHeight-20;t.hasClass(n,"cc-top")&&e.clientYs&&(i=!0),i?t.hasClass(n,"cc-active")||t.addClass(n,"cc-active"):t.hasClass(n,"cc-active")&&t.removeClass(n,"cc-active")},200);this.onMouseMove=o,window.addEventListener("mousemove",o)}}}var g={enabled:!0,container:null,cookie:{name:"cookieconsent_status",path:"/",domain:"",expiryDays:365},onPopupOpen:function(){},onPopupClose:function(){},onInitialise:function(e){},onStatusChange:function(e,t){},onRevokeChoice:function(){},content:{header:"Cookies used on the website!",message:"This website uses cookies to ensure you get the best experience on our website.",dismiss:"Got it!",allow:"Allow cookies",deny:"Decline",link:"Learn more",href:"http://cookiesandyou.com",close:"❌"},elements:{header:'{{header}} ',message:'{{message}}',messagelink:'{{message}} {{link}}',dismiss:'{{dismiss}}',allow:'{{allow}}',deny:'{{deny}}',link:'{{link}}',close:'{{close}}'},window:'',revokeBtn:'
Cookie Policy
',compliance:{info:'
{{dismiss}}
',"opt-in":'
{{dismiss}}{{allow}}
',"opt-out":'
{{deny}}{{dismiss}}
'},type:"info",layouts:{basic:"{{messagelink}}{{compliance}}","basic-close":"{{messagelink}}{{compliance}}{{close}}","basic-header":"{{header}}{{message}}{{link}}{{compliance}}"},layout:"basic",position:"bottom",theme:"block","static":!1,palette:null,revokable:!1,animateRevokable:!0,showLink:!0,dismissOnScroll:!1,dismissOnTimeout:!1,autoOpen:!0,autoAttach:!0,whitelistPage:[],blacklistPage:[],overrideHTML:null};return n.prototype.initialise=function(e){this.options&&this.destroy(),t.deepExtend(this.options={},g),t.isPlainObject(e)&&t.deepExtend(this.options,e),r.call(this)&&(this.options.enabled=!1),m(this.options.blacklistPage,location.pathname)&&(this.options.enabled=!1),m(this.options.whitelistPage,location.pathname)&&(this.options.enabled=!0);var i=this.options.window.replace("{{classes}}",c.call(this).join(" ")).replace("{{children}}",l.call(this)),n=this.options.overrideHTML;if("string"==typeof n&&n.length&&(i=n),this.options["static"]){var o=u.call(this,'
'+i+"
");o.style.display="",this.element=o.firstChild,this.element.style.display="none",t.addClass(this.element,"cc-invisible")}else this.element=u.call(this,i);b.call(this),y.call(this),this.options.autoOpen&&this.autoOpen()},n.prototype.destroy=function(){this.onButtonClick&&this.element&&(this.element.removeEventListener("click",this.onButtonClick),this.onButtonClick=null),this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.onWindowScroll&&(window.removeEventListener("scroll",this.onWindowScroll),this.onWindowScroll=null),this.onMouseMove&&(window.removeEventListener("mousemove",this.onMouseMove),this.onMouseMove=null),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.revokeBtn&&this.revokeBtn.parentNode&&this.revokeBtn.parentNode.removeChild(this.revokeBtn),this.revokeBtn=null,f(this.options.palette),this.options=null},n.prototype.open=function(t){if(this.element)return this.isOpen()||(e.hasTransition?this.fadeIn():this.element.style.display="",this.options.revokable&&this.toggleRevokeButton(),this.options.onPopupOpen.call(this)),this},n.prototype.close=function(t){if(this.element)return this.isOpen()&&(e.hasTransition?this.fadeOut():this.element.style.display="none",t&&this.options.revokable&&this.toggleRevokeButton(!0),this.options.onPopupClose.call(this)),this},n.prototype.fadeIn=function(){var i=this.element;if(e.hasTransition&&i&&(this.afterTransition&&s.call(this,i),t.hasClass(i,"cc-invisible"))){if(i.style.display="",this.options["static"]){var n=this.element.clientHeight;this.element.parentNode.style.maxHeight=n+"px"}var r=20;this.openingTimeout=setTimeout(o.bind(this,i),r)}},n.prototype.fadeOut=function(){var i=this.element;e.hasTransition&&i&&(this.openingTimeout&&(clearTimeout(this.openingTimeout),o.bind(this,i)),t.hasClass(i,"cc-invisible")||(this.options["static"]&&(this.element.parentNode.style.maxHeight=""),this.afterTransition=s.bind(this,i),i.addEventListener(e.transitionEnd,this.afterTransition),t.addClass(i,"cc-invisible")))},n.prototype.isOpen=function(){return this.element&&""==this.element.style.display&&(!e.hasTransition||!t.hasClass(this.element,"cc-invisible"))},n.prototype.toggleRevokeButton=function(e){this.revokeBtn&&(this.revokeBtn.style.display=e?"":"none")},n.prototype.revokeChoice=function(e){this.options.enabled=!0,this.clearStatus(),this.options.onRevokeChoice.call(this),e||this.autoOpen()},n.prototype.hasAnswered=function(t){return Object.keys(e.status).indexOf(this.getStatus())>=0},n.prototype.hasConsented=function(t){var i=this.getStatus();return i==e.status.allow||i==e.status.dismiss},n.prototype.autoOpen=function(e){!this.hasAnswered()&&this.options.enabled&&this.open()},n.prototype.setStatus=function(i){var n=this.options.cookie,o=t.getCookie(n.name),s=Object.keys(e.status).indexOf(o)>=0;Object.keys(e.status).indexOf(i)>=0?(t.setCookie(n.name,i,n.expiryDays,n.domain,n.path),this.options.onStatusChange.call(this,i,s)):this.clearStatus()},n.prototype.getStatus=function(){return t.getCookie(this.options.cookie.name)},n.prototype.clearStatus=function(){var e=this.options.cookie;t.setCookie(e.name,"",-1,e.domain,e.path)},n}(),e.Location=function(){function e(e){t.deepExtend(this.options={},s),t.isPlainObject(e)&&t.deepExtend(this.options,e),this.currentServiceIndex=-1}function i(e,t,i){var n,o=document.createElement("script");o.type="text/"+(e.type||"javascript"),o.src=e.src||e,o.async=!1,o.onreadystatechange=o.onload=function(){var e=o.readyState;clearTimeout(n),t.done||e&&!/loaded|complete/.test(e)||(t.done=!0,t(),o.onreadystatechange=o.onload=null)},document.body.appendChild(o),n=setTimeout(function(){t.done=!0,t(),o.onreadystatechange=o.onload=null},i)}function n(e,t,i,n,o){var s=new(window.XMLHttpRequest||window.ActiveXObject)("MSXML2.XMLHTTP.3.0");if(s.open(n?"POST":"GET",e,1),s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),Array.isArray(o))for(var r=0,a=o.length;r3&&t(s)}),s.send(n)}function o(e){return new Error("Error ["+(e.code||"UNKNOWN")+"]: "+e.error)}var s={timeout:5e3,services:["freegeoip","ipinfo","maxmind"],serviceDefinitions:{freegeoip:function(){return{url:"//freegeoip.net/json/?callback={callback}",isScript:!0,callback:function(e,t){try{var i=JSON.parse(t);return i.error?o(i):{code:i.country_code}}catch(n){return o({error:"Invalid response ("+n+")"})}}}},ipinfo:function(){return{url:"//ipinfo.io",headers:["Accept: application/json"],callback:function(e,t){try{var i=JSON.parse(t);return i.error?o(i):{code:i.country}}catch(n){return o({error:"Invalid response ("+n+")"})}}}},ipinfodb:function(e){return{url:"//api.ipinfodb.com/v3/ip-country/?key={api_key}&format=json&callback={callback}",isScript:!0,callback:function(e,t){try{var i=JSON.parse(t);return"ERROR"==i.statusCode?o({error:i.statusMessage}):{code:i.countryCode}}catch(n){return o({error:"Invalid response ("+n+")"})}}}},maxmind:function(){return{url:"//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js",isScript:!0,callback:function(e){return window.geoip2?void geoip2.country(function(t){try{e({code:t.country.iso_code})}catch(i){e(o(i))}},function(t){e(o(t))}):void e(new Error("Unexpected response format. The downloaded script should have exported `geoip2` to the global scope"))}}}}};return e.prototype.getNextService=function(){var e;do e=this.getServiceByIdx(++this.currentServiceIndex);while(this.currentServiceIndex=0,revokable:t.revokable.indexOf(e)>=0,explicitAction:t.explicitAction.indexOf(e)>=0}},e.prototype.applyLaw=function(e,t){var i=this.get(t);return i.hasLaw||(e.enabled=!1),this.options.regionalLaw&&(i.revokable&&(e.revokable=!0),i.explicitAction&&(e.dismissOnScroll=!1,e.dismissOnTimeout=!1)),e},e}(),e.initialise=function(t,i,n){var o=new e.Law(t.law);i||(i=function(){}),n||(n=function(){}),e.getCountryCode(t,function(n){delete t.law,delete t.location,n.code&&(t=o.applyLaw(t,n.code)),i(new e.Popup(t))},function(i){delete t.law,delete t.location,n(i,new e.Popup(t))})},e.getCountryCode=function(t,i,n){if(t.law&&t.law.countryCode)return void i({code:t.law.countryCode});if(t.location){var o=new e.Location(t.location);return void o.locate(function(e){i(e||{})},n)}i({})},e.utils=t,e.hasInitialised=!0,window.cookieconsent=e}}(window.cookieconsent||{});; /*global Drupal, jQuery, Mustache, window, console, AndroidInterface, jplayer_swfPath, ga */ window.addEventListener("load", function() { window.cookieconsent.initialise({ "palette": { "popup": { "background": "#ffffff", "text": "#191919" }, "button": { "background": "#ffffff", "text": "#191919" } }, "theme": "edgeless", "content": { "message": "We use cookies and other tracking technologies to enhance your browsing experience. If you continue to use our site, you agree to the use of such cookies. For more info, see our privacy policy.", "dismiss": '', "link": false, "href": "https://www.thisamericanlife.org/page/privacy-policy" } }); }); var isMobile = { Android: function() { if (navigator.userAgent.match(/Android/i)) { if (typeof AndroidInterface !== 'undefined') { return true; } } return false; }, iOS: function() { if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { if (typeof window.webkit !== 'undefined' && typeof window.webkit.messageHandlers !== 'undefined') { return true; } } return false; } }; // Andoird if (isMobile.Android()) { window.addEventListener('talShortcut', function(e) { AndroidInterface.talShortcut(JSON.stringify(e.detail)); }); window.addEventListener('talPlay', function(e) { AndroidInterface.talPlay(JSON.stringify(e.detail)); }); window.addEventListener('talGoto', function(e) { AndroidInterface.talGoto(JSON.stringify(e.detail)); }); } // iOS if (isMobile.iOS()) { window.addEventListener('talShortcut', function(e) { window.webkit.messageHandlers.talShortcut.postMessage(JSON.stringify(e.detail)); }); window.addEventListener('talPlay', function(e) { window.webkit.messageHandlers.talPlay.postMessage(JSON.stringify(e.detail)); }); window.addEventListener('talGoto', function(e) { window.webkit.messageHandlers.talGoto.postMessage(JSON.stringify(e.detail)); }); } (function($) { $.fn.matchHeight._maintainScroll = true; $(document).ready(function() { $('body').addClass('loaded'); }); Drupal.behaviors.thislife = { attach: function() { } }; Drupal.behaviors.thislifePlayer = { attach: function() { var $body = $('body'), $header = $('#site-header'), $burger = $('#burger'), $nav = $('#main-menu'), $saved_archive = $('#saved-archive'), open_menu = false, isMobile = function() { try { document.createEvent("TouchEvent"); return true; } catch (e) { return false; } }; $nav.on('click', function(e) { e.stopPropagation(); }); $burger.on('click', function(e) { e.preventDefault(); e.stopPropagation(); if (open_menu) { open_menu = false; $body.removeClass('open-menu'); } else { open_menu = true; $body.addClass('open-menu'); } }); if (isMobile()) { $body.swipe({ swipeRight: function() { if (open_menu) { open_menu = false; $body.removeClass('open-menu'); } }, threshold: 20 }); } $header.on('click', '.scrim', function(e) { if (open_menu) { open_menu = false; $body.removeClass('open-menu'); e.preventDefault(); e.stopPropagation(); } }); var $eyebrow = $('#eyebrow'); if ($eyebrow.length) { if (typeof Cookies.get('serial_s3_eyebrow') === 'undefined') { $body.addClass('open-eyebrow'); } $eyebrow.on('click', 'a.close', function(e) { e.preventDefault(); $body.removeClass('open-eyebrow'); Cookies.set('serial_s3_eyebrow', true, { expires: 7 }); }); } var $main = $('#main'), $sidebar = $('#sidebar'), $top = $('#top'), $jp = $("#jplayer"), $player = $("#player"), $progress = $player.find('.jp-progress'), $info = $player.find('#player-info'), $share_modal = $('#share-modal'), $player_share_modal = $('#player-share-modal'), last_position = 0, playing = false, ready = false, current_episode = false, current_act = 0, last_path = window.location.pathname + window.location.search, $window = $(window), scrollTop = 0, windowHeight = 0, scrolled = false, viewSize = function() { var width = $window.width(), newview = (width >= 1024 ? 'desktop' : (width >= 768 ? 'tablet' : 'mobile')); return newview; }, view = viewSize(), updatePage = function() { scrollTop = $window.scrollTop(); animateElements(); window.requestAnimationFrame(updatePage); }, animateElements = function() { if (!scrolled && scrollTop > 0) { scrolled = true; $body.addClass('scrolled'); } else if (scrolled && scrollTop <= 0) { scrolled = false; $body.removeClass('scrolled'); } }, playAct = function(act) { var data = current_episode, current_timestamp = 0; $('a.play-act').removeClass('playing'); $info.find('.title').html('').hide(); if (typeof act !== 'undefined') { current_act = act; } else { current_act = 0; } if (typeof current_episode.acts !== 'undefined') { $.each(current_episode.acts, function(i, act) { if (act.number === current_act) { current_timestamp = act.timestamp; $info.find('.title').html(act.name).css('display', 'inline-block'); } }); } $jp.jPlayer('play', current_timestamp); $('a.play-' + current_episode.episode + '-' + current_act).addClass('playing'); }, playEpisode = function(act) { var data = current_episode, current_timestamp = 0; $('a.play-act').removeClass('playing'); $info.find('.episode').html(data.title); $info.find('.image').html($('').attr('src', data.thumbnail)); $info.find('.title').html('').hide(); $progress.find('.jump').remove(); if (typeof act !== 'undefined') { current_act = act; } else { current_act = 0; } if (typeof current_episode.acts !== 'undefined') { $.each(current_episode.acts, function(i, act) { if (act.number === current_act) { current_timestamp = act.timestamp; $info.find('.title').html(act.name).css('display', 'inline-block'); } }); } $jp.jPlayer("setMedia", { mp3: data.audio }).jPlayer('play', current_timestamp); $('a.play-' + current_episode.episode + '-' + current_act).addClass('playing'); }, initArchive = function() { var $form = $('#tal-episode-browse-form'); if ($form.length) { var $top = $('#top'), $body = $('body'), $modals = $form.find('.modal'), $options = $form.find('#browse-options'), $selects = $form.find('.form-wrapper-select'), $type_sort = $('#type-sort'), $filter_wrapper = $form.find('.filters'), dirty = false, active = true; $top.removeClass('disabled'); $type_sort.on('click', function(e) { if (view !== 'desktop') { if (!$type_sort.hasClass('open')) { e.preventDefault(); e.stopPropagation(); $type_sort.addClass('open'); } } }); $body.on('click', function(e) { if ($type_sort.hasClass('open')) { $type_sort.removeClass('open'); e.preventDefault(); } }); $form.find('a.options').on('click', function(e) { e.preventDefault(); $top.addClass('open-filters'); }); $options.on('click', 'a.close', function(e) { e.preventDefault(); $top.removeClass('open-filters'); }); $options.on('click', 'a.modal', function(e) { e.preventDefault(); var target = $(this).attr('href'), $target = $(target); $top.addClass('open-modals'); $target.show(); }); $options.find('a.modal').each(function() { var $option = $(this), element = $(this).data('element'), $element = $form.find('.' + element).find('select'); $option.on('click', function(e) { if ($option.hasClass('selected')) { e.preventDefault(); e.stopPropagation(); $option.removeClass('selected').find('.selection .value').text(''); $element.val(0); if (!dirty) { dirty = true; $form.addClass('dirty'); $form.submit(); } $top.removeClass('open-filters open-modals'); } }); }); $modals.each(function() { var $modal = $(this), id = $modal.attr('id'), $option = $options.find('.' + id), $select_wrapper = $selects.filter('.' + id), $alpha_nav = $modal.find('.alpha-nav'), $alpha = $modal.find('.alpha'); $modal.on('click', 'header a', function(e) { e.preventDefault(); $modal.hide(); $top.removeClass('open-modals'); }); $alpha_nav.on('click', 'a', function(e) { var href = $(this).attr('href'), $anchor = $(href); e.preventDefault(); e.stopPropagation(); $modal.find('.inner > .item-list').animate({ scrollTop: $anchor.position().top }, 250); }); $modal.on('click', '.inner a', function(e) { e.preventDefault(); var value = $(this).data('value'), key = $(this).data('key'), element = $(this).data('element'), $element = $form.find('.' + element), $select = $element.find('select'); $select.val(key); $option.addClass('selected').find('.selection .value').text(value); $select_wrapper.addClass('selected').find('.selection .value').text(value); dirty = true; $form.addClass('dirty'); if (view === 'desktop') { $form.submit(); } else { $modal.hide(); $top.removeClass('open-modals'); } }); }); $selects.each(function() { var $select = $(this); $select.on('click', 'label', function(e) { e.preventDefault(); if ($select.hasClass('selected')) { e.stopPropagation(); $select.find('select').val(0); $form.submit(); } else { var target = $select.data('target'), $target = $('#' + target); $top.addClass('open-modals'); $target.show(); } }); }); $form.on('submit', function(e) { e.preventDefault(); if (active) { active = false; $top.removeClass('open-filters open-modals').addClass('disabled'); $modals.hide(); $.ajax({ url: $(this).attr('action'), type: $(this).attr('method'), dataType: 'json', data: $(this).serialize(), success: function(data) { $top.removeClass('open-modals'); gotoPath(data.redirect); } }); } }); /* $modals.on('click', function(e) { e.stopPropagation(); }); $options.on('click', function(e) { e.stopPropagation(); }); $filter_wrapper.on('click', function(e) { $top.removeClass('open-modals open-filters'); $modals.hide(); $options.hide(); }); */ } }, resizePage = function() { scrollTop = $window.scrollTop(); windowHeight = $window.height(); view = viewSize(); }, initLinks = function() { $('.contextual-links-wrapper').find('a').addClass('ignore'); // External Links $('a.shareout').once('links').addClass('external').on('click', function(e) { var event = new CustomEvent('talGoto', { detail: { type: 'external', url: $(this).prop('href'), ctrlKey: e.ctrlKey, metaKey: e.metaKey } }); window.dispatchEvent(event); if ($jp.length) { e.preventDefault(); } }); $share_modal.find('a.close').once('links').addClass('ignore').on('click', function(e) { e.preventDefault(); $body.removeClass('open-share'); }); $('a.share').once('links').addClass('ignore').on('click', function(e) { e.preventDefault(); $body.addClass('open-share'); }); $player_share_modal.find('a.close').once('links').addClass('ignore').on('click', function(e) { e.preventDefault(); $body.removeClass('open-player-share'); }); $('a.player-share').once('links').addClass('ignore').on('click', function(e) { e.preventDefault(); $body.addClass('open-player-share'); }); // External Links $('a[href]:not([href*="' + window.location.hostname + '"]):not([href^="#"]):not([href^="/"]):not([href^="javascript:"]):not([href^="mailto:"]):not(.cut)').once('links').addClass('external').on('click', function(e) { var event = new CustomEvent('talGoto', { detail: { type: 'external', url: $(this).prop('href'), ctrlKey: e.ctrlKey, metaKey: e.metaKey } }); window.dispatchEvent(event); if ($jp.length) { e.preventDefault(); } }); // External Links $('a.external').once('links').on('click', function(e) { var event = new CustomEvent('talGoto', { detail: { type: 'external', url: $(this).prop('href'), ctrlKey: e.ctrlKey, metaKey: e.metaKey } }); window.dispatchEvent(event); if ($jp.length) { e.preventDefault(); } }); // Links $('a[href*="' + window.location.hostname + '"],[href^="/"]').not('.goto, .play, .ignore').once('links').addClass('internal').on('click', function(e) { var event = new CustomEvent('talGoto', { detail: { type: 'internal', url: $(this).prop('href'), ctrlKey: e.ctrlKey, metaKey: e.metaKey } }); window.dispatchEvent(event); if ($jp.length) { e.preventDefault(); } }); $('.node-episode').once('links').each(function() { var detail = { type: $(this).data('type'), id: $(this).data('id'), episode: $(this).data('episode'), }; $(this).on('click.special', 'a.goto-episode', function(e) { detail.url = $(this).prop('href'); detail.ctrlKey = e.ctrlKey; detail.metaKey = e.metaKey; var event = new CustomEvent('talGoto', { detail: detail }); window.dispatchEvent(event); if ($jp.length) { e.preventDefault(); } }); }); $('.node-transcript').once('links').each(function() { var $node = $(this); $(this).on('click.special', 'a.goto-episode', function(e) { var detail = { type: 'episode', id: $node.data('episode-id'), episode: $node.data('episode'), url: $(this).prop('href') }; detail.ctrlKey = e.ctrlKey; detail.metaKey = e.metaKey; var event = new CustomEvent('talGoto', { detail: detail }); window.dispatchEvent(event); if ($jp.length) { e.preventDefault(); } }); }); $('.node-pick').once('links').each(function() { var detail = { type: $(this).data('type'), id: $(this).data('id'), }; $(this).on('click.special', 'a.goto-collection', function(e) { detail.url = $(this).prop('href'); detail.ctrlKey = e.ctrlKey; detail.metaKey = e.metaKey; var event = new CustomEvent('talGoto', { detail: detail }); window.dispatchEvent(event); if ($jp.length) { e.preventDefault(); } }); $(this).on('click.special', 'a.goto-act, a.goto-episode', function(e) { var $act = $(this), detail = { type: $act.data('type'), id: $act.data('id'), episode: $act.data('episode'), url: $(this).prop('href') }; detail.ctrlKey = e.ctrlKey; detail.metaKey = e.metaKey; var event = new CustomEvent('talGoto', { detail: detail }); window.dispatchEvent(event); if ($jp.length) { e.preventDefault(); } }); }); $('.node-act').once('links').each(function() { var $act = $(this); $(this).on('click.special', 'a.goto-act', function(e) { var detail = { type: $act.data('type'), id: $act.data('id'), episode: $act.data('episode'), url: $(this).prop('href') }; detail.url = $(this).prop('href'); detail.ctrlKey = e.ctrlKey; detail.metaKey = e.metaKey; var event = new CustomEvent('talGoto', { detail: detail }); window.dispatchEvent(event); if ($jp.length) { e.preventDefault(); } }); $(this).on('click.special', 'a.goto-episode', function(e) { var detail = { type: 'episode', id: $act.data('episode-id'), episode: $act.data('episode'), url: $(this).prop('href') }; detail.ctrlKey = e.ctrlKey; detail.metaKey = e.metaKey; var event = new CustomEvent('talGoto', { detail: detail }); window.dispatchEvent(event); if ($jp.length) { e.preventDefault(); } }); }); $('.node-collection').once('links').each(function() { var detail = { type: $(this).data('type'), id: $(this).data('id'), }; $(this).on('click.special', 'a.goto-collection', function(e) { detail.url = $(this).prop('href'); detail.ctrlKey = e.ctrlKey; detail.metaKey = e.metaKey; var event = new CustomEvent('talGoto', { detail: detail }); window.dispatchEvent(event); if ($jp.length) { e.preventDefault(); } }); }); var $actions = $('ul.actions'); $actions.find('a.download').off('click').on('click.download', function(e) { e.preventDefault(); }); // Shortcut $('a.cut').attr('target', '_blank'); $actions.on('click.shortcut', 'a.cut', function(e) { var event = new CustomEvent('talShortcut', { detail: { type: $(this).data('type'), id: $(this).data('id'), url: $(this).prop('href') } }); window.dispatchEvent(event); }); // Play $('a.play').off('click').on('click.play', function(e) { e.preventDefault(); if ($(this).hasClass('playing')) { $jp.jPlayer('pause'); } else { if (!$body.hasClass('player') && $body.hasClass('node-type-homepage')) { var event = new CustomEvent('talGoto', { detail: { type: 'internal', url: $(this).prop('href') } }); window.dispatchEvent(event); } var event = new CustomEvent('talPlay', { detail: { type: $(this).data('type'), id: $(this).data('id'), episode: $(this).data('episode'), act: $(this).data('act') } }); window.dispatchEvent(event); } }); }, initPage = function() { initLinks(); initArchive(); Drupal.behaviors.contextualLinks.attach(); Drupal.behaviors.thislifeHeight.attach(); Drupal.behaviors.thislifeAbout.attach(); Drupal.behaviors.thislifeExtras.attach(); if (typeof current_episode !== 'undefined') { if (playing) { $('a.play-' + current_episode.episode + '-' + current_act).addClass('playing'); $('a.play-' + current_episode.episode).addClass('playing'); } else { $('a.play-act').removeClass('playing'); $('a.play-' + current_episode.episode).removeClass('playing'); } } }, gotoPath = function(url, data, replace) { var split = url.split('#'), path = split[0], fragment = split[1], scrollTo = 0; if (path[0] === '/') { if (last_path === path) { $top.removeClass('disabled'); if (fragment && $('#' + fragment).length) { var offset = $('#' + fragment).offset().top; $('html, body').animate({ scrollTop: offset }, 0); } else { $('html, body').animate({ scrollTop: 0 }, 0); } } else { if (typeof replace === 'undefined' && last_path.substring(0, 8) === '/archive') { // If archive, save current state for when we need to go back $saved_archive.html($main.html()).data({ path: last_path, scroll: scrollTop }); } var goto_path = Drupal.settings.basePath + 'goto' + path; if (path === '/') { goto_path += '?type=json'; } $.ajax({ url: goto_path, cache: true, data: data, dataType: 'json', error: function() { window.open(path, '_self'); }, success: function(data) { last_path = path; if (window.history.pushState) { if (replace) { window.history.replaceState({ path: path }, '', path); } else { window.history.pushState({ path: path }, '', path); } } $top.empty(); $sidebar.empty(); if (typeof replace !== 'undefined' && replace && url.substring(0, 8) === '/archive' && $saved_archive.html() && $saved_archive.data('path') === url) { // We're going back to the archive. Try to load from saved state. if ($saved_archive.data('scroll')) { scrollTo = $saved_archive.data('scroll'); } $main.html($saved_archive.html()); $main.find('.links-processed').removeClass('links-processed'); $saved_archive.empty().removeData('scroll path'); } else { $main.html(data.main); } if (typeof data.sidebar !== 'undefined') { $sidebar.html(data.sidebar); } if (typeof data.top !== 'undefined') { $top.html(data.top); } if (typeof data.color !== 'undefined') { $header.css('background-color', data.color); } else { $header.css('background-color', ''); } $nav.find('li.active-trail').removeClass('active-trail'); $nav.find('a.active').removeClass('active'); open_menu = false; $body.removeClass('open-menu player-open'); if (typeof data.facebook !== 'undefined') { $share_modal.find('a.facebook').attr('href', data.facebook); } if (typeof data.twitter !== 'undefined') { $share_modal.find('a.twitter').attr('href', data.twitter); } if (typeof data.mail !== 'undefined') { $share_modal.find('a.mail').attr('href', data.mail); } if (fragment && fragment === 'keyword' && $('#edit-keyword').length) { $('#edit-keyword').focus(); } else if (fragment && $('#' + fragment).length) { var offset = $('#' + fragment).offset().top; $('html, body').animate({ scrollTop: offset }, 0); } else { $('html, body').animate({ scrollTop: scrollTo }, 0); } var classes = $('body').attr("class").split(' '); $.each(classes, function(i, c) { if (c.indexOf("page-") === 0) { $('body').removeClass(c); } if (c.indexOf("node-") === 0) { $('body').removeClass(c); } }); if (typeof data.node_type !== 'undefined') { $('body').addClass('node-type-' + data.node_type); } if (typeof data.section !== 'undefined') { $('body').addClass('page-' + data.section); if (!isNaN(data.section)) { $('body').addClass('page-episode-number-' + data.section); } var section = data.section; if (section === 'listen') { section = 'how-to-listen'; } $nav.find('li.' + section).addClass('active-trail'); } $('title').text(data.title); initPage(); //Drupal.attachBehaviors($main); if (typeof ga !== 'undefined') { ga('send', 'pageview', { 'page': path, 'title': data.title }); } } }); /* end ajax */ } } }; initLinks(); initArchive(); $(window).on('load', function() { resizePage(); }).on("throttledresize", function() { resizePage(); }); resizePage(); window.requestAnimationFrame(updatePage); if ($jp.length) { var fingerprint, heartbeat = function() { if (typeof fingerprint !== 'undefined') { var data = { fingerprint: fingerprint, episode: current_episode.episode, position: last_position, source: 'thisamericanlife' }; $.ajax({ url: "https://hb.serialpodcast.org/", data: data }); } }; new Fingerprint2().get(function(result) { fingerprint = result; }); $jp.jPlayer({ ready: function() { ready = true; }, timeupdate: function(event) { var position = parseInt(event.jPlayer.status.currentTime), new_total = Math.floor(event.jPlayer.status.duration), new_act = 0; if (typeof current_episode.acts !== 'undefined') { $.each(current_episode.acts, function(i, act) { if (position >= act.timestamp) { new_act = act.number; } }); } if (new_act !== current_act) { $('a.play-act').removeClass('playing'); if (typeof current_episode.acts !== 'undefined') { $.each(current_episode.acts, function(i, act) { if (act.number === new_act) { current_act = act.number; $info.find('.title').html(act.name).css('display', 'inline-block'); if (typeof act.byline !== 'undefined') { $info.find('.contributor').html(act.byline); } else { $info.find('.contributor').empty(); } if (typeof act.summary !== 'undefined') { $info.find('.body').html(act.summary); } else { $info.find('.body').empty(); } initLinks(); } }); } $('a.play-' + current_episode.episode + '-' + current_act).addClass('playing'); } if (new_total > 60 && position % 1 === 0) { if (position > (last_position + 14)) { last_position = position; heartbeat(); } } var status = event.jPlayer.status; $('.jp-remaining').text($.jPlayer.convertTime(status.duration - status.currentTime)); }, play: function() { playing = true; $('body').addClass('player playing'); $('a.play-' + current_episode.episode + '-' + current_act).addClass('playing'); $('a.play-' + current_episode.episode).addClass('playing'); }, pause: function() { $('body').removeClass('playing'); playing = false; $('a.play-act').removeClass('playing'); $('a.play-' + current_episode.episode).removeClass('playing'); }, loadeddata: function(event) { var duration = event.jPlayer.status.duration; if (typeof current_episode.acts !== 'undefined') { $.each(current_episode.acts, function(i, act) { if (act.number > 0) { var $jump = $('').addClass('jump').css({ left: (act.timestamp / duration * 100) + '%' }).on('click', function() { $jp.jPlayer('play', act.timestamp); }); $progress.append($jump); } }); } }, ended: function() { playing = false; $('body').removeClass('playing'); last_position = 0; }, swfPath: jplayer_swfPath, wmode: "window" }); $player.find('a.cut').on('click', function(e) { e.preventDefault(); if (typeof current_episode !== false && typeof current_episode.episode !== 'undefined') { var url = 'https://shortcut.thisamericanlife.org/#/clipping/' + current_episode.episode; if ($jp.data("jPlayer").status.currentTime) { var timestamp = Math.floor($jp.data("jPlayer").status.currentTime); url += '/' + timestamp; } $jp.jPlayer('pause'); window.open(url, '_blank'); } }); $(window).on('talGoto', function(e) { var detail = e.originalEvent.detail; if ((typeof detail.ctrlKey !== 'undefined' && detail.ctrlKey) || (typeof detail.metaKey !== 'undefined' && detail.metaKey)) { window.open(detail.url, '_blank'); } else if ($body.hasClass('page-broadcast')) { window.open(detail.url, '_blank'); } else if ($body.hasClass('page-status-404-not-found')) { window.open(detail.url, '_self'); } else if ($body.hasClass('page-heartbeat')) { window.open(detail.url, '_self'); } else if (detail.type === 'external') { window.open(detail.url, '_blank'); } else { var path = detail.url; if (path[0] !== '/') { path = path.replace('http://' + window.location.hostname, ''); path = path.replace('https://' + window.location.hostname, ''); } if (path.match(/^\/(user|admin|system|heartbeat)/i)) { // Admin path, open regularly window.open(detail.url, '_self'); } else if (path[0] === '/') { gotoPath(path); } } }); $(window).bind('popstate', function() { var path = window.location.pathname + window.location.search; gotoPath(path, {}, true); }); $(window).on('talPlay', function(e) { var detail = e.originalEvent.detail; if (typeof detail.type !== 'undefined') { $('body').addClass('player'); if (detail.type === 'episode') { if (typeof detail.episode !== 'undefined') { if (typeof current_episode === false || current_episode.episode !== detail.episode) { if ($('#playlist-data').length) { var data = JSON.parse($('#playlist-data').html()); current_episode = data; if (typeof data.facebook !== 'undefined') { $player_share_modal.find('a.facebook').attr('href', data.facebook); } if (typeof data.twitter !== 'undefined') { $player_share_modal.find('a.twitter').attr('href', data.twitter); } if (typeof data.mail !== 'undefined') { $player_share_modal.find('a.mail').attr('href', data.mail); } playEpisode(); } } else { $jp.jPlayer('play'); } } } else if (detail.type === 'act') { if (typeof detail.episode !== 'undefined') { if (typeof current_episode === false || current_episode.episode !== detail.episode) { if ($('#playlist-data').length) { var data = JSON.parse($('#playlist-data').html()); current_episode = data; if (typeof data.facebook !== 'undefined') { $player_share_modal.find('a.facebook').attr('href', data.facebook); } if (typeof data.twitter !== 'undefined') { $player_share_modal.find('a.twitter').attr('href', data.twitter); } if (typeof data.mail !== 'undefined') { $player_share_modal.find('a.mail').attr('href', data.mail); } playEpisode(detail.act); } } else if (detail.act !== current_act) { playAct(detail.act); } else { $jp.jPlayer('play'); } } } } }); $player.on('click', 'a, .jp-progress', function(e) { e.stopPropagation(); }); $player.on('click', 'a.close', function() { $body.removeClass('player-open'); }); $player.find('a.jp-rewind').click(function(e) { e.preventDefault(); if (ready) { var new_time = Math.floor($jp.data("jPlayer").status.currentTime) - 10; if (new_time < 0) { new_time = 0; } $jp.jPlayer('play', new_time); } }); $player.find('a.jp-forward').click(function(e) { e.preventDefault(); if (ready) { var new_time = Math.floor($jp.data("jPlayer").status.currentTime) + 30; if (new_time < $jp.data("jPlayer").status.duration) { $jp.jPlayer('play', new_time); } } }); $player.find('a.jp-previous').click(function(e) { e.preventDefault(); if (ready && current_episode) { if (typeof current_episode.acts !== 'undefined') { var time = Math.floor($jp.data("jPlayer").status.currentTime), acts = current_episode.acts.slice().reverse(); $.each(acts, function(i, act) { if (act.number <= current_act && act.timestamp < time) { $jp.jPlayer('play', act.timestamp); return false; } }); } } }); $player.find('a.jp-next').click(function(e) { e.preventDefault(); if (ready && current_episode) { if (typeof current_episode.acts !== 'undefined') { var time = Math.floor($jp.data("jPlayer").status.currentTime); $.each(current_episode.acts, function(i, act) { if (act.number > current_act && act.timestamp > time) { $jp.jPlayer('play', act.timestamp); return false; } }); } } }); $player.on('click', function() { if (view === 'mobile') { if ($body.hasClass('player-open')) { } else { $body.addClass('player-open'); } } }); } $main.on('click', 'a.pager', function(e) { e.preventDefault(); var $a = $(this), path = $(this).attr('href'); $.ajax({ url: path, cache: true, dataType: 'json', success: function(data) { var $pager = $a.parents('ul.pager').parent('.item-list'); $pager.replaceWith(data.html); if (window.history.pushState) { window.history.replaceState({ path: path, }, '', data.path); } Drupal.behaviors.thislifeHeight.attach(); initLinks(); if (typeof ga !== 'undefined') { ga('send', 'pageview', { 'page': path, 'title': data.title }); } } }); }); } }; Drupal.behaviors.thislifeAbout = { attach: function() { var $menu = $('#block-tal-about-menu'); if ($menu.length) { $menu.on('click', function(e) { e.preventDefault(); $menu.toggleClass('open'); }); $menu.on('click', '.content', function(e) { e.stopPropagation(); }); $menu.on('click', 'a', function() { $menu.removeClass('open'); }); } if ($('body').hasClass('page-about-announcements')) { var $nodes = $('#main').find('.node-announcement').slice(0, 2); $nodes.matchHeight(); } } }; Drupal.behaviors.thislifeExtras = { attach: function() { if ($('body').hasClass('node-type-gallery')) { var $node = $('#main').find('.node-gallery'), $gallery_slideshow = $node.find('#gallery-slideshow'), $gallery_slides = $gallery_slideshow.find('.gallery-slide'), $gallery_images = $node.find('figure.file-image'), gallery_slide_template = $node.find('#gallery-slide-template').html(), current_slide = 0, total_slides = $gallery_images.length, $window = $(window), window_width = $window.width(), desktop_width = 1024, caption_offset = 0, reset_caption_offset = function() { $gallery_slides.removeClass('offset').find('.meta > .inner').removeAttr('style'); caption_offset = $gallery_slides.eq(current_slide).find('.meta > .inner').position(); $gallery_slides.addClass('offset').find('.meta > .inner').css('top', caption_offset.top); }; $(window).on('load', function() { window_width = $window.width(); }).on("throttledresize", function() { var new_width = $window.width(); if (new_width < desktop_width) { $gallery_slideshow.hide(); $gallery_slides.hide(); } window_width = new_width; reset_caption_offset(); }); $gallery_images.each(function(i) { var $gallery_image = $(this), slide_data = { color: $node.data('background'), img: $gallery_image.find('img').attr('src'), width: $gallery_image.find('img').attr('width'), height: $gallery_image.find('img').attr('height'), current: i + 1, total: total_slides, caption: $gallery_image.find('figcaption').html() }, slide = Mustache.to_html(gallery_slide_template, slide_data); $gallery_slideshow.append(slide); $gallery_image.on('click', function(e) { if (window_width >= desktop_width) { e.preventDefault(); current_slide = i; $gallery_slides.eq(i).show(); $gallery_slideshow.show(); reset_caption_offset(); } }); }); $gallery_slides = $gallery_slideshow.find('.gallery-slide'); $gallery_slideshow.on('click', 'button.close', function(e) { e.preventDefault(); $gallery_slideshow.hide(); $gallery_slides.hide(); }); $gallery_slideshow.on('click', 'button.prev', function(e) { e.preventDefault(); var new_slide = current_slide - 1; if (new_slide < 0) { new_slide = total_slides - 1; } $gallery_slides.hide(); $gallery_slides.eq(new_slide).show(); current_slide = new_slide; }); $gallery_slideshow.on('click', 'button.next', function(e) { e.preventDefault(); var new_slide = current_slide + 1; if (new_slide >= total_slides) { new_slide = 0; } $gallery_slides.hide(); $gallery_slides.eq(new_slide).show(); current_slide = new_slide; }); $(document).keydown(function(e) { switch (e.keyCode) { // Left case 37: var new_slide = current_slide - 1; if (new_slide < 0) { new_slide = total_slides - 1; } $gallery_slides.hide(); $gallery_slides.eq(new_slide).show(); current_slide = new_slide; break; // Right case 39: var new_slide = current_slide + 1; if (new_slide >= total_slides) { new_slide = 0; } $gallery_slides.hide(); $gallery_slides.eq(new_slide).show(); current_slide = new_slide; break; // Escape case 27: $gallery_slideshow.hide(); $gallery_slides.hide(); break; } }); } } }; Drupal.behaviors.thislifeHeight = { attach: function() { if ($('body').hasClass('page-archive')) { $('#main').find('.node.view-teaser').matchHeight(); } if ($('body').hasClass('node-type-video-collection')) { $('#main').find('.node-video.view-collection .content').matchHeight(); } if ($('body').hasClass('node-type-homepage')) { var $node = $('#main').find('.node-homepage'), $featured = $node.find('.featured'); if ($featured.length) { $featured.find('.node.view-featured .inner').matchHeight(); } } } }; /* This is the end */ })(jQuery);;