!function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){var d,e;d=[c(2),c(3),c(5),c(4),c(6)],e=function(a,b,c,d){var e=function(a,e,f){function g(){setTimeout(function(){y("setup",{})},0),"hide"!==e.oncomplete&&e.oncomplete!==!1&&a.getConfig().repeat!==!0&&a.on("playlistComplete",k),"autoplay"===e.oncomplete&&(e.onclick="play",M=new c(e),M.on("autoplayTrigger",w),M.on("countdownUpdate",u)),K=B.isString(e.heading)?e.heading:U,h(),z.addClass(f,"jw-plugin-related"),N.resize(a.getWidth(),a.getHeight())}function h(){D=z.createElement('
'),f.appendChild(D);var a=z.createElement(W);F=a.getElementsByClassName("jw-related-grid")[0];for(var c=0;12>c;c++){var d=new b(e);d.on("activate",w),O.push(d),F.appendChild(d.el)}D.appendChild(a);var g=z.createElement(V),h=g.getElementsByClassName("jw-related-close-icon")[0];E=g.getElementsByClassName("jw-related-heading-text")[0],new A(h).on("click tap",l),D.appendChild(g)}function i(b){l(b);var c=a.getPlaylistItem();C=j(e.file,c.mediaid),q(),I=K}function j(a,b){return a&&a.indexOf("MEDIAID")>0&&b?a.replace("MEDIAID",b):a&&-1===a.indexOf("MEDIAID")?a:null}function k(b){R||S||!P.length||("playing"===a.getState()&&a.pause(),S=!0,J=b?"click"===b.type||"tap"===b.type?"interaction":"complete":"api",u(K),p(),M&&"complete"===J&&M.startAutoplay(O[0],P[0]),v(J))}function l(b){if(S){var c="play";b?("click"===b.type||"tap"===b.type)&&(c="interaction"):c="api","paused"===a.getState()&&a.play(),M&&M.clearAutoplay(),S=!1,v(c)}}function m(b){b===C?z.log("RELATED: Failed to load "+b):z.log("RELATED: "+b),x(null),a.removeButton("related"),u("No related videos found")}function n(){C?(u(""),z.ajax(C,o,m,!0)):m("No related videos file found")}function o(b){var c;if(b.responseText!==G){if(c="["===b.responseText.trim().substring(0,1)?z.tryCatch(function(){return JSON.parse(b.responseText)}):z.tryCatch(function(){return z.rssparser.parse(b.responseXML.firstChild)}),!B.isArray(c))return void m("This feed is not valid XML, JSON, and/or RSS feed.");G=b.responseText,P=B.filter(c,function(a){var b=B.isArray(a.sources)&&a.sources[0]?a.sources[0]:{};return a.image&&a.title&&("play"===e.onclick&&(b.file||a.file)||"play"!==e.onclick&&a.link)?!0:void 0}),P.length||m("Related feed entries do not contain the necessary data.")}P.length&&(a.addButton(void 0,I,k,"related",T),x(c),p(),u(K),M&&"complete"===J&&M.startAutoplay(O[0],P[0]))}function p(a){var b=L;if(L=B.isUndefined(a)?L:a,F&&L){L!==b&&(b&&z.removeClass(F,b.classname),z.addClass(F,L.classname)),z.toggleClass(F,"jw-related-grid-center-content",P.length