var Global,CivicWeb;if(window.Modernizr=function(n,t,i){function l(n){h.cssText=n}function lt(n,t){return l(y.join(n+";")+(t||""))}function s(n,t){return typeof n===t}function a(n,t){return!!~(""+n).indexOf(t)}function it(n,t){var u,r;for(u in n)if(r=n[u],!a(r,"-")&&h[r]!==i)return t=="pfx"?r:!0;return!1}function at(n,t,r){var f,u;for(f in n)if(u=t[n[f]],u!==i)return r===!1?n[f]:s(u,"function")?u.bind(r||t):u;return!1}function f(n,t,i){var r=n.charAt(0).toUpperCase()+n.slice(1),u=(n+" "+et.join(r+" ")+r).split(" ");return s(t,"string")||s(t,"undefined")?it(u,t):(u=(n+" "+ot.join(r+" ")+r).split(" "),at(u,t,i))}function vt(){u.input=function(i){for(var r=0,u=i.length;r<u;r++)w[i[r]]=!!(i[r]in o);return w.list&&(w.list=!!(t.createElement("datalist")&&n.HTMLDataListElement)),w}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));u.inputtypes=function(n){for(var u=0,r,f,e,s=n.length;u<s;u++)o.setAttribute("type",f=n[u]),r=o.type!=="text",r&&(o.value=d,o.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&o.style.WebkitAppearance!==i?(c.appendChild(o),e=t.defaultView,r=e.getComputedStyle&&e.getComputedStyle(o,null).WebkitAppearance!=="textfield"&&o.offsetHeight!==0,c.removeChild(o)):/^(search|tel)$/.test(f)||(r=/^(url|email)$/.test(f)?o.checkValidity&&o.checkValidity()===!1:o.value!=d)),st[n[u]]=!!r;return st}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var u={},c=t.documentElement,e="modernizr",rt=t.createElement(e),h=rt.style,o=t.createElement("input"),d=":)",ut={}.toString,y=" -webkit- -moz- -o- -ms- ".split(" "),ft="Webkit Moz O ms",et=ft.split(" "),ot=ft.toLowerCase().split(" "),p={svg:"http://www.w3.org/2000/svg"},r={},st={},w={},ht=[],g=ht.slice,b,v=function(n,i,r,u){var l,a,h,v,f=t.createElement("div"),s=t.body,o=s||t.createElement("body");if(parseInt(r,10))while(r--)h=t.createElement("div"),h.id=u?u[r]:e+(r+1),f.appendChild(h);return l=["&#173;",'<style id="s',e,'">',n,"<\/style>"].join(""),f.id=e,(s?f:o).innerHTML+=l,o.appendChild(f),s||(o.style.background="",o.style.overflow="hidden",v=c.style.overflow,c.style.overflow="hidden",c.appendChild(o)),a=i(f,n),s?f.parentNode.removeChild(f):(o.parentNode.removeChild(o),c.style.overflow=v),!!a},yt=function(t){var i=n.matchMedia||n.msMatchMedia,r;return i?i(t).matches:(v("@media "+t+" { #"+e+" { position: absolute; } }",function(t){r=(n.getComputedStyle?getComputedStyle(t,null):t.currentStyle).position=="absolute"}),r)},ct=function(){function n(n,u){u=u||t.createElement(r[n]||"div");n="on"+n;var f=n in u;return f||(u.setAttribute||(u=t.createElement("div")),u.setAttribute&&u.removeAttribute&&(u.setAttribute(n,""),f=s(u[n],"function"),s(u[n],"undefined")||(u[n]=i),u.removeAttribute(n))),u=null,f}var r={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return n}(),nt={}.hasOwnProperty,tt,k;tt=s(nt,"undefined")||s(nt.call,"undefined")?function(n,t){return t in n&&s(n.constructor.prototype[t],"undefined")}:function(n,t){return nt.call(n,t)};Function.prototype.bind||(Function.prototype.bind=function(n){var t=this,i,r;if(typeof t!="function")throw new TypeError;return i=g.call(arguments,1),r=function(){var f,e,u;return this instanceof r?(f=function(){},f.prototype=t.prototype,e=new f,u=t.apply(e,i.concat(g.call(arguments))),Object(u)===u)?u:e:t.apply(n,i.concat(g.call(arguments)))},r});r.flexbox=function(){return f("flexWrap")};r.canvas=function(){var n=t.createElement("canvas");return!!(n.getContext&&n.getContext("2d"))};r.canvastext=function(){return!!(u.canvas&&s(t.createElement("canvas").getContext("2d").fillText,"function"))};r.webgl=function(){return!!n.WebGLRenderingContext};r.touch=function(){var i;return"ontouchstart"in n||n.DocumentTouch&&t instanceof DocumentTouch?i=!0:v(["@media (",y.join("touch-enabled),("),e,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(n){i=n.offsetTop===9}),i};r.geolocation=function(){return"geolocation"in navigator};r.postmessage=function(){return!!n.postMessage};r.websqldatabase=function(){return!!n.openDatabase};r.indexedDB=function(){return!!f("indexedDB",n)};r.hashchange=function(){return ct("hashchange",n)&&(t.documentMode===i||t.documentMode>7)};r.history=function(){return!!(n.history&&history.pushState)};r.draganddrop=function(){var n=t.createElement("div");return"draggable"in n||"ondragstart"in n&&"ondrop"in n};r.websockets=function(){return"WebSocket"in n||"MozWebSocket"in n};r.rgba=function(){return l("background-color:rgba(150,255,150,.5)"),a(h.backgroundColor,"rgba")};r.hsla=function(){return l("background-color:hsla(120,40%,100%,.5)"),a(h.backgroundColor,"rgba")||a(h.backgroundColor,"hsla")};r.multiplebgs=function(){return l("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(h.background)};r.backgroundsize=function(){return f("backgroundSize")};r.borderimage=function(){return f("borderImage")};r.borderradius=function(){return f("borderRadius")};r.boxshadow=function(){return f("boxShadow")};r.textshadow=function(){return t.createElement("div").style.textShadow===""};r.opacity=function(){return lt("opacity:.55"),/^0.55$/.test(h.opacity)};r.cssanimations=function(){return f("animationName")};r.csscolumns=function(){return f("columnCount")};r.cssgradients=function(){var n="background-image:";return l((n+"-webkit- ".split(" ").join("gradient(linear,left top,right bottom,from(#9f9),to(white));"+n)+y.join("linear-gradient(left top,#9f9, white);"+n)).slice(0,-n.length)),a(h.backgroundImage,"gradient")};r.cssreflections=function(){return f("boxReflect")};r.csstransforms=function(){return!!f("transform")};r.csstransitions=function(){return f("transition")};r.fontface=function(){var n;return v('@font-face {font-family:"font";src:url("https://")}',function(i,r){var f=t.getElementById("smodernizr"),u=f.sheet||f.styleSheet,e=u?u.cssRules&&u.cssRules[0]?u.cssRules[0].cssText:u.cssText||"":"";n=/src/i.test(e)&&e.indexOf(r.split(" ")[0])===0}),n};r.generatedcontent=function(){var n;return v(["#",e,"{font:0/0 a}#",e,':after{content:"',d,'";visibility:hidden;font:3px/1 a}'].join(""),function(t){n=t.offsetHeight>=3}),n};r.video=function(){var i=t.createElement("video"),n=!1;try{(n=!!i.canPlayType)&&(n=new Boolean(n),n.ogg=i.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),n.h264=i.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),n.webm=i.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(r){}return n};r.audio=function(){var i=t.createElement("audio"),n=!1;try{(n=!!i.canPlayType)&&(n=new Boolean(n),n.ogg=i.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),n.mp3=i.canPlayType("audio/mpeg;").replace(/^no$/,""),n.wav=i.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),n.m4a=(i.canPlayType("audio/x-m4a;")||i.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(r){}return n};r.localstorage=function(){try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(n){return!1}};r.sessionstorage=function(){try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(n){return!1}};r.webworkers=function(){return!!n.Worker};r.applicationcache=function(){return!!n.applicationCache};r.svg=function(){return!!t.createElementNS&&!!t.createElementNS(p.svg,"svg").createSVGRect};r.inlinesvg=function(){var n=t.createElement("div");return n.innerHTML="<svg/>",(n.firstChild&&n.firstChild.namespaceURI)==p.svg};r.smil=function(){return!!t.createElementNS&&/SVGAnimate/.test(ut.call(t.createElementNS(p.svg,"animate")))};r.svgclippaths=function(){return!!t.createElementNS&&/SVGClipPath/.test(ut.call(t.createElementNS(p.svg,"clipPath")))};for(k in r)tt(r,k)&&(b=k.toLowerCase(),u[b]=r[k](),ht.push((u[b]?"":"no-")+b));return u.input||vt(),u.addTest=function(n,t){if(typeof n=="object")for(var r in n)tt(n,r)&&u.addTest(r,n[r]);else{if(n=n.toLowerCase(),u[n]!==i)return u;t=typeof t=="function"?t():t;typeof enableClasses!="undefined"&&enableClasses&&(c.className+=" "+(t?"":"no-")+n);u[n]=t}return u},l(""),rt=o=null,function(n,t){function v(n,t){var i=n.createElement("p"),r=n.getElementsByTagName("head")[0]||n.documentElement;return i.innerHTML="x<style>"+t+"<\/style>",r.insertBefore(i.lastChild,r.firstChild)}function s(){var n=r.elements;return typeof n=="string"?n.split(" "):n}function u(n){var t=a[n[l]];return t||(t={},o++,n[l]=o,a[o]=t),t}function h(n,r,f){if(r||(r=t),i)return r.createElement(n);f||(f=u(r));var e;return e=f.cache[n]?f.cache[n].cloneNode():b.test(n)?(f.cache[n]=f.createElem(n)).cloneNode():f.createElem(n),e.canHaveChildren&&!w.test(n)?f.frag.appendChild(e):e}function y(n,r){if(n||(n=t),i)return n.createDocumentFragment();r=r||u(n);for(var e=r.frag.cloneNode(),f=0,o=s(),h=o.length;f<h;f++)e.createElement(o[f]);return e}function p(n,t){t.cache||(t.cache={},t.createElem=n.createElement,t.createFrag=n.createDocumentFragment,t.frag=t.createFrag());n.createElement=function(i){return r.shivMethods?h(i,n,t):t.createElem(i)};n.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+s().join().replace(/\w+/g,function(n){return t.createElem(n),t.frag.createElement(n),'c("'+n+'")'})+");return n}")(r,t.frag)}function c(n){n||(n=t);var f=u(n);return!r.shivCSS||e||f.hasCSS||(f.hasCSS=!!v(n,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),i||p(n,f),n}var f=n.html5||{},w=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,b=/^(?: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,e,l="_html5shiv",o=0,a={},i,r;(function(){try{var n=t.createElement("a");n.innerHTML="<xyz><\/xyz>";e="hidden"in n;i=n.childNodes.length==1||function(){t.createElement("a");var n=t.createDocumentFragment();return typeof n.cloneNode=="undefined"||typeof n.createDocumentFragment=="undefined"||typeof n.createElement=="undefined"}()}catch(r){e=!0;i=!0}})();r={elements:f.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:f.shivCSS!==!1,supportsUnknownElements:i,shivMethods:f.shivMethods!==!1,type:"default",shivDocument:c,createElement:h,createDocumentFragment:y};n.html5=r;c(t)}(this,t),u._version="2.6.2",u._prefixes=y,u._domPrefixes=ot,u._cssomPrefixes=et,u.mq=yt,u.hasEvent=ct,u.testProp=function(n){return it([n])},u.testAllProps=f,u.testStyles=v,u.prefixed=function(n,t,i){return t?f(n,t,i):f(n,"pfx")},u}(this,this.document),function(n,t,i){function h(n){return"[object Function]"==y.call(n)}function c(n){return"string"==typeof n}function l(){}function w(n){return!n||"loaded"==n||"complete"==n||"uninitialized"==n}function f(){var n=a.shift();v=1;n?n.t?s(function(){("c"==n.t?u.injectCss:u.injectJs)(n.s,0,n.a,n.x,n.e,1)},0):(n(),f()):v=0}function ut(n,i,o,h,c,l,y){function k(t){if(!nt&&w(p.readyState)&&(tt.r=nt=1,!v&&f(),p.onload=p.onreadystatechange=null,t)){"img"!=n&&s(function(){g.removeChild(p)},50);for(var u in r[i])r[i].hasOwnProperty(u)&&r[i][u].onload()}}var y=y||u.errorTimeout,p=t.createElement(n),nt=0,b=0,tt={t:o,s:i,e:c,a:l,x:y};1===r[i]&&(b=1,r[i]=[]);"object"==n?p.data=i:(p.src=i,p.type=n);p.width=p.height="0";p.onerror=p.onload=p.onreadystatechange=function(){k.call(this,b)};a.splice(h,0,tt);"img"!=n&&(b||2===r[i]?(g.insertBefore(p,d?null:e),s(k,y)):r[i].push(p))}function ft(n,t,i,r,u){return v=0,t=t||"j",c(n)?ut("c"==t?et:nt,n,t,this.i++,i,r,u):(a.splice(this.i++,0,n),1==a.length&&f()),this}function b(){var n=u;return n.loader={load:ft,i:0},n}var o=t.documentElement,s=n.setTimeout,e=t.getElementsByTagName("script")[0],y={}.toString,a=[],v=0,k="MozAppearance"in o.style,d=k&&!!t.createRange().compareNode,g=d?o:e.parentNode,o=n.opera&&"[object Opera]"==y.call(n.opera),o=!!t.attachEvent&&!o,nt=k?"object":o?"script":"img",et=o?"script":nt,tt=Array.isArray||function(n){return"[object Array]"==y.call(n)},p=[],r={},it={timeout:function(n,t){return t.length&&(n.timeout=t[0]),n}},rt,u;u=function(n){function a(n){for(var n=n.split("!"),f=p.length,t=n.pop(),e=n.length,t={url:t,origUrl:t,prefixes:n},u,r,i=0;i<e;i++)r=n[i].split("="),(u=it[r.shift()])&&(t=u(t,r));for(i=0;i<f;i++)t=p[i](t);return t}function f(n,t,u,f,e){var o=a(n),s=o.autoCallback;o.url.split(".").pop().split("?").shift();o.bypass||(t&&(t=h(t)?t:t[n]||t[f]||t[n.split("/").pop().split("?")[0]]),o.instead?o.instead(n,t,u,f,e):(r[o.url]?o.noexec=!0:r[o.url]=1,u.load(o.url,o.forceCSS||!o.forceJS&&"css"==o.url.split(".").pop().split("?").shift()?"c":i,o.noexec,o.attrs,o.timeout),(h(t)||h(s))&&u.load(function(){b();t&&t(o.origUrl,e,f);s&&s(o.origUrl,e,f);r[o.url]=2})))}function s(n,t){function a(n,o){if(n){if(c(n))o||(i=function(){var n=[].slice.call(arguments);s.apply(this,n);u()}),f(n,i,t,0,e);else if(Object(n)===n)for(r in v=function(){var t=0;for(var i in n)n.hasOwnProperty(i)&&t++;return t}(),n)n.hasOwnProperty(r)&&(!o&&!--v&&(h(i)?i=function(){var n=[].slice.call(arguments);s.apply(this,n);u()}:i[r]=function(n){return function(){var t=[].slice.call(arguments);n&&n.apply(this,t);u()}}(s[r])),f(n[r],i,t,r,e))}else o||u()}var e=!!n.test,o=n.load||n.both,i=n.callback||l,s=i,u=n.complete||l,v,r;a(e?n.yep:n.nope,!!o);o&&a(o)}var e,t,o=this.yepnope.loader;if(c(n))f(n,0,o,0);else if(tt(n))for(e=0;e<n.length;e++)t=n[e],c(t)?f(t,0,o,0):tt(t)?u(t):Object(t)===t&&s(t,o);else Object(n)===n&&s(n,o)};u.addPrefix=function(n,t){it[n]=t};u.addFilter=function(n){p.push(n)};u.errorTimeout=1e4;null==t.readyState&&t.addEventListener&&(t.readyState="loading",t.addEventListener("DOMContentLoaded",rt=function(){t.removeEventListener("DOMContentLoaded",rt,0);t.readyState="complete"},0));n.yepnope=b();n.yepnope.executeStack=f;n.yepnope.injectJs=function(n,i,r,o,h,c){var a=t.createElement("script"),v,y,o=o||u.errorTimeout;a.src=n;for(y in r)a.setAttribute(y,r[y]);i=c?f:i||l;a.onreadystatechange=a.onload=function(){!v&&w(a.readyState)&&(v=1,i(),a.onload=a.onreadystatechange=null)};s(function(){v||(v=1,i(1))},o);h?a.onload():e.parentNode.insertBefore(a,e)};n.yepnope.injectCss=function(n,i,r,u,o,h){var u=t.createElement("link"),c,i=h?f:i||l;u.href=n;u.rel="stylesheet";u.type="text/css";for(c in r)u.setAttribute(c,r[c]);o||(e.parentNode.insertBefore(u,e),s(i,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},Modernizr.addTest("csscalc",function(){var n="width:",t=document.createElement("div");return t.style.cssText=n+Modernizr._prefixes.join("calc(10px);"+n),!!t.style.length}),Modernizr.addTest("svganimation",function(){return!/msie/.test(navigator.userAgent.toLowerCase())&&!/trident/.test(navigator.userAgent.toLowerCase())}),Global=Global||{},Global.Controls=Global.Controls||{},Global.Controls.HeaderMenu=function(n){var w=n.impersonatePublicUser,r=n.module,u=n.entityId,f=n.recycleBin,b=n.selectLanguageLabelText,k=n.feedbackData,d=n.selectedCulture,t=n.availableCultures,e="CultureSelectorContainer",o="CultureSelectorList",g=n.signInLocalization,nt=function(){et()},tt=function(){a()},it=function(n){CivicWeb.Common.Instrumentation.recordAction("Changed the selected language.").then(function(){var t=$(n.target).closest("li");CivicWeb.Common.Cookie.set("Culture",t.attr("data-culture"),365).then(function(){a();window.location.href=window.location.href})})},s=function(){i(!1)},h=function(){$(".dropdown.open").length===0&&i(!0)},c=function(n){i(!0);n.preventDefault()},rt=function(n){var t=$(n.target),i=window.open("","VideoGuide","status=0, height=338, width=575, titlebar=0, toolbar=0");i.document.write("<video id='video-guide' style='width: 100%;' controls autoplay preload><source src='"+t.attr("href")+"' type='video/mp4'><\/video>");n.preventDefault()},ut=function(n){window.open("/user/clerkonlogin","_blank");n.preventDefault()},l=function(){CivicWeb.Common.Instrumentation.recordAction($(this).text()+" thirdparty header link clicked on "+window.location.pathname+" page.")},ft=function(){var n=$(".culture-selector");if(t.length>1&&n.length>0&&n.html().indexOf("▼")===-1)n.append(" &#9660;").off("click").on("click",nt)},et=function(){var r=$(".culture-selector"),s=r.offset(),n=$("<div><\/div>").attr({id:e,"class":"culture-selector-container"}).css({left:s.left.toString()+"px",top:s.top.toString()+"px"}).on("mouseleave",tt),u,i,f,h,c;for(n.append($("<label><\/label>").attr({"for":o}).text(b)),u=$("<ul><\/ul>").attr({id:o}),n.append(u),i=0;i<t.length;i++)f=$("<li><\/li>").attr({"data-culture":t[i].name}).on("click",it).text(t[i].nativeName),t[i].name===d&&f.css({"font-weight":"bold"}),u.append(f);$("body").append(n);h=r.outerWidth()-r.width();c=n.outerWidth()-n.width();n.css({"min-width":(r.width()+(h-c)).toString()+"px"})},a=function(){$(document.getElementById(e)).remove()},ot=function(){var n=$('.search-text-box:not([id="ctl00_MainContent_SearchTextBox"]):not(.large-text-box)');n.keydown(function(n){n.which===13&&(v(),n.preventDefault());$(this).addClass("search-text-box-expand","slow")});n.blur(function(){$(this).removeClass("search-text-box-expand","slow")})},st=function(n){$.ajax({url:"/Services/SecurityService.svc/security/users/impersonatepublic?impersonate="+(w?"False":"True"),contentType:"application/json",dataType:"json",async:!0,type:"POST",timeout:3e4,data:null,success:function(n){n.Result&&(window.location.href=window.location.href)},error:function(){}});n.preventDefault()},ht=function(){$.ajax({url:"/Services/SecurityService.svc/security/logoff",contentType:"application/json",dataType:"json",async:!0,type:"POST",timeout:3e4,data:null,success:function(n){n.Result&&(window.location.href.indexOf("notices=True")>=0||window.location.href.indexOf("securityPolicy=True")>=0?window.location.href=window.location.href.replace("?notices=True","").replace("&notices=True","").replace("?securityPolicy=True","").replace("&securityPolicy=True",""):window.location.reload())},error:function(){}})},v=function(){var t=$(".search-button").attr("id"),n=$(".search-text-box").val();return r==="Portal"?window.location.href="/Portal/VirtualLibrary.aspx?SearchText="+n:r==="DocumentCenter"?window.location.href="/filepro/documents/search?keywords="+n+(u>0?"&location="+u:"")+(f?"&deleted=True":""):"ActionTracking"===r?window.location.href="/items/search?keywords="+n+(f?"&deleted=True":""):window.__doPostBack(t,n),!1},i,y,p;this.OnSearchButtonClick=function(){return v()};i=function(n){var t=$(document.getElementById("FeedbackModal")).length>0,i=$(document.getElementById("preview-folder-list")).attr("data-show")==="true";t||i||(n?$('iframe:not([data-hidden="True"])').removeClass("invisible hidden"):$('iframe:not([data-hidden="True"])').filter(function(){var n=$(this);return n.attr("src")!=null&&n.attr("src").indexOf(".pdf")>-1?n:null}).addClass("invisible hidden"))};p=function(){i(!1);y.open();$(".feedback-close").off("click",c).on("click",c)},function(){$(".view-mode").off("click").on("click",st);$(".user-sign-out").off("click").on("click",ht);$(".user-feedback").off("click").on("click",p);$(".dropdown-toggle:not(.show-pdf-iframe)").off("mouseover").off("mouseout").on("mouseover",s).on("mouseout",h);$(".dropdown-menu:not(.show-pdf-iframe)").off("mouseenter").off("mouseleave").on("mouseenter",s).on("mouseleave",h);$("#header-help-video").off("click").on("click",rt);$("#header-clerkon").off("click").on("click",ut);ft();ot();CivicWeb.Common.SignIn.load({clientId:"logOn",signInButton:$(".user-sign-in"),localization:g});y=window.Feedback(k);$("ul.nav li.dropdown").hover(function(){$(this).find(".dropdown-menu").stop(!0,!0).delay(0).fadeIn(5)},function(){$(this).hasClass("open")||$(this).find(".dropdown-menu").stop(!0,!0).delay(250).fadeOut(5)});$("ul.nav li.dropdown").click(function(){$("ul.nav li.dropdown").not(this).find(".dropdown-menu").stop(!0,!0).delay(0).fadeOut(5)});var n=$("#header-links").closest("li.dropdown").find("a:not(.dropdown-toggle)");if(n&&n.length)n.off("click",l).on("click",l)}();$("#header-search").children().tooltip({delay:{show:300,hide:150},placement:"auto",html:!0,trigger:"hover"})},Global.Controls.HeaderMenus={instance:null,createInstance:function(n){this.instance&&delete this.instance;this.instance=new Global.Controls.HeaderMenu(n)},Events:{OnSearchButtonClick:function(){Global.Controls.HeaderMenus.instance.OnSearchButtonClick()}}},"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(){"use strict";var n=jQuery.fn.jquery.split(" ")[0].split(".");if(n[0]<2&&n[1]<9||1==n[0]&&9==n[1]&&n[2]<1||3<n[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4");}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var i=!1,r=this;n(this).one("bsTransitionEnd",function(){i=!0});return setTimeout(function(){i||n(r).trigger(n.support.transition.end)},t),this};n(function(){n.support.transition=function(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(i.style[t]!==undefined)return{end:n[t]};return!1}();n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(n){"use strict";var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.VERSION="3.4.1";t.TRANSITION_DURATION=150;t.prototype.close=function(i){function e(){u.detach().trigger("closed.bs.alert").remove()}var f=n(this),r=f.attr("data-target"),u;r||(r=(r=f.attr("href"))&&r.replace(/.*(?=#[^\s]*$)/,""));r="#"===r?[]:r;u=n(document).find(r);i&&i.preventDefault();u.length||(u=f.closest(".alert"));u.trigger(i=n.Event("close.bs.alert"));i.isDefaultPrevented()||(u.removeClass("in"),n.support.transition&&u.hasClass("fade")?u.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e())};r=n.fn.alert;n.fn.alert=function(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));"string"==typeof i&&u[i].call(r)})};n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery),function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f="object"==typeof i&&i;r||u.data("bs.button",r=new t(this,f));"toggle"==i?r.toggle():i&&r.setState(i)})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},r;t.VERSION="3.4.1";t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var i="disabled",r=this.$element,f=r.is("input")?"val":"html",u=r.data();t+="Text";null==u.resetText&&r.data("resetText",r[f]());setTimeout(n.proxy(function(){r[f](null==u[t]?this.options[t]:u[t]);"loadingText"==t?(this.isLoading=!0,r.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,r.removeClass(i).removeAttr(i).prop(i,!1))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length?(n=this.$element.find("input"),"radio"==n.prop("type")?(n.prop("checked")&&(t=!1),i.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),t&&n.trigger("change")):(this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active"))};r=n.fn.button;n.fn.button=i;n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=r,this};n(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var r=n(t.target).closest(".btn");i.call(r,"toggle");n(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),r.is("input,button")?r.trigger("focus"):r.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){n(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i),e="string"==typeof i?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));"number"==typeof i?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})}var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=null;this.sliding=null;this.interval=null;this.$active=null;this.$items=null;this.options.keyboard&&this.$element.on("keydown.bs.carousel",n.proxy(this.keydown,this));"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",n.proxy(this.pause,this)).on("mouseleave.bs.carousel",n.proxy(this.cycle,this))},u,r;t.VERSION="3.4.1";t.TRANSITION_DURATION=600;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0};t.prototype.keydown=function(n){if(!/input|textarea/i.test(n.target.tagName)){switch(n.which){case 37:this.prev();break;case 39:this.next();break;default:return}n.preventDefault()}};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getItemIndex=function(n){return this.$items=n.parent().children(".item"),this.$items.index(n||this.$active)};t.prototype.getItemForDirection=function(n,t){var i=this.getItemIndex(t),r;return("prev"==n&&0===i||"next"==n&&i==this.$items.length-1)&&!this.options.wrap?t:(r=(i+("prev"==n?-1:1))%this.$items.length,this.$items.eq(r))};t.prototype.to=function(n){var i=this,t=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(n>this.$items.length-1||n<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){i.to(n)}):t==n?this.pause().cycle():this.slide(t<n?"next":"prev",this.$items.eq(n))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(i,r){var e=this.$element.find(".item.active"),u=r||this.getItemForDirection(i,e),l=this.interval,f="next"==i?"left":"right",a=this,o,s,h,c;return u.hasClass("active")?this.sliding=!1:(o=u[0],s=n.Event("slide.bs.carousel",{relatedTarget:o,direction:f}),(this.$element.trigger(s),!s.isDefaultPrevented())?((this.sliding=!0,l&&this.pause(),this.$indicators.length)&&(this.$indicators.find(".active").removeClass("active"),h=n(this.$indicators.children()[this.getItemIndex(u)]),h&&h.addClass("active")),c=n.Event("slid.bs.carousel",{relatedTarget:o,direction:f}),n.support.transition&&this.$element.hasClass("slide")?(u.addClass(i),"object"==typeof u&&u.length&&u[0].offsetWidth,e.addClass(f),u.addClass(f),e.one("bsTransitionEnd",function(){u.removeClass([i,f].join(" ")).addClass("active");e.removeClass(["active",f].join(" "));a.sliding=!1;setTimeout(function(){a.$element.trigger(c)},0)}).emulateTransitionEnd(t.TRANSITION_DURATION)):(e.removeClass("active"),u.addClass("active"),this.sliding=!1,this.$element.trigger(c)),l&&this.cycle(),this):void 0)};u=n.fn.carousel;n.fn.carousel=i;n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=u,this};r=function(t){var u=n(this),f=u.attr("href"),s,r,o,e;f&&(f=f.replace(/.*(?=#[^\s]+$)/,""));s=u.attr("data-target")||f;r=n(document).find(s);r.hasClass("carousel")&&(o=n.extend({},r.data(),u.data()),e=u.attr("data-slide-to"),e&&(o.interval=!1),i.call(r,o),e&&r.data("bs.carousel").to(e),t.preventDefault())};n(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r);n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery),function(n){"use strict";function r(t){var i,r=t.attr("data-target")||(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return n(document).find(r)}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i);!r&&f.toggle&&/show|hide/.test(i)&&(f.toggle=!1);r||u.data("bs.collapse",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.$trigger=n('[data-toggle="collapse"][href="#'+i.id+'"],[data-toggle="collapse"][data-target="#'+i.id+'"]');this.transitioning=null;this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger);this.options.toggle&&this.toggle()},u;t.VERSION="3.4.1";t.TRANSITION_DURATION=350;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"};t.prototype.show=function(){var f,r,e,u,o,s;if(!this.transitioning&&!this.$element.hasClass("in")&&(r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing"),!(r&&r.length&&(f=r.data("bs.collapse"))&&f.transitioning)&&(e=n.Event("show.bs.collapse"),this.$element.trigger(e),!e.isDefaultPrevented()))){if(r&&r.length&&(i.call(r,"hide"),f||r.data("bs.collapse",null)),u=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[u](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1,o=function(){this.$element.removeClass("collapsing").addClass("collapse in")[u]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return o.call(this);s=n.camelCase(["scroll",u].join("-"));this.$element.one("bsTransitionEnd",n.proxy(o,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[u](this.$element[0][s])}};t.prototype.hide=function(){var r,i,u;if(!this.transitioning&&this.$element.hasClass("in")&&(r=n.Event("hide.bs.collapse"),this.$element.trigger(r),!r.isDefaultPrevented())){if(i=this.dimension(),this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1,u=function(){this.transitioning=0;this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")},!n.support.transition)return u.call(this);this.$element[i](0).one("bsTransitionEnd",n.proxy(u,this)).emulateTransitionEnd(t.TRANSITION_DURATION)}};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};t.prototype.getParent=function(){return n(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(n.proxy(function(t,i){var u=n(i);this.addAriaAndCollapsedClass(r(u),u)},this)).end()};t.prototype.addAriaAndCollapsedClass=function(n,t){var i=n.hasClass("in");n.attr("aria-expanded",i);t.toggleClass("collapsed",!i).attr("aria-expanded",i)};u=n.fn.collapse;n.fn.collapse=i;n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=u,this};n(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var u=n(this),f,e;u.attr("data-target")||t.preventDefault();f=r(u);e=f.data("bs.collapse")?"toggle":u.data();i.call(f,e)})}(jQuery),function(n){"use strict";function r(t){var i=t.attr("data-target"),r;return i||(i=(i=t.attr("href"))&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r="#"!==i?n(document).find(i):null,r&&r.length?r:t.parent()}function u(t){t&&3===t.which||(n(".dropdown-backdrop").remove(),n(i).each(function(){var u=n(this),i=r(u),f={relatedTarget:this};i.hasClass("open")&&(t&&"click"==t.type&&/input|textarea/i.test(t.target.tagName)&&n.contains(i[0],t.target)||(i.trigger(t=n.Event("hide.bs.dropdown",f)),t.isDefaultPrevented()||(u.attr("aria-expanded","false"),i.removeClass("open").trigger(n.Event("hidden.bs.dropdown",f)))))}))}var i='[data-toggle="dropdown"]',t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.VERSION="3.4.1";t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=r(f),o=i.hasClass("open"),u(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(n(this)).on("click",u),e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;f.trigger("focus").attr("aria-expanded","true");i.toggleClass("open").trigger(n.Event("shown.bs.dropdown",e))}return!1}};t.prototype.keydown=function(t){var e,o,s,f,u;if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=r(e),s=o.hasClass("open"),!s&&27!=t.which||s&&27==t.which)return 27==t.which&&o.find(i).trigger("focus"),e.trigger("click");f=o.find(".dropdown-menu li:not(.disabled):visible a");f.length&&(u=f.index(t.target),38==t.which&&0<u&&u--,40==t.which&&u<f.length-1&&u++,~u||(u=0),f.eq(u).trigger("focus"))}};f=n.fn.dropdown;n.fn.dropdown=function(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));"string"==typeof i&&u[i].call(r)})};n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",u).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i,t.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",t.prototype.keydown)}(jQuery),function(n){"use strict";function i(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),"object"==typeof i&&i);u||f.data("bs.modal",u=new t(this,e));"string"==typeof i?u[i](r):e.show&&u.show(r)})}var t=function(t,i){this.options=i;this.$body=n(document.body);this.$element=n(t);this.$dialog=this.$element.find(".modal-dialog");this.$backdrop=null;this.isShown=null;this.originalBodyPad=null;this.scrollbarWidth=0;this.ignoreBackdropClick=!1;this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom";this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},r;t.VERSION="3.4.1";t.TRANSITION_DURATION=300;t.BACKDROP_TRANSITION_DURATION=150;t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this.isShown?this.hide():this.show(n)};t.prototype.show=function(i){var r=this,u=n.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(u);this.isShown||u.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){n(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})}),this.backdrop(function(){var f=n.support.transition&&r.$element.hasClass("fade"),u;r.$element.parent().length||r.$element.appendTo(r.$body);r.$element.show().scrollTop(0);r.adjustDialog();f&&r.$element[0].offsetWidth;r.$element.addClass("in");r.enforceFocus();u=n.Event("shown.bs.modal",{relatedTarget:i});f?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(u)}).emulateTransitionEnd(t.TRANSITION_DURATION):r.$element.trigger("focus").trigger(u)}))};t.prototype.hide=function(i){i&&i.preventDefault();i=n.Event("hide.bs.modal");this.$element.trigger(i);this.isShown&&!i.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(t.TRANSITION_DURATION):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){document===n.target||this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.trigger("focus")},this))};t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",n.proxy(function(n){27==n.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")};t.prototype.resize=function(){this.isShown?n(window).on("resize.bs.modal",n.proxy(this.handleUpdate,this)):n(window).off("resize.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.$body.removeClass("modal-open");n.resetAdjustments();n.resetScrollbar();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(i){var e=this,f=this.$element.hasClass("fade")?"fade":"",r,u;if(this.isShown&&this.options.backdrop){if(r=n.support.transition&&f,this.$backdrop=n(document.createElement("div")).addClass("modal-backdrop "+f).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:n.target===n.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),r&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!i)return;r?this.$backdrop.one("bsTransitionEnd",i).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):i()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),u=function(){e.removeBackdrop();i&&i()},n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",u).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):u()):i&&i()};t.prototype.handleUpdate=function(){this.adjustDialog()};t.prototype.adjustDialog=function(){var n=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&n?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!n?this.scrollbarWidth:""})};t.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})};t.prototype.checkScrollbar=function(){var n=window.innerWidth,t;n||(t=document.documentElement.getBoundingClientRect(),n=t.right-Math.abs(t.left));this.bodyIsOverflowing=document.body.clientWidth<n;this.scrollbarWidth=this.measureScrollbar()};t.prototype.setScrollbar=function(){var i=parseInt(this.$body.css("padding-right")||0,10),t;this.originalBodyPad=document.body.style.paddingRight||"";t=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",i+t),n(this.fixedContent).each(function(i,r){var u=r.style.paddingRight,f=n(r).css("padding-right");n(r).data("padding-right",u).css("padding-right",parseFloat(f)+t+"px")}))};t.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad);n(this.fixedContent).each(function(t,i){var r=n(i).data("padding-right");n(i).removeData("padding-right");i.style.paddingRight=r||""})};t.prototype.measureScrollbar=function(){var n=document.createElement("div"),t;return n.className="modal-scrollbar-measure",this.$body.append(n),t=n.offsetWidth-n.clientWidth,this.$body[0].removeChild(n),t};r=n.fn.modal;n.fn.modal=i;n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=r,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var r=n(this),f=r.attr("href"),e=r.attr("data-target")||f&&f.replace(/.*(?=#[^\s]+$)/,""),u=n(document).find(e),o=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(f)&&f},u.data(),r.data());r.is("a")&&t.preventDefault();u.one("show.bs.modal",function(n){n.isDefaultPrevented()||u.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})});i.call(u,o,this)})}(jQuery),function(n){"use strict";function s(t,i){var r=t.nodeName.toLowerCase();if(-1!==n.inArray(r,i))return-1===n.inArray(r,f)||Boolean(t.nodeValue.match(e)||t.nodeValue.match(o));for(var s=n(i).filter(function(n,t){return t instanceof RegExp}),u=0,h=s.length;u<h;u++)if(r.match(s[u]))return!0;return!1}function i(t,i,r){var f,u,h;if(0===t.length)return t;if(r&&"function"==typeof r)return r(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;f=document.implementation.createHTMLDocument("sanitization");f.body.innerHTML=t;for(var a=n.map(i,function(n,t){return t}),l=n(f.body).find("*"),o=0,v=l.length;o<v;o++)if(u=l[o],h=u.nodeName.toLowerCase(),-1!==n.inArray(h,a))for(var c=n.map(u.attributes,function(n){return n}),y=[].concat(i["*"]||[],i[h]||[]),e=0,p=c.length;e<p;e++)s(c[e],y)||u.removeAttribute(c[e].nodeName);else u.parentNode.removeChild(u);return f.body.innerHTML}var u=["sanitize","whiteList","sanitizeFn"],f=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],e=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i,t=function(n,t){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.init("tooltip",n,t)},r;t.VERSION="3.4.1";t.TRANSITION_DURATION=150;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}};t.prototype.init=function(t,i,r){var f,e,u,o,s;if(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(document).find(n.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],"click"==u)this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else"manual"!=u&&(o="hover"==u?"mouseenter":"focusin",s="hover"==u?"mouseleave":"focusout",this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this)));this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){var r=this.$element.data();for(var f in r)r.hasOwnProperty(f)&&-1!==n.inArray(f,u)&&delete r[f];return(t=n.extend({},this.getDefaults(),r,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=i(t.template,t.whiteList,t.sanitizeFn)),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusin"==t.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState)i.hoverState="in";else{if(clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)}};t.prototype.isInStateTrue=function(){for(var n in this.inState)if(this.inState[n])return!0;return!1};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusout"==t.type?"focus":"hover"]=!1),!i.isInStateTrue()){if(clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)}};t.prototype.show=function(){var c=n.Event("show.bs."+this.type),l,p,e,w,h;if(this.hasContent()&&this.enabled){if(this.$element.trigger(c),l=n.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]),c.isDefaultPrevented()||!l)return;var u=this,r=this.tip(),a=this.getUID(this.type);this.setContent();r.attr("id",a);this.$element.attr("aria-describedby",a);this.options.animation&&r.addClass("fade");var i="function"==typeof this.options.placement?this.options.placement.call(this,r[0],this.$element[0]):this.options.placement,v=/\s?auto?\s?/i,y=v.test(i);y&&(i=i.replace(v,"")||"top");r.detach().css({top:0,left:0,display:"block"}).addClass(i).data("bs."+this.type,this);this.options.container?r.appendTo(n(document).find(this.options.container)):r.insertAfter(this.$element);this.$element.trigger("inserted.bs."+this.type);var f=this.getPosition(),o=r[0].offsetWidth,s=r[0].offsetHeight;y&&(p=i,e=this.getPosition(this.$viewport),i="bottom"==i&&f.bottom+s>e.bottom?"top":"top"==i&&f.top-s<e.top?"bottom":"right"==i&&f.right+o>e.width?"left":"left"==i&&f.left-o<e.left?"right":i,r.removeClass(p).addClass(i));w=this.getCalculatedOffset(i,f,o,s);this.applyPlacement(w,i);h=function(){var n=u.hoverState;u.$element.trigger("shown.bs."+u.type);u.hoverState=null;"out"==n&&u.leave(u)};n.support.transition&&this.$tip.hasClass("fade")?r.one("bsTransitionEnd",h).emulateTransitionEnd(t.TRANSITION_DURATION):h()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),l=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top+=o;t.left+=s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;"top"==i&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var c=/top|bottom/.test(i),a=c?2*u.left-l+h:2*u.top-e+f,v=c?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(a,r[0][v],c)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i?"left":"top",50*(1-n/t)+"%").css(i?"top":"left","")};t.prototype.setContent=function(){var t=this.tip(),n=this.getTitle();this.options.html?(this.options.sanitize&&(n=i(n,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(n)):t.find(".tooltip-inner").text(n);t.removeClass("fade in top bottom left right")};t.prototype.hide=function(i){function e(){"in"!=r.hoverState&&u.detach();r.$element&&r.$element.removeAttr("aria-describedby").trigger("hidden.bs."+r.type);i&&i()}var r=this,u=n(this.$tip),f=n.Event("hide.bs."+this.type);if(this.$element.trigger(f),!f.isDefaultPrevented())return u.removeClass("in"),n.support.transition&&u.hasClass("fade")?u.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||"string"!=typeof n.attr("data-original-title"))&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){var r=(t=t||this.$element)[0],u="BODY"==r.tagName,i=r.getBoundingClientRect();null==i.width&&(i=n.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var f=window.SVGElement&&r instanceof window.SVGElement,e=u?{top:0,left:0}:f?null:t.offset(),o={scroll:u?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},s=u?{width:n(window).width(),height:n(window).height()}:null;return n.extend({},i,o,s,e)};t.prototype.getCalculatedOffset=function(n,t,i,r){return"bottom"==n?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==n?{top:t.top-r,left:t.left+t.width/2-i/2}:"left"==n?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.right&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){for(;n+=~~(1e6*Math.random()),document.getElementById(n););return n};t.prototype.tip=function(){if(!this.$tip&&(this.$tip=n(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&((i=n(t.currentTarget).data("bs."+this.type))||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));t?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){var n=this;clearTimeout(this.timeout);this.hide(function(){n.$element.off("."+n.type).removeData("bs."+n.type);n.$tip&&n.$tip.detach();n.$tip=null;n.$arrow=null;n.$viewport=null;n.$element=null})};t.prototype.sanitizeHtml=function(n){return i(n,this.options.whiteList,this.options.sanitizeFn)};r=n.fn.tooltip;n.fn.tooltip=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f="object"==typeof i&&i;!r&&/destroy|hide/.test(i)||(r||u.data("bs.tooltip",r=new t(this,f)),"string"==typeof i&&r[i]())})};n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=r,this}}(jQuery),function(n){"use strict";var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.4.1";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});((t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=t).prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent(),r;this.options.html?(r=typeof t,this.options.sanitize&&(i=this.sanitizeHtml(i),"string"===r&&(t=this.sanitizeHtml(t))),n.find(".popover-title").html(i),n.find(".popover-content").children().detach().end()["string"===r?"html":"append"](t)):(n.find(".popover-title").text(i),n.find(".popover-content").children().detach().end().text(t));n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||("function"==typeof n.content?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};i=n.fn.popover;n.fn.popover=function(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f="object"==typeof i&&i;!r&&/destroy|hide/.test(i)||(r||u.data("bs.popover",r=new t(this,f)),"string"==typeof i&&r[i]())})};n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery),function(n){"use strict";function t(i,r){this.$body=n(document.body);this.$scrollElement=n(i).is(document.body)?n(window):n(i);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||"")+" .nav li > a";this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on("scroll.bs.scrollspy",n.proxy(this.process,this));this.refresh();this.process()}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f="object"==typeof i&&i;r||u.data("bs.scrollspy",r=new t(this,f));"string"==typeof i&&r[i]()})}t.VERSION="3.4.1";t.DEFAULTS={offset:10};t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)};t.prototype.refresh=function(){var t=this,i="offset",r=0;this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();n.isWindow(this.$scrollElement[0])||(i="position",r=this.$scrollElement.scrollTop());this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),t=/^#./.test(u)&&n(u);return t&&t.length&&t.is(":visible")&&[[t[i]().top+r,u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var n,i=this.$scrollElement.scrollTop()+this.options.offset,f=this.getScrollHeight(),e=this.options.offset+f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget;if(this.scrollHeight!=f&&this.refresh(),e<=i)return u!=(n=r[r.length-1])&&this.activate(n);if(u&&i<t[0])return this.activeTarget=null,this.clear();for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(t[n+1]===undefined||i<t[n+1])&&this.activate(r[n])};t.prototype.activate=function(t){this.activeTarget=t;this.clear();var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};t.prototype.clear=function(){n(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var r=n.fn.scrollspy;n.fn.scrollspy=i;n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=r,this};n(window).on("load.bs.scrollspy.data-api",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery),function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));"string"==typeof i&&r[i]()})}var t=function(t){this.element=n(t)},u,i;t.VERSION="3.4.1";t.TRANSITION_DURATION=150;t.prototype.show=function(){var t=this.element,f=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),u;if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=f.find(".active:last a"),e=n.Event("hide.bs.tab",{relatedTarget:t[0]}),o=n.Event("show.bs.tab",{relatedTarget:r[0]});(r.trigger(e),t.trigger(o),o.isDefaultPrevented()||e.isDefaultPrevented())||(u=n(document).find(i),this.activate(t.closest("li"),f),this.activate(u,u.parent(),function(){r.trigger({type:"hidden.bs.tab",relatedTarget:t[0]});t.trigger({type:"shown.bs.tab",relatedTarget:r[0]})}))}};t.prototype.activate=function(i,r,u){function o(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1);i.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0);e?(i[0].offsetWidth,i.addClass("in")):i.removeClass("fade");i.parent(".dropdown-menu").length&&i.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0);u&&u()}var f=r.find("> .active"),e=u&&n.support.transition&&(f.length&&f.hasClass("fade")||!!r.find("> .fade").length);f.length&&e?f.one("bsTransitionEnd",o).emulateTransitionEnd(t.TRANSITION_DURATION):o();f.removeClass("in")};u=n.fn.tab;n.fn.tab=r;n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=u,this};i=function(t){t.preventDefault();r.call(n(this),"show")};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f="object"==typeof i&&i;r||u.data("bs.affix",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);var u=this.options.target===t.DEFAULTS.target?n(this.options.target):n(document).find(this.options.target);this.$target=u.on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=null;this.unpin=null;this.pinnedOffset=null;this.checkPosition()},r;t.VERSION="3.4.1";t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0,target:window};t.prototype.getState=function(n,t,i,r){var u=this.$target.scrollTop(),e=this.$element.offset(),o=this.$target.height(),f,s;return null!=i&&"top"==this.affixed?u<i&&"top":"bottom"==this.affixed?null!=i?!(u+this.unpin<=e.top)&&"bottom":!(u+o<=n-r)&&"bottom":(f=null==this.affixed,s=f?u:e.top,null!=i&&u<=i?"top":null!=r&&n-r<=s+(f?o:t)&&"bottom")};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,o;if(this.$element.is(":visible")){var s=this.$element.height(),r=this.options.offset,f=r.top,u=r.bottom,h=Math.max(n(document).height(),n(document.body).height());if("object"!=typeof r&&(u=f=r),"function"==typeof f&&(f=r.top(this.$element)),"function"==typeof u&&(u=r.bottom(this.$element)),i=this.getState(h,s,f,u),this.affixed!=i){if(null!=this.unpin&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),o=n.Event(e+".bs.affix"),this.$element.trigger(o),o.isDefaultPrevented())return;this.affixed=i;this.unpin="bottom"==i?this.getPinnedOffset():null;this.$element.removeClass(t.RESET).addClass(e).trigger(e.replace("affix","affixed")+".bs.affix")}"bottom"==i&&this.$element.offset({top:h-s-u})}};r=n.fn.affix;n.fn.affix=i;n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=r,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var r=n(this),t=r.data();t.offset=t.offset||{};null!=t.offsetBottom&&(t.offset.bottom=t.offsetBottom);null!=t.offsetTop&&(t.offset.top=t.offsetTop);i.call(r,t)})})}(jQuery),function(n,t,i){function y(){var n=t.createElement("canvas");return!!(n.getContext&&n.getContext("2d"))}function p(n){var t=n.position().left+n.width()-n.position().left,i=n.position().top+n.height()-n.position().top;return Math.sqrt(t*t+i*i)}var h,r,f;if(n.Feedback===i){var l=function(n){for(var t,i=0,r=n.length;i<r;i++)t=Array.prototype.pop.call(n),t&&t.parentNode!==null&&t.parentNode.removeChild(t)},o=function(n){for(var t;(t=n.firstChild)!==null?n.removeChild(t):!1;);},e=function(n,i){var r=t.createElement(n);return r.appendChild(t.createTextNode(i)),r},u,a="data-html2canvas-ignore",s=t.createElement("div"),c=function(n){var i="";for(var t in n)n.hasOwnProperty(t)&&(i+=t+": "+n[t]+"<br/>");return i},v=function(){var r=navigator.userAgent,n=[{s:"Windows 3.11",r:/Win16/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 10",r:/(Windows 10|Windows NT 10|Windows 10.0|Windows NT 10.0)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows ME",r:/Windows ME/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}],t,i;for(t in n)if(n.hasOwnProperty(t)&&(i=n[t],r.match(i.r)))return i.s;return""};n.Feedback=function(f){n.Feedback.options=f=f||{};f.describePanel={};f.annotatePanel={};f.reviewPanel={};f.thankYouPanel={};f.descriptonLabel="Description";f.screenshotLabel="Screenshot";f.describePanel.descriptionLabel="What do you need help with?";f.describePanel.annotateLabel="Next we'll let you select areas of the page related to your description.";f.annotatePanel.descriptionLabel="Select important information";f.reviewPanel.browserInfoLabel="Browser Info";f.reviewPanel.userInfoLabel="User Info";f.reviewPanel.pageInfoLabel="Page Info";f.reviewPanel.creatingImageLabel="Creating Image. Please wait...";f.localization=f.Localization;f.reviewPanel.browserData=c(f.BrowserData);f.reviewPanel.userData=c(f.UserData);f.reviewPanel.pageData=c(f.PageData);f.AgendaFree=f.AgendaFree;f.thankYouPanel.descriptionLabel="Thank you for your feedback.";f.label=f.label||"Send Feedback";f.header=f.header||"Support / Feedback";f.url=f.Url||"/";f.nextLabel=f.nextLabel||"Continue";f.reviewLabel=f.reviewLabel||"Next Review";f.sendLabel=f.sendLabel||"Send";f.closeLabel=f.closeLabel||"Close";f.messageSuccess=f.messageSuccess||"Thank you, your feedback was sent successfully.";f.messageError=f.messageError||"There was an error sending your feedback. Please contact our Customer Success Team at 1-800-260-7409. ";f.pages===i&&(f.pages=[new n.Feedback.Describe,new n.Feedback.Annotate(f),new n.Feedback.Review,new n.Feedback.ThankYou]);var y,h,p=t.createElement("div"),w={open:function(){var nt=f.pages.length,k,d,g,i;for(h=0;h<nt;h++)f.pages[h]instanceof n.Feedback.Review||f.pages[h].render(f);var b=e("a","×"),c=t.createElement("div"),l=t.createElement("div");y=t.createElement("div");y.id="FeedbackModal";y.style.zIndex="9999";p.id="glass";p.style.width=t.body.clientWidth+"px";p.style.height=t.body.clientHeight+"px";p.style.top=0;p.style.left=0;p.style.position="absolute";p.style.backgroundColor="#333333";p.style.opacity="0.2";t.body.appendChild(p);b.className="feedback-close";b.onclick=w.close;b.href="#";c.appendChild(b);k=t.createElement("h3");d=t.createElement("span");d.className="glyphicon glyphicon-info-sign";k.appendChild(d);k.appendChild(t.createTextNode(" "+f.header));c.appendChild(k);c.className="feedback-header";s.className="feedback-body";o(s);h=0;s.appendChild(f.pages[h++].dom);u=e("button",f.nextLabel);u.className="feedback-btn";u.setAttribute("disabled","disabled");u.onclick=function(){if(h>0)if(f.pages[h-1]instanceof n.Feedback.Review){var t={};t.ErrorDescription=n.Feedback.Describe.Description.replace(/\n/g,"<br />");t.Image=f.reviewPanel.imageData;t.BrowserData=JSON.stringify(f.BrowserData);t.UserAgent=n.navigator.userAgent;t.OS=v();t.UserData=JSON.stringify(f.UserData);t.PageData=JSON.stringify(f.PageData);t.Priority=n.Feedback.Describe.Priority;$.ajax({url:"/Services/ExceptionsService.svc/userErrorSubmit",contentType:"application/json",dataType:"json",async:!0,type:"POST",cache:!1,timeout:45e3,data:JSON.stringify(t),beforeSend:function(){$("#loaderImage").show()},success:function(){$("#loaderImage").hide();g();$(".feedback-body > div > label").html(f.messageSuccess)},error:function(){$(".feedback-body > div > label").html(f.messageError);alert("Failed submission")}})}else g()};g=function(){f.pages[h-1].end(y)!==!1&&(o(s),f.pages[h].start(y,c,l,u,f),f.pages[h]instanceof n.Feedback.Annotate&&(r.init("body"),r.show()),f.pages[h]instanceof n.Feedback.Review&&f.pages[h].render(y,f.pages,f),s.appendChild(f.pages[h++].dom),$("#accordionInfo").length&&$("#accordionInfo").accordion({collapsible:!0,active:!1}),h===nt&&(u.firstChild.nodeValue=f.closeLabel,u.onclick=w.close),f.pages[h]instanceof n.Feedback.Review&&(u.firstChild.nodeValue=f.reviewLabel),f.pages[h]instanceof n.Feedback.ThankYou&&(u.firstChild.nodeValue=f.sendLabel))};l.className="feedback-footer";l.appendChild(u);i=t.createElement("span");i.id="loaderImage";i.style.width="25px";i.style.height="25px";i.style.fontSize="2em";i.style.cssFloat="right";i.style.display="none";i.innerHTML='<span class="fa fa-spinner fa-spin"><\/span>';l.appendChild(i);y.className="feedback-modal";y.setAttribute(a,!0);y.appendChild(c);y.appendChild(s);y.appendChild(l);t.body.appendChild(y)},close:function(){r.options!=i&&(r.hide(),r.clear());l([y,p]);h>0&&f.pages[h-1].end(y);for(var n=0,t=f.pages.length;n<t;n++)f.pages[n].close();return!1}};return w};n.Feedback.refreshPriorityOptions=function(){return $.ajax({url:"/api/settings/fullsupport",contentType:"application/json",dataType:"json",async:!0,type:"GET",cache:!1}).done(function(i){if(i){var r=$(t.getElementById("FeedbackModal"));r.find('input[type="radio"][name="priority"][value="High"]').removeAttr("disabled").closest("label").css({color:""}).find("span").text(n.Feedback.options.localization.optionHighPrioritySupport);r.find(".upgrade-request").addClass("hidden");n.Feedback.options.FullSupport=!0}})};n.Feedback.Page=function(){};n.Feedback.Page.prototype={render:function(n){this.dom=n},start:function(){},close:function(){},data:function(){return!1},review:function(){return null},end:function(){return!0}};n.Feedback.Describe=function(){this.dom=t.createElement("div")};n.Feedback.Describe.prototype=new n.Feedback.Page;n.Feedback.Describe.prototype.render=function(n){var u,f,w,r,b,a,s,v,c,y,l,p,i;return o(this.dom),n.AgendaFree&&(u=t.createElement("a"),u.text=n.localization.faq,u.href="/Help/FAQ",u.target="_blank",u.className="pull-right",this.dom.appendChild(u),this.dom.appendChild(t.createElement("br"))),f=t.createElement("label"),f.innerHTML=n.describePanel.descriptionLabel,this.dom.appendChild(f),w=t.createElement("textarea"),w.id="Description",this.dom.appendChild(w),this.dom.appendChild(e("strong","Urgency?")),r=e("input"),r.value="High",r.type="radio",r.name="priority",r.onclick=h,b=t.createElement("span"),b.appendChild(t.createTextNode(n.AgendaFree&&!n.FullSupport?n.localization.optionHighPrioritySupportUnpurchased:n.localization.optionHighPrioritySupport)),a=t.createElement("label"),a.appendChild(r),a.appendChild(b),n.AgendaFree&&!n.FullSupport&&(r.setAttribute("disabled","disabled"),a.style.color="gray"),s=e("input"),s.value="Medium - 1 day",s.type="radio",s.name="priority",s.onclick=h,v=t.createElement("label"),v.appendChild(s),v.appendChild(t.createTextNode("Medium - 1 day response")),c=e("input"),c.value="Low - 1 week",c.type="radio",c.name="priority",c.onclick=h,y=t.createElement("label"),y.appendChild(c),y.appendChild(t.createTextNode("Low - 1 week response")),l=e("input"),l.value="No response necessary",l.type="radio",l.name="priority",l.onclick=h,p=t.createElement("label"),p.appendChild(l),p.appendChild(t.createTextNode("No response necessary")),this.dom.appendChild(t.createElement("br")),this.dom.appendChild(a),n.AgendaFree&&!n.FullSupport&&(i=t.createElement("a"),i.textContent="Upgrade to Full version",i.style.marginLeft="10px",i.className="button button-short button-highlighted background-color-hover upgrade-request",i.setAttribute("href","https://www.icompasstech.com/pricing/"),i.setAttribute("target","_blank"),i.setAttribute("data-type","AgendaFree_Full_Support"),this.dom.appendChild(i)),this.dom.appendChild(t.createElement("br")),this.dom.appendChild(v),this.dom.appendChild(t.createElement("br")),this.dom.appendChild(y),this.dom.appendChild(t.createElement("br")),this.dom.appendChild(p),this.dom.appendChild(t.createElement("br")),this.dom.appendChild(t.createElement("br")),f=t.createElement("label"),f.innerHTML=n.describePanel.annotateLabel,this.dom.appendChild(f),this};h=function(){$(".feedback-btn").removeAttr("disabled");$(".feedback-lbl-priority").hide()};n.Feedback.Describe.prototype.end=function(){n.Feedback.Describe.Description=$("#Description").val();n.Feedback.Describe.Priority=t.querySelector('input[name="priority"]:checked').value};n.Feedback.Annotate=function(n){this.options=n||{};this.options.highlightClass=this.options.highlightClass||"feedback-highlighted"};n.Feedback.Annotate.prototype=new n.Feedback.Page;n.Feedback.Annotate.prototype.start=function(n){o(this.dom);var i=t.createElement("label");i.innerHTML=" Select areas relevant to your feedback";n.className+=" feedback-animate-toside";this.dom.appendChild(i);$("#FeedbackModal").draggable({handle:".feedback-header",delay:0})};n.Feedback.Annotate.prototype.render=function(){return this.dom=t.createElement("div"),this};n.Feedback.Annotate.prototype.end=function(){};n.Feedback.Annotate.prototype.close=function(){};n.Feedback.Review=function(){var n=t.createElement("div");n.style.overflow="hidden";this.dom=n};n.Feedback.Review.prototype=new n.Feedback.Page;n.Feedback.Review.prototype.render=function(i,r,u){var w,c,a,v,s,h,f,e,l,y,p,b;return i.removeAttribute("style"),$(i).removeClass("feedback-animate-toside").addClass("feedback-animate-review"),o(this.dom),c=t.createElement("div"),c.id="firstColumn",c.className="feedback-columns",a=t.createElement("label"),a.innerHTML=u.descriptonLabel,a.style.fontWeight="bold",c.appendChild(a),v=t.createElement("textarea"),v.style.width="90%",v.value=n.Feedback.Describe.Description,c.appendChild(v),s=t.createElement("div"),s.id="accordionInfo",h=t.createElement("h5"),h.innerHTML=u.reviewPanel.browserInfoLabel,f=t.createElement("p"),f.id="browserInfo",f.innerHTML=u.reviewPanel.browserData,s.appendChild(h),s.appendChild(f),h=t.createElement("h5"),h.innerHTML=u.reviewPanel.userInfoLabel,f=t.createElement("p"),f.id="userInfo",f.innerHTML=u.reviewPanel.userData,s.appendChild(h),s.appendChild(f),h=t.createElement("h5"),h.innerHTML=u.reviewPanel.pageInfoLabel,f=t.createElement("p"),f.id="pageInfo",f.innerHTML=u.reviewPanel.pageData,s.appendChild(h),s.appendChild(f),c.appendChild(s),e=t.createElement("div"),e.id="secondColumn",e.className="feedback-columns",w=t.createElement("label"),w.innerHTML=u.screenshotLabel,e.appendChild(w),this.dom.appendChild(c),this.dom.appendChild(e),e.appendChild(t.createElement("br")),l=t.createElement("img"),l.className="hidden",e.appendChild(l),y=t.createElement("span"),y.innerHTML='<span class="fa fa-spinner fa-spin"><\/span>',e.appendChild(y),p=t.createElement("label"),p.innerHTML="&nbsp;&nbsp;"+u.reviewPanel.creatingImageLabel,e.appendChild(p),setTimeout(function(){n.html2canvas(t.body,{onrendered:function(n){e.removeChild(y);e.removeChild(p);b=n.toDataURL();u.reviewPanel.imageData=b;l.className="";l.src=b;l.style.width="100%";l.style.height="100%"}})},1300),this};n.Feedback.ThankYou=function(){this.dom=t.createElement("div")};n.Feedback.ThankYou.prototype=new n.Feedback.Page;n.Feedback.ThankYou.prototype.render=function(n){o(this.dom);var i=t.createElement("label");return i.innerHTML=n.thankYouPanel.descriptionLabel,this.dom.appendChild(i),this};r={};f={base:{position:"absolute",top:0,left:0,margin:0,"z-index":4900},markers:{"z-index":5e3,"background-color":"rgba(0,0,0,0)",color:"gray",cursor:"crosshair"},rectangle:{position:"absolute","font-size":"14px","font-weight":"bold","z-index":5500,border:"2px solid #000"},unselectable:{"-moz-user-select":"-moz-none","-khtml-user-select":"none","-webkit-user-select":"none","user-select":"none"}};r.defaults={useCanvas:y(),minimalDistance:10,color:"rgba(255,255,255,0)",container:$(t),uploadName:"screenshot",uploadMIME:"image/png",onRectangleStart:function(){},onRectangleEnd:function(n){n.text("Click me to remove");n.mouseover(function(){n.text("Click me to remove")});n.mouseout(function(){n.text("")})},onPreRender:function(){alert("Feedback will now create a screen shot of the web elements ONLY. The overlay and feedback window will hide for a second and will then show again. Rendering can take a few seconds.")},onPostRender:function(){},onShow:function(){},onHide:function(){}};r.init=function(t,i){r.options=$.extend(r.defaults,i);r.overlay=$("<canvas />").css(f.base).css(f.unselectable).appendTo(t);r.markers=$("<div />").css(f.base).css(f.markers).css(f.unselectable).appendTo(t);r.element=t;var u=null;$(n).resize(function(){r.resize();r.paint()});r.markers.mousedown(function(n){u=$("<div />").css({left:n.pageX,top:n.pageY}).css($.extend(f.rectangle,f.unselectable,{"background-color":r.options.color}));var t=n.pageX,i=n.pageY;r.options.onRectangleStart(u,t,i);u.appendTo(r.markers);r.markers.mousemove(function(n){u.width(Math.abs(n.pageX-t));u.height(Math.abs(n.pageY-i));n.pageX<t&&u.css("left",n.pageX);n.pageY<i&&u.css("top",n.pageY)})});r.markers.mouseup(function(n){var t=u,i=function(){t.remove();r.paint()};if(p(t)<r.options.minimalDistance)i();else{r.options.onRectangleEnd(t,n.pageX,n.pageY);t.mousedown(function(){return!1});t.click(i)}r.markers.unbind("mousemove");r.paint()});r.hide();r.resize();r.clear()};r.paint=function(){var n;r.options.useCanvas&&(n=r.overlay[0].getContext("2d"),n.clearRect(0,0,r.overlay.width(),r.overlay.height()),n.fillStyle="rgba(0, 0, 0, 0.5)",n.fillRect(0,0,r.overlay.width(),r.overlay.height()));r.markers.find("div").each(function(){var t=$(this),i=parseInt(t.css("border-left-width"),10);r.options.useCanvas&&n.clearRect(t.position().left,t.position().top,t.width()+i*2,t.height()+i*2)})};r.resize=function(){r.options.useCanvas&&(r.overlay.prop("width",r.options.container.width()),r.overlay.prop("height",r.options.container.height()));r.markers.width(r.options.container.width());r.markers.height(r.options.container.height())};r.clear=function(){r.markers.html("");r.paint()};r.show=function(){r.options.useCanvas&&r.overlay.show();r.markers.show();r.options.onShow()};r.hide=function(){r.options.useCanvas&&r.overlay.hide();r.markers.hide();r.options.onHide()};r.toggle=function(){r.markers.is(":visible")?r.hide():r.show()}}}(window,document),function(n){function o(n){for(var r,i=atob(n.split(",")[1]),e=n.split(",")[0].split(":")[1].split(";")[0],f=new ArrayBuffer(i.length),o=new Uint8Array(f),t=0;t<i.length;t++)o[t]=i.charCodeAt(t);return r=new u,r.append(f),r.getBlob(e)}function r(n){if(!(n.originalEvent.touches.length>1)){var t=n.originalEvent.changedTouches[0],r=document.createEvent("MouseEvents"),i,u;switch(n.type){case"touchstart":i="mousedown";break;case"touchmove":i="mousemove";break;case"touchend":i="mouseup";break;default:return}n.type==="touchstart"?(n.target.startX=t.clientX,n.target.startY=t.clientY):n.type==="touchend"&&(u=Math.abs(n.target.startX-t.clientX)<10||Math.abs(n.target.startY-t.clientY)<10,u&&(i="click"));r.initMouseEvent(i,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null);n.target.dispatchEvent(r);n.preventDefault()}}function s(){var n=document.createElement("canvas");return!!(n.getContext&&n.getContext("2d"))}function h(n){var t=n.position().left+n.width()-n.position().left,i=n.position().top+n.height()-n.position().top;return Math.sqrt(t*t+i*i)}var u=window.BlobBuilder||window.MozBlobBuilder||window.WebKitBlobBuilder||window.MSBlobBuilder||undefined,f=window.FormData||undefined,e="ontouchstart"in document.documentElement,i={base:{position:"absolute",top:0,left:0,margin:0,"z-index":4900},markers:{"z-index":5e3,"background-color":"rgba(0,0,0,0)",cursor:"crosshair",color:"black"},rectangle:{position:"absolute","font-size":"14px","font-weight":"bold","z-index":5500,border:"2px solid #000"},unselectable:{"-moz-user-select":"-moz-none","-khtml-user-select":"none","-webkit-user-select":"none","user-select":"none"}},t={};t.instances={};t.defaults={uploadAsURI:u?!1:!0,useCanvas:s(),minimalDistance:10,color:"rgba(255,255,255,0)",container:n(document),uploadName:"screenshot",uploadMIME:"image/png",onRectangleStart:function(){},onRectangleEnd:function(n){n.text("Click me to remove");n.mouseover(function(){n.text("Click me to remove")});n.mouseout(function(){n.text("")})},onPreRender:function(){alert("HTMLFeedback will now create a screenshot of the web elements ONLY. The overlay and feedback window will hide for a second and will then show again. Rendering can take a few seconds.")},onPostRender:function(){},onShow:function(){},onHide:function(){}};t.paint=function(t){var i;t.options.useCanvas&&(i=t.overlay[0].getContext("2d"),i.clearRect(0,0,t.overlay.width(),t.overlay.height()),i.fillStyle="rgba(0, 0, 0, 0.5)",i.fillRect(0,0,t.overlay.width(),t.overlay.height()));t.markers.find("div").each(function(){var r=n(this),u=parseInt(r.css("border-left-width"),10);t.options.useCanvas&&i.clearRect(r.position().left,r.position().top,r.width()+u*2,r.height()+u*2)})};t.resize=function(n){n.options.useCanvas&&(n.overlay.prop("width",n.options.container.width()),n.overlay.prop("height",n.options.container.height()));n.markers.width(n.options.container.width());n.markers.height(n.options.container.height())};t.clear=function(n){n.markers.html("");t.paint(n)};t.show=function(n){n.options.useCanvas&&n.overlay.show();n.markers.show();n.options.onShow()};t.hide=function(n){n.options.useCanvas&&n.overlay.hide();n.markers.hide();n.options.onHide()};t.toggle=function(n){n.markers.is(":visible")?t.hide(n):t.show(n)};t.render=function(n){n.options.onPreRender();html2canvas(n.element,{onrendered:function(t){n.options.onPostRender(t);n.options.useCanvas&&n.overlay.show()}})};t.upload=function(t,i){var r=null,u=t.options.uploadMime,e=t.options.uploadName;t.options.useCanvas&&t.overlay.hide();t.options.onPreRender();html2canvas(t.element,{onrendered:function(s){t.options.onPostRender(s);if(t.options.uploadAsURI?r=s.toDataURL(u):(s.toBlob?!0:!1)?s.toBlob(function(n){r=n},u):r=o(s.toDataURL(u)),f){var h=new f;h.append(e,r);n.each(i.data||{},function(n,t){h.append(n,t)});i.data=h}else i.data=i.data||{},i.data[e]=r;n.ajax(n.extend({cache:!1,contentType:!1,processData:!1,type:"POST"},i));t.options.useCanvas&&t.overlay.show()}})};t.init=function(u,f){var f=n.extend(t.defaults,f),l=f.useCanvas?n("<canvas />").css(i.base).css(i.unselectable).appendTo(u):null,c=n("<div />").css(i.base).css(i.markers).css(i.unselectable).appendTo(u),o=t.instances[u]={overlay:l,markers:c,options:f,element:u},s=null;n(window).resize(function(){t.resize(o);t.paint(o)});c.mousedown(function(t){s=n("<div />").css({left:t.pageX,top:t.pageY}).css(n.extend(i.rectangle,i.unselectable,{"background-color":o.options.color}));var r=t.pageX,u=t.pageY;o.options.onRectangleStart(s,r,u);s.appendTo(c);c.mousemove(function(n){s.width(Math.abs(n.pageX-r));s.height(Math.abs(n.pageY-u));n.pageX<r&&s.css("left",n.pageX);n.pageY<u&&s.css("top",n.pageY)})});c.mouseup(function(n){var i=s,r=function(){i.remove();t.paint(o)};if(h(i)<f.minimalDistance)r();else{o.options.onRectangleEnd(i,n.pageX,n.pageY);i.mousedown(function(){return!1});i.click(r)}c.unbind("mousemove");t.paint(o)});e&&(o.markers.bind("touchstart",r),o.markers.bind("touchmove",r),o.markers.bind("touchend",r),o.markers.bind("touchcancel",r));t.hide(o);t.resize(o);t.clear(o)};n.fn.htmlfeedback=function(i,r){var e=typeof i,f=n(this),u;if(arguments.length===0||e==="object")t.init(f,i);else if(e==="string"){u=t.instances[f];switch(i.toLowerCase()){case"show":t.show(u);break;case"hide":t.hide(u);break;case"toggle":t.toggle(u);break;case"render":t.render(u,r);break;case"upload":t.upload(u,r);break;case"reset":t.hide(u);t.resize(u);t.clear(u);break;case"color":u.options.color=r}return f}return null}}(jQuery),function(n,t,i){"use strict";function f(n,t,i){var u=n.runtimeStyle&&n.runtimeStyle[t],f,r=n.style;return(!/^-?[0-9]+\.?[0-9]*(?:px)?$/i.test(i)&&/^-?\d/.test(i)&&(f=r.left,u&&(n.runtimeStyle.left=n.currentStyle.left),r.left=t==="fontSize"?"1em":i||0,i=r.pixelLeft+"px",r.left=f,u&&(n.runtimeStyle.left=u)),!/^(thin|medium|thick)$/i.test(i))?Math.round(parseFloat(i))+"px":i}function s(n){return parseInt(n,10)}function h(n,t,u,e){if(n=(n||"").split(","),n=n[e||0]||n[0]||"auto",n=r.Util.trimText(n).split(" "),u!=="backgroundSize"||n[0]&&!n[0].match(/cover|contain|auto/)){if(n[0]=n[0].indexOf("%")===-1?f(t,u+"X",n[0]):n[0],n[1]===i){if(u==="backgroundSize")return n[1]="auto",n;n[1]=n[0]}n[1]=n[1].indexOf("%")===-1?f(t,u+"Y",n[1]):n[1]}return n}function e(n,t,i,u,f,e){var o=r.Util.getCSS(t,n,f),c,s,h,l,a;return o.length===1&&(l=o[0],o=[],o[0]=l,o[1]=l),o[0].toString().indexOf("%")!==-1?(h=parseFloat(o[0])/100,s=i.width*h,n!=="backgroundSize"&&(s-=(e||u).width*h)):n==="backgroundSize"?o[0]==="auto"?s=u.width:/contain|cover/.test(o[0])?(a=r.Util.resizeBounds(u.width,u.height,i.width,i.height,o[0]),s=a.width):s=parseInt(o[0],10):s=parseInt(o[0],10),o[1]==="auto"?c=s/u.width*u.height:o[1].toString().indexOf("%")!==-1?(h=parseFloat(o[1])/100,c=i.height*h,n!=="backgroundSize"&&(c-=(e||u).height*h)):c=parseInt(o[1],10),[s,c]}function c(n,t){var i=[];return{storage:i,width:n,height:t,clip:function(){i.push({type:"function",name:"clip",arguments:arguments})},translate:function(){i.push({type:"function",name:"translate",arguments:arguments})},fill:function(){i.push({type:"function",name:"fill",arguments:arguments})},save:function(){i.push({type:"function",name:"save",arguments:arguments})},restore:function(){i.push({type:"function",name:"restore",arguments:arguments})},fillRect:function(){i.push({type:"function",name:"fillRect",arguments:arguments})},createPattern:function(){i.push({type:"function",name:"createPattern",arguments:arguments})},drawShape:function(){var n=[];return i.push({type:"function",name:"drawShape",arguments:n}),{moveTo:function(){n.push({name:"moveTo",arguments:arguments})},lineTo:function(){n.push({name:"lineTo",arguments:arguments})},arcTo:function(){n.push({name:"arcTo",arguments:arguments})},bezierCurveTo:function(){n.push({name:"bezierCurveTo",arguments:arguments})},quadraticCurveTo:function(){n.push({name:"quadraticCurveTo",arguments:arguments})}}},drawImage:function(){i.push({type:"function",name:"drawImage",arguments:arguments})},fillText:function(){i.push({type:"function",name:"fillText",arguments:arguments})},setVariable:function(n,t){return i.push({type:"variable",name:n,arguments:t}),t}}}function l(n){return{zindex:n,children:[]}}var r={},o,u;r.Util={};r.Util.log=function(t){r.logging&&n.console&&n.console.log&&n.console.log(t)};r.Util.trimText=function(n){return function(t){return n?n.apply(t):((t||"")+"").replace(/^\s+|\s+$/g,"")}}(String.prototype.trim);r.Util.asFloat=function(n){return parseFloat(n)},function(){var n=/((rgba|rgb)\([^\)]+\)(\s-?\d+px){0,})/g,t=/(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g;r.Util.parseTextShadows=function(i){var u,e,f,r;if(!i||i==="none")return[];for(u=i.match(n),e=[],f=0;u&&f<u.length;f++)r=u[f].match(t),e.push({color:r[0],offsetX:r[1]?r[1].replace("px",""):0,offsetY:r[2]?r[2].replace("px",""):0,blur:r[3]?r[3].replace("px",""):0});return e}}();r.Util.parseBackgroundImage=function(n){var i,r,l,a,e,v=[],t,u=0,o=0,f=null,s,h=function(){i&&(r.substr(0,1)==='"'&&(r=r.substr(1,r.length-2)),r&&s.push(r),i.substr(0,1)==="-"&&(a=i.indexOf("-",1)+1)>0&&(l=i.substr(0,a),i=i.substr(a)),v.push({prefix:l,method:i.toLowerCase(),value:e,args:s}));s=[];i=l=r=e=""},c,y;for(h(),c=0,y=n.length;c<y;c++)if(t=n[c],u!==0||!(" \r\n\t".indexOf(t)>-1)){switch(t){case'"':f?f===t&&(f=null):f=t;break;case"(":if(f)break;else if(u===0){u=1;e+=t;continue}else o++;break;case")":if(f)break;else if(u===1)if(o===0){u=0;e+=t;h();continue}else o--;break;case",":if(f)break;else if(u===0){h();continue}else if(u===1&&o===0&&!i.match(/^url$/i)){s.push(r);r="";e+=t;continue}}e+=t;u===0?i+=t:r+=t}return h(),v};r.Util.Bounds=function(n){var t,i={};return n.getBoundingClientRect&&(t=n.getBoundingClientRect(),i.top=t.top,i.bottom=t.bottom||t.top+t.height,i.left=t.left,i.width=n.offsetWidth,i.height=n.offsetHeight),i};r.Util.OffsetBounds=function(n){var t=n.offsetParent?r.Util.OffsetBounds(n.offsetParent):{top:0,left:0};return{top:n.offsetTop+t.top,bottom:n.offsetTop+n.offsetHeight+t.top,left:n.offsetLeft+t.left,width:n.offsetWidth,height:n.offsetHeight}};r.Util.getCSS=function(n,i,r){var e,f;return(o!==n&&(u=t.defaultView.getComputedStyle(n,null)),e=u[i],/^background(Size|Position)$/.test(i))?h(e,n,i,r):/border(Top|Bottom)(Left|Right)Radius/.test(i)?(f=e.split(" "),f.length<=1&&(f[1]=f[0]),f.map(s)):e};r.Util.resizeBounds=function(n,t,i,r,u){var s=i/r,o=n/t,f,e;return u&&u!=="auto"?s<o^u==="contain"?(e=r,f=r*o):(f=i,e=i/o):(f=i,e=r),{width:f,height:e}};r.Util.BackgroundPosition=function(n,t,i,r,u){var f=e("backgroundPosition",n,t,i,r,u);return{left:f[0],top:f[1]}};r.Util.BackgroundSize=function(n,t,i,r){var u=e("backgroundSize",n,t,i,r);return{width:u[0],height:u[1]}};r.Util.Extend=function(n,t){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return t};r.Util.Children=function(n){var t;try{t=n.nodeName&&n.nodeName.toUpperCase()==="IFRAME"?n.contentDocument||n.contentWindow.document:function(n){var t=[];return n!==null&&function(n,t){var u=n.length,r=0,f;if(typeof t.length=="number")for(f=t.length;r<f;r++)n[u++]=t[r];else while(t[r]!==i)n[u++]=t[r++];return n.length=u,n}(t,n),t}(n.childNodes)}catch(u){r.Util.log("html2canvas.Util.Children failed with exception: "+u.message);t=[]}return t};r.Util.isTransparent=function(n){return n==="transparent"||n==="rgba(0, 0, 0, 0)"};r.Util.Font=function(){var n={};return function(t,r,u){var c,l,s;if(n[t+"-"+r]!==i)return n[t+"-"+r];var f=u.createElement("div"),e=u.createElement("img"),o=u.createElement("span"),h="Hidden Text";return f.style.visibility="hidden",f.style.fontFamily=t,f.style.fontSize=r,f.style.margin=0,f.style.padding=0,u.body.appendChild(f),e.src="data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=",e.width=1,e.height=1,e.style.margin=0,e.style.padding=0,e.style.verticalAlign="baseline",o.style.fontFamily=t,o.style.fontSize=r,o.style.margin=0,o.style.padding=0,o.appendChild(u.createTextNode(h)),f.appendChild(o),f.appendChild(e),c=e.offsetTop-o.offsetTop+1,f.removeChild(o),f.appendChild(u.createTextNode(h)),f.style.lineHeight="normal",e.style.verticalAlign="super",l=e.offsetTop-f.offsetTop+1,s={baseline:c,lineWidth:1,middle:l},n[t+"-"+r]=s,u.body.removeChild(f),s}}(),function(){function u(n){return function(t){try{n.addColorStop(t.stop,t.color)}catch(i){f.log(["failed to add color stop: ",i,"; tried to add: ",t])}}}var f=r.Util,n={},i;r.Generate=n;i=[/^(-webkit-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-o-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-webkit-gradient)\((linear|radial),\s((?:\d{1,3}%?)\s(?:\d{1,3}%?),\s(?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)\-]+)\)$/,/^(-moz-linear-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)]+)\)$/,/^(-webkit-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-moz-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s?([a-z\-]*)([\w\d\.\s,%\(\)]+)\)$/,/^(-o-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/];n.parseGradient=function(n,t){for(var r,p=i.length,o,h,u,s,c,e,l,a,v,y,f=0;f<p;f+=1)if(o=n.match(i[f]),o)break;if(o)switch(o[1]){case"-webkit-linear-gradient":case"-o-linear-gradient":if(r={type:"linear",x0:null,y0:null,x1:null,y1:null,colorStops:[]},u=o[2].match(/\w+/g),u)for(s=u.length,f=0;f<s;f+=1)switch(u[f]){case"top":r.y0=0;r.y1=t.height;break;case"right":r.x0=t.width;r.x1=0;break;case"bottom":r.y0=t.height;r.y1=0;break;case"left":r.x0=0;r.x1=t.width}if(r.x0===null&&r.x1===null&&(r.x0=r.x1=t.width/2),r.y0===null&&r.y1===null&&(r.y0=r.y1=t.height/2),u=o[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g),u)for(s=u.length,c=1/Math.max(s-1,1),f=0;f<s;f+=1)e=u[f].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/),h=e[2]?parseFloat(e[2])/(e[3]==="%"?100:t.width):f*c,r.colorStops.push({color:e[1],stop:h});break;case"-webkit-gradient":if(r={type:o[2]==="radial"?"circle":o[2],x0:0,y0:0,x1:0,y1:0,colorStops:[]},u=o[3].match(/(\d{1,3})%?\s(\d{1,3})%?,\s(\d{1,3})%?\s(\d{1,3})%?/),u&&(r.x0=u[1]*t.width/100,r.y0=u[2]*t.height/100,r.x1=u[3]*t.width/100,r.y1=u[4]*t.height/100),u=o[4].match(/((?:from|to|color-stop)\((?:[0-9\.]+,\s)?(?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)\))+/g),u)for(s=u.length,f=0;f<s;f+=1)e=u[f].match(/(from|to|color-stop)\(([0-9\.]+)?(?:,\s)?((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\)/),h=parseFloat(e[2]),e[1]==="from"&&(h=0),e[1]==="to"&&(h=1),r.colorStops.push({color:e[3],stop:h});break;case"-moz-linear-gradient":if(r={type:"linear",x0:0,y0:0,x1:0,y1:0,colorStops:[]},u=o[2].match(/(\d{1,3})%?\s(\d{1,3})%?/),u&&(r.x0=u[1]*t.width/100,r.y0=u[2]*t.height/100,r.x1=t.width-r.x0,r.y1=t.height-r.y0),u=o[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}%)?)+/g),u)for(s=u.length,c=1/Math.max(s-1,1),f=0;f<s;f+=1)e=u[f].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%)?/),e[2]?(h=parseFloat(e[2]),e[3]&&(h/=100)):h=f*c,r.colorStops.push({color:e[1],stop:h});break;case"-webkit-radial-gradient":case"-moz-radial-gradient":case"-o-radial-gradient":if(r={type:"circle",x0:0,y0:0,x1:t.width,y1:t.height,cx:0,cy:0,rx:0,ry:0,colorStops:[]},u=o[2].match(/(\d{1,3})%?\s(\d{1,3})%?/),u&&(r.cx=u[1]*t.width/100,r.cy=u[2]*t.height/100),u=o[3].match(/\w+/),e=o[4].match(/[a-z\-]*/),u&&e)switch(e[0]){case"farthest-corner":case"cover":case"":l=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.cy,2));a=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.y1-r.cy,2));v=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.y1-r.cy,2));y=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.cy,2));r.rx=r.ry=Math.max(l,a,v,y);break;case"closest-corner":l=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.cy,2));a=Math.sqrt(Math.pow(r.cx,2)+Math.pow(r.y1-r.cy,2));v=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.y1-r.cy,2));y=Math.sqrt(Math.pow(r.x1-r.cx,2)+Math.pow(r.cy,2));r.rx=r.ry=Math.min(l,a,v,y);break;case"farthest-side":u[0]==="circle"?r.rx=r.ry=Math.max(r.cx,r.cy,r.x1-r.cx,r.y1-r.cy):(r.type=u[0],r.rx=Math.max(r.cx,r.x1-r.cx),r.ry=Math.max(r.cy,r.y1-r.cy));break;case"closest-side":case"contain":u[0]==="circle"?r.rx=r.ry=Math.min(r.cx,r.cy,r.x1-r.cx,r.y1-r.cy):(r.type=u[0],r.rx=Math.min(r.cx,r.x1-r.cx),r.ry=Math.min(r.cy,r.y1-r.cy))}if(u=o[5].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g),u)for(s=u.length,c=1/Math.max(s-1,1),f=0;f<s;f+=1)e=u[f].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/),h=e[2]?parseFloat(e[2])/(e[3]==="%"?100:t.width):f*c,r.colorStops.push({color:e[1],stop:h})}return r};n.Gradient=function(n,i){var s,e,f,o;if(i.width===0||i.height===0)return null;if(s=t.createElement("canvas"),e=s.getContext("2d"),s.width=i.width,s.height=i.height,f=r.Generate.parseGradient(n,i),f)switch(f.type){case"linear":o=e.createLinearGradient(f.x0,f.y0,f.x1,f.y1);f.colorStops.forEach(u(o));e.fillStyle=o;e.fillRect(0,0,i.width,i.height);break;case"circle":o=e.createRadialGradient(f.cx,f.cy,0,f.cx,f.cy,f.rx);f.colorStops.forEach(u(o));e.fillStyle=o;e.fillRect(0,0,i.width,i.height);break;case"ellipse":var h=t.createElement("canvas"),c=h.getContext("2d"),a=Math.max(f.rx,f.ry),l=a*2;h.width=h.height=l;o=c.createRadialGradient(f.rx,f.ry,0,f.rx,f.ry,a);f.colorStops.forEach(u(o));c.fillStyle=o;c.fillRect(0,0,l,l);e.fillStyle=f.colorStops[f.colorStops.length-1].color;e.fillRect(0,0,s.width,s.height);e.drawImage(h,f.cx-f.rx,f.cy-f.ry,2*f.rx,2*f.ry)}return s};n.ListAlpha=function(n){var t="",i;do i=n%26,t=String.fromCharCode(i+64)+t,n=n/26;while(n*26>26);return t};n.ListRoman=function(n){var i=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"],r=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],u="",t,f=i.length;if(n<=0||n>=4e3)return n;for(t=0;t<f;t+=1)while(n>=r[t])n-=r[t],u+=i[t];return u}}();r.Parse=function(u,f){function dt(){return Math.max(Math.max(s.body.scrollWidth,s.documentElement.scrollWidth),Math.max(s.body.offsetWidth,s.documentElement.offsetWidth),Math.max(s.body.clientWidth,s.documentElement.clientWidth))}function gt(){return Math.max(Math.max(s.body.scrollHeight,s.documentElement.scrollHeight),Math.max(s.body.offsetHeight,s.documentElement.offsetHeight),Math.max(s.body.clientHeight,s.documentElement.clientHeight))}function p(n,t){var i=parseInt(e(n,t),10);return isNaN(i)?0:i}function d(n,t,i,r,u,f){f!=="transparent"&&(n.setVariable("fillStyle",f),n.fillRect(t,i,r,u),b+=1)}function ni(n,t,i){return n.length>0?t+i.toUpperCase():""}function ti(n,t){switch(t){case"lowercase":return n.toLowerCase();case"capitalize":return n.replace(/(^|\s|:|-|\(|\))([a-z])/g,ni);case"uppercase":return n.toUpperCase();default:return n}}function ii(n){return/^(normal|none|0px)$/.test(n)}function et(n,t,i,r){n!==null&&o.trimText(n).length>0&&(r.fillText(n,t,i),b+=1)}function ot(n,t,i,r){var f=e(t,"fontWeight"),h=e(t,"fontFamily"),c=e(t,"fontSize"),u=o.parseTextShadows(e(t,"textShadow"));switch(parseInt(f,10)){case 401:f="bold";break;case 400:f="normal"}return(n.setVariable("fillStyle",r),n.setVariable("font",[e(t,"fontStyle"),e(t,"fontVariant"),f,c,h].join(" ")),n.setVariable("textAlign","left"),u.length&&(n.setVariable("shadowColor",u[0].color),n.setVariable("shadowOffsetX",u[0].offsetX),n.setVariable("shadowOffsetY",u[0].offsetY),n.setVariable("shadowBlur",u[0].blur)),i!=="none")?o.Font(h,c,s):null}function ri(n,t,i,r,u){switch(t){case"underline":d(n,i.left,Math.round(i.top+r.baseline+r.lineWidth),i.width,1,u);break;case"overline":d(n,i.left,Math.round(i.top),i.width,1,u);break;case"line-through":d(n,i.left,Math.ceil(i.top+r.middle+r.lineWidth),i.width,1,u)}}function ui(n,t,i){var r=s.createRange();return r.setStart(t,i),r.setEnd(t,i+n.length),r.getBoundingClientRect()}function fi(n,t){var r=n.parentNode,i=s.createElement("wrapper"),f=n.cloneNode(!0),u;return i.appendChild(n.cloneNode(!0)),r.replaceChild(i,n),u=t?o.OffsetBounds(i):o.Bounds(i),r.replaceChild(f,i),u}function ei(n,t,i,r,u){var f=null,e;return kt.rangeBounds&&!u?((i!=="none"||o.trimText(t).length!==0)&&(f=ui(t,n.node,n.textOffset)),n.textOffset+=t.length):n.node&&typeof n.node.nodeValue=="string"&&(e=r?n.node.splitText(t.length):null,f=fi(n.node,u),n.node=e),f}function st(n,t,i){var u=i.ctx,c=e(n,"color"),s=e(n,"textDecoration"),h=e(n,"textAlign"),l,r,a={node:t,textOffset:0};o.trimText(t.nodeValue).length>0&&(t.nodeValue=ti(t.nodeValue,e(n,"textTransform")),h=h.replace(["-webkit-auto"],["auto"]),r=!f.letterRendering&&/^(left|right|justify|auto)$/.test(h)&&ii(e(n,"letterSpacing"))?t.nodeValue.split(/(\b| )/):t.nodeValue.split(""),l=ot(u,n,s,c),f.chinese&&r.forEach(function(n,t){/.*[\u4E00-\u9FA5].*$/.test(n)&&(n=n.split(""),n.unshift(t,1),r.splice.apply(r,n))}),r.forEach(function(n,t){var f=ei(a,n,s,t<r.length-1,i.transform.matrix);f&&(et(n,f.left,f.bottom,u),ri(u,s,f,l,c))}))}function oi(n,t){var i=s.createElement("boundelement"),r,u;return i.style.display="inline",r=n.style.listStyleType,n.style.listStyleType="none",i.appendChild(s.createTextNode(t)),n.insertBefore(i,n.firstChild),u=o.Bounds(i),n.removeChild(i),n.style.listStyleType=r,u}function si(n){var t=-1,i=1,r=n.parentNode.childNodes;if(n.parentNode){while(r[++t]!==n)r[t].nodeType===1&&i++;return i}return-1}function hi(n,t){var i=si(n),u="";switch(t){case"decimal":u=i;break;case"decimal-leading-zero":u=i.toString().length===1?"0"+i.toString():i.toString();break;case"upper-roman":u=r.Generate.ListRoman(i);break;case"lower-roman":u=r.Generate.ListRoman(i).toLowerCase();break;case"lower-alpha":u=r.Generate.ListAlpha(i).toLowerCase();break;case"upper-alpha":u=r.Generate.ListAlpha(i)}return u+". "}function ci(n,t,i){var f,r=t.ctx,o=e(n,"listStyleType"),s,u;if(/^(decimal|decimal-leading-zero|upper-alpha|upper-latin|upper-roman|lower-alpha|lower-greek|lower-latin|lower-roman)$/i.test(o)){if(u=hi(n,o),s=oi(n,u),ot(r,n,"none",e(n,"color")),e(n,"listStylePosition")==="inside")r.setVariable("textAlign","left"),f=i.left;else return;et(u,f,s.bottom,r)}}function ht(n){var t=u[n];return t&&t.succeeded===!0?t.img:!1}function ct(n,t){var i=Math.max(n.left,t.left),r=Math.max(n.top,t.top),u=Math.min(n.left+n.width,t.left+t.width),f=Math.min(n.top+n.height,t.top+t.height);return{left:i,top:r,width:u-i,height:f-r}}function li(n,t,i){var r,u=t.cssPosition!=="static",f=u?e(n,"zIndex"):"auto",o=e(n,"opacity"),s=e(n,"cssFloat")!=="none";t.zIndex=r=l(f);r.isPositioned=u;r.isFloated=s;r.opacity=o;r.ownStacking=f!=="auto"||o<1;i&&i.zIndex.children.push(t)}function lt(n){n.drawImage.apply(n,Array.prototype.slice.call(arguments,1));b+=1}function at(n,t,i,r,u){var f=p(t,"paddingLeft"),e=p(t,"paddingTop"),o=p(t,"paddingRight"),s=p(t,"paddingBottom");lt(n,i,0,0,i.width,i.height,r.left+f+u[3].width,r.top+e+u[0].width,r.width-(u[1].width+u[3].width+f+o),r.height-(u[0].width+u[2].width+e+s))}function ai(n){return["Top","Right","Bottom","Left"].map(function(t){return{width:p(n,"border"+t+"Width"),color:e(n,"border"+t+"Color")}})}function vi(n){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(t){return e(n,"border"+t+"Radius")})}function y(n,t,i,r){var u=function(n,t,i){return{x:n.x+(t.x-n.x)*i,y:n.y+(t.y-n.y)*i}};return{start:n,startControl:t,endControl:i,end:r,subdivide:function(f){var e=u(n,t,f),o=u(t,i,f),s=u(i,r,f),h=u(e,o,f),c=u(o,s,f),l=u(h,c,f);return[y(n,e,h,l),y(l,c,s,r)]},curveTo:function(n){n.push(["bezierCurve",t.x,t.y,i.x,i.y,r.x,r.y])},curveToReversed:function(r){r.push(["bezierCurve",i.x,i.y,t.x,t.y,n.x,n.y])}}}function v(n,t,i,r,u,f,e){t[0]>0||t[1]>0?(n.push(["line",r[0].start.x,r[0].start.y]),r[0].curveTo(n),r[1].curveTo(n)):n.push(["line",f,e]);(i[0]>0||i[1]>0)&&n.push(["line",u[0].start.x,u[0].start.y])}function g(n,t,i,r,u,f,e){var o=[];return t[0]>0||t[1]>0?(o.push(["line",r[1].start.x,r[1].start.y]),r[1].curveTo(o)):o.push(["line",n.c1[0],n.c1[1]]),i[0]>0||i[1]>0?(o.push(["line",f[0].start.x,f[0].start.y]),f[0].curveTo(o),o.push(["line",e[0].end.x,e[0].end.y]),e[0].curveToReversed(o)):(o.push(["line",n.c2[0],n.c2[1]]),o.push(["line",n.c3[0],n.c3[1]])),t[0]>0||t[1]>0?(o.push(["line",u[1].end.x,u[1].end.y]),u[1].curveToReversed(o)):o.push(["line",n.c4[0],n.c4[1]]),o}function yi(n,t,i){var r=n.left,u=n.top,f=n.width,e=n.height,v=t[0][0],y=t[0][1],o=t[1][0],p=t[1][1],s=t[2][0],c=t[2][1],w=t[3][0],l=t[3][1],a=f-o,b=e-c,k=f-s,d=e-l;return{topLeftOuter:h(r,u,v,y).topLeft.subdivide(.5),topLeftInner:h(r+i[3].width,u+i[0].width,Math.max(0,v-i[3].width),Math.max(0,y-i[0].width)).topLeft.subdivide(.5),topRightOuter:h(r+a,u,o,p).topRight.subdivide(.5),topRightInner:h(r+Math.min(a,f+i[3].width),u+i[0].width,a>f+i[3].width?0:o-i[3].width,p-i[0].width).topRight.subdivide(.5),bottomRightOuter:h(r+k,u+b,s,c).bottomRight.subdivide(.5),bottomRightInner:h(r+Math.min(k,f+i[3].width),u+Math.min(b,e+i[0].width),Math.max(0,s-i[1].width),Math.max(0,c-i[2].width)).bottomRight.subdivide(.5),bottomLeftOuter:h(r,u+d,w,l).bottomLeft.subdivide(.5),bottomLeftInner:h(r+i[3].width,u+d,Math.max(0,w-i[3].width),Math.max(0,l-i[2].width)).bottomLeft.subdivide(.5)}}function pi(n,t,i,r,u){var o=e(n,"backgroundClip"),f=[];switch(o){case"content-box":case"padding-box":v(f,r[0],r[1],t.topLeftInner,t.topRightInner,u.left+i[3].width,u.top+i[0].width);v(f,r[1],r[2],t.topRightInner,t.bottomRightInner,u.left+u.width-i[1].width,u.top+i[0].width);v(f,r[2],r[3],t.bottomRightInner,t.bottomLeftInner,u.left+u.width-i[1].width,u.top+u.height-i[2].width);v(f,r[3],r[0],t.bottomLeftInner,t.topLeftInner,u.left+i[3].width,u.top+u.height-i[2].width);break;default:v(f,r[0],r[1],t.topLeftOuter,t.topRightOuter,u.left,u.top);v(f,r[1],r[2],t.topRightOuter,t.bottomRightOuter,u.left+u.width,u.top);v(f,r[2],r[3],t.bottomRightOuter,t.bottomLeftOuter,u.left+u.width,u.top+u.height);v(f,r[3],r[0],t.bottomLeftOuter,t.topLeftOuter,u.left,u.top+u.height)}return f}function wi(n,t,i){for(var l=t.left,p=t.top,a=t.width,v=t.height,u,r,e,o,c,s=vi(n),f=yi(t,s,i),y={clip:pi(n,f,i,s,t),borders:[]},h=0;h<4;h++)if(i[h].width>0){u=l;r=p;e=a;o=v-i[2].width;switch(h){case 0:o=i[0].width;c=g({c1:[u,r],c2:[u+e,r],c3:[u+e-i[1].width,r+o],c4:[u+i[3].width,r+o]},s[0],s[1],f.topLeftOuter,f.topLeftInner,f.topRightOuter,f.topRightInner);break;case 1:u=l+a-i[1].width;e=i[1].width;c=g({c1:[u+e,r],c2:[u+e,r+o+i[2].width],c3:[u,r+o],c4:[u,r+i[0].width]},s[1],s[2],f.topRightOuter,f.topRightInner,f.bottomRightOuter,f.bottomRightInner);break;case 2:r=r+v-i[2].width;o=i[2].width;c=g({c1:[u+e,r+o],c2:[u,r+o],c3:[u+i[3].width,r],c4:[u+e-i[3].width,r]},s[2],s[3],f.bottomRightOuter,f.bottomRightInner,f.bottomLeftOuter,f.bottomLeftInner);break;case 3:e=i[3].width;c=g({c1:[u,r+o+i[2].width],c2:[u,r],c3:[u+e,r+i[0].width],c4:[u+e,r+o]},s[3],s[0],f.bottomLeftOuter,f.bottomLeftInner,f.topLeftOuter,f.topLeftInner)}y.borders.push({args:c,color:i[h].color})}return y}function tt(n,t){var i=n.drawShape();return t.forEach(function(n,t){i[t===0?"moveTo":n[0]+"To"].apply(null,n.slice(1))}),i}function bi(n,t,i){i!=="transparent"&&(n.setVariable("fillStyle",i),tt(n,t),n.fill(),b+=1)}function it(n,t,i){var r=s.createElement("valuewrap"),u,f;["lineHeight","textAlign","fontFamily","color","fontSize","paddingLeft","paddingTop","width","height","border","borderLeftWidth","borderTopWidth"].forEach(function(t){try{r.style[t]=e(n,t)}catch(i){o.log("html2canvas: Parse: Exception caught in renderFormValue: "+i.message)}});r.style.borderColor="black";r.style.borderStyle="solid";r.style.display="block";r.style.position="absolute";(/^(submit|reset|button|text|password)$/.test(n.type)||n.nodeName==="SELECT")&&(r.style.lineHeight=e(n,"height"));r.style.top=t.top+"px";r.style.left=t.left+"px";u=n.nodeName==="SELECT"?(n.options[n.selectedIndex]||0).text:n.value;u||(u=n.placeholder);f=s.createTextNode(u);r.appendChild(f);k.appendChild(r);st(n,f,i);k.removeChild(r)}function ki(t){return isNaN(n.parseInt(t,10))}function vt(i,r){var f=n.getComputedStyle(i,r),u,s,h,e;return!f||!f.content||f.content==="none"||f.content==="-moz-alt-content"||f.display==="none"?null:(u=f.content+"",s=u.substr(0,1),s===u.substr(u.length-1)&&s.match(/'|"/)&&(u=u.substr(1,u.length-2)),h=u.substr(0,3)==="url",e=t.createElement(h?"img":"span"),e.className=a+"-before "+a+"-after",Object.keys(f).filter(ki).forEach(function(n){try{e.style[n]=f[n]}catch(t){o.log(["Tried to assign readonly property ",n,"Error:",t])}}),h?e.src=o.parseBackgroundImage(u)[0].args[0]:e.innerHTML=u,e)}function di(n){return e(n,"display")!=="none"&&e(n,"visibility")!=="hidden"&&!n.hasAttribute("data-html2canvas-ignore")}function gi(n){return n.replace("px","")}function nr(n){var i=e(n,"transform")||e(n,"-webkit-transform")||e(n,"-moz-transform")||e(n,"-ms-transform")||e(n,"-o-transform"),r=e(n,"transform-origin")||e(n,"-webkit-transform-origin")||e(n,"-moz-transform-origin")||e(n,"-ms-transform-origin")||e(n,"-o-transform-origin")||"0px 0px",u,t;if(r=r.split(" ").map(gi).map(o.asFloat),u=null,i&&i!=="none"&&(t=i.match(wt),t))switch(t[1]){case"matrix":u=t[2].split(",").map(o.trimText).map(o.asFloat)}return{origin:r,matrix:u}}function tr(n,t){var i=t.matrix?o.OffsetBounds(n):o.Bounds(n);return t.origin[0]+=i.left,t.origin[1]+=i.top,i}function ir(n,t,i){return n.setVariable("globalAlpha",e(t,"opacity")*(i?i.opacity:1))}function rr(n,t,i,r){var s=c(t?i.width:dt(),t?i.height:gt()),u={ctx:s,opacity:ir(s,n,t),cssPosition:e(n,"position"),borders:ai(n),transform:r,clip:t&&t.clip?o.Extend({},t.clip):null};return li(n,u,t),f.useOverflow===!0&&/(hidden|scroll|auto)/.test(e(n,"overflow"))===!0&&/(BODY)/i.test(n.nodeName)===!1&&(u.clip=u.clip?ct(u.clip,i):i),u}function ur(n,t,i){var r={left:t.left+n[3].width,top:t.top+n[0].width,width:t.width-(n[1].width+n[3].width),height:t.height-(n[0].width+n[2].width)};return i&&(r=ct(r,i)),r}function fr(n,t,i){d(n,t.left,t.top,t.width,t.height,i)}function er(n,t){var i,r;return n.width===t.width&&n.height===t.height?n:(i=s.createElement("canvas"),i.width=t.width,i.height=t.height,r=i.getContext("2d"),lt(r,n,0,0,n.width,n.height,0,0,t.width,t.height),i)}function yt(n,t,i,r){var u=Math.round(r.left+i.left),f=Math.round(r.top+i.top);n.createPattern(t);n.translate(u,f);n.fill();n.translate(-u,-f)}function rt(n,t,i,r,u,f,e,o){var s=[];s.push(["line",Math.round(u),Math.round(f)]);s.push(["line",Math.round(u+e),Math.round(f)]);s.push(["line",Math.round(u+e),Math.round(o+f)]);s.push(["line",Math.round(u),Math.round(o+f)]);tt(n,s);n.save();n.clip();yt(n,t,i,r);n.restore()}function or(n,t,i,r,u){var h=o.BackgroundSize(n,t,r,u),f=o.BackgroundPosition(n,t,r,u,h),s=e(n,"backgroundRepeat").split(",").map(o.trimText);r=er(r,h);s=s[u]||s[0];switch(s){case"repeat-x":rt(i,r,f,t,t.left,t.top+f.top,99999,r.height);break;case"repeat-y":rt(i,r,f,t,t.left+f.left,t.top,r.width,99999);break;case"no-repeat":rt(i,r,f,t,t.left+f.left,t.top+f.top,r.width,r.height);break;default:yt(i,r,f,{top:t.top,left:t.left,width:r.width,height:r.height})}}function sr(n,t,i){for(var r=e(n,"backgroundImage"),s=o.parseBackgroundImage(r),u,f=s.length,h;f--;)(r=s[f],r.args&&r.args.length!==0)&&(h=r.method==="url"?r.args[0]:r.value,u=ht(h),u?or(n,t,i,u,f):o.log("html2canvas: Error loading background:",r))}function ut(n,t,i){di(n)&&(t=pt(n,t,i,!1)||t,ft.test(n.nodeName)||bt(n,t,i))}function hr(n,t){var i=vt(n,":before"),r=vt(n,":after");(i||r)&&(i&&(n.className+=" "+a+"-before",n.parentNode.insertBefore(i,n),ut(i,t,!0),n.parentNode.removeChild(i),n.className=n.className.replace(a+"-before","").trim()),r&&(n.className+=" "+a+"-after",n.appendChild(r),ut(r,t,!0),n.removeChild(r),n.className=n.className.replace(a+"-after","").trim()))}function pt(n,t,i,r){var l=nr(n,t),f=tr(n,l),a,u=rr(n,t,f,l),h=u.borders,s=u.ctx,c=ur(h,f,u.clip),v=wi(n,f,h),y=ft.test(n.nodeName)?"#efefef":e(n,"backgroundColor");tt(s,v.clip);s.save();s.clip();c.height>0&&c.width>0&&!r?(fr(s,f,y),sr(n,c,s)):r&&(u.backgroundColor=y);s.restore();v.borders.forEach(function(n){bi(s,n.args,n.color)});i||hr(n,u);switch(n.nodeName){case"IMG":(a=ht(n.getAttribute("src")))?at(s,n,a,f,h):o.log("html2canvas: Error loading <img>:"+n.getAttribute("src"));break;case"INPUT":/^(text|url|email|submit|button|reset)$/.test(n.type)&&(n.value||n.placeholder||"").length>0&&it(n,f,u);break;case"TEXTAREA":(n.value||n.placeholder||"").length>0&&it(n,f,u);break;case"SELECT":(n.options||n.placeholder||"").length>0&&it(n,f,u);break;case"LI":ci(n,u,c);break;case"CANVAS":at(s,n,n,f,h)}return u}function bt(n,t,i){o.Children(n).forEach(function(r){r.nodeType===r.ELEMENT_NODE?ut(r,t,i):r.nodeType===r.TEXT_NODE&&st(n,r,t)})}function cr(){var n=e(t.documentElement,"backgroundColor"),r=o.isTransparent(n)&&w===t.body,i=pt(w,null,!1,r);return bt(w,i),r&&(n=i.backgroundColor),k.removeChild(nt),{backgroundColor:n,stack:i}}var h,wt;n.scroll(0,0);var w=f.elements===i?t.body:f.elements[0],b=0,s=w.ownerDocument,o=r.Util,kt=o.Support(f,s),ft=new RegExp("("+f.ignoreElements+")"),k=s.body,e=o.getCSS,a="___html2canvas___pseudoelement",nt=s.createElement("style");return nt.innerHTML="."+a+'-before:before { content: "" !important; display: none !important; }.'+a+'-after:after { content: "" !important; display: none !important; }',k.appendChild(nt),u=u||{},h=function(n){return function(t,i,r,u){var o=r*n,s=u*n,f=t+r,e=i+u;return{topLeft:y({x:t,y:e},{x:t,y:e-s},{x:f-o,y:i},{x:f,y:i}),topRight:y({x:t,y:i},{x:t+o,y:i},{x:f,y:e-s},{x:f,y:e}),bottomRight:y({x:f,y:i},{x:f,y:i+s},{x:t+o,y:e},{x:t,y:e}),bottomLeft:y({x:f,y:e},{x:f-o,y:e},{x:t,y:i+s},{x:t,y:i})}}}(4*((Math.sqrt(2)-1)/3)),wt=/(matrix)\((.+)\)/,cr()};r.Preload=function(u){function rt(n){o.href=n;o.href=o.href;var t=o.protocol+o.host;return t===b}function s(){e.log("html2canvas: start: images: "+f.numLoaded+" / "+f.numTotal+" (failed: "+f.numFailed+")");!f.firstRun&&f.numLoaded>=f.numTotal&&(e.log("Finished loading images: # "+f.numTotal+" (failed: "+f.numFailed+")"),typeof u.complete=="function"&&u.complete(f))}function l(t,r){t.onload=function(){r.timer!==i&&n.clearTimeout(r.timer);f.numLoaded++;r.succeeded=!0;t.onerror=t.onload=null;s()};t.onerror=function(){if(t.crossOrigin==="anonymous"&&(n.clearTimeout(r.timer),u.proxy)){var i=t.src;t=new Image;r.img=t;t.src=i;k(t.src,t,r);return}f.numLoaded++;f.numFailed++;r.succeeded=!1;t.onerror=t.onload=null;s()}}function k(t,r,e){var a=u.proxy,c,h;o.href=t;t=o.href;c="html2canvas_"+nt++;e.callbackname=c;a+=a.indexOf("?")>-1?"&":"?";a+="url="+encodeURIComponent(t)+"&callback="+c;h=p.createElement("script");n[c]=function(t){t.substring(0,6)==="error:"?(e.succeeded=!1,f.numLoaded++,f.numFailed++,s()):(l(r,e),r.src=t);n[c]=i;try{delete n[c]}catch(u){}h.parentNode.removeChild(h);h=null;delete e.script;delete e.callbackname};h.setAttribute("type","text/javascript");h.setAttribute("src",a);e.script=h;n.document.body.appendChild(h)}function ut(n){return n&&n.method&&n.args&&n.args.length>0}function ft(n,t){var u=r.Generate.Gradient(n,t);u!==i&&(f[n]={img:u,succeeded:!0},f.numTotal++,f.numLoaded++,s())}function y(n,t){var u;r.Util.parseBackgroundImage(n).filter(ut).forEach(function(n){n.method==="url"?h.loadImage(n.args[0]):n.method.match(/\-?gradient$/)&&(u===i&&(u=r.Util.Bounds(t)),ft(n.value,u))})}function d(t,i){var u=n.getComputedStyle(t,i),f=u.content;f.substr(0,3)==="url"&&h.loadImage(r.Util.parseBackgroundImage(f)[0].args[0]);y(u.backgroundImage,t)}function et(n){d(n,":before");d(n,":after")}function g(n){var t,r;try{e.Children(n).forEach(g)}catch(r){}try{t=n.nodeType}catch(u){t=!1;e.log("html2canvas: failed to access some element's nodeType - Exception: "+u.message)}if(t===1||t===i){et(n);try{y(e.getCSS(n,"backgroundImage"),n)}catch(r){e.log("html2canvas: failed to get background-image - Exception: "+r.message)}y(n)}}var f={numLoaded:0,numFailed:0,numTotal:0,cleanupDone:!1},e=r.Util,c,nt=0,a=u.elements[0]||t.body,p=a.ownerDocument,w=a.getElementsByTagName("img"),tt=w.length,o=p.createElement("a"),it=function(n){return n.crossOrigin!==i}(new Image),v,b,h;for(o.href=n.location.href,b=o.protocol+o.host,h={loadImage:function(n){var t,r;n&&f[n]===i&&(t=new Image,n.match(/data:image\/.*;base64,/i)?(t.src=n.replace(/url\(['"]{0,}|['"]{0,}\)$/ig,""),r=f[n]={img:t},f.numTotal++,l(t,r)):rt(n)||u.allowTaint===!0?(r=f[n]={img:t},f.numTotal++,l(t,r),t.src=n):it&&!u.allowTaint&&u.useCORS?(t.crossOrigin="anonymous",r=f[n]={img:t},f.numTotal++,l(t,r),t.src=n):u.proxy&&(r=f[n]={img:t},f.numTotal++,k(n,t,r)))},cleanupDOM:function(r){var o,h;if(!f.cleanupDone){r&&typeof r=="string"?e.log("html2canvas: Cleanup because: "+r):e.log("html2canvas: Cleanup after timeout: "+u.timeout+" ms.");for(h in f)if(f.hasOwnProperty(h)&&(o=f[h],o&&typeof o=="object"&&o.callbackname&&o.succeeded===i)){n[o.callbackname]=i;try{delete n[o.callbackname]}catch(c){}o.script&&o.script.parentNode&&(o.script.setAttribute("src","about:blank"),o.script.parentNode.removeChild(o.script));f.numLoaded++;f.numFailed++;e.log("html2canvas: Cleaned up failed img: '"+h+"' Steps: "+f.numLoaded+" / "+f.numTotal)}n.stop!==i?n.stop():t.execCommand!==i&&t.execCommand("Stop",!1);t.close!==i&&t.close();f.cleanupDone=!0;r&&typeof r=="string"||s()}},renderingDone:function(){v&&n.clearTimeout(v)}},u.timeout>0&&(v=n.setTimeout(h.cleanupDOM,u.timeout)),e.log("html2canvas: Preload starts: finding background-images"),f.firstRun=!0,g(a),e.log("html2canvas: Preload: Finding images"),c=0;c<tt;c+=1)h.loadImage(w[c].getAttribute("src"));return f.firstRun=!1,e.log("html2canvas: Preload: Done."),f.numTotal===f.numLoaded&&s(),h};r.Renderer=function(n,u){function f(n){function r(n){Object.keys(n).sort().forEach(function(i){var u=[],f=[],e=[],o=[];n[i].forEach(function(n){n.node.zIndex.isPositioned||n.node.zIndex.opacity<1?e.push(n):n.node.zIndex.isFloated?f.push(n):u.push(n)}),function s(n){n.forEach(function(n){o.push(n);n.children&&s(n.children)})}(u.concat(f,e));o.forEach(function(n){n.context?r(n.context):t.push(n.node)})})}var t=[],u=function(n){function r(n,t,u){var f=t.zIndex.zindex==="auto"?0:Number(t.zIndex.zindex),s=n,h=t.zIndex.isPositioned,c=t.zIndex.isFloated,e={node:t},o=u;t.zIndex.ownStacking?(s=e.context={"!":[{node:t,children:[]}]},o=i):(h||c)&&(o=e.children=[]);f===0&&u?u.push(e):(n[f]||(n[f]=[]),n[f].push(e));t.zIndex.children.forEach(function(n){r(s,n,o)})}var t={};return r(t,n),t}(n);return r(u),t}function e(n){var t;if(typeof u.renderer=="string"&&r.Renderer[n]!==i)t=r.Renderer[n](u);else if(typeof n=="function")t=n(u);else throw new Error("Unknown renderer");if(typeof t!="function")throw new Error("Invalid renderer defined");return t}return e(u.renderer)(n,u,t,f(n.stack),r)};r.Util.Support=function(n,t){function u(){var u=new Image,n=t.createElement("canvas"),f=n.getContext===i?!1:n.getContext("2d");if(f===!1)return!1;n.width=n.height=10;u.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10'><foreignObject width='10' height='10'><div xmlns='http://www.w3.org/1999/xhtml' style='width:10;height:10;'>sup<\/div><\/foreignObject><\/svg>";try{f.drawImage(u,0,0);n.toDataURL()}catch(e){return!1}return r.Util.log("html2canvas: Parse: SVG powered rendering available"),!0}function f(){var i,n,r,u,f=!1;return t.createRange&&(i=t.createRange(),i.getBoundingClientRect&&(n=t.createElement("boundtest"),n.style.height="123px",n.style.display="block",t.body.appendChild(n),i.selectNode(n),r=i.getBoundingClientRect(),u=r.height,u===123&&(f=!0),t.body.removeChild(n))),f}return{rangeBounds:f(),svgRendering:n.svgRendering&&u()}};n.html2canvas=function(t,i){t=t.length?t:[t];var f,e,u={logging:!1,elements:t,background:"#fff",proxy:null,timeout:0,useCORS:!1,allowTaint:!1,svgRendering:!1,ignoreElements:"IFRAME|OBJECT|PARAM",useOverflow:!0,letterRendering:!1,chinese:!1,width:null,height:null,taintTest:!0,renderer:"Canvas"};return u=r.Util.Extend(i,u),r.logging=u.logging,u.complete=function(n){if((typeof u.onpreloaded!="function"||u.onpreloaded(n)!==!1)&&(f=r.Parse(n,u),typeof u.onparsed!="function"||u.onparsed(f)!==!1)&&(e=r.Renderer(f,u),typeof u.onrendered=="function"))u.onrendered(e)},n.setTimeout(function(){r.Preload(u)},0),{render:function(n,t){return r.Renderer(n,r.Util.Extend(t,u))},parse:function(n,t){return r.Parse(n,r.Util.Extend(t,u))},preload:function(n){return r.Preload(r.Util.Extend(n,u))},log:r.Util.log}};n.html2canvas.log=r.Util.log;n.html2canvas.Renderer={Canvas:i};r.Renderer.Canvas=function(n){function c(n,t){n.beginPath();t.forEach(function(t){n[t.name].apply(n,t.arguments)});n.closePath()}function l(n){if(h.indexOf(n.arguments[0].src)===-1){e.drawImage(n.arguments[0],0,0);try{e.getImageData(0,0,1,1)}catch(t){return f=s.createElement("canvas"),e=f.getContext("2d"),!1}h.push(n.arguments[0].src)}return!0}function a(t,i){switch(i.type){case"variable":t[i.name]=i.arguments;break;case"function":switch(i.name){case"createPattern":if(i.arguments[0].width>0&&i.arguments[0].height>0)try{t.fillStyle=t.createPattern(i.arguments[0],"repeat")}catch(r){o.log("html2canvas: Renderer: Error creating pattern",r.message)}break;case"drawShape":c(t,i.arguments);break;case"drawImage":i.arguments[8]>0&&i.arguments[7]>0&&(!n.taintTest||n.taintTest&&l(i))&&t.drawImage.apply(t,i.arguments);break;default:t[i.name].apply(t,i.arguments)}}}n=n||{};var s=t,h=[],f=t.createElement("canvas"),e=f.getContext("2d"),o=r.Util,u=n.canvas||s.createElement("canvas");return function(n,t,r,f,e){var s=u.getContext("2d"),c,h,l=n.stack,v;return(u.width=u.style.width=t.width||l.ctx.width,u.height=u.style.height=t.height||l.ctx.height,v=s.fillStyle,s.fillStyle=o.isTransparent(l.backgroundColor)&&t.background!==i?t.background:n.backgroundColor,s.fillRect(0,0,u.width,u.height),s.fillStyle=v,f.forEach(function(n){s.textBaseline="bottom";s.save();n.transform.matrix&&(s.translate(n.transform.origin[0],n.transform.origin[1]),s.transform.apply(s,n.transform.matrix),s.translate(-n.transform.origin[0],-n.transform.origin[1]));n.clip&&(s.beginPath(),s.rect(n.clip.left,n.clip.top,n.clip.width,n.clip.height),s.clip());n.ctx.storage&&n.ctx.storage.forEach(function(n){a(s,n)});s.restore()}),o.log("html2canvas: Renderer: Canvas renderer done - returning canvas obj"),t.elements.length===1&&typeof t.elements[0]=="object"&&t.elements[0].nodeName!=="BODY")?(h=e.Util.Bounds(t.elements[0]),c=r.createElement("canvas"),c.width=Math.ceil(h.width),c.height=Math.ceil(h.height),s=c.getContext("2d"),s.drawImage(u,h.left,h.top,h.width,h.height,0,0,h.width,h.height),u=null,c):u}}}(window,document);CivicWeb=CivicWeb||{};CivicWeb.Integration=CivicWeb.Integration||{};CivicWeb.Integration.VideoClass=function(n){function br(n){return new Promise(function(t){setTimeout(t,n)})}function nu(n){if(n!=undefined||n!=""){var t=n.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=|\?v=)([^#\&\?]*).*/);return t&&t[2].length==11?t[2]:""}}function su(n){fi||n.target.playVideo()}function hu(n){clearTimeout(tr);n.data==YT.PlayerState.ENDED?i+1<r.length?(i=i+1,s=r.length>=i&&r[i].eventId!=null?r[i].eventId:"",s.length>0&&(yt(),window.myPlayer.loadVideoById(s,0,"large"))):wi():n.data==YT.PlayerState.BUFFERING&&(tr=setTimeout(function(){i+1<r.length?(i=i+1,s=r.length>=i&&r[i].eventId!=null?r[i].eventId:"",s.length>0&&(yt(),window.myPlayer.loadVideoById(s,0,"large"))):wi()},1e4))}var f=n.localization,bi=n.referenceFieldLocalization,pt=n!=null&&n.minutesBuild!=null?n.minutesBuild:!1,vr=n!=null&&n.agendaDocument!=null?n.agendaDocument:!1,l=n!=null&&n.meetingId!=null?n.meetingId:0,ki=n!=null&&f.createEvent!=null?f.createEvent:"",yr=n!=null&&f.viewEvent!=null?f.viewEvent:"",h=n!=null&&n.audioOnly!=null?n.audioOnly:!1,pr=n!=null&&n.earthChannel!=null?n.earthChannel:!1,ui=n!=null&&n.youTubeLite!=null?n.youTubeLite:!1,e=n!=null&&n.youTube!=null?n.youTube:!1,s=n!=null&&n.youTubeEventId!=null?n.youTubeEventId:"",wt=n!=null&&n.manageVideo!=null?n.manageVideo:!1,wr=n!=null&&n.timestampEnabled!=null?n.timestampEnabled:!1,u=null,lt=null,di=function(){},gi=0,nr=!1,fi=!1,w=!1,ei=null,et=!1,it=!1,ut=Number.MAX_SAFE_INTEGER,oi=!1,t=null,y=300,o=400,ot=.618,nt=505,st=.75,ht=.5625,v=400,b=464,ft=200,i=0,c=[],k=[],d=[],r=[],si=!1,tr=null,bt,rt=[],ir,hi,kt,at,ci,dt,li,ai,a,tt,gt,ni,vi,rr;this.addVideoButtonToPortal=function(n,t,r){$.ajax({url:"/api/videolink/"+n.toString(),contentType:"application/json",dataType:"json",async:!0,cache:!1,type:"GET",success:function(n){var s=!1,h,o,v;if(n&&n.length>0)if(!e&&n.indexOf("IsMediaEnabled")<0)r.is("a")?r.show().removeClass("hidden").text(f.audioVideoLabel).attr("title",f.showAudioVideoLabel):r.show().removeClass("hidden").find("span").text(f.audioVideoLabel).attr("title",f.showAudioVideoLabel),r.attr({href:n,target:"_blank"}),s=!0;else for(h=JSON.parse(n),i=0,k=[],o=0;o<h.length;o++){var u=h[o],y=u.IsMediaEnabled?u.IsMediaEnabled:!1,c=u.PublisherEventID?u.PublisherEventID:0,p=u.EventStatus?u.EventStatus:"",l=u.YouTubeEventId?u.YouTubeEventId:"",w=u.ShowVideoLink?u.ShowVideoLink:!1;if(it=u.Historic?u.Historic||it:!1,e&&w&&l.length>0&&l!="0"||p.toLowerCase()=="published"&&y&&c>0){if(r.is("a")?r.show().removeClass("hidden").text(f.audioVideoLabel).attr("title",f.showAudioVideoLabel):r.show().removeClass("hidden").find("span").text(f.audioVideoLabel).attr("title",f.showAudioVideoLabel),it){v=u.URLBase.replace("view.","viewer.")+"&eID="+c;k.push(v);r.off("click",a).on("click",a)}else r.off("click",a),r.attr({href:"/document/"+t+"?splitscreen=true&media=true",target:"_blank"});s=!0;break}}s||r.hide().addClass("hidden")},error:function(){r.hide().addClass("hidden")}})};this.showPdfQuickViewVideoLink=function(n,t){$.ajax({url:"/api/videolink/"+n.toString(),contentType:"application/json",dataType:"json",async:!0,cache:!1,type:"GET",success:function(n){var o=!1,s,u;if(n&&n.length>0){if(!e&&n.indexOf("IsMediaEnabled")<0)$("#VideoLink > a > span").text(f.audioVideoLabel).attr("title",f.showAudioVideoLabel),$("#VideoLink > a").attr({href:n,target:"_blank"}),o=!0;else for(s=JSON.parse(n),i=0,k=[],u=0;u<s.length;u++){var r=s[u],c=r.IsMediaEnabled?r.IsMediaEnabled:!1,l=r.PublisherEventID?r.PublisherEventID:0,a=r.EventStatus?r.EventStatus:"",h=r.YouTubeEventId?r.YouTubeEventId:"",v=r.ShowVideoLink?r.ShowVideoLink:!1;if(it=r.Historic?r.Historic||it:!1,e&&v&&h.length>0&&h!="0"||a.toLowerCase()=="published"&&c&&l>0){$("#VideoLink > a").attr({href:"/document/"+t+"?splitscreen=true&media=true",target:"_blank"});o=!0;break}}o&&$("#VideoLink").removeClass("hidden")}},error:function(){buttonClient.hide()}})};this.addTimestampsAndVideoToMeetingDocument=function(n,l,v){$.ajax({url:"/api/geteventwithindexpoints/"+n.toString(),contentType:"application/json",dataType:"json",async:!0,cache:!1,type:"GET",success:function(n){var b,ft,et,ct,vi,w,ui,fi,ei,wt,g,vt,yi,ti,pi;if(n&&(b=JSON.parse(n),b.length>0&&(e=b[0].YouTube!=null?b[0].YouTube:!1),b&&b.length>0)){l.find("a[id^=video-timestamp-]").remove();i=0;c=[];k=[];d=[];r=[];var wi=!1,si=!0,bi=!1,ki=!1,ii=[],di=[],ri=h?"/Global/Images/icon-audio-light-16x16.png":"/Global/Images/icon-video-light-16x16.png",gi=h?"/Global/Images/icon-audio-dark-16x16.png":"/Global/Images/icon-video-dark-16x16.png";for(u=l,rt=[],g=0;g<b.length;g++){var tr=b[g],yt=tr.Event!=null?tr.Event:null,pt=yt!=null&&yt.eventId!=null?yt.eventId:"";rt.indexOf(pt)==-1&&rt.push(pt)}for(ft=0;ft<b.length;ft++){var p=b[ft],ir=p.PublisherEvent?p.PublisherEvent.IsMediaEnabled:!1,ci=p.PublisherEvent?p.PublisherEvent.PublisherEventID:0,rr=p.PublisherEvent?p.PublisherEvent.EventStatus:"",yt=p.Event!=null?p.Event:null,pt=yt!=null&&yt.eventId!=null?yt.eventId:"";if(ft==0&&(it=p.Historic!=null?p.Historic:!1,si=p.ShowVideoLink!=null?p.ShowVideoLink:!0,bi=p.ShowTimeStamps!=null?p.ShowTimeStamps:!1,oi=p.StartAtFirstTimestamp!=null?p.StartAtFirstTimestamp:!1,ki=p.PublisherEvent!=null?p.PublisherEvent.MediaType.toLowerCase()=="live":!1),e&&si&&pt.length>0&&pt!="0"||rr.toLowerCase()=="published"&&ir&&ci>0){if(bi){if(et=b[ft].LocalIndexPoints?b[ft].LocalIndexPoints:null,et)for(ct=0;ct<et.length;ct++){var lt=et[ct].ItemId,tt=et[ct].Value,ai=et[ct].Event!=null?et[ct].Event:"",ur=et[ct].RelationshipTypeId,dt=et[ct].RelatedItem;isNaN(tt)||ai!=pt&&ai!=""||(vi=ni(tt,!1,lt,ai),w=$("<a />").attr({title:vi,"time-stamp-event":pt,"time-stamp-video":ft,"time-stamp":tt}).css({position:"absolute",right:"0",cursor:"pointer","text-decoration":"underline","z-index":"500"}).on("click",function(){hi(this)}).append($("<img />").css({width:"20px",height:"20px"}).attr({src:ri}).hover(function(){$(this).attr("src",gi)},function(){$(this).attr("src",ri)})),di.indexOf(parseInt(lt))<0&&(ui=l.find("a[name=MinutesHeading"+lt+"]"),ui.length>0&&(w.attr({id:"video-timestamp-"+lt,top:ui.top}),ui.parent().after(w)),fi=l.find("a[name=MinutesItem"+lt+"]"),fi.length>0&&(w.attr({id:"video-timestamp-"+lt,top:fi.top}),fi.parent().after(w)),ei=l.find("a[name=Resolution"+lt+"]"),ei.length>0&&(w.attr({id:"video-timestamp-"+lt,top:ei.top}),ei.parent().after(w)),di.push(lt)),ur==6&&ii.indexOf(parseInt(dt))<0&&(wt=l.find("a[name=AgendaHeading"+dt+"]"),wt.length>0&&(w.attr({id:"video-timestamp-"+dt,top:wt.top}),wt.parent().after(w)),vt=l.find("a[name=AgendaItem"+dt+"]"),vt.length>0&&(w.attr({id:"video-timestamp-"+dt,top:vt.top}),vt.parent().after(w)),ii.push(dt)),ut>tt&&(ut=tt))}if(!ki&&p.IndexPoints!=null)for(g=0;g<p.IndexPoints.length;g++){var gt=p.IndexPoints[g].ExternalID,tt=p.IndexPoints[g].SecondsStart,fr=!isNaN(tt)&&parseInt(tt)>0||!isNaN(p.IndexPoints[g].SecondsEnd)&&parseInt(p.IndexPoints[g].SecondsEnd)>0,er=p.IndexPoints[g].Title;if(fr&&ii.indexOf(parseInt(gt))<0){var vi=ni(tt),w=$("<a />").attr({title:vi,"time-stamp-video":ft,"time-stamp":tt}).css({position:"absolute",right:"0",cursor:"pointer","text-decoration":"underline","z-index":"500"}).on("click",function(){hi(this)}).append($("<img />").css({width:"20px",height:"20px"}).attr({src:ri}).hover(function(){$(this).attr("src",gi)},function(){$(this).attr("src",ri)})),wt=l.find("a[name=AgendaHeading"+gt+"]");wt.length>0&&(w.attr({id:"video-timestamp-"+gt,top:wt.top}),wt.parent().after(w));vt=l.find("a[name=AgendaItem"+gt+"]");vt.length>0&&(w.attr({id:"video-timestamp-"+gt,top:vt.top}),vt.parent().after(w));ii.push(gt)}ut>tt&&(ut=tt)}}yi=p.PublisherEvent&&(parseInt(p.PublisherEvent.EnabledItemMask)&4096)>0?ht:st;c.push(yi);r.push(yt);at(yi);e&&pt.length>0?d.push('<div id="videoDiv" height="'+y+'px" width="'+o+'px" style=" margin-top:'+(v?"0em;":"2.5em;")+' text-align: center; top: 0; width:100%; background-color: white; z-index: 600; "><div id="timeStampVideoDiv"><\/div><hr style="margin:0"/><\/div>'):it?(ti=p.PublisherEvent.URLBase.replace("view.","viewer.")+"&eID="+ci,k.push(ti)):(ti=(p.PublisherEvent?p.PublisherEvent.URLBase.replace("http://view.earthchannel.com/PlayerController.aspx","//viewer.earthchannel.com/PlayerMedia.aspx"):"")+"&amp;eID="+ci+"&amp;mode=embed",k.push(ti),d.push('<div id="videoDiv" style=" margin-top:'+(v?"0em;":"2.5em;")+' text-align: center;"><iframe id="iframeONE" height="'+y+'px" width="'+o+'px" src="'+ti+'" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"><\/iframe><hr style="margin:0"/><\/div>'));wi=!0}}if(s=r.length>0&&r[0]!=null&&r[0].eventId!=null?r[0].eventId:"",e&&s!="")if(t=$("#attachment-pane"),t.length==0&&(t=window.parent.$("#attachment-pane")),t.length>0){ot=1;nt=800;l.find('a[target="AgendaAttachment"]').on("click",function(){t.find("#videoDiv").length>0&&setTimeout(function(){li(!0)},0)})}else t=null;if(wi&&si){(t?t:u).css({margin:"0"});(t?t:u).css({padding:"0"});$(window).on("resize",kt);$("#video-button").removeClass("hidden").find('span[class="toolbar-text"]').text(f.audioVideoLabel).attr("title",f.showAudioVideoLabel);pi=$("ul.split-screen-toolbar").find("li#close-split-screen");pi&&pi.length>0&&typeof CivicWeb!="undefined"&&typeof window.CivicWeb.Documents!="undefined"&&typeof window.CivicWeb.Documents.SplitscreenPage!="undefined"&&window.CivicWeb.Documents.SplitscreenPage.setToolbarCollapsedState();$("#video-button").off("click").on("click",a);(window.location.href.indexOf("media=true")>0||window.location.href.indexOf("timestamp")>0)&&(nr&&v&&$(window).height()>$(window).width()||(window.location.href.indexOf("timestamp")>0&&(startAt=bt.timestamp),a()))}}},error:function(){}})};at=function(n){var i=(t?t:u).width();o=(isNaN(i)?v:parseFloat(i))*ot;o>nt&&(o=nt);o<v&&navigator.userAgent.indexOf("Chrome")!=-1&&n==st&&!e?(o=v,(t?t:u).attr("width",v)):o<b&&navigator.userAgent.indexOf("Chrome")!=-1&&n==ht&&!e&&(o=b,(t?t:u).attr("width",b));y=o*n};ir=function(n){if(r!=null)for(var t=0;t<r.length;t++)if(r[t].eventId!=null&&r[t].eventId==n){i=t;s=r.length>=i&&r[i].eventId!=null?r[i].eventId:"";window.myPlayer.loadVideoById(s,0,"large");break}};this.getEvents=function(){return r};this.getCurrentEvent=function(){return r.length>=i&&r[i]!=null?r[i]:null};this.getVideoTime=function(n,t,i){var u,f;if(w)ei==null?(ei=new Date,i(t,0,!0,s)):(u=new Date,f=Math.round((u-ei)/1e3),i(t,f,!0,s));else if(e&&window.myPlayer!=null)i(t,Math.round(window.myPlayer.getCurrentTime()),!0,s);else if(gi=t,di=i,n){var r=$("<a>",{href:n.src})[0],o=r.origin?r.origin:r.protocol+"//"+r.host.replace(":80","").replace(":443",""),h=n.contentWindow?n.contentWindow:n.contentDocument.defaultView;h.postMessage("GETTIME",o)}};hi=function(n){var h=isNaN($(n).attr("time-stamp-video"))?0:parseInt($(n).attr("time-stamp-video")),o=isNaN($(n).attr("time-stamp"))?0:parseInt($(n).attr("time-stamp")),f;if(o=o<0?"0":o.toString(),fi){if(a(),f=(t?t:u).find("#timeStampVideoDiv")[0],f){var c=f.src,v=new RegExp("([?|&])start=.*?(&|$)","i"),y,p=c.indexOf("?")!==-1?"&":"?";y=c.match(v)?c.replace(v,p+"start="+o+"$2"):c+p+"start="+o;f.src=y}}else if(e&&r[i]!=null&&r[h]!=null)window.myPlayer!=null?h!=i?(i=h,s=r.length>=i&&r[i].eventId!=null?r[i].eventId:"",window.myPlayer.loadVideoById(s,o,"large")):window.myPlayer.seekTo(o):(tt(),i=h,s=r.length>=i&&r[i].eventId!=null?r[i].eventId:"",oi=!0,ut=o,a());else if(h!=i){tt();i=h;a();f=(t?t:u).find("#iframeONE")[0];$(f).on("load",function(){setTimeout(function(){var n=$("<a>",{href:f.src})[0],t=n.origin?n.origin:n.protocol+"//"+n.host.replace(":80","").replace(":443",""),i=f.contentWindow?f.contentWindow:f.contentDocument.defaultView;i.postMessage("SETTIME:"+o,t)},100)})}else if(f=(t?t:u).find("#iframeONE")[0],f){var l=$("<a>",{href:f.src})[0],w=l.origin?l.origin:l.protocol+"//"+l.host.replace(":80","").replace(":443",""),b=f.contentWindow?f.contentWindow:f.contentDocument.defaultView;b.postMessage("SETTIME:"+o,w)}else{tt();a();f=(t?t:u).find("#iframeONE")[0];$(f).on("load",function(){setTimeout(function(){var n=$("<a>",{href:f.src})[0],t=n.origin?n.origin:n.protocol+"//"+n.host.replace(":80","").replace(":443",""),i=f.contentWindow?f.contentWindow:f.contentDocument.defaultView;i.postMessage("SETTIME:"+o,t)},100)})}return!1};this.resizeVideo=function(){kt()};kt=function(){var f,n,r;u&&(f=(t?t:u).width(),n=(isNaN(f)?v:parseFloat(f))*ot,n>nt&&(n=nt),r=n*c[i],e&&s.length>0?((t?t:u).find("#timeStampVideoDiv").attr("width",n).attr("height",r),(t?t:u).find("#videoDiv").attr("width",n).attr("height",r)):(t?t:u).find("#iframeONE").attr("width",n).attr("height",r))};at=function(n){var i=(t?t:u).width();o=(isNaN(i)?v:parseFloat(i))*ot;o>nt&&(o=nt);o<v&&navigator.userAgent.indexOf("Chrome")!=-1&&n==st&&!e?(o=v,(t?t:u).attr("width",v)):o<b&&navigator.userAgent.indexOf("Chrome")!=-1&&n==ht&&!e&&(o=b,(t?t:u).attr("width",b));y=o*n};ci=function(n){e&&window.myPlayer!=null?n(0,Math.round(window.myPlayer.getCurrentTime()),!0):n(0,0,!0)};dt=function(n,t){e&&window.myPlayer!=null&&(window.myPlayer.seekTo?window.myPlayer.seekTo(n):t<20&&(t++,br(100).then(function(){return dt(n,t)})))};this.moveVideoToAgendaFrame=function(n,t){u==null&&t<20?(t++,setTimeout(function(){CivicWeb.Integration.Video.moveVideoToAgendaFrame(n,t)},100)):li(n)};li=function(n){u&&u.find("#videoDiv").length==0?ci(function(r,u){tt();ot=.618;nt=505;t!=null&&(t.find("#attachment-container").removeClass("hidden"),t=null);at(c[i]);a();setTimeout(function(){dt(u,1)},100);n?$("#video-button").off("click").on("click",ai).removeClass("hidden").find('span[class="toolbar-text"]').text(f.audioVideoLabel).attr("title",f.showAudioVideoLabel+" in the attachment pane"):$("#video-button").off("click").on("click",tt).find('span[class="toolbar-text"]').text(f.hideLabel).attr("title",f.hideAudioVideoLabel)}):(t=null,$("#video-button").off("click").on("click",a).find('span[class="toolbar-text"]').text(f.audioVideoLabel).attr("title",f.showAudioVideoLabel))};this.moveVideoToAttachmentFrame=function(){ai()};ai=function(){u&&u.find("#videoDiv").length>0&&ci(function(n,r){tt();t=$("#attachment-pane");t.length==0&&(t=window.parent.$("#attachment-pane"));t.length>0?(ot=1,nt=800,setTimeout(function(){at(c[i]);a();setTimeout(function(){dt(r,1)},100)},0)):t=null})};a=function(n){if((t?t:u).find("#videoDiv").remove(),d.length>0&&u!=null){if(navigator.userAgent.indexOf("Chrome")!=-1){var r=(t?t:u).width(),o=b;r<v&&c[i]==st?o=v:r<b&&c[i]==ht&&(o=b);r<o?($(document.getElementById("AgendaPane")).width(o+25),e&&s.length>0?($("body").prepend(d[i]),ri("videoDiv")):(t?t:u).prepend(d[i]),r=r<ft/c[i]?ft/c[i]:r,setTimeout(function(){$(document.getElementById("AgendaPane")).width(r+25);kt()},1e3)):e&&s.length>0?($("body").prepend(d[i]),ri("videoDiv")):(t?t:u).prepend(d[i])}else e&&s.length>0?($("body").prepend(d[i]),ri("videoDiv")):(t?t:u).prepend(d[i]);$(u.find("body")).css({"margin-right":"15px"});$("#video-button").off("click").on("click",tt).find('span[class="toolbar-text"]').text(f.hideLabel).attr("title",f.hideAudioVideoLabel);e||gt(n)}else it&&window.open(k[i],"_blank","toolbar=no,scrollbars=no,resizable=no,top=50,left=50,width=1000,height=770");return t&&t.find("#attachment-container").addClass("hidden"),window.parent&&window.parent.$&&window.parent.$("#walkme-player").hide(),n!=null&&n.preventDefault(),!1};this.hideVideo=function(n){tt(n)};tt=function(n){return u!=null&&(i=0,s=r.length>=i&&r[i].eventId!=null?r[i].eventId:"",e&&(lt=null,$(document.getElementById("timeStampVideoDiv")).closest(".k-window").remove()),(t?t:u).find("#videoDiv").remove(),u.css({"margin-right":"0"}),$("#video-button").off("click").on("click",a).find('span[class="toolbar-text"]').text(f.audioVideoLabel).attr("title",f.showAudioVideoLabel),(t?t:u).css({"padding-top":""}),typeof CivicWeb!="undefined"&&typeof CivicWeb.Document!="undefined"&&typeof CivicWeb.Document.AgendaNotesPage!="undefined"&&CivicWeb.Document.AgendaNotesPage.getInstance()!=null&&CivicWeb.Document.AgendaNotesPage.events.resizeAgendaDocument(n)),t&&t.find("#attachment-container").removeClass("hidden"),n!=null&&n.preventDefault(),!1};gt=function(n){if(u.length>0){var i=$("#quickview-header-container").length>0?$("#quickview-header-container").height():$("#MenuContainer").length>0?$("#MenuContainer").height():0,r=$(".footer").length>0?$(".footer").height():$(".portal-footer").length>0?$(".portal-footer").height():0;t?t.find("#videoDiv").css({top:"0","background-color":"white","z-index":"600",position:"",height:"99.83%"}):(u.css({"padding-top":y+10+"px"}),u.find("#videoDiv").css({position:"fixed",top:"0",width:"100%","background-color":"white","z-index":"600"}));vr&&typeof CivicWeb!="undefined"&&typeof CivicWeb.Document!="undefined"&&typeof CivicWeb.Document.AgendaNotesPage!="undefined"&&CivicWeb.Document.AgendaNotesPage.getInstance()!=null&&CivicWeb.Document.AgendaNotesPage.events.resizeAgendaDocument(n)}};this.convertSecondsToTimeString=function(n,t,i){return ni(n,t,i)};ni=function(n,t,i,r){var e="",u=t?"-":"0",o,f,c,h;if(n>=3600){var s=Math.floor(n/3600),o=Math.floor(n%3600/60),f=Math.floor(n%3600%60);e=s<10?(t?u:"")+s+"h":s+"h";e+=o<10?"0"+o+"m":o+"m";e+=f<10?"0"+f+"s":f+"s"}else n>=60?(o=Math.floor(n/60),f=n%60,e=(t?u+u:u)+"h",e+=o<10?u+o+"m":o+"m",e+=f<10?"0"+f+"s":f+"s"):(f=n%60,e=(t?u+u:u)+"h"+u+u+"m"+(f<10?u+f+"s":f+"s"));return i!=null&&rt.length>1&&(c=r!=null?r:BuildForms!=null?BuildForms.GetItemValue(i,bi.videoTimeStampEventFieldReferenceName):"",h=rt.indexOf(c)+1,h>0&&(e="Part "+h+": "+e)),e};vi=function(n){$.ajax({url:"/api/geteventwithindexpoints/"+n.toString(),contentType:"application/json",dataType:"json",async:!0,cache:!1,type:"GET",success:function(n){var p,d,nt,t,l,a,it;if(n&&n.length>0){for(k=[],p=JSON.parse(n),rt=[],d=0;d<p.length;d++){var ut=p[d],u=ut.Event!=null?ut.Event:null,g=u!=null&&u.eventId!=null?u.eventId:"";rt.indexOf(g)==-1&&rt.push(g)}for(nt=0;nt<p.length;nt++){t=p[nt];w=t.PublisherEvent?t.PublisherEvent.MediaType.toLowerCase()=="live":!1;var ct=t.PublisherEvent?t.PublisherEvent.IsMediaEnabled:!1,et=t.PublisherEvent?t.PublisherEvent.PublisherEventID:0,u=t.Event!=null?t.Event:null,g=u!=null&&u.eventId!=null?u.eventId:"";if(ct&&et>0||g.length>0&&g!="0"){if(c.push(t.PublisherEvent&&(parseInt(t.PublisherEvent.EnabledItemMask)&4096)>0?ht:st),u!=null&&r.push(u),l=t.LocalIndexPoints?t.LocalIndexPoints:null,l)for(a=0;a<l.length;a++){var tt=l[a].ItemId,f=l[a].Value,ot=l[a].Event;f==null||isNaN(f)||(timeString=f<0?'<a href"#" style="color:red;" class="time-stamp-event-link" time-stamp-event="'+ot+'" time-stamp="'+f+'" onclick="CivicWeb.Integration.Video.gotoMinutesVideoTimeStamp(this)">-'+CivicWeb.Integration.Video.convertSecondsToTimeString(Math.abs(f),!1,tt)+"<\/a>":'<a href"#" class="time-stamp-event-link" time-stamp-event="'+ot+'" time-stamp="'+f+'" onclick="CivicWeb.Integration.Video.gotoMinutesVideoTimeStamp(this)">'+CivicWeb.Integration.Video.convertSecondsToTimeString(f,!1,tt)+"<\/a>",it=$(document.getElementById(bi.videoTimeStampFieldReferenceName+"_"+tt)),it.length>0&&it.html(timeString))}if(e||navigator.userAgent.indexOf("Chrome")==-1?(y=ft,o=y/c[i]):c[0]==st?(o=v,y=o*c[i]):c[0]==ht&&(o=b,y=o*c[i]),k.push((t.PublisherEvent?t.PublisherEvent.URLBase.replace("http://view.earthchannel.com/PlayerController.aspx","//viewer.earthchannel.com/PlayerMedia.aspx"):"")+"&amp;eID="+et+"&amp;mode=embed"),w)$("#timeStampVideoButton").removeClass("hidden").attr({title:h?"Play the live stream":"View the live stream"}).off("click").on("click",ti).find("span").text(h?"Play Stream":"View Stream");else{$("#timeStampVideoButton").removeClass("hidden").off("click").on("click",ti);if(wt&&wr)$("#timeStampSyncVideo").removeClass("hidden").off("click").on("click",ur)}}}s=r.length>0&&r[0]!=null&&r[0].eventId!=null?r[0].eventId:""}},error:function(){}})};this.gotoMinutesVideoTimeStamp=function(n){rr(n)};rr=function(n){var t=$(n).attr("time-stamp"),r,i;if(t=isNaN(t)?0:parseInt(t),t=t<0?"0":t.toString(),e&&window.myPlayer!=null)r=$(n).attr("time-stamp-event"),r!=null&&r!=s?(s=r,window.myPlayer.loadVideoById(r,t,"large"),yt()):window.myPlayer.seekTo(t);else if(i=$("#timeStampVideoDiv").find("iframe")[0],i){var u=$("<a>",{href:i.src})[0],f=u.origin?u.origin:u.protocol+"//"+u.host.replace(":80","").replace(":443",""),o=i.contentWindow?i.contentWindow:i.contentDocument.defaultView;o.postMessage("SETTIME:"+t,f)}return!1};this.toggleTimeStampSyncMode=function(){ur()};var ur=function(){var n=$("#timeStampSyncVideo");!et&&confirm("Sync mode allows timestamps to be synced with the recorded "+(h?"audio":"video")+". Sync mode affects all timestamps related to the video.\nDo you want to continue?")?(n.attr({title:"Disable Sync Mode"}).find("span").text("Disable Sync Mode"),$("#subMenu").append('<b id="syncModeEnabledLabel" style="float: right; margin-right: 2em; padding-right: 3px; background-color: #296498; color: #fff;" >Sync Mode Enabled<\/b>'),et=!0,$(document.getElementById("timeStampVideoDiv")).length==0&&ti()):(n.attr({title:"Sync timestamps with recorded "+(h?"audio":"video")}).find("span").text("Enable Sync Mode"),$("#syncModeEnabledLabel").remove(),et=!1);ATMBuild.SelectedItem!=null&&Build.AddVideoTimeStampButton(ATMBuild.SelectedItem)},ti=function(){if(CivicWeb.Common.loadKendoUi(ti))if(lt)fr(),$("#timeStampVideoButton").attr({title:w?h?"Play the live stream":"View the live stream":h?"Play the recorded audio":"View the recorded video"}).find("span").text(w?h?"Play Stream":"View Stream":h?"Play Audio":"View Video");else{$("body").prepend('<div id="timeStampVideoDiv"/>');var n=$(document.getElementById("timeStampVideoDiv"));n.css({margin:"0",padding:"0"}).kendoWindow({width:o+"px",height:y+"px",title:"Timestamp "+(h?"Audio":"Video"),modal:!1,visible:!0,resizable:!1,actions:["Close"],content:k[i],close:fr,position:{top:0,left:0},id:"kendoVideoWindow"});setTimeout(function(){var n=$(document.getElementById("timeStampVideoDiv"));e?(n.height(ft),n.width(ft/c[i])):(n.parent().height(ft),n.parent().width(ft/c[i]))},1e3);lt=$(document.getElementById("timeStampVideoDiv")).data("kendoWindow");$(document.getElementById("timeStampVideoDiv")).closest(".k-window").css({position:"fixed",top:"0",left:"0"});lt.open();$("#timeStampVideoButton").attr({title:w?h?"Stop playing the stream":"Stop viewing the stream":h?"Stop playing the audio":"Stop viewing the video"}).find("span").text(w?"Stop Stream":h?"Stop Audio":"Close video popup");e&&CivicWeb.Integration.Video.getCurrentEvent()!=null&&(ri("timeStampVideoDiv"),yt())}},fr=function(){lt=null;$(document.getElementById("timeStampVideoDiv")).closest(".k-window").remove();$("#timeStampVideoButton").attr({title:w?h?"Play the live stream":"View the live stream":h?"Play the recorded audio":"View the recorded video"}).find("span").text(w?h?"Play Stream":"View Stream":h?"Play Audio":"View Video");et&&($("#timeStampSyncVideo").attr({title:"Sync timestamps with recorded "+(h?"audio":"video")}).find("span").text("Enable Sync Mode"),$("#syncModeEnabledLabel").remove(),et=!1)},kr=function(n,t){var i={};i.MeetingId=l;i.Events=n;i.StartAtFirstTimestamp=t;$.ajax({url:"/api/savevideoeventsettings",contentType:"application/json",dataType:"json",async:!0,cache:!1,type:"POST",data:JSON.stringify(i),success:function(){setTimeout(function(){$("#videoevent-selector-container").slideUp();$("#earthChannelEventLink").remove();$("#showVideoLinkSpan").remove();$("#showTimeStampsSpan").remove();$("#timeStampVideoButton").addClass("hidden");$("#timeStampSyncVideo").addClass("hidden");$(".time-stamp-event-link").remove();wt&&l!=null&&l>0&&or(l);pt&&vi(l)},750)},error:function(){}})},er=function(n){var t={};t.MeetingId=l;var i=$(n).attr("id"),r="",u=!1,f=!1;i=="showVideoLink"?(t.ShowVideoLink=n.checked,n.checked?t.ShowTimeStamps=$("#showTimeStamps").prop("checked"):($("#showTimeStamps").prop("checked",!1),t.ShowTimeStamps=!1,f=!0),r=(n.checked?"Show":"Hide")+" the "+(h?"audio":"video")+" button on the published agenda and minutes?\nDo you want to continue?"):i=="showTimeStamps"&&(t.ShowTimeStamps=n.checked,$("#showVideoLink").prop("checked")||(u=!0),$("#showVideoLink").prop("checked",!0),t.ShowVideoLink=!0,r=(n.checked?"Show":"Hide")+" the timestamps on the published agenda and minutes?\nDo you want to continue?");confirm(r)?$.ajax({url:"/api/savevideoeventsettings",contentType:"application/json",dataType:"json",async:!0,cache:!1,type:"POST",data:JSON.stringify(t),success:function(){},error:function(){}}):(n.checked=!n.checked,i=="showVideoLink"&&f&&$("#showTimeStamps").prop("checked",n.checked),u&&$("#showVideoLink").prop("checked",!1))};this.getSyncMode=function(){return et};this.isAudioOnly=function(){return h};this.isLive=function(){return w};var or=function(n){$.ajax({url:"/api/getevent/"+n.toString(),contentType:"application/json",dataType:"json",async:!0,cache:!1,type:"GET",success:function(n){var t=JSON.parse(n),b=t.DisplayShowVideoLinkCheckbox!=null?t.DisplayShowVideoLinkCheckbox:!1,k=t.ShowVideoLink!=null?t.ShowVideoLink:!1,d=t.ShowTimeStamps!=null?t.ShowTimeStamps:!1,g=t.Historic!=null?t.Historic:!1,nt=t.validYouTubeCredentialExists!=null?t.validYouTubeCredentialExists:!1,tt=t.publicDocumentExists!=null?t.publicDocumentExists:!1,c=t.MeetingId!=null?t.MeetingId:0,l=t.MeetingName!=null?t.MeetingName:"",a=t.MeetingDateInThePast!=null?t.MeetingDateInThePast:!1,v=t.MeetingStartTimeExists!=null?t.MeetingStartTimeExists:!1,r=t.eventId!=null?t.eventId:"",it=t.Events!=null?t.Events:[],y=t.StartAtFirstTimestamp!=null?t.StartAtFirstTimestamp:!1,u=t.boxcast!=null?t.boxcast:!1,f=t.broadcasts!=null?t.broadcasts:[],p=t.boxcasters!=null?t.boxcasters:[],w=t.youtubeAccounts!=null?t.youtubeAccounts:[],i=$("<a/>"),o,s;if(e&&r!="-1"){i.attr({id:"earthChannelEventLink","class":"subMenuText",href:""}).text("Video").off("click").on("click",function(n){yi();cr(n,l,it,a,v,y,u,f,p,w);n.preventDefault()});i.attr({title:ui?"Paste in the YouTube link to connect to this meeting instance":u?"Select a broadcast or create a new broadcast to connect to this meeting":"Select the YouTube live stream or a recorded video to connect to this meeting instance."})}else i.attr({id:"earthChannelEventLink","class":"subMenuText",href:"/videologin/"+c+"/"+(r=="-1"?"0":r),target:"_blank"}),r!="0"&&r!="-1"?i.text(yr):i.text(ki);if(r=="-1")if(tt)e&&!nt&&i.text("Video").addClass("disableCreateEventLink").attr({title:"Valid YouTube credentials are needed before an event can be created. Add credentials under the admin area on the General Settings page."}).removeAttr("href target");else if(i.text(e?"Video":ki).addClass("disableCreateEventLink").attr({disabled:"disabled",title:"A public Agenda needs to be published before "+(u?"a broadcast can be connected":e?"a video can be connected":"an event can be created")}).removeAttr("href target"),e)i.off("click").on("click",function(n){if($(this).attr("disabled"))return!1;yi();cr(n,l,[],a,v,y,u,f,p,w);n.preventDefault()});$("#subMenu").append(i);r!="0"&&r!="-1"&&b&&(o=$("<span/>").attr({id:"showVideoLinkSpan",title:"Show the "+(h?"audio":"video")+" button on the published agenda and minutes documents"}),o.append($("<input/>").attr({id:"showVideoLink",type:"checkbox",checked:k}).css({"margin-left":"2em","vertical-align":"middle"}).off("click").on("click",function(){er(this)})),o.append($("<label/>").attr({"for":"showVideoLink"}).css({"text-indent":"0px"}).text("Show "+(h?"Audio":"Video")+" Button")),$("#subMenu").append(o),g||(s=$("<span/>").attr({id:"showTimeStampsSpan",title:"Show timestamps on the published agenda and minutes documents"}),s.append($("<input/>").attr({id:"showTimeStamps",type:"checkbox",checked:d}).css({"margin-left":"2em","vertical-align":"middle"}).off("click").on("click",function(){er(this)})),s.append($("<label/>").attr({"for":"showTimeStamps"}).css({"text-indent":"0px"}).text("Show Timestamps")),$("#subMenu").append(s)));pt&&c>0&&f.length>0?dr(f,c):$("#boxcaster-incamera-control").addClass("hidden")},error:function(){}})},yi=function(){$("#videoevent-selector-container").remove()},sr=function(n,t){if($("#boxcaster-incamera-control").removeClass("hidden"),t)$("#OpenSession").removeClass("hidden").off("click").on("click",function(t){g(t,n,!1)});else $("#ClosedSession").removeClass("hidden").off("click").on("click",function(t){g(t,n,!0)})},hr=function(n,t){var u,i;if(n&&n.length>0){var f=!1,r=Number.MAX_SAFE_INTEGER,e=!0;for(u=0;u<n.length;u++)i=n[u],(i.metadata.mixer!=null&&i.metadata.mixer.muted||i.metadata.overlays!=null&&i.metadata.overlays.length>0)&&(f=!0),r=i.millisecondsToStart<r?i.millisecondsToStart:r,e=e&&i.streamEnded;e||(r>0?setTimeout(function(){sr(t,f)},r):sr(t,f))}},dr=function(n,t){var i={};i.Broadcasts=n;$.ajax({url:"/api/broadcastdetails",contentType:"application/json",dataType:"json",async:!0,cache:!1,type:"POST",data:JSON.stringify(i),success:function(n){hr(n,t)},error:function(){hr(!1,t)}})},g=function(n,t,i){i?($("#ClosedSession").attr("disabled",!0),$("#loadingSpinnerClosed").removeClass("hidden")):($("#OpenSession").attr("disabled",!0),$("#loadingSpinnerOpen").removeClass("hidden"));var r={};r.MeetingId=t;r.InCamera=i;$.ajax({url:"/api/toggleboxcastintermission",contentType:"application/json",dataType:"json",async:!0,cache:!1,type:"POST",data:JSON.stringify(r),success:function(n){if($("#loadingSpinnerOpen").addClass("hidden"),$("#loadingSpinnerClosed").addClass("hidden"),n.success&&i){$("#OpenSession").removeClass("hidden").off("click").on("click",function(n){g(n,t,!1)});$("#ClosedSession").addClass("hidden").attr("disabled",!1).off("click").on("click",function(n){g(n,t,!0)})}else if(n.success&&!i){$("#ClosedSession").removeClass("hidden").off("click").on("click",function(n){g(n,t,!0)});$("#OpenSession").addClass("hidden").attr("disabled",!1).off("click").on("click",function(n){g(n,t,!1)})}else{$("#ClosedSession").attr("disabled",!1).off("click").on("click",function(n){g(n,t,!0)});$("#OpenSession").attr("disabled",!1).off("click").on("click",function(n){g(n,t,!1)});alert("There was an error setting the broadcast to "+(i?"intermission":"public"))}},error:function(){$("#loadingSpinnerOpen").addClass("hidden");$("#loadingSpinnerClosed").addClass("hidden");$("#ClosedSession").attr("disabled",!1).off("click").on("click",function(n){g(n,t,!0)});$("#OpenSession").attr("disabled",!1).off("click").on("click",function(n){g(n,t,!1)});alert("There was an error setting the broadcast to "+(i?"intermission":"public"))}});n.preventDefault()},cr=function(n,t,i,r,u,e,o,s,h,c){var g=$("<div/>").attr({id:"videoevent-selector-container"}).css({"z-index":"1000",top:"150px",width:"500px",position:"absolute",left:"29%","background-color":"#E8E8E8"}),lt=$("<div/>").css({margin:"0"}).addClass("visBorder").append($("<div/>").css({clear:"both"}).addClass("visHeader visHeaderHover").text(o?"BoxCast Broadcast Selector":"YouTube Video Selector").append($("<span/>").attr({id:"closeVideoSelector",title:"Close"}).css({"border-width":"0",float:"right"}).addClass("cw-icon-delete glyphbutton cursor-pointer").off("click").on("click",yi))),p,v,y,b,rt,k,ut,w,nt,a,ot,st,d,ft,ht;if(g.append(lt),videoSelector=$("<div/>").attr({id:"videoevent-selector"}).css({margin:"0.8em"}),videoSelector.append($("<hr/>").attr({id:"hr1"}).css({margin:"1em"})),ui?(v=$("<div/>").text("Paste in YouTube link"),v.append($("<br />")),v.append($("<input/>").attr({id:"videoEventId",type:"text",placeholder:"https://youtube.com/watch?v=xxxxxxxxxxx",title:"Paste in YouTube link","data-meetingname":t}).css({"margin-right":"5px","margin-bottom":"3px",width:"300px"})),v.append($("<button/>").attr({id:"addEventRow",type:"button",title:"Add"}).addClass("button background-color-hover").text("Add").off("click").on("click",gr)),videoSelector.append(v)):(p=$("<button/>").attr({id:"createYouTubeEvent",type:"button",title:o?"Create a broadcast for this meeting":"Create a live event for this meeting"}).addClass("button background-color-hover").text(o?"Create New Broadcast":"Create New Event").off("click").on("click",function(n){uu(n,t)}),o&&h&&h.length>1?videoSelector.append($("<div/>").css("padding-bottom","5px").append(p)):videoSelector.append($("<div/>").css("text-align","center").append(p)),v=$("<div/>").text(o?"Select Broadcast":"Select Video / Current Live Stream"),v.append($("<br />")),v.append($("<select/>").attr({id:"videoEventId",title:"Start typing the date of the "+(o?"broadcast":"video")+" then select from the drop down the "+(o?"broadcast":"video")+" you would like associated with this meeting"}).css({"margin-left":"5px","margin-right":"5px","margin-bottom":"3px",display:"none"})),v.append($("<button/>").attr({id:"addEventRow",type:"button",title:"Add",disabled:"disabled"}).addClass("button background-color-hover").text("Add").off("click").on("click",o?iu:tu)),v.append($("<span/>").attr({id:"videoLoading"}).append($("<span/>").addClass("fa fa-spinner fa-spin"))),videoSelector.append(v)),videoSelector.append($("<hr/>").attr({id:"hr2"}).css({margin:"1em"}).addClass("hidden currentlySelectedVideos")),videoSelector.append($("<div/>").addClass("hidden currentlySelectedVideos").text("Currently Selected Video(s)")),y=$("<table/>").attr({id:"currentlySelectedVideosTable"}).addClass("hidden currentlySelectedVideos").css({"background-color":"white",width:o?"100%":"300px"}),videoSelector.append(y),o){var tt="",it="",et=[];if(s.length>0)for(a=0;a<s.length>0;a++){var at=s[a].broadcastId,b=s[a].youtubeId,rt=s[a].title;tt=s[a].boxcasterId;it=s[a].youtubeAccountId;et.push(b);y=pi(y,at,b,rt)}if(i.length>0)for(a=0;a<i.length>0;a++)b=i[a].eventId,rt=i[a].eventTitle,et.includes(b)||(y=pi(y,"",b,rt));if(h&&h.length>0){for(k=$("<select/>").attr({id:"boxcastersId"}).css({width:"325px","margin-right":"5px",height:"25px"}),a=0;a<h.length>0;a++)w=h[a].id,nt=h[a].name,k.append("<option value="+w+(tt!=""&&w==tt?" selected":"")+">"+nt+"<\/option>");h.length==1?(k.addClass("hidden"),p.before(k)):(p.before($("<span/>").text("Source")),p.before($("<br/>")),p.before(k))}if(c&&c.length>0){for(ut=$("<select/>").attr({id:"youtubeAccounts"}).css({width:"300px"}).addClass("hidden"),a=0;a<c.length>0;a++)w=c[a].id,nt=c[a].name,ut.append("<option value="+w+(it!=""&&w==it?" selected":"")+">"+nt+"<\/option>");g.append(ut)}}else if(i.length>0)for(a=0;a<i.length>0;a++)ot=i[a].eventId,st=i[a].eventTitle,y=ii(y,ot,st);videoSelector.append($("<hr/>").attr({id:"hr3"}).css({margin:"1em"}));d=$("<span/>").css({"padding-left":"15px"});d.append($("<input/>").attr({id:"startAtFirstTimestamp",type:"checkbox"}).prop("checked",e).off("click").on("click",function(){ct()}));d.append($("<label/>").attr({"for":"startAtFirstTimestamp"}).text("Start At First Timestamp?"));d.append($("<span/>").css({"padding-left":"20px"}).append($("<button/>").attr({id:"saveYouTubeEvents",type:"button",disabled:"disabled",title:"Connect the selected "+(o?"broadcast(s)":"video(s)")+" with this meeting"}).addClass("button button-wide background-color-hover").text("Save").off("click").on("click",fu)));videoSelector.append($("<div/>").append(d));g.append(videoSelector);$("body").prepend(g);$("#videoevent-selector-container").draggable({handle:"div.visHeader",containment:"body",scroll:!1});o&&(f.meetingDateInThePast=f.meetingDateInThePast.replace("video","broadcast").replace("live event","broadcast"),f.meetingStartTimeDoesNotExists=f.meetingStartTimeDoesNotExists.replace("live event","broadcast"),f.meetingNameToLong=f.meetingNameToLong.replace("live event","broadcast"));ui||(ft=$('<div id="searchLiveMsg" class="hidden">'),ft.append(CivicWeb.Common.Notification.create("search-live-msg",CivicWeb.Common.Notification.types.warning,"Searching for the YouTube live stream may take a few minutes.",!1,!1)),$("#hr3").after(ft),o&&h.length==0?($("#hr1").after(CivicWeb.Common.Notification.create("create-event-msg",CivicWeb.Common.Notification.types.warning,"Please validate the BoxCast credentials before creating a broadcast",!1,!1)),$("#createYouTubeEvent").attr({disabled:"disabled"})):r?($("#hr1").after(CivicWeb.Common.Notification.create("create-event-msg",CivicWeb.Common.Notification.types.warning,f.meetingDateInThePast,!1,!1)),$("#createYouTubeEvent").attr({disabled:"disabled"})):u?t.length>100&&($("#hr1").after(CivicWeb.Common.Notification.create("create-event-msg",CivicWeb.Common.Notification.types.warning,f.meetingNameToLong.replace("{0}",t.length),!1,!1)),$("#createYouTubeEvent").attr({disabled:"disabled"})):(ht=window.location.href.indexOf("MeetingDetail.aspx")>-1?f.meetingStartTimeDoesNotExists+".":f.meetingStartTimeDoesNotExists+' from the <a href="/eaengine/MeetingDetail.aspx?id='+l+'">Overview Page.<\/a>',$("#hr1").after(CivicWeb.Common.Notification.create("create-event-msg",CivicWeb.Common.Notification.types.warning,ht,!1,!1)),$("#createYouTubeEvent").attr({disabled:"disabled",title:f.meetingStartTimeDoesNotExists})),ar(!0));(i.length>0||s&&s.length>0)&&$(".currentlySelectedVideos").removeClass("hidden");n.preventDefault()},gr=function(n){var r=nu($("#videoEventId").val());if(r.length>0){var i=r,u=$("#videoEventId").attr("data-meetingname"),t=$("#currentlySelectedVideosTable");i!="0"&&i.length>0&&t.find('a[eventId="'+i+'"]').length==0&&t.children().length<9&&(t=ii(t,i,u),vt(t),$(".currentlySelectedVideos").removeClass("hidden"),$("#videoEventId").val(""),ct());$("#invalid-youtube-msg").remove()}else $("#hr1").after(CivicWeb.Common.Notification.create("invalid-youtube-msg",CivicWeb.Common.Notification.types.warning,"Please enter a valid YouTube broadcast link",!1,!1));n.preventDefault()};var lr=function(n){$(this).closest("tr").remove();$(".selectedEvent").length>0?(vt($("#currentlySelectedVideosTable")),$(".currentlySelectedVideos").removeClass("hidden")):$(".currentlySelectedVideos").addClass("hidden");ct();n.preventDefault()},tu=function(n){var i=$("#videoEventId option:selected").val(),r=$("#videoEventId option:selected").text(),t=$("#currentlySelectedVideosTable");i!="0"&&i.length>0&&t.find('a[eventId="'+i+'"]').length==0&&t.children().length<9&&(t=ii(t,i,r),vt(t),$(".currentlySelectedVideos").removeClass("hidden"),ct());n.preventDefault()},iu=function(n){var i=$("#videoEventId option:selected").val(),r=$("#videoEventId option:selected").text(),t=$("#currentlySelectedVideosTable");i!="0"&&i.length>0&&t.find('a[eventId="'+i+'"]').length==0&&t.children().length<9&&(t=pi(t,i,"",r),vt(t),$(".currentlySelectedVideos").removeClass("hidden"),ct());n.preventDefault()},ii=function(n,t,i){var r=$("<tr/>"),u=$("<td/>").append($("<a/>").attr({href:"https://www.youtube.com/watch?v="+(t.length>0?t:"#"),target:"_blank",eventId:t,eventTitle:i}).addClass("selectedEvent subMenuText").text(i)),f=$("<td/>").css({"text-align":"right"}).append($("<span/>").attr({role:"button",title:"Remove"}).css({color:"#d20000","padding-left":"2em"}).addClass("glyphbutton text-negative button-spacing").off("click").on("click",lr).append($("<span/>").addClass("fas fa-times")));return r.append(u),r.append(f),n.append(r),n},pi=function(n,t,i,r){var u=$("<tr/>"),f=$("<td/>").attr({eventId:i,broadcastId:t,eventTitle:r}).addClass("selectedEvent subMenuText").text(r),e=$("<td/>").append($("<a/>").attr({href:"https://dashboard.boxcast.com/#/events/"+(t.length>0?t:"#"),target:"_blank",eventId:t,eventTitle:r}).text(t.length>0?"Broadcast":"")),o=$("<td/>").append($("<a/>").attr({href:"https://www.youtube.com/watch?v="+(i.length>0?i:"#"),target:"_blank",eventId:i,eventTitle:r}).text(i.length>0?"YouTube":"")),s=$("<td/>").css({"text-align":"right"}).append($("<span/>").attr({role:"button",title:"Remove"}).css({color:"#d20000","padding-left":"2em"}).addClass("glyphbutton text-negative button-spacing").off("click").on("click",lr).append($("<span/>").addClass("fas fa-times")));return u.append(f),u.append(e),u.append(o),u.append(s),n.append(u),n},vt=function(n){var u=[" (Part 1)"," (Part 2)"," (Part 3)"," (Part 4)"," (Part 5)"," (Part 6)"," (Part 7)"," (Part 8)"," (Part 9)"],r,i,t,f;if(n.children().length<10)for(r=n.find(".subMenuText"),i=0;i<r.length;i++)t=$(r[i]).text(),f=t.substring(t.length-u[0].length,t.length),u.indexOf(f)>-1&&(t=t.substring(0,t.length-u[0].length)),$(r[i]).text(t+(r.length>1?u[i]:""))},ct=function(){var n=$("#saveYouTubeEvents");n.parent().addClass("wizard");n.attr("disabled",!1).css({"font-weight":"bold"}).addClass("current")};this.populateYouTubeVideoDropDown=function(){ar(!1)};var ar=function(n){$.ajax({url:"/api/getyoutubevideos",contentType:"application/json",dataType:"json",async:!0,cache:!1,type:"GET",success:function(t){var f=t,r="",u="",i;si=!1;i=$("#videoEventId");i.find("option").remove();i.prepend('<option value="0"><\/option>');$.each(f,function(t,f){f.liveBroadcast=="live"?(r=f.value,u=f.label,si=!0):f.liveBroadcast=="upcoming"?n&&i.append("<option value="+f.value+">"+f.label+" (Event)<\/option>"):i.append("<option value="+f.value+">"+f.label+"<\/option>")});r.length>0&&(i.prepend("<option value="+r+" selected>**Live** "+u+"<\/option>"),videoSelected=!0);$("#addEventRow").removeAttr("disabled");$("#videoLoading").addClass("hidden");ru();si&&$("#videoSelectorInput").val("**Live** "+u)},error:function(){}})},ru=function(){$.widget("custom.combobox",{_create:function(){this.wrapper=$("<span>").addClass("custom-combobox").insertAfter(this.element);this.element.hide();this._createAutocomplete();this._createShowAllButton()},_createAutocomplete:function(){var n=this.element.children(":selected"),t=n.val()?n.text():"";this.input=$("<input id='videoSelectorInput'>").appendTo(this.wrapper).val(t).attr("title","").css({width:"300px","max-width":"300px",background:"white",height:"24px"}).addClass("custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left").autocomplete({delay:0,minLength:0,source:$.proxy(this,"_source")}).tooltip({classes:{"ui-tooltip":"ui-state-highlight"}});this._on(this.input,{autocompleteselect:function(n,t){t.item.option.selected=!0;this._trigger("select",n,{item:t.item.option})},autocompletechange:"_removeIfInvalid"})},_createShowAllButton:function(){var n=this.input,t=!1;$("<a>").attr("tabIndex",-1).attr("title","Show All Items").css({height:"25px","vertical-align":"top","margin-top":"2px","margin-right":"5px"}).tooltip().appendTo(this.wrapper).button({icons:{primary:"ui-icon-triangle-1-s"},text:!1}).removeClass("ui-corner-all").addClass("custom-combobox-toggle ui-corner-right").on("mousedown",function(){t=n.autocomplete("widget").is(":visible")}).on("click",function(){(n.trigger("focus"),t)||n.autocomplete("search","")})},_source:function(n,t){var i=new RegExp($.ui.autocomplete.escapeRegex(n.term),"i");t(this.element.children("option").map(function(){var t=$(this).text();if(this.value&&(!n.term||i.test(t)))return{label:t,value:t,option:this}}))},_removeIfInvalid:function(n,t){if(!t.item){var i=this.input.val(),u=i.toLowerCase(),r=!1;(this.element.children("option").each(function(){if($(this).text().toLowerCase()===u)return this.selected=r=!0,!1}),r)||(this.input.val("").attr("title",i+" didn't match any item").tooltip("open"),this.element.val(""),this._delay(function(){this.input.tooltip("close").attr("title","")},2500),this.input.autocomplete("instance").term="")}},_destroy:function(){this.wrapper.remove();this.element.show()}});$("#videoEventId").combobox();$(".ui-autocomplete").css({"z-index":14e3,"max-height":"165px",overflow:"auto",border:"1px solid transparent"})},uu=function(n,t){var i=$("#currentlySelectedVideosTable");i.children().length<9&&(i=ii(i,"",t),vt(i),$(".currentlySelectedVideos").removeClass("hidden"),ct());n.preventDefault()},fu=function(n){var r,i,t;for($("#saveYouTubeEvents").attr("disabled","disabled").text("Saving").css({"font-weight":"normal"}).removeClass("current").append($("<span/>").addClass("fa fa-spinner fa-spin").css({float:"right","margin-left":"5px","margin-top":"4px"})),r=[],i=$(".selectedEvent"),t=0;t<i.length;t++){var u=$(i[t]).attr("eventId")!=null?$(i[t]).attr("eventId"):"",f=$(i[t]).attr("broadcastId")!=null?$(i[t]).attr("broadcastId"):"",e=$("#boxcastersId option:selected").val(),o=$("#youtubeAccounts option:selected").val(),s=$(i[t]).text();r.push({eventId:u,broadcastId:f,boxcasterId:e,eventTitle:s,youtubeAccountId:o})}kr(r,$("#startAtFirstTimestamp").prop("checked"));r.length>1&&CivicWeb.Common.Instrumentation.recordAction("VMHD: Added multiple events on "+window.location.pathname+" page.",l);n.preventDefault()},wi=function(){var n={};n.MeetingId=l;n.CurrentEvents=r;console.log("getAdditionalEvents");$.ajax({url:"/api/getadditionalevents/"+l.toString(),contentType:"application/json",dataType:"json",async:!0,cache:!1,type:"GET",success:function(n){var t=ou(n),i=t!=null&&t.eventId!=null?t.eventId:"";window.myPlayer!=null&&i.length>0?(yt(),window.myPlayer.loadVideoById(i,0,"large")):window.myPlayer!=null&&window.myPlayer.getPlayerState()==YT.PlayerState.BUFFERING&&setTimeout(function(){wi()},1e4)},error:function(){}})},ri=function(){var n=0,i;oi&&ut<Number.MAX_SAFE_INTEGER&&(n=ut);window.location.href.indexOf("timestamp")>0&&(n=bt.timestamp);i={playVideo:function(n,t){if(typeof YT=="undefined"||typeof YT.Player=="undefined"){window.onYouTubePlayerAPIReady=function(){i.loadPlayer(n,t)};var r=document.createElement("script");r.type="text/javascript";r.src="//www.youtube.com/player_api";$("body").append(r)}else i.loadPlayer(n,t)},loadPlayer:function(i,r){window.myPlayer=new YT.Player(i,{playerVars:{modestbranding:1,rel:0,showinfo:0,autoplay:window.location.href.indexOf("timestamp")>0&&bt.timestamp==n?0:1,start:n},height:y,width:o,videoId:r,events:{onReady:su,onStateChange:hu}});p=$("#videoDiv").detach();t?(p.css("height","100%"),t.prepend(p),gt(null)):u&&(u.prepend(p),gt(null))}};i.playVideo("timeStampVideoDiv",s)},eu=function(){for(var t=[],n,r=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),i=0;i<r.length;i++)n=r[i].split("="),t.push(n[0]),t[n[0]]=n[1];return t},yt=function(){var n,i,t;if(pt&&($("#multiVideoDropDown").remove(),n=CivicWeb.Integration.Video.getEvents(),i=$("<select/>").attr({id:"multiVideoDropDown",width:o-2+"px"}).css({width:o-2+"px","max-width":o-2+"px",margin:"0",padding:"0"}).change(function(){var n=$(this).val();ir(n)}),n!=null&&n.length>1)){for(t=0;t<n.length;t++)i.append($("<option/>").attr({value:n[t].eventId}).css({width:o-2+"px","max-width":o-2+"px"}).text(n[t].eventTitle));i.val(s);$("#timeStampVideoDiv").before(i)}},ou=function(n){for(var t,f=[],u=0;u<r.length;u++)f.push(r[u].eventId);for(t=0;t<n.length;t++)if(f.indexOf(n[t].eventId)==-1)return i=t,s=n[t].eventId,r=n,n[t];return""};(function(){if(wt&&l!=null&&l>0&&or(l),wt&&pr){var n=window.addEventListener?"addEventListener":"attachEvent",t=window[n],i=n=="attachEvent"?"onmessage":"message";t(i,function(n){var r=n.message?"message":"data",t=n[r],i;t.indexOf("ECPlayerTime:")===0&&(i=t.split(":")[1],di(gi,i,!0))},!1)}h&&($("#timeStampSyncVideo").attr({title:"Sync timestamps with recorded audio"}),$("#timeStampVideoButton").attr({title:"Play the recorded audio"}).find("span").text("Play Audio"));pt&&vi(l);bt=eu();nr=/android|webos|iphone|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());fi=/ipad|iphone|ipod/i.test(navigator.userAgent.toLowerCase())})()};CivicWeb.Integration.Video={instance:null,createInstance:function(n){this.instance&&delete this.instance;this.instance=new CivicWeb.Integration.VideoClass(n)},getPublishedVideoUrl:function(n,t){return this.instance.getPublishedVideoUrl(n,t)},addTimestampsAndVideoToMeetingDocument:function(n,t,i){return this.instance.addTimestampsAndVideoToMeetingDocument(n,t,i)},moveVideoToAgendaFrame:function(n,t){return this.instance.moveVideoToAgendaFrame(n,t?t:1)},moveVideoToAttachmentFrame:function(){return this.instance.moveVideoToAttachmentFrame()},addVideoButtonToPortal:function(n,t,i){return this.instance.addVideoButtonToPortal(n,t,i)},getEvents:function(){return this.instance.getEvents()},getCurrentEvent:function(){return this.instance.getCurrentEvent()},getVideoTime:function(n,t,i){return this.instance.getVideoTime(n,t,i)},getSyncMode:function(){return this.instance.getSyncMode()},isAudioOnly:function(){return this.instance.isAudioOnly()},isLive:function(){return this.instance.isLive()},toggleTimeStampSyncMode:function(){return this.instance.toggleTimeStampSyncMode()},hideVideo:function(n){return this.instance.hideVideo(n)},convertSecondsToTimeString:function(n,t,i){return this.instance.convertSecondsToTimeString(n,t,i)},resizeVideo:function(){return this.instance.resizeVideo()},gotoMinutesVideoTimeStamp:function(n){return this.instance.gotoMinutesVideoTimeStamp(n)},showPdfQuickViewVideoLink:function(n,t){return this.instance.showPdfQuickViewVideoLink(n,t)},populateYouTubeVideoDropDown:function(){return this.instance.populateYouTubeVideoDropDown()},events:{}}