var addComment={moveForm:function(a,b,c,d){var e,f=this,g=f.I(a),h=f.I(c),i=f.I("cancel-comment-reply-link"),j=f.I("comment_parent"),k=f.I("comment_post_ID");if(g&&h&&i&&j){f.respondId=c,d=d||!1,f.I("wp-temp-form-div")||(e=document.createElement("div"),e.id="wp-temp-form-div",e.style.display="none",h.parentNode.insertBefore(e,h)),g.parentNode.insertBefore(h,g.nextSibling),k&&d&&(k.value=d),j.value=b,i.style.display="",i.onclick=function(){var a=addComment,b=a.I("wp-temp-form-div"),c=a.I(a.respondId);if(b&&c)return a.I("comment_parent").value="0",b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),this.style.display="none",this.onclick=null,!1};try{f.I("comment").focus()}catch(l){}return!1}},I:function(a){return document.getElementById(a)}}; ;/* RequireJS 2.1.11 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. Available via the MIT or new BSD license. see: http://github.com/jrburke/requirejs for details */ var requirejs,require,define; (function(ca){function G(b){return"[object Function]"===M.call(b)}function H(b){return"[object Array]"===M.call(b)}function v(b,c){if(b){var d;for(d=0;dthis.depCount&&!this.defined){if(G(c)){if(this.events.error&&this.map.isDefine||h.onError!==da)try{f=i.execCb(b,c,e,f)}catch(d){a=d}else f=i.execCb(b,c,e,f);this.map.isDefine&&void 0===f&&((e=this.module)?f=e.exports:this.usingExports&& (f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=c;this.exports=f;if(this.map.isDefine&&!this.ignore&&(p[b]=f,h.onResourceLoad))h.onResourceLoad(i,this.map,this.depMaps);y(b);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a= this.map,b=a.id,d=m(a.prefix);this.depMaps.push(d);r(d,"defined",t(this,function(f){var d,g;g=j(ba,this.map.id);var J=this.map.name,u=this.map.parentMap?this.map.parentMap.name:null,p=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(J=f.normalize(J,function(a){return c(a,u,!0)})||""),f=m(a.prefix+"!"+J,this.map.parentMap),r(f,"defined",t(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),g=j(k,f.id)){this.depMaps.push(f); if(this.events.error)g.on("error",t(this,function(a){this.emit("error",a)}));g.enable()}}else g?(this.map.url=i.nameToUrl(g),this.load()):(d=t(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),d.error=t(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(k,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),d.fromText=t(this,function(f,c){var g=a.name,J=m(g),k=O;c&&(f=c);k&&(O=!1);q(J);s(l.config,b)&&(l.config[g]=l.config[b]);try{h.exec(f)}catch(j){return w(C("fromtexteval", "fromText eval for "+b+" failed: "+j,j,[b]))}k&&(O=!0);this.depMaps.push(J);i.completeLoad(g);p([g],d)}),f.load(a.name,p,d,l))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){W[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,t(this,function(a,b){var c,f;if("string"===typeof a){a=m(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=j(N,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;r(a,"defined",t(this,function(a){this.defineDep(b, a);this.check()}));this.errback&&r(a,"error",t(this,this.errback))}c=a.id;f=k[c];!s(N,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,t(this,function(a){var b=j(k,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:l,contextName:b,registry:k,defined:p,urlFetched:T,defQueue:A,Module:$,makeModuleMap:m, nextTick:h.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="index.html");var b=l.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(l[b]||(l[b]={}),V(l[b],a,!0,!0)):l[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(ba[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);b[c]=a}),l.shim=b);a.packages&&v(a.packages,function(a){var b, a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(l.paths[b]=a.location);l.pkgs[b]=a.name+"/"+(a.main||"main").replace(ja,"").replace(R,"")});B(k,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=m(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ca,arguments));return b||a.exports&&ea(a.exports)}},makeRequire:function(a,e){function g(f,c,d){var j,l;e.enableBuildCallback&&(c&&G(c))&&(c.__requireJsBuild= !0);if("string"===typeof f){if(G(c))return w(C("requireargs","Invalid require call"),d);if(a&&s(N,f))return N[f](k[a.id]);if(h.get)return h.get(i,f,a,g);j=m(f,a,!1,!0);j=j.id;return!s(p,j)?w(C("notloaded",'Module name "'+j+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):p[j]}L();i.nextTick(function(){L();l=q(m(null,a));l.skipMap=e.skipMap;l.init(f,c,d,{enabled:!0});D()});return g}e=e||{};V(g,{isBrowser:z,toUrl:function(b){var e,d=b.lastIndexOf("."),g=b.split("index.html")[0];if(-1!== d&&(!("."===g||".."===g)||1g.attachEvent.toString().indexOf("[native code"))&&!Z?(O=!0,g.attachEvent("onreadystatechange",b.onScriptLoad)): (g.addEventListener("load",b.onScriptLoad,!1),g.addEventListener("error",b.onScriptError,!1)),g.src=d,L=g,D?y.insertBefore(g,D):y.appendChild(g),L=null,g;if(fa)try{importScripts(d),b.completeLoad(c)}catch(j){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,j,[c]))}};z&&!r.skipDataMain&&U(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(K=b.getAttribute("data-main"))return q=K,r.baseUrl||(E=q.split("index.html"),q=E.pop(),Q=E.length?E.join("index.html")+"/":"./",r.baseUrl= Q),q=q.replace(R,""),h.jsExtRegExp.test(q)&&(q=K),r.deps=r.deps?r.deps.concat(q):[q],!0});define=function(b,c,d){var g,h;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(la,"").replace(ma,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(O){if(!(g=L))P&&"interactive"===P.readyState||U(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return P=b}),g=P;g&&(b|| (b=g.getAttribute("data-requiremodule")),h=F[g.getAttribute("data-requirecontext")])}(h?h.defQueue:S).push([b,c,d])};define.amd={jQuery:!0};h.exec=function(b){return eval(b)};h(r)}})(this); ;(function(){var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.push,h=d.slice,i=d.concat,j=e.toString,k=e.hasOwnProperty,l=d.forEach,m=d.map,n=d.reduce,o=d.reduceRight,p=d.filter,q=d.every,r=d.some,s=d.indexOf,t=d.lastIndexOf,u=Array.isArray,v=Object.keys,w=f.bind,x=function(a){return a instanceof x?a:this instanceof x?void(this._wrapped=a):new x(a)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=x),exports._=x):a._=x,x.VERSION="1.6.0";var y=x.each=x.forEach=function(a,b,d){if(null==a)return a;if(l&&a.forEach===l)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;f>e;e++)if(b.call(d,a[e],e,a)===c)return}else for(var g=x.keys(a),e=0,f=g.length;f>e;e++)if(b.call(d,a[g[e]],g[e],a)===c)return;return a};x.map=x.collect=function(a,b,c){var d=[];return null==a?d:m&&a.map===m?a.map(b,c):(y(a,function(a,e,f){d.push(b.call(c,a,e,f))}),d)};var z="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),n&&a.reduce===n)return d&&(b=x.bind(b,d)),e?a.reduce(b,c):a.reduce(b);if(y(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)}),!e)throw new TypeError(z);return c},x.reduceRight=x.foldr=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),o&&a.reduceRight===o)return d&&(b=x.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=a.length;if(f!==+f){var g=x.keys(a);f=g.length}if(y(a,function(h,i,j){i=g?g[--f]:--f,e?c=b.call(d,c,a[i],i,j):(c=a[i],e=!0)}),!e)throw new TypeError(z);return c},x.find=x.detect=function(a,b,c){var d;return A(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},x.filter=x.select=function(a,b,c){var d=[];return null==a?d:p&&a.filter===p?a.filter(b,c):(y(a,function(a,e,f){b.call(c,a,e,f)&&d.push(a)}),d)},x.reject=function(a,b,c){return x.filter(a,function(a,d,e){return!b.call(c,a,d,e)},c)},x.every=x.all=function(a,b,d){b||(b=x.identity);var e=!0;return null==a?e:q&&a.every===q?a.every(b,d):(y(a,function(a,f,g){return(e=e&&b.call(d,a,f,g))?void 0:c}),!!e)};var A=x.some=x.any=function(a,b,d){b||(b=x.identity);var e=!1;return null==a?e:r&&a.some===r?a.some(b,d):(y(a,function(a,f,g){return e||(e=b.call(d,a,f,g))?c:void 0}),!!e)};x.contains=x.include=function(a,b){return null==a?!1:s&&a.indexOf===s?-1!=a.indexOf(b):A(a,function(a){return a===b})},x.invoke=function(a,b){var c=h.call(arguments,2),d=x.isFunction(b);return x.map(a,function(a){return(d?b:a[b]).apply(a,c)})},x.pluck=function(a,b){return x.map(a,x.property(b))},x.where=function(a,b){return x.filter(a,x.matches(b))},x.findWhere=function(a,b){return x.find(a,x.matches(b))},x.max=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.max.apply(Math,a);var d=-1/0,e=-1/0;return y(a,function(a,f,g){var h=b?b.call(c,a,f,g):a;h>e&&(d=a,e=h)}),d},x.min=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.min.apply(Math,a);var d=1/0,e=1/0;return y(a,function(a,f,g){var h=b?b.call(c,a,f,g):a;e>h&&(d=a,e=h)}),d},x.shuffle=function(a){var b,c=0,d=[];return y(a,function(a){b=x.random(c++),d[c-1]=d[b],d[b]=a}),d},x.sample=function(a,b,c){return null==b||c?(a.length!==+a.length&&(a=x.values(a)),a[x.random(a.length-1)]):x.shuffle(a).slice(0,Math.max(0,b))};var B=function(a){return null==a?x.identity:x.isFunction(a)?a:x.property(a)};x.sortBy=function(a,b,c){return b=B(b),x.pluck(x.map(a,function(a,d,e){return{value:a,index:d,criteria:b.call(c,a,d,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var C=function(a){return function(b,c,d){var e={};return c=B(c),y(b,function(f,g){var h=c.call(d,f,g,b);a(e,h,f)}),e}};x.groupBy=C(function(a,b,c){x.has(a,b)?a[b].push(c):a[b]=[c]}),x.indexBy=C(function(a,b,c){a[b]=c}),x.countBy=C(function(a,b){x.has(a,b)?a[b]++:a[b]=1}),x.sortedIndex=function(a,b,c,d){c=B(c);for(var e=c.call(d,b),f=0,g=a.length;g>f;){var h=f+g>>>1;c.call(d,a[h])b?[]:h.call(a,0,b)},x.initial=function(a,b,c){return h.call(a,0,a.length-(null==b||c?1:b))},x.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:h.call(a,Math.max(a.length-b,0))},x.rest=x.tail=x.drop=function(a,b,c){return h.call(a,null==b||c?1:b)},x.compact=function(a){return x.filter(a,x.identity)};var D=function(a,b,c){return b&&x.every(a,x.isArray)?i.apply(c,a):(y(a,function(a){x.isArray(a)||x.isArguments(a)?b?g.apply(c,a):D(a,b,c):c.push(a)}),c)};x.flatten=function(a,b){return D(a,b,[])},x.without=function(a){return x.difference(a,h.call(arguments,1))},x.partition=function(a,b){var c=[],d=[];return y(a,function(a){(b(a)?c:d).push(a)}),[c,d]},x.uniq=x.unique=function(a,b,c,d){x.isFunction(b)&&(d=c,c=b,b=!1);var e=c?x.map(a,c,d):a,f=[],g=[];return y(e,function(c,d){(b?d&&g[g.length-1]===c:x.contains(g,c))||(g.push(c),f.push(a[d]))}),f},x.union=function(){return x.uniq(x.flatten(arguments,!0))},x.intersection=function(a){var b=h.call(arguments,1);return x.filter(x.uniq(a),function(a){return x.every(b,function(b){return x.contains(b,a)})})},x.difference=function(a){var b=i.apply(d,h.call(arguments,1));return x.filter(a,function(a){return!x.contains(b,a)})},x.zip=function(){for(var a=x.max(x.pluck(arguments,"length").concat(0)),b=new Array(a),c=0;a>c;c++)b[c]=x.pluck(arguments,""+c);return b},x.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},x.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=x.sortedIndex(a,b),a[d]===b?d:-1;d=0>c?Math.max(0,e+c):c}if(s&&a.indexOf===s)return a.indexOf(b,c);for(;e>d;d++)if(a[d]===b)return d;return-1},x.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=null!=c;if(t&&a.lastIndexOf===t)return d?a.lastIndexOf(b,c):a.lastIndexOf(b);for(var e=d?c:a.length;e--;)if(a[e]===b)return e;return-1},x.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);d>e;)f[e++]=a,a+=c;return f};var E=function(){};x.bind=function(a,b){var c,d;if(w&&a.bind===w)return w.apply(a,h.call(arguments,1));if(!x.isFunction(a))throw new TypeError;return c=h.call(arguments,2),d=function(){if(!(this instanceof d))return a.apply(b,c.concat(h.call(arguments)));E.prototype=a.prototype;var e=new E;E.prototype=null;var f=a.apply(e,c.concat(h.call(arguments)));return Object(f)===f?f:e}},x.partial=function(a){var b=h.call(arguments,1);return function(){for(var c=0,d=b.slice(),e=0,f=d.length;f>e;e++)d[e]===x&&(d[e]=arguments[c++]);for(;c=k?(clearTimeout(g),g=null,h=j,f=a.apply(d,e),d=e=null):g||c.trailing===!1||(g=setTimeout(i,k)),f}},x.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=x.now()-g;b>j?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),f=e=null))};return function(){f=this,e=arguments,g=x.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},x.once=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments),a=null,b)}},x.wrap=function(a,b){return x.partial(b,a)},x.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},x.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},x.keys=function(a){if(!x.isObject(a))return[];if(v)return v(a);var b=[];for(var c in a)x.has(a,c)&&b.push(c);return b},x.values=function(a){for(var b=x.keys(a),c=b.length,d=new Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},x.pairs=function(a){for(var b=x.keys(a),c=b.length,d=new Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},x.invert=function(a){for(var b={},c=x.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},x.functions=x.methods=function(a){var b=[];for(var c in a)x.isFunction(a[c])&&b.push(c);return b.sort()},x.extend=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)a[c]=b[c]}),a},x.pick=function(a){var b={},c=i.apply(d,h.call(arguments,1));return y(c,function(c){c in a&&(b[c]=a[c])}),b},x.omit=function(a){var b={},c=i.apply(d,h.call(arguments,1));for(var e in a)x.contains(c,e)||(b[e]=a[e]);return b},x.defaults=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)void 0===a[c]&&(a[c]=b[c])}),a},x.clone=function(a){return x.isObject(a)?x.isArray(a)?a.slice():x.extend({},a):a},x.tap=function(a,b){return b(a),a};var F=function(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof x&&(a=a._wrapped),b instanceof x&&(b=b._wrapped);var e=j.call(a);if(e!=j.call(b))return!1;switch(e){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]==a)return d[f]==b;var g=a.constructor,h=b.constructor;if(g!==h&&!(x.isFunction(g)&&g instanceof g&&x.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1;c.push(a),d.push(b);var i=0,k=!0;if("[object Array]"==e){if(i=a.length,k=i==b.length)for(;i--&&(k=F(a[i],b[i],c,d)););}else{for(var l in a)if(x.has(a,l)&&(i++,!(k=x.has(b,l)&&F(a[l],b[l],c,d))))break;if(k){for(l in b)if(x.has(b,l)&&!i--)break;k=!i}}return c.pop(),d.pop(),k};x.isEqual=function(a,b){return F(a,b,[],[])},x.isEmpty=function(a){if(null==a)return!0;if(x.isArray(a)||x.isString(a))return 0===a.length;for(var b in a)if(x.has(a,b))return!1;return!0},x.isElement=function(a){return!(!a||1!==a.nodeType)},x.isArray=u||function(a){return"[object Array]"==j.call(a)},x.isObject=function(a){return a===Object(a)},y(["Arguments","Function","String","Number","Date","RegExp"],function(a){x["is"+a]=function(b){return j.call(b)=="[object "+a+"]"}}),x.isArguments(arguments)||(x.isArguments=function(a){return!(!a||!x.has(a,"callee"))}),"function"!=typeof/./&&(x.isFunction=function(a){return"function"==typeof a}),x.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},x.isNaN=function(a){return x.isNumber(a)&&a!=+a},x.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"==j.call(a)},x.isNull=function(a){return null===a},x.isUndefined=function(a){return void 0===a},x.has=function(a,b){return k.call(a,b)},x.noConflict=function(){return a._=b,this},x.identity=function(a){return a},x.constant=function(a){return function(){return a}},x.property=function(a){return function(b){return b[a]}},x.matches=function(a){return function(b){if(b===a)return!0;for(var c in a)if(a[c]!==b[c])return!1;return!0}},x.times=function(a,b,c){for(var d=Array(Math.max(0,a)),e=0;a>e;e++)d[e]=b.call(c,e);return d},x.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},x.now=Date.now||function(){return(new Date).getTime()};var G={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};G.unescape=x.invert(G.escape);var H={escape:new RegExp("["+x.keys(G.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(G.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(a){x[a]=function(b){return null==b?"":(""+b).replace(H[a],function(b){return G[a][b]})}}),x.result=function(a,b){if(null==a)return void 0;var c=a[b];return x.isFunction(c)?c.call(a):c},x.mixin=function(a){y(x.functions(a),function(b){var c=x[b]=a[b];x.prototype[b]=function(){var a=[this._wrapped];return g.apply(a,arguments),M.call(this,c.apply(x,a))}})};var I=0;x.uniqueId=function(a){var b=++I+"";return a?a+b:b},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var J=/(.)^/,K={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(a,b,c){var d;c=x.defaults({},c,x.templateSettings);var e=new RegExp([(c.escape||J).source,(c.interpolate||J).source,(c.evaluate||J).source].join("|")+"|$","g"),f=0,g="__p+='";a.replace(e,function(b,c,d,e,h){return g+=a.slice(f,h).replace(L,function(a){return"\\"+K[a]}),c&&(g+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"),d&&(g+="'+\n((__t=("+d+"))==null?'':__t)+\n'"),e&&(g+="';\n"+e+"\n__p+='"),f=h+b.length,b}),g+="';\n",c.variable||(g="with(obj||{}){\n"+g+"}\n"),g="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+g+"return __p;\n";try{d=new Function(c.variable||"obj","_",g)}catch(h){throw h.source=g,h}if(b)return d(b,x);var i=function(a){return d.call(this,a,x)};return i.source="function("+(c.variable||"obj")+"){\n"+g+"}",i},x.chain=function(a){return x(a).chain()};var M=function(a){return this._chain?x(a).chain():a};x.mixin(x),y(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];x.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!=a&&"splice"!=a||0!==c.length||delete c[0],M.call(this,c)}}),y(["concat","join","slice"],function(a){var b=d[a];x.prototype[a]=function(){return M.call(this,b.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return x})}).call(this); ;// (c) 2010-2011 Jeremy Ashkenas, DocumentCloud Inc. // (c) 2011-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Backbone may be freely distributed under the MIT license. // Copyright (c)2014 Derick Bailey, Muted Solutions, LLC. // Distributed under MIT license /*! * Includes BabySitter * https://github.com/marionettejs/backbone.babysitter/ * * Includes Wreqr * https://github.com/marionettejs/backbone.wreqr/ */ /** @license * * SoundManager 2: JavaScript Sound for the Web * ---------------------------------------------- * http://schillmania.com/projects/soundmanager2/ * * Copyright (c) 2007, Scott Schiller. All rights reserved. * Code provided under the BSD License: * http://schillmania.com/projects/soundmanager2/license.txt * * V2.97a.20131201 */ /** * @license RequireJS text 2.0.10 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/requirejs/text for details */ /*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh) * Licensed under the MIT License (LICENSE.txt). * * Version: 3.1.9 * * Requires: jQuery 1.2.2+ */ /*! * jScrollPane - v2.0.19 - 2013-11-16 * http://jscrollpane.kelvinluck.com/ * * Copyright (c) 2013 Kelvin Luck * Dual licensed under the MIT or GPL licenses. */ function replaceURLWithHTMLLinks(e){var t=/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi;return e.replace(t,"$1")}function pad(e,t){for(var n=e+"";n.lengthl;l++)if(e=o[l],s=this._events[e]){if(this._events[e]=r=[],t||i)for(c=0,d=s.length;d>c;c++)a=s[c],(t&&t!==a.callback&&t!==a.callback._callback||i&&i!==a.context)&&r.push(a);r.length||delete this._events[e]}return this},trigger:function(e){if(!this._events)return this;var t=s.call(arguments,1);if(!u(this,"trigger",e,t))return this;var n=this._events[e],i=this._events.all;return n&&p(n,t),i&&p(i,arguments),this},stopListening:function(e,t,i){var r=this._listeningTo;if(!r)return this;var a=!t&&!i;i||"object"!=typeof t||(i=this),e&&((r={})[e._listenId]=e);for(var s in r)e=r[s],e.off(t,i,this),(a||n.isEmpty(e._events))&&delete this._listeningTo[s];return this}},l=/\s+/,u=function(e,t,n,i){if(!n)return!0;if("object"==typeof n){for(var r in n)e[t].apply(e,[r,n[r]].concat(i));return!1}if(l.test(n)){for(var a=n.split(l),s=0,o=a.length;o>s;s++)e[t].apply(e,[a[s]].concat(i));return!1}return!0},p=function(e,t){var n,i=-1,r=e.length,a=t[0],s=t[1],o=t[2];switch(t.length){case 0:for(;++id;d++)this.trigger("change:"+o[d],this,c[o[d]],i)}if(u)return this;if(!l)for(;this._pending;)this._pending=!1,this.trigger("change",this,i);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,n.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var i in this.attributes)t[i]=void 0;return this.set(t,n.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!n.isEmpty(this.changed):n.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?n.clone(this.changed):!1;var t,i=!1,r=this._changing?this._previousAttributes:this.attributes;for(var a in e)n.isEqual(r[a],t=e[a])||((i||(i={}))[a]=t);return i},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(e){e=e?n.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=this,i=e.success;return e.success=function(n){return t.set(t.parse(n,e),e)?(i&&i(t,n,e),void t.trigger("sync",t,n,e)):!1},H(this,e),this.sync("read",this,e)},save:function(e,t,i){var r,a,s,o=this.attributes;if(null==e||"object"==typeof e?(r=e,i=t):(r={})[e]=t,i=n.extend({validate:!0},i),r&&!i.wait){if(!this.set(r,i))return!1}else if(!this._validate(r,i))return!1;r&&i.wait&&(this.attributes=n.extend({},o,r)),void 0===i.parse&&(i.parse=!0);var l=this,u=i.success;return i.success=function(e){l.attributes=o;var t=l.parse(e,i);return i.wait&&(t=n.extend(r||{},t)),n.isObject(t)&&!l.set(t,i)?!1:(u&&u(l,e,i),void l.trigger("sync",l,e,i))},H(this,i),a=this.isNew()?"create":i.patch?"patch":"update","patch"===a&&(i.attrs=r),s=this.sync(a,this,i),r&&i.wait&&(this.attributes=o),s},destroy:function(e){e=e?n.clone(e):{};var t=this,i=e.success,r=function(){t.trigger("destroy",t,t.collection,e)};if(e.success=function(n){(e.wait||t.isNew())&&r(),i&&i(t,n,e),t.isNew()||t.trigger("sync",t,n,e)},this.isNew())return e.success(),!1;H(this,e);var a=this.sync("delete",this,e);return e.wait||r(),a},url:function(){var e=n.result(this,"urlRoot")||n.result(this.collection,"url")||L();return this.isNew()?e:e+("/"===e.charAt(e.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(e){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},isValid:function(e){return this._validate({},n.extend(e||{},{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=n.extend({},this.attributes,e);var i=this.validationError=this.validate(e,t)||null;return i?(this.trigger("invalid",this,i,n.extend(t,{validationError:i})),!1):!0}});var h=["keys","values","pairs","invert","pick","omit"];n.each(h,function(e){d.prototype[e]=function(){var t=s.call(arguments);return t.unshift(this.attributes),n[e].apply(n,t)}});var f=t.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,n.extend({silent:!0},t))},m={add:!0,remove:!0,merge:!0},g={add:!0,remove:!1};n.extend(f.prototype,o,{model:d,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return t.sync.apply(this,arguments)},add:function(e,t){return this.set(e,n.extend({merge:!1},t,g))},remove:function(e,t){var i=!n.isArray(e);e=i?[e]:n.clone(e),t||(t={});var r,a,s,o;for(r=0,a=e.length;a>r;r++)o=e[r]=this.get(e[r]),o&&(delete this._byId[o.id],delete this._byId[o.cid],s=this.indexOf(o),this.models.splice(s,1),this.length--,t.silent||(t.index=s,o.trigger("remove",o,this,t)),this._removeReference(o));return i?e[0]:e},set:function(e,t){t=n.defaults({},t,m),t.parse&&(e=this.parse(e,t));var i=!n.isArray(e);e=i?e?[e]:[]:n.clone(e);var r,a,s,o,l,u,p,c=t.at,h=this.model,f=this.comparator&&null==c&&t.sort!==!1,g=n.isString(this.comparator)?this.comparator:null,v=[],y=[],_={},w=t.add,b=t.merge,k=t.remove,C=!f&&w&&k?[]:!1;for(r=0,a=e.length;a>r;r++){if(l=e[r],s=l instanceof d?o=l:l[h.prototype.idAttribute],u=this.get(s))k&&(_[u.cid]=!0),b&&(l=l===o?o.attributes:l,t.parse&&(l=u.parse(l,t)),u.set(l,t),f&&!p&&u.hasChanged(g)&&(p=!0)),e[r]=u;else if(w){if(o=e[r]=this._prepareModel(l,t),!o)continue;v.push(o),o.on("all",this._onModelEvent,this),this._byId[o.cid]=o,null!=o.id&&(this._byId[o.id]=o)}C&&C.push(u||o)}if(k){for(r=0,a=this.length;a>r;++r)_[(o=this.models[r]).cid]||y.push(o);y.length&&this.remove(y,t)}if(v.length||C&&C.length)if(f&&(p=!0),this.length+=v.length,null!=c)for(r=0,a=v.length;a>r;r++)this.models.splice(c+r,0,v[r]);else{C&&(this.models.length=0);var M=C||v;for(r=0,a=M.length;a>r;r++)this.models.push(M[r])}if(p&&this.sort({silent:!0}),!t.silent){for(r=0,a=v.length;a>r;r++)(o=v[r]).trigger("add",o,this,t);(p||C&&C.length)&&this.trigger("sort",this,t)}return i?e[0]:e},reset:function(e,t){t||(t={});for(var i=0,r=this.models.length;r>i;i++)this._removeReference(this.models[i]);return t.previousModels=this.models,this._reset(),e=this.add(e,n.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,n.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e),t},unshift:function(e,t){return this.add(e,n.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(){return s.apply(this.models,arguments)},get:function(e){return null==e?void 0:this._byId[e.id]||this._byId[e.cid]||this._byId[e]},at:function(e){return this.models[e]},where:function(e,t){return n.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var n in e)if(e[n]!==t.get(n))return!1;return!0})},findWhere:function(e){return this.where(e,!0)},sort:function(e){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return e||(e={}),n.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(n.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return n.invoke(this.models,"get",e)},fetch:function(e){e=e?n.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=e.success,i=this;return e.success=function(n){var r=e.reset?"reset":"set";i[r](n,e),t&&t(i,n,e),i.trigger("sync",i,n,e)},H(this,e),this.sync("read",this,e)},create:function(e,t){if(t=t?n.clone(t):{},!(e=this._prepareModel(e,t)))return!1;t.wait||this.add(e,t);var i=this,r=t.success;return t.success=function(e,t,n){n.wait&&i.add(e,n),r&&r(e,t,n)},e.save(null,t),e},parse:function(e){return e},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(e instanceof d)return e.collection||(e.collection=this),e;t=t?n.clone(t):{},t.collection=this;var i=new this.model(e,t);return i.validationError?(this.trigger("invalid",this,i.validationError,t),!1):i},_removeReference:function(e){this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,i){("add"!==e&&"remove"!==e||n===this)&&("destroy"===e&&this.remove(t,i),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],null!=t.id&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments))}});var v=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain"];n.each(v,function(e){f.prototype[e]=function(){var t=s.call(arguments);return t.unshift(this.models),n[e].apply(n,t)}});var y=["groupBy","countBy","sortBy"];n.each(y,function(e){f.prototype[e]=function(t,i){var r=n.isFunction(t)?t:function(e){return e.get(t)};return n[e](this.models,r,i)}});var _=t.View=function(e){this.cid=n.uniqueId("view"),e||(e={}),n.extend(this,n.pick(e,b)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},w=/^(\S+)\s*(.*)$/,b=["model","collection","el","id","attributes","className","tagName","events"];n.extend(_.prototype,o,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(e,n){return this.$el&&this.undelegateEvents(),this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0],n!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=n.result(this,"events")))return this;this.undelegateEvents();for(var t in e){var i=e[t];if(n.isFunction(i)||(i=this[e[t]]),i){var r=t.match(w),a=r[1],s=r[2];i=n.bind(i,this),a+=".delegateEvents"+this.cid,""===s?this.$el.on(a,i):this.$el.on(a,s,i)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"),!1);else{var e=n.extend({},n.result(this,"attributes"));this.id&&(e.id=n.result(this,"id")),this.className&&(e["class"]=n.result(this,"className"));var i=t.$("<"+n.result(this,"tagName")+">").attr(e);this.setElement(i,!1)}}}),t.sync=function(e,i,r){var a=C[e];n.defaults(r||(r={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var s={type:a,dataType:"json"};if(r.url||(s.url=n.result(i,"url")||L()),null!=r.data||!i||"create"!==e&&"update"!==e&&"patch"!==e||(s.contentType="application/json",s.data=JSON.stringify(r.attrs||i.toJSON(r))),r.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),r.emulateHTTP&&("PUT"===a||"DELETE"===a||"PATCH"===a)){s.type="POST",r.emulateJSON&&(s.data._method=a);var o=r.beforeSend;r.beforeSend=function(e){return e.setRequestHeader("X-HTTP-Method-Override",a),o?o.apply(this,arguments):void 0}}"GET"===s.type||r.emulateJSON||(s.processData=!1),"PATCH"===s.type&&k&&(s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var l=r.xhr=t.ajax(n.extend(s,r));return i.trigger("request",i,l,r),l};var k=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),C={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var M=t.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},P=/\((.*?)\)/g,T=/(\(\?)?:\w+/g,x=/\*\w+/g,O=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(M.prototype,o,{initialize:function(){},route:function(e,i,r){n.isRegExp(e)||(e=this._routeToRegExp(e)),n.isFunction(i)&&(r=i,i=""),r||(r=this[i]);var a=this;return t.history.route(e,function(n){var s=a._extractParameters(e,n);r&&r.apply(a,s),a.trigger.apply(a,["route:"+i].concat(s)),a.trigger("route",i,s),t.history.trigger("route",a,i,s)}),this},navigate:function(e,n){return t.history.navigate(e,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var e,t=n.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(O,"\\$&").replace(P,"(?:$1)?").replace(T,function(e,t){return t?e:"([^/]+)"}).replace(x,"(.*?)"),new RegExp("^"+e+"$")},_extractParameters:function(e,t){var i=e.exec(t).slice(1);return n.map(i,function(e){return e?decodeURIComponent(e):null})}});var A=t.History=function(){this.handlers=[],n.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},j=/^[#\/]|\s+$/g,S=/^\/+|\/+$/g,I=/msie [\w.]+/,E=/\/$/,R=/[?#].*$/;A.started=!1,n.extend(A.prototype,o,{interval:50,getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(e,t){if(null==e)if(this._hasPushState||!this._wantsHashChange||t){e=this.location.pathname;var n=this.root.replace(E,"");e.indexOf(n)||(e=e.slice(n.length))}else e=this.getHash();return e.replace(j,"")},start:function(e){if(A.started)throw new Error("Backbone.history has already been started");A.started=!0,this.options=n.extend({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var i=this.getFragment(),r=document.documentMode,a=I.exec(navigator.userAgent.toLowerCase())&&(!r||7>=r);this.root=("/"+this.root+"/").replace(S,"/"),a&&this._wantsHashChange&&(this.iframe=t.$('\r\n \r\n\r\n' }),define("apps/smart-podcast-player/track-details/view",["app","text!templates/track-details-template.html"],function(e,t){return e.module("AskPatPlayerApp.TrackDetails.View",function(e,n,i,r,a,s){e.TrackDetails=r.Layout.extend({template:s.template(t),className:"spp-track-details",triggers:{"click .spp-play-pause-btn":"play","click .spp-button-download":"track:download","click .spp-previous-btn":"track:previous","click .spp-next-btn":"track:next","click .spp-currently-playing":"track:current","click .details-btn":"content:toggle"},events:{"click .spp-player-tag":"filterTag","click .spp-progress-container":"seek","click .spp-share-btn":"share"},initialize:function(){var e=this;a(window).on("spp_resize",function(){e.resize()})},resize:function(){this.trigger("resize")},socialPopup:function(e,t){window.open(t,"pinterest","screenX=100,screenY=100,height=360,width=730"),e.preventDefault(),e.stopPropagation()},share:function(e){var t=this,n=t.model.get("data"),i=a(e.currentTarget),r=""!=n.fallback_permalink&&null!=n.fallback_permalink&&void 0!=n.fallback_permalink?n.fallback_permalink:""!=n.permalink_url?n.permalink_url:"";if(i.hasClass("spp-facebook")&&this.socialPopup(e,"http://www.facebook.com/sharer/sharer.php?s=100&p[url]="+encodeURIComponent(r)+"&p[images][0]=&p[title]="+encodeURIComponent(n.title)),i.hasClass("spp-twitter")){var s=encodeURIComponent(n.title)+" "+encodeURIComponent(r);""!=n.hashtag&&void 0!=n.hashtag&&(s=s+" "+encodeURIComponent("#"+n.hashtag)),this.socialPopup(e,"http://twitter.com/home?status="+s)}i.hasClass("spp-gplus")&&this.socialPopup(e,"https://plus.google.com/share?url="+encodeURIComponent(r))},seek:function(e){function t(){n.bytesLoaded/n.bytesTotal>p&&(n.pause(),n.setPosition(p*l),n.spp-play(),clearInterval(u))}var n=soundManager.getSoundById("track_"+this.model.get("id")),i=e.offsetX,r=e.offsetY,s=a(e.currentTarget).width(),o=n.spp-o,l=this.model.get("duration");void 0==i&&(i=e.pageX-this.$(".spp-progress-container").offset().left),void 0==r&&(r=e.pageY-this.$(".spp-progress-container").offset().top);var u,p=i/s;if(n.bytesLoaded/n.bytesTotal>p)n.pause(),n.setPosition(p*l),n.spp-play();else{this.$el.hasClass("playing")||n.spp-play(),n.pause();var c=100*p+"%";a(e.currentTarget).find(".spp-progress-icon").css({left:c}),u=setInterval(t,250)}},filterTag:function(e){this.trigger("playlist:filter",this,a(e.currentTarget).text())},onRender:function(){var e=this.model.get("data"),t=e.tags,n="";a.each(t,function(e,t){n+='
  • '+t+"
  • "}),this.$(".spp-tag-list").html(n)}})}),e.AskPatPlayerApp.TrackDetails.View}),define("apps/smart-podcast-player/track-details/controller",["app","apps/smart-podcast-player/track-details/view","entities/podcast-track","soundmanager2","vendor/jquery.jscrollpane.min","vendor/jquery.mousewheel"],function(e,t){return e.module("AskPatPlayerApp.TrackDetails",function(e,n,i,r,a){var s=[];e.Controller={init:function(e){var i=e.model.get("region"),r=(e.model.get("options"),n.request("track:entity:current",e)),o=new t.TrackDetails({model:r});o.on("show",function(){window.innerWidth>768&&o.$el.jScrollPane()}),o.on("playlist:filter",function(t,i){n.trigger("playlist:filter",e,i)}),o.on("resize",function(){window.innerWidth>768&&a(".spp-player .spp-track-details-container").show(),o.$el.removeData("jsp").removeClass("jspScrollable"),o.$el.attr("style","").attr("tabindex",""),o.$(".jspContainer").remove(),o.render(),window.innerWidth>768&&o.$el.jScrollPane()}),o.on("track:download",function(e){var t=e.model.get("data"),n=t.download_url;"https:"===location.protocol&&(n=n.replace(/^http:\/\//i,"https://"));var i=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);if(i||"soundcloud"==t.method&&("http:"!==location.protocol||i))window.location=n+"?consumer_key="+AP_Player.soundcloudConsumerKey;else{var r="soundcloud"==t.method?n+"?consumer_key="+AP_Player.soundcloudConsumerKey:AP_Player.homeUrl+"?spp_download="+n;e.view.$(".spp-downloader").prop("src",r)}}),o.on("track:current",function(){var t=n.request("track:entity:current",e);o.$el.removeData("jsp").removeClass("jspScrollable"),o.$el.attr("style","").attr("tabindex",""),o.$(".jspContainer").remove(),this.model=t,this.render(),window.innerWidth>768&&this.$el.jScrollPane()}),o.on("render",function(){o.$el.removeClass("spp-current"),window.innerWidth>768?o.$el.jScrollPane():(o.$el.removeData("jsp").removeClass("jspScrollable"),o.$el.attr("style","").attr("tabindex",""),o.$(".jspContainer").remove());var t=n.request("track:entity:current",e);t.attributes.data.id===o.model.attributes.data.id&&o.$el.addClass("spp-current")}),e.trackDetailsRegion.show(o),s[i]=o},show:function(e,t){var n=e.model.get("region"),i=s[n];i.$el.removeData("jsp").removeClass("jspScrollable"),i.$el.attr("style","").attr("tabindex",""),i.$(".jspContainer").remove(),i.model=t,i.render(),window.innerWidth>768&&i.$el.jScrollPane()}}}),e.AskPatPlayerApp.TrackDetails.Controller}),define("apps/smart-podcast-player/player/view",["app","text!templates/player-template.html"],function(e,t){return e.module("AskPatPlayerApp.Player.View",function(e,n,i,r,a,s){e.Player=r.ItemView.extend({template:s.template(t),className:"spp-player",triggers:{"click .spp-play":"track:play","click .spp-next":"track:next","click .spp-previous":"track:previous","click .spp-speed":"track:speed","click .spp-show-notes-button":"track:show-notes"},events:{"mousemove .spp-track":"cursorMove","mouseout .spp-track":"cursorOut","click .spp-track":"seek"},initialize:function(){this.hover=!1;var e=this;a(window).on("spp_resize",function(){e.resize()})},resize:function(){this.trigger("resize")},seek:function(e){this.trigger("track:seek",e)},cursorMove:function(e){this.trigger("cursor:move",e)},cursorOut:function(e){this.trigger("cursor:out",e)},onRender:function(){}})}),e.AskPatPlayerApp.Player.View}),define("apps/smart-podcast-player/player/controller",["app","apps/smart-podcast-player/player/view","entities/podcast-player","entities/podcast-track","soundmanager2"],function(e,t){return e.module("AskPatPlayerApp.Player",function(e,n,i,r,a){var s=[],o=[],l=[];e.Controller={init:function(e){var i=e.model.get("region"),r=e.model.get("options"),u=n.request("player:entity",e);l[i]=new t.Player({model:u});var p=0,c=n.request("track:entities",e);c.each(function(e){var t=e.get("data");p+="number"==typeof t.playback_count?t.playback_count:0}),l[i].on("resize",function(){var e=l[i].model.get("data");if(window.innerWidth>768){var t=l[i].$el.outerWidth();null===e.show_logo||void 0===e.show_logo||""===e.show_logo?t=t:t-=100,l[i].$(".spp-track").css({width:t+"px"}),l[i].$(".spp-show-logo").show()}else l[i].$(".spp-track").css({width:"100%"}),l[i].$(".spp-show-logo").hide()}),l[i].on("track:show-notes",function(){this.$el.parents(".smart-podcast-player").find(".spp-track-details-container").is(":visible")?(this.$el.parents(".smart-podcast-player").find(".spp-track-details-container").hide(),l[i].$(".spp-show-notes-button").text("Show Notes")):(this.$el.parents(".smart-podcast-player").find(".spp-track-details-container").show(),l[i].$(".spp-show-notes-button").text("Hide Notes"))}),l[i].on("show",function(){var e=l[i].model.get("data");if(window.innerWidth>768){var t=l[i].$el.outerWidth();null===e.show_logo||void 0===e.show_logo||""===e.show_logo?t=t:t-=100,l[i].$(".spp-track").css({width:t+"px"}),l[i].$(".spp-show-logo").show()}else l[i].$(".spp-track").css({width:"100%"}),l[i].$(".spp-show-logo").hide();if(p){var n=p.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")+" Listens";""!=e.show_name&&void 0!==e.show_name&&(n=" • "+n),l[i].$(".spp-show-count").text(n)}}),l[i].on("render",function(){var e=l[i].model.get("data");if(window.innerWidth>768){var t=l[i].$el.outerWidth();null===e.show_logo||void 0===e.show_logo||""===e.show_logo?t=t:t-=100,l[i].$(".spp-track").css({width:t+"px"}),l[i].$(".spp-show-logo").show()}else l[i].$(".spp-track").css({width:"100%"}),l[i].$(".spp-show-logo").hide();if(p){var n=p.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")+" Listens";""!=e.show_name&&void 0!==e.show_name&&(n=" • "+n),l[i].$(".spp-show-count").text(n)}}),l[i].on("track:play",function(t){var i=this.$el.hasClass("spp-playing"),r=(t.model.get("data"),"track_"+t.model.cid);a(".spp-track, .smart-track-player").removeClass("spp-playing"),i?(a(".spp-player").removeClass("spp-playing"),this.$(".spp-player-playlist .spp-track").removeClass("spp-active"),soundManager.pauseAll(),n.request("track:entities:set",e,"playing",!1)):(soundManager.pauseAll(),soundManager.play(r),this.$el.addClass("spp-playing"),n.request("track:entities:set",e,"playing",!1),n.request("track:entity:set",e,t.model,"playing",!0),a('.spp-track[data-tid="'+r+'"]').addClass("spp-playing"))}),l[i].on("track:speed",function(t){var i=this.$el.hasClass("spp-playing"),r=(t.model.get("data"),"track_"+t.model.cid),s=soundManager.getSoundById(r);a(".spp-track, .smart-track-player").removeClass("spp-playing"),i||(soundManager.pauseAll(),soundManager.play(r),this.$el.addClass("spp-playing"),n.request("track:entities:set",e,"playing",!1),n.request("track:entity:set",e,t.model,"playing",!0),a('.spp-track[data-tid="'+r+'"]').addClass("spp-playing")),s.isHTML5&&(.5==s._a.playbackRate?(this.$el.hasClass("spp-speeding-half")&&this.$el.removeClass("spp-speeding-half"),s._a.playbackRate=1):1==s._a.playbackRate?(this.$el.addClass("spp-speeding-onehalf"),s._a.playbackRate=1.5):1.5==s._a.playbackRate?(this.$el.hasClass("spp-speeding-onehalf")&&this.$el.removeClass("spp-speeding-onehalf"),this.$el.addClass("spp-speeding-two"),s._a.playbackRate=2):2==s._a.playbackRate?(this.$el.hasClass("spp-speeding-two")&&this.$el.removeClass("spp-speeding-two"),this.$el.addClass("spp-speeding-three"),s._a.playbackRate=3):3==s._a.playbackRate?(this.$el.hasClass("spp-speeding-three")&&this.$el.removeClass("spp-speeding-three"),this.$el.addClass("spp-speeding-half"),s._a.playbackRate=.5):s._a.playbackRate=1)}),l[i].on("track:seek",function(e){function t(){r.bytesLoaded/r.bytesTotal>c&&(r.setPosition(c*r.durationEstimate),r.play(),clearInterval(p))}if(window.innerWidth>768){{var n=l[i].model.get("data"),r=soundManager.getSoundById("track_"+l[i].model.cid),s=l[i].$(".spp-track").offset(),o=e.pageX-s.left,u=a(e.currentTarget).outerWidth();r.position,n.durationEstimate}void 0==o&&(o=e.pageX-this.$(".spp-track").offset().left);var p,c=o/u;r.bytesLoaded/r.bytesTotal>c?(r.pause(),r.setPosition(c*r.durationEstimate),r.play()):(this.$el.hasClass("spp-playing")||r.play(),r.pause(),p=setInterval(t,250))}}),l[i].on("cursor:move",function(e){if(window.innerWidth>768){l[i].$el.addClass("spp-hover");var t=l[i].$(".spp-track").offset(),n=e.pageX-t.left;this.$(".spp-position").css({left:n+"px"})}}),l[i].on("cursor:out",function(){if(window.innerWidth>768){var e=l[i].model.get("data"),t=soundManager.getSoundById("track_"+l[i].model.cid);if(t){var n=t.position,r=e.duration,a=n/r*100;l[i].$(".spp-position").css({left:a+"%"})}l[i].$el.removeClass("spp-hover")}}),l[i].on("track:next",function(t){var u=t.model,p=(u.get("data"),"track_"+u.cid);soundManager.pauseAll(),soundManager.unload(p),a(".spp-player").removeClass("spp-playing"),s[i]=n.request("track:entities:current",e),o[i]=n.request("track:entities:paged",e,s[i],r.current_page,r.tracks_per_page);var c=s[i].indexOf(u),d=c+1,h=s[i].length-1,f=s[i].at(h>d?d:0);n.trigger("playlist:paging:track",e,f),l[i].trigger("track:update",f)}),l[i].on("track:previous",function(t){var a=t.model,u=(a.get("data"),"track_"+a.cid);soundManager.pauseAll(),soundManager.unload(u),s[i]=n.request("track:entities:current",e),o[i]=n.request("track:entities:paged",e,s[i],r.current_page,r.tracks_per_page);var p=s[i].indexOf(a),c=p-1,d=s[i].length-1,h=s[i].at(0>c?d:c);n.trigger("playlist:paging:track",e,h),l[i].trigger("track:update",h)}),l[i].on("track:update",function(t){{var r=(t.get("data"),"track_"+t.cid),s=(l[i].model.get("data"),"track_"+l[i].model.cid);this.$el.hasClass("spp-playing")}a(".spp-player").removeClass("spp-playing"),a(".spp-track").removeClass("spp-active"),s==r?l[i].trigger("track:play",this):(a('.spp-track[data-tid="'+s+'"]').addClass("spp-active"),soundManager.pauseAll(),soundManager.unload(s),l[i].model=t,l[i].render(),l[i].trigger("track:play",this),n.trigger("playlist:paging:update",e),n.trigger("track-details:show",e,t))}),e.playerRegion.show(l[i])},playTrack:function(e,t){var n=e.model.get("region");l[n].trigger("track:update",t)}}}),e.AskPatPlayerApp.Player.Controller}),define("apps/smart-podcast-player/app",["app"],function(e){return e.module("AskPatPlayerApp",function(e,t){var n={initCore:function(e){require(["apps/smart-podcast-player/core/controller"],function(t){t.init(e)})},setupColors:function(e){require(["apps/smart-podcast-player/core/controller"],function(t){t.setupColors(e)})},initPlaylist:function(e){require(["apps/smart-podcast-player/playlist/controller"],function(t){t.init(e)})},updatePlaylistPaging:function(e){require(["apps/smart-podcast-player/playlist/controller"],function(t){t.updatePaging(e)})},gotoPlaylistTrackPage:function(e,t){require(["apps/smart-podcast-player/playlist/controller"],function(n){n.gotoPlaylistTrackPage(e,t)})},filterPlaylist:function(e,t){require(["apps/smart-podcast-player/playlist/controller"],function(n){n.filter(e,t)})},initTrackDetails:function(e){require(["apps/smart-podcast-player/track-details/controller"],function(t){t.init(e)})},showTrack:function(e,t){require(["apps/smart-podcast-player/track-details/controller"],function(n){n.show(e,t)})},initPlayer:function(e){require(["apps/smart-podcast-player/player/controller"],function(t){t.init(e)})},playTrack:function(e,t){require(["apps/smart-podcast-player/player/controller"],function(n){n.playTrack(e,t)})}};t.on("app:core:init",function(){n.initCore()}),t.on("core:color:setup",function(){n.setupColors()}),t.on("player:track:play",function(e,t){n.playTrack(e,t)}),t.on("player:init",function(e){n.initPlayer(e)}),t.on("playlist:paging:update",function(e){n.updatePlaylistPaging(e)}),t.on("playlist:paging:track",function(e,t){n.gotoPlaylistTrackPage(e,t)}),t.on("playlist:init",function(e){n.initPlaylist(e)}),t.on("playlist:filter",function(e,t){n.filterPlaylist(e,t)}),t.on("track-details:init",function(e){n.initTrackDetails(e)}),t.on("track-details:show",function(e,t){n.showTrack(e,t)})}),e.PlaylistApp}),define("app",["jquery","marionette","soundmanager2"],function(e,t){var n=new t.Application;return n.options={},n.options.current_page=1,n.options.tracks_per_page=10,n.on("initialize:after",function(){(jQuery(".smart-podcast-player").length>0||jQuery(".smart-track-player").length>0)&&require(["apps/smart-podcast-player/app"],function(){soundManager.setup({url:AP_Player.baseUrl+"vendor/SoundManager2/swf/",flashVersion:9,useHighPerformance:!0,wmode:"transparent",useHTML5Audio:!0,preferFlash:!1,onready:function(){n.trigger("app:core:init")}})})}),n}),define("text!templates/track-template.html",[],function(){return'<% if ( data.show_logo != undefined && data.show_logo != null ) { %>\r\n \r\n<% } %>\r\n\r\n
    \r\n <% if ( data.artist != undefined && data.artist != null ) { %>\r\n

    <%= data.artist %>

    \r\n <% } %> \r\n\r\n

    <%= data.title %>

    \r\n

    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n\r\n
    \r\n
    \r\n
    \r\n\r\n
    \r\n \r\n \r\n
    \r\n Share\r\n Share\r\n Share\r\n \r\n
    \r\n
    \r\n\r\n <% var adl = document.createElement(\'a\'); %>\r\n <% var adloff = /Firefox/i.test(navigator.userAgent); %>\r\n\r\n <% if ( data.download == true && (typeof adl.download != "undefined") && (!adloff) && data.method != \'soundcloud\' ) { %><% } %>\r\n <% if ( data.download == true && (typeof adl.download == "undefined" || (adloff) || data.method == \'soundcloud\' ) ) { %><% } %>\r\n \r\n
    \r\n\r\n \r\n \r\n
    \r\n'}),define("apps/smart-track-player/player/view",["app","text!templates/track-template.html"],function(e,t){return e.module("SmartTrackPlayerApp.Player.View",function(e,n,i,r,a,s){e.Player=r.ItemView.extend({template:s.template(t),className:"smart-track-player",events:{"mousemove .spp-track":"cursorMove","mouseout .spp-track":"cursorOut","click .spp-position":"seek","click .spp-play":"play","click .spp-button-download":"download","click .spp-dload":"download","click .spp-speed":"speed","hover .spp-play":"shareOut","hover .spp-button-download":"shareOut","hover .spp-dload":"shareOut","hover .spp-dloada":"shareOut","hover .spp-speed":"shareOut","hover .spp-share":"shareOn","hover .spp-share-options":"shareOn","click .spp-share":"shareOn","click .spp-share-icon":"share","mouseleave .spp-controls":"shareOut"},initialize:function(){this.hover=!1;var e=this;a(window).on("resize",function(){e.resize()})},download:function(e){e.preventDefault();var t=this.model.get("data"),n=t.download_url;"https:"===location.protocol&&(n=n.replace(/^http:\/\//i,"https://"));var i=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);if(i||"soundcloud"==t.method&&("http:"!==location.protocol||i)){var r="soundcloud"==t.method?n+"?consumer_key="+AP_Player.soundcloudConsumerKey:n;window.location=r}else{var r="soundcloud"==t.method?n+"?consumer_key="+AP_Player.soundcloudConsumerKey:AP_Player.homeUrl+"?spp_download="+n;this.$(".spp-downloader").prop("src",r)}},resize:function(){var e=this.model.get("data");if(window.innerWidth>768){var t=a(".smart-track-player").first().outerWidth();null===e.artwork_url||void 0===e.artwork_url||(t-=100),this.$(".spp-track").css({width:t+"px"})}else this.$(".spp-track").css({width:"100%"})},socialPopup:function(e,t){window.open(t,"pinterest","screenX=100,screenY=100,height=360,width=730"),e.preventDefault(),e.stopPropagation()},shareOn:function(){this.$(".spp-share-options").css("display","block")},shareOut:function(){this.$(".spp-share-options").css("display","none")},share:function(e){var t=this,n=t.model.get("data"),i=a(e.currentTarget),r=window.location.href;if((i.hasClass("spp-facebook")||i.hasClass("spp-fb-btn"))&&this.socialPopup(e,"http://www.facebook.com/sharer/sharer.php?s=100&p[url]="+encodeURIComponent(r)+"&p[images][0]=&p[title]="+encodeURIComponent(n.title)),i.hasClass("spp-twitter")||i.hasClass("spp-twitter-btn")){var s=encodeURIComponent(n.title)+" "+encodeURIComponent(r);""!=n.hashtag&&void 0!=n.hashtag&&(s=s+" "+encodeURIComponent("#"+n.hashtag)),this.socialPopup(e,"http://twitter.com/home?status="+s)}(i.hasClass("spp-gplus")||i.hasClass("spp-gplus-btn"))&&this.socialPopup(e,"https://plus.google.com/share?url="+encodeURIComponent(r))},stop:function(){this.$el.removeClass("spp-playing")},seek:function(e){function t(){r.bytesLoaded/r.bytesTotal>d&&(p=null!==r.duration?r.duration:r.durationEstimate,s.pause(),r.setPosition(d*p),s.play(),clearInterval(c))}if(a(window).outerWidth()>768){var n=this.model.get("data"),i="smart_track_"+n.track_uid+"_"+this.model.cid,r=soundManager.getSoundById(i),s=this;void 0===r&&(r=this.createSound(),r.load());var o=this.$(".spp-track").offset(),l=e.pageX-o.left,u=this.$(".spp-track").outerWidth(),p=null!==r.duration?r.duration:r.durationEstimate;void 0==l&&(l=e.pageX-this.$(".spp-track").offset().left);var c,d=l/u;r.bytesLoaded/r.bytesTotal>d&&null!==p?(p=null!==r.duration?r.duration:r.durationEstimate,this.$el.hasClass("spp-playing")&&this.pause(),r.setPosition(d*p),this.play()):(this.pause(),c=setInterval(t,250))}},cursorMove:function(e){if(this.trigger("cursor:move",e),window.innerWidth>768){this.hover=!0;var t=this.$(".spp-track").offset(),n=e.pageX-t.left;this.$(".spp-position").css({left:n+"px"})}},cursorOut:function(){if(window.innerWidth>768){var e=this.model.get("data"),t="smart_track_"+e.track_uid+"_"+this.model.cid,n=soundManager.getSoundById(t);if(n){var i=n.position,r=n.duration,a=i/r*100;this.$(".spp-position").css({left:a+"%"})}this.hover=!1}},onRender:function(){{var e=this.model.get("data");"smart_track_"+e.track_uid+"_"+this.model.cid}if(window.innerWidth>768){var t=a(".smart-track-player").first().outerWidth();null===e.show_logo||void 0===e.show_logo||(t-=60),this.$(".spp-track").css({width:t+"px"})}else this.$(".spp-track").css({width:"100%"}),this.$(".spp-show-logo").hide();void 0!==e.download&&this.$el.addClass("spp-has-download"),void 0!==e.color&&this.$el.addClass("stp-color-"+e.color),void 0!==e.get&&0!=e.get&&"file"==e.method&&this.fetchTrackData(e.url)},fetchTrackData:function(e){var t=this,n={action:"fetch_track_data",url:e};console.log("Getting track data"),a.post(AP_Player.ajaxurl,n,function(e){var n=t.model.get("data");e=JSON.parse(e),"0"!=e?(void 0===typeof e.title||void 0!=n.title&&'Getting file data...'!=n.title||(n.title=e.title),void 0!==typeof e.artist&&void 0==n.artist&&(n.artist=e.artist),n.get=!1,t.model.set({data:n}),void 0!==typeof e.title&&t.$(".spp-track-title").text(n.title),void 0!==typeof e.artist&&(t.$(".spp-artist").length>0?t.$(".spp-artist").text(n.artist):t.$(".spp-track-title").before('

    '+n.artist+"

    ")),void 0!=t.loading_timer&&clearInterval(t.loading_timer),t.render()):(n.title="Unable to retrieve track data",n.get=!1,t.model.set({data:n}),t.render())})},pause:function(){var e=this.model.get("data"),t="smart_track_"+e.track_uid+"_"+this.model.cid,n=soundManager.getSoundById(t);n.pause(),this.$el.removeClass("spp-playing")},speed:function(){var e=this.model.get("data"),t="smart_track_"+e.track_uid+"_"+this.model.cid,n=soundManager.getSoundById(t);if(void 0===n)n=this.createSound(),this.play();else{var i=this.$el.hasClass("spp-playing");i||this.play()}n.isHTML5&&(.5==n._a.playbackRate?(this.$el.hasClass("spp-speeding-half")&&this.$el.removeClass("spp-speeding-half"),n._a.playbackRate=1):1==n._a.playbackRate?(this.$el.addClass("spp-speeding-onehalf"),n._a.playbackRate=1.5):1.5==n._a.playbackRate?(this.$el.hasClass("spp-speeding-onehalf")&&this.$el.removeClass("spp-speeding-onehalf"),this.$el.addClass("spp-speeding-two"),n._a.playbackRate=2):2==n._a.playbackRate?(this.$el.hasClass("spp-speeding-two")&&this.$el.removeClass("spp-speeding-two"),this.$el.addClass("spp-speeding-three"),n._a.playbackRate=3):3==n._a.playbackRate?(this.$el.hasClass("spp-speeding-three")&&this.$el.removeClass("spp-speeding-three"),this.$el.addClass("spp-speeding-half"),n._a.playbackRate=.5):n._a.playbackRate=1)},play:function(){var e=this.$el.hasClass("spp-playing"),t=this.model.get("data"),n="smart_track_"+t.track_uid+"_"+this.model.cid,i=soundManager.getSoundById(n);void 0===i&&(i=this.createSound()),a(".spp-track").removeClass("spp-playing"),e?(this.$el.removeClass("spp-playing"),soundManager.pauseAll()):(soundManager.pauseAll(),i.play(),this.$el.addClass("spp-playing"))},createSound:function(){var e=this,t=this.model,n=t.get("data"),i="smart_track_"+n.track_uid+"_"+this.model.cid,r=soundManager.createSound({id:i,url:n.url,type:"audio/mp3",onload:function(){},onresume:function(){},onplay:function(){},onid3:function(){},onfinish:function(){e.stop()},whileloading:function(){var t=this.bytesLoaded/this.bytesTotal*100+"%";e.$(".spp-loaded").width(t),this.bytesLoaded/this.bytesTotal==1&&e.$(".spp-loaded-container").fadeOut("slow")},whileplaying:function(){var t,n,i,r,a=this.durationEstimate,s=this.position,o=a-s;t=s/1e3,n=t/60,i=n/60,r=Math.floor(i)+":"+pad(Math.floor(n%60),2)+":"+pad(Math.floor(t%60),2),t=o/1e3,n=t/60,i=n/60,remaining_time=pad(Math.floor(n),2)+":"+pad(Math.floor(t%60),2),e.$(".spp-duration").text("-"+remaining_time);var l=s/a*100;e.$(".spp-current-time").css({width:l+"%"}),e.hover===!1&&e.$(".spp-position").css({left:l+"%"})}});return r}})}),e.SmartTrackPlayerApp.Player.View}),define("entities/player-track",["app"],function(e){e.module("Entities",function(e,t,n){e.Player=n.Model.extend({defaults:{data:{}}}),e.Track=n.Model.extend({defaults:{data:{active:!1,artwork_url:"",attachments_uri:"",bpm:null,comment_count:0,commentable:!0,created_at:"",current_time:"0:00:00",description:"",download_count:0,download_url:"",downloadable:!0,duration:0,duration_time:"0:00:00",episode_number:0,embeddable_by:"all",favoritings_count:0,filename:"",genre:"",id:0,isrc:"",key_signature:"",kind:"track",label_id:null,label_name:"",license:"",original_content_size:0,original_format:"mp3",permalink:"",permalink_url:"",playing:!1,playback_count:0,purchase_title:null,purchase_url:null,release:"",release_day:null,release_month:null,release_year:null,sharing:"",show_name:"",state:"",stream_url:"",streamable:!0,tag_list:"",tags:"",tag_string:"",title:"",track_type:"",uri:"",user:{avatar_url:"",id:0,kind:"user",permalink:"",permalink_url:"",uri:"",username:""},user_id:0,video_url:null,waveform_url:"",show_notes:""}}})})}),define("entities/player",["app","entities/player-track"],function(e){return e.module("Entities",function(e,t){var n=[],i=function(e){var i=e.model.get("region");n[i]=t.request("track:entity:current",e)},r={getPlayerEntities:function(e){var t=e.model.get("region");return void 0===n[t]&&i(e),n[t]}};t.reqres.setHandler("player:entity",function(e){return r.getPlayerEntities(e)})}),e.Entities}),define("apps/smart-track-player/player/controller",["app-player","apps/smart-track-player/player/view","entities/player","entities/player-track","soundmanager2"],function(e,t){return e.module("SmartTrackPlayerApp.Player",function(e,n,i,r,a){e.Controller={init:function(){a(".smart-track-player").length>0&&n.trigger("core:color:setup"),a(".smart-track-player").each(function(e,n){var r=a(n).data("url"),s={url:r,track_uid:a(n).data("uid"),show_logo:a(n).data("image"),download:a(n).data("download"),download_url:r,color:a(n).data("color"),title:a(n).data("title"),artist:a(n).data("artist"),filename:"",get:a(n).data("get"),method:"file"},o=document.createElement("a");o.href=r;var l=o.hostname;if(l.indexOf("soundcloud.com")>-1){var u="",p={action:"get_soundcloud_track",stream:r};a.ajax({url:AP_Player.ajaxurl,dataType:"json",async:!1,type:"POST",data:p,success:function(e){u=e}}),s.method="soundcloud",s.url=u.stream_url+"?consumer_key="+AP_Player.soundcloudConsumerKey,s.title=s.title?s.title:u.title,s.download_url=u.download_url,s.filename=u.permalink+".mp3";var c=new i.Model({data:s}),d=new t.Player({model:c});d.render(),a(n).after(d.$el);var h="?spp_view=1";h+="&type=track",h+="&url="+s.url,h+="&download="+(void 0!=s.download?encodeURIComponent(s.download):""),h+="&title="+(void 0!=s.title?encodeURIComponent(s.title):""),h+="&artist="+(void 0!=s.artist?encodeURIComponent(s.artist):""),h+="&image="+(void 0!=s.image?encodeURIComponent(s.image):""),h+="&color="+(void 0!=s.color?encodeURIComponent(s.color):""),a(n).remove()}else{void 0!=s.get&&void 0==s.title&&(s.title='Getting file data...'),s.filename=s.url.replace(/^.*[\\\/]/,"");var c=new i.Model({data:s}),d=new t.Player({model:c});d.on("render",function(){if(this.$(".spp-loading-ellipsis").length>0){var e=this,t=0;this.loading_timer=setInterval(function(){t++;var n=new Array(t%5).join(".");e.$(".spp-loading-ellipsis").text("."+n)},300)}}),d.render(),a(n).after(d.$el);var h="?spp_view=1";h+="&type=track",h+="&url="+s.url,h+="&download="+(void 0!=s.download?encodeURIComponent(s.download):""),h+="&image="+(void 0!=s.image?encodeURIComponent(s.image):""),h+="&color="+(void 0!=s.color?encodeURIComponent(s.color):""),a(n).remove()}})},setupColors:function(){var e=new Array;a(".smart-track-player").each(function(t,n){var i=a(n).attr("class"),r=i.trim().split(/\s+/);a.each(r,function(t,n){var i=n.indexOf("stp-color-");if(i>-1){var r=n.replace("stp-color-","");-1==a.inArray(r,e)&&e.push(r)}})});var t={action:"get_colors",stp_colors:e};a.post(AP_Player.ajaxurl,t,function(e){a("head").append(e)})}}}),e.SmartTrackPlayerApp.Player.Controller}),define("apps/smart-track-player/app",["app-player"],function(e){return e.module("SmartTrackPlayerApp",function(e,t){var n={initPlayer:function(){require(["apps/smart-track-player/player/controller"],function(e){e.init()})},setupColors:function(e){require(["apps/smart-track-player/player/controller"],function(t){t.setupColors(e)})}};t.on("player:init",function(){n.initPlayer()}),t.on("core:color:setup",function(){n.setupColors()})}),e.SmartTrackPlayerApp}),define("app-player",["marionette","soundmanager2"],function(e){var t=new e.Application;return t.options={},t.on("initialize:after",function(){jQuery(".smart-track-player").length>0&&require(["apps/smart-track-player/app"],function(){soundManager.setup({url:AP_Player.baseUrl+"vendor/SoundManager2/swf/",flashVersion:9,wmode:"transparent",useHTML5Audio:!0,preferFlash:!1,onready:function(){t.trigger("player:init")}})})}),t}),"function"==typeof jQuery&&define("jquery",function(){return jQuery}),"function"==typeof _&&define("underscore",function(){return _}),require.config({name:"AP_Player_App",baseUrl:"/wp-content/plugins/smart-podcast-player/assets/js/",urlArgs:"bust="+(new Date).getTime(),paths:{backbone:"vendor/amdjs/backbone","backbone.wreqr":"vendor/amdjs/backbone.wreqr","backbone.babysitter":"vendor/amdjs/backbone.babysitter",marionette:"vendor/amdjs/marionette",soundmanager2:"vendor/soundmanager2-jsmin","mwheel-intent":"vendor/mwheelIntent"},shim:{soundmanager2:{exports:"soundManager"},"vendor/jquery.mousewheel":["jquery","mwheel-intent"],"vendor/jquery.jscrollpane.min":["jquery","vendor/jquery.mousewheel","mwheel-intent"]}}),require(["jquery","app"],function(e,t){var n=jQuery(window).width(),i=jQuery(window).height();jQuery(window).on("resize",function(){(n!=jQuery(window).width()||i!=jQuery(window).height())&&(n=jQuery(window).width(),i=jQuery(window).height(),jQuery(window).trigger("spp_resize"))}),e(window).resize(function(){e(".smart-podcast-player").each(function(){var t=e(this).parent(),n=e(t).width(),i=e(window).width();768>n||768>i?t.addClass("spp-player-small"):t.removeClass("spp-player-small")})}),e(".smart-podcast-player").each(function(){var t=e(this).parent(),n=e(t).width(),i=e(window).width();(768>n||768>i)&&t.addClass("spp-player-small")}),t.start()}),require(["jquery","app-player"],function(e,t){jQuery(".smart-track-player ").length>0&&t.start()}),define("main",function(){});