(function(){"use strict";var n=function(n){function isAppCandidate(){var t=getCookie(o),i,r,u;if(t)if(i=(new Date).valueOf(),r=parseInt(t),i>r)e(o,"",undefined),n.AppCookieOverrideName&&e(n.AppCookieOverrideName,"",undefined);else if(n.AppCookieOverrideName){if(u=getCookie(n.AppCookieOverrideName),u)return!1}else return!1;return isSmallIosDevice()&&isIosVersionLessThanTen()&&n.AppEnabled}function isEmbedded(){try{return window.self!==window.top}catch(n){return!0}}function isSmallIosDevice(){var n=navigator.userAgent||"";return!(n.toLowerCase().indexOf("windows phone")>-1)&&!(n.toLowerCase().indexOf("windows")>-1)&&(n.indexOf("iPhone")>-1||n.indexOf("iPod")>-1)&&n.indexOf("Safari")>-1}function isIosVersionLessThanTen(){var n=/(?:iPhone|iPod|iPad).*OS (\d+)_/.exec(navigator.userAgent),t=0;return n&&n.length>1&&(t=Number(n[1])),t<10}function buildIosPlayCover(){t=$("body"),h=$(''+n.IPhonePlayCoverLinkText+""),h.prependTo(t),t.css({height:i.height()+"px",overflow:"hidden"})}function buildDetectionPrompt(){var o,s,e,h;t=$("body"),i=$('
'),r=i.find(".IosAppDetection-PromptContainer"),i.prependTo(t),u=$('

'+n.InstallTheIosAppText+'

"),f=$('

'+n.InstallTheIosAppText+'

"),o=u.find("button"),s=f.find("button"),u.appendTo(r),f.appendTo(r),e=$('

"),h=e.find("button"),e.appendTo(r);h.on("click",closePrompt);o.on("click",getAppClicked);s.on("click",tryAppLaunch);t.css({height:i.height()+"px",overflow:"hidden"})}function closePrompt(){$(l).trigger("IosAppMessageClosed");var f=(new Date).valueOf()+36e5;e(o,f,undefined),n.AppCookieOverrideName&&e(n.AppCookieOverrideName,f,undefined),r.empty(),r.remove(),i.remove(),t.css({height:"",overflow:""})}function tryAppLaunch(){c=new Date,window.location=n.AppContentUrl,window.setTimeout(function(){var n=new Date;n.valueOf()0&&(t=document.cookie.indexOf(n+"="),t!=-1)?(t=t+n.length+1,i=document.cookie.indexOf(";",t),i==-1&&(i=document.cookie.length),unescape(document.cookie.substring(t,i))):""}var i,r,h,t,u,f,o="MediasiteAppDismissed",l=this,a,s,c,e;this.Run=function(){isIosVersionLessThanTen()?isEmbedded()&&isSmallIosDevice()?buildIosPlayCover():isAppCandidate()?buildDetectionPrompt():$(this).trigger("NotIosAppCandidate"):$(this).trigger("NotIosAppCandidate")},s=1500,e=function(n,t,i){var u,r;i?(r=new Date,r.setTime(r.getTime()+i*864e5),u="; expires="+r.toGMTString()):u="",document.cookie=n+"="+t+u+"; path=/"}};window.IosAppDetection=n})()