Loading
function(e){!function(){var t=function(e){"use strict";e=e||{};var t,r,n,o,a,i,s,c,l,u,h,f,d,p,g,m,b={bgColor:"#d00",textColor:"#fff",fontFamily:"sans-serif",fontStyle:"bold",type:"circle",position:"down",animation:"slide",elementId:!1,dataUrl:!1,win:window};(d={}).ff="u">typeof InstallTrigger,d.chrome=!!window.chrome,d.opera=!!window.opera||navigator.userAgent.indexOf("Opera")>=0,d.ie=!1,d.safari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,d.supported=d.chrome||d.ff||d.opera;var _=[];h=function(){},c=f=!1;var y={};y.ready=function(){c=!0,y.reset(),h()},y.reset=function(){c&&(_=[],l=!1,u=!1,i.clearRect(0,0,o,n),i.drawImage(s,0,0,o,n),x.setIcon(a),window.clearTimeout(p),window.clearTimeout(g))},y.start=function(){if(c&&!u){var e=function(){l=_[0],u=!1,_.length>0&&(_.shift(),y.start())};if(_.length>0){u=!0;var r=function(){["type","animation","bgColor","textColor","fontFamily","fontStyle"].forEach(function(e){e in _[0].options&&(t[e]=_[0].options[e])}),S.run(_[0].options,function(){e()},!1)};l?S.run(l.options,function(){r()},!0):r()}}};var w={},v=function(e){return e.n="number"==typeof e.n?Math.abs(0|e.n):e.n,e.x=o*e.x,e.y=n*e.y,e.w=o*e.w,e.h=n*e.h,e.len=(""+e.n).length,e};function M(e){if(e.paused||e.ended||f)return!1;try{i.clearRect(0,0,o,n),i.drawImage(e,0,0,o,n)}catch(e){}g=setTimeout(function(){M(e)},S.duration),x.setIcon(a)}w.circle=function(e){e=v(e);var r=!1;2===e.len?(e.x=e.x-.4*e.w,e.w=1.4*e.w,r=!0):e.len>=3&&(e.x=e.x-.65*e.w,e.w=1.65*e.w,r=!0),i.clearRect(0,0,o,n),i.drawImage(s,0,0,o,n),i.beginPath(),i.font=t.fontStyle+" "+Math.floor(e.h*(e.n>99?.85:1))+"px "+t.fontFamily,i.textAlign="center",r?(i.moveTo(e.x+e.w/2,e.y),i.lineTo(e.x+e.w-e.h/2,e.y),i.quadraticCurveTo(e.x+e.w,e.y,e.x+e.w,e.y+e.h/2),i.lineTo(e.x+e.w,e.y+e.h-e.h/2),i.quadraticCurveTo(e.x+e.w,e.y+e.h,e.x+e.w-e.h/2,e.y+e.h),i.lineTo(e.x+e.h/2,e.y+e.h),i.quadraticCurveTo(e.x,e.y+e.h,e.x,e.y+e.h-e.h/2),i.lineTo(e.x,e.y+e.h/2),i.quadraticCurveTo(e.x,e.y,e.x+e.h/2,e.y)):i.arc(e.x+e.w/2,e.y+e.h/2,e.h/2,0,2*Math.PI),i.fillStyle="rgba("+t.bgColor.r+","+t.bgColor.g+","+t.bgColor.b+","+e.o+")",i.fill(),i.closePath(),i.beginPath(),i.stroke(),i.fillStyle="rgba("+t.textColor.r+","+t.textColor.g+","+t.textColor.b+","+e.o+")","number"==typeof e.n&&e.n>999?i.fillText((e.n>9999?9:Math.floor(e.n/1e3))+"k+",Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.2*e.h)):i.fillText(e.n,Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.15*e.h)),i.closePath()},w.rectangle=function(e){e=v(e);2===e.len?(e.x=e.x-.4*e.w,e.w=1.4*e.w):e.len>=3&&(e.x=e.x-.65*e.w,e.w=1.65*e.w),i.clearRect(0,0,o,n),i.drawImage(s,0,0,o,n),i.beginPath(),i.font=t.fontStyle+" "+Math.floor(e.h*(e.n>99?.9:1))+"px "+t.fontFamily,i.textAlign="center",i.fillStyle="rgba("+t.bgColor.r+","+t.bgColor.g+","+t.bgColor.b+","+e.o+")",i.fillRect(e.x,e.y,e.w,e.h),i.fillStyle="rgba("+t.textColor.r+","+t.textColor.g+","+t.textColor.b+","+e.o+")","number"==typeof e.n&&e.n>999?i.fillText((e.n>9999?9:Math.floor(e.n/1e3))+"k+",Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.2*e.h)):i.fillText(e.n,Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.15*e.h)),i.closePath()};var x={};function C(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,r,n){return t+t+r+r+n+n});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return!!t&&{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}}function R(e,t){var r,n={};for(r in e)n[r]=e[r];for(r in t)n[r]=t[r];return n}x.getIcon=function(){var e=!1;return t.element?e=t.element:t.elementId?(e=m.getElementById(t.elementId)).setAttribute("href",e.getAttribute("src")):!1===(e=function(){for(var e=m.getElementsByTagName("head")[0].getElementsByTagName("link"),t=e.length,r=t-1;r>=0;r--)if(/(^|\s)icon(\s|$)/i.test(e[r].getAttribute("rel")))return e[r];return!1}())&&((e=m.createElement("link")).setAttribute("rel","icon"),m.getElementsByTagName("head")[0].appendChild(e)),e.setAttribute("type","image/png"),e},x.setIcon=function(e){var n=e.toDataURL("image/png");if(t.dataUrl&&t.dataUrl(n),t.element)t.element.setAttribute("href",n),t.element.setAttribute("src",n);else if(t.elementId){var o=m.getElementById(t.elementId);o.setAttribute("href",n),o.setAttribute("src",n)}else if(d.ff||d.opera){var a=r;r=m.createElement("link"),d.opera&&r.setAttribute("rel","icon"),r.setAttribute("rel","icon"),r.setAttribute("type","image/png"),m.getElementsByTagName("head")[0].appendChild(r),r.setAttribute("href",n),a.parentNode&&a.parentNode.removeChild(a)}else r.setAttribute("href",n)};var S={};S.duration=40,S.types={},S.types.fade=[{x:.4,y:.4,w:.6,h:.6,o:0},{x:.4,y:.4,w:.6,h:.6,o:.1},{x:.4,y:.4,w:.6,h:.6,o:.2},{x:.4,y:.4,w:.6,h:.6,o:.3},{x:.4,y:.4,w:.6,h:.6,o:.4},{x:.4,y:.4,w:.6,h:.6,o:.5},{x:.4,y:.4,w:.6,h:.6,o:.6},{x:.4,y:.4,w:.6,h:.6,o:.7},{x:.4,y:.4,w:.6,h:.6,o:.8},{x:.4,y:.4,w:.6,h:.6,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],S.types.none=[{x:.4,y:.4,w:.6,h:.6,o:1}],S.types.pop=[{x:1,y:1,w:0,h:0,o:1},{x:.9,y:.9,w:.1,h:.1,o:1},{x:.8,y:.8,w:.2,h:.2,o:1},{x:.7,y:.7,w:.3,h:.3,o:1},{x:.6,y:.6,w:.4,h:.4,o:1},{x:.5,y:.5,w:.5,h:.5,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],S.types.popFade=[{x:.75,y:.75,w:0,h:0,o:0},{x:.65,y:.65,w:.1,h:.1,o:.2},{x:.6,y:.6,w:.2,h:.2,o:.4},{x:.55,y:.55,w:.3,h:.3,o:.6},{x:.5,y:.5,w:.4,h:.4,o:.8},{x:.45,y:.45,w:.5,h:.5,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],S.types.slide=[{x:.4,y:1,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.8,w:.6,h:.6,o:1},{x:.4,y:.7,w:.6,h:.6,o:1},{x:.4,y:.6,w:.6,h:.6,o:1},{x:.4,y:.5,w:.6,h:.6,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],S.run=function(e,r,n,o){var i=S.types[m.hidden||m.msHidden||m.webkitHidden||m.mozHidden?"none":t.animation];(o=!0===n?void 0!==o?o:i.length-1:void 0!==o?o:0,r=r||function(){},o<i.length&&o>=0)?(w[t.type](R(e,i[o])),p=setTimeout(function(){n?o-=1:o+=1,S.run(e,r,n,o)},S.duration),x.setIcon(a)):r()},(t=R(b,e)).bgColor=C(t.bgColor),t.textColor=C(t.textColor),t.position=t.position.toLowerCase(),t.animation=S.types[""+t.animation]?t.animation:b.animation,m=t.win.document;var E=t.position.indexOf("up")>-1,A=t.position.indexOf("left")>-1;if(E||A)for(var I=0;I<S.types[""+t.animation].length;I++){var T=S.types[""+t.animation][I];E&&(T.y<.6?T.y=T.y-.4:T.y=T.y-2*T.y+(1-T.w)),A&&(T.x<.6?T.x=T.x-.4:T.x=T.x-2*T.x+(1-T.h)),S.types[""+t.animation][I]=T}return t.type=w[""+t.type]?t.type:b.type,r=x.getIcon(),a=document.createElement("canvas"),s=document.createElement("img"),r.hasAttribute("href")?(s.setAttribute("crossOrigin","anonymous"),s.onload=function(){n=s.height>0?s.height:32,o=s.width>0?s.width:32,a.height=n,a.width=o,i=a.getContext("2d"),y.ready()},s.setAttribute("src",r.getAttribute("href"))):(s.onload=function(){n=32,o=32,s.height=n,s.width=o,a.height=n,a.width=o,i=a.getContext("2d"),y.ready()},s.setAttribute("src","")),{badge:function(e,t){t=("string"==typeof t?{animation:t}:t)||{},h=function(){try{if("number"==typeof e?e>0:""!==e){var r={type:"badge",options:{n:e}};if("animation"in t&&S.types[""+t.animation]&&(r.options.animation=""+t.animation),"type"in t&&w[""+t.type]&&(r.options.type=""+t.type),["bgColor","textColor"].forEach(function(e){e in t&&(r.options[e]=C(t[e]))}),["fontStyle","fontFamily"].forEach(function(e){e in t&&(r.options[e]=t[e])}),_.push(r),_.length>100)throw Error("Too many badges requests in queue.");y.start()}else y.reset()}catch(e){throw Error("Error setting badge. Message: "+e.message)}},c&&h()},video:function(e){h=function(){try{if("stop"===e){f=!0,y.reset(),f=!1;return}e.addEventListener("play",function(){M(this)},!1)}catch(e){throw Error("Error setting video. Message: "+e.message)}},c&&h()},image:function(e){h=function(){try{var t=e.width,r=e.height,s=document.createElement("img"),c=t/o<r/n?t/o:r/n;s.setAttribute("crossOrigin","anonymous"),s.onload=function(){i.clearRect(0,0,o,n),i.drawImage(s,0,0,o,n),x.setIcon(a)},s.setAttribute("src",e.getAttribute("src")),s.height=r/c,s.width=t/c}catch(e){throw Error("Error setting image. Message: "+e.message)}},c&&h()},webcam:function(e){if(window.URL&&window.URL.createObjectURL||(window.URL=window.URL||{},window.URL.createObjectURL=function(e){return e}),d.supported){var t=!1;navigator.getUserMedia=navigator.getUserMedia||navigator.oGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia,h=function(){try{if("stop"===e){f=!0,y.reset(),f=!1;return}(t=document.createElement("video")).width=o,t.height=n,navigator.getUserMedia({video:!0,audio:!1},function(e){t.src=URL.createObjectURL(e),t.play(),M(t)},function(){})}catch(e){throw Error("Error setting webcam. Message: "+e.message)}},c&&h()}},reset:y.reset,browser:{supported:d.supported}}};"u">typeof define&&define.amd?define([],function(){return t}):e.exports?e.exports=t:this.Favico=t}()}