You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
824 KiB

function BigInteger(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function nbi(){return new BigInteger(null)}function am1(e,t,n,i,a,o){for(;--o>=0;){var r=t*this[e++]+n[i]+a;a=Math.floor(r/67108864),n[i++]=67108863&r}return a}function am2(e,t,n,i,a,o){for(var r=32767&t,s=t>>15;--o>=0;){var c=32767&this[e],l=this[e++]>>15,d=s*c+l*r;c=r*c+((32767&d)<<15)+n[i]+(1073741823&a),a=(c>>>30)+(d>>>15)+s*l+(a>>>30),n[i++]=1073741823&c}return a}function am3(e,t,n,i,a,o){for(var r=16383&t,s=t>>14;--o>=0;){var c=16383&this[e],l=this[e++]>>14,d=s*c+l*r;c=r*c+((16383&d)<<14)+n[i]+a,a=(c>>28)+(d>>14)+s*l,n[i++]=268435455&c}return a}function int2char(e){return BI_RM.charAt(e)}function intAt(e,t){var n=BI_RC[e.charCodeAt(t)];return null==n?-1:n}function bnpCopyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function bnpFromInt(e){this.t=1,this.s=0>e?-1:0,e>0?this[0]=e:-1>e?this[0]=e+this.DV:this.t=0}function nbv(e){var t=nbi();return t.fromInt(e),t}function bnpFromString(e,t,n){var i;if(16==t)i=4;else if(8==t)i=3;else if(256==t)i=8;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)return void this.fromRadix(e,t);i=2}this.t=0,this.s=0;for(var a=e.length,o=!1,r=0;--a>=0;){var s=8==i?255&e[a]:intAt(e,a);0>s?"-"==e.charAt(a)&&(o=!0):(o=!1,0==r?this[this.t++]=s:r+i>this.DB?(this[this.t-1]|=(s&(1<<this.DB-r)-1)<<r,this[this.t++]=s>>this.DB-r):this[this.t-1]|=s<<r,r+=i,r>=this.DB&&(r-=this.DB))}8==i&&0!=(128&e[0])&&n&&(this.s=-1,r>0&&(this[this.t-1]|=(1<<this.DB-r)-1<<r)),this.clamp(),o&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function bnToString(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,i=(1<<t)-1,a=!1,o="",r=this.t,s=this.DB-r*this.DB%t;if(r-->0)for(s<this.DB&&(n=this[r]>>s)>0&&(a=!0,o=int2char(n));r>=0;)t>s?(n=(this[r]&(1<<s)-1)<<t-s,n|=this[--r]>>(s+=this.DB-t)):(n=this[r]>>(s-=t)&i,0>=s&&(s+=this.DB,--r)),n>0&&(a=!0),a&&(o+=int2char(n));return a?o:"0"}function bnNegate(){var e=nbi();return BigInteger.ZERO.subTo(this,e),e}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(t=n-e.t,0!=t)return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0}function nbits(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s}function bnpDRShiftTo(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s}function bnpLShiftTo(e,t){var n,i=e%this.DB,a=this.DB-i,o=(1<<a)-1,r=Math.floor(e/this.DB),s=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)t[n+r+1]=this[n]>>a|s,s=(this[n]&o)<<i;for(n=r-1;n>=0;--n)t[n]=0;t[r]=s,t.t=this.t+r+1,t.s=this.s,t.clamp()}function bnpRShiftTo(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)return void(t.t=0);var i=e%this.DB,a=this.DB-i,o=(1<<i)-1;t[0]=this[n]>>i;for(var r=n+1;r<this.t;++r)t[r-n-1]|=(this[r]&o)<<a,t[r-n]=this[r]>>i;i>0&&(t[this.t-n-1]|=(this.s&o)<<a),t.t=this.t-n,t.clamp()}function bnpSubTo(e,t){for(var n=0,i=0,a=Math.min(e.t,this.t);a>n;)i+=this[n]-e[n],t[n++]=i&this.DM,i>>=this.DB;if(e.t<this.t){for(i-=e.s;n<this.t;)i+=this[n],t[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<e.t;)i-=e[n],t[n++]=i&this.DM,i>>=this.DB;i-=e.s}t.s=0>i?-1:0,-1>i?t[n++]=this.DV+i:i>0&&(t[n++]=i),t.t=n,t.clamp()}function bnpMultiplyTo(e,t){var n=this.abs(),i=e.abs(),a=n.t;for(t.t=a+i.t;--a>=0;)t[a]=0;for(a=0;a<i.t;++a)t[a+n.t]=n.am(0,i[a],t,a,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&BigInteger.ZERO.subTo(t,t)}function bnpSquareTo(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var i=t.a
return e}function T(e,t,n){var i=ln.exec(t);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):t}function E(e,t,n,i,a){for(var o=n===(i?"border":"content")?4:"width"===t?1:0,r=0;4>o;o+=2)"margin"===n&&(r+=at.css(e,n+xt[o],!0,a)),i?("content"===n&&(r-=at.css(e,"padding"+xt[o],!0,a)),"margin"!==n&&(r-=at.css(e,"border"+xt[o]+"Width",!0,a))):(r+=at.css(e,"padding"+xt[o],!0,a),"padding"!==n&&(r+=at.css(e,"border"+xt[o]+"Width",!0,a)));return r}function I(e,t,n){var i=!0,a="width"===t?e.offsetWidth:e.offsetHeight,o=en(e),r=nt.boxSizing&&"border-box"===at.css(e,"boxSizing",!1,o);if(0>=a||null==a){if(a=tn(e,t,o),(0>a||null==a)&&(a=e.style[t]),an.test(a))return a;i=r&&(nt.boxSizingReliable()||a===e.style[t]),a=parseFloat(a)||0}return a+E(e,t,n||(r?"border":"content"),i,o)+"px"}function D(e,t,n,i,a){return new D.prototype.init(e,t,n,i,a)}function P(){return setTimeout(function(){hn=void 0}),hn=at.now()}function N(e,t){var n,i={height:e},a=0;for(t=t?1:0;4>a;a+=2-t)n=xt[a],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function L(e,t,n){for(var i,a=(bn[t]||[]).concat(bn["*"]),o=0,r=a.length;r>o;o++)if(i=a[o].call(n,t,e))return i}function U(e,t,n){var i,a,o,r,s,c,l,d,u=this,p={},m=e.style,h=e.nodeType&&At(e),f=at._data(e,"fxshow");n.queue||(s=at._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,c=s.empty.fire,s.empty.fire=function(){s.unqueued||c()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,at.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[m.overflow,m.overflowX,m.overflowY],l=at.css(e,"display"),d="none"===l?at._data(e,"olddisplay")||S(e.nodeName):l,"inline"===d&&"none"===at.css(e,"float")&&(nt.inlineBlockNeedsLayout&&"inline"!==S(e.nodeName)?m.zoom=1:m.display="inline-block")),n.overflow&&(m.overflow="hidden",nt.shrinkWrapBlocks()||u.always(function(){m.overflow=n.overflow[0],m.overflowX=n.overflow[1],m.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],gn.exec(a)){if(delete t[i],o=o||"toggle"===a,a===(h?"hide":"show")){if("show"!==a||!f||void 0===f[i])continue;h=!0}p[i]=f&&f[i]||at.style(e,i)}else l=void 0;if(at.isEmptyObject(p))"inline"===("none"===l?S(e.nodeName):l)&&(m.display=l);else{f?"hidden"in f&&(h=f.hidden):f=at._data(e,"fxshow",{}),o&&(f.hidden=!h),h?at(e).show():u.done(function(){at(e).hide()}),u.done(function(){var t;at._removeData(e,"fxshow");for(t in p)at.style(e,t,p[t])});for(i in p)r=L(h?f[i]:0,i,u),i in f||(f[i]=r.start,h&&(r.end=r.start,r.start="width"===i||"height"===i?1:0))}}function O(e,t){var n,i,a,o,r;for(n in e)if(i=at.camelCase(n),a=t[i],o=e[n],at.isArray(o)&&(a=o[1],o=e[n]=o[0]),n!==i&&(e[i]=o,delete e[n]),r=at.cssHooks[i],r&&"expand"in r){o=r.expand(o),delete e[i];for(n in o)n in e||(e[n]=o[n],t[n]=a)}else t[i]=a}function F(e,t,n){var i,a,o=0,r=vn.length,s=at.Deferred().always(function(){delete c.elem}),c=function(){if(a)return!1;for(var t=hn||P(),n=Math.max(0,l.startTime+l.duration-t),i=n/l.duration||0,o=1-i,r=0,c=l.tweens.length;c>r;r++)l.tweens[r].run(o);return s.notifyWith(e,[l,o,n]),1>o&&c?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:at.extend({},t),opts:at.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:hn||P(),duration:n.duration,tweens:[],createTween:function(t,n){var i=at.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(i),i},stop:function(t){var n=0,i=t?l.tweens.length:0;if(a)return this;for(a=!0;i>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),d=l.props;for(O(d,l.opts.specialEasing);r>o;o++)if(i=vn[o].call(l,e,d,l.opts))return i;return at.map(d,L,l),at.isFunction(l.opts.start)&&l.opts.start.call(e,l),at.fx.timer(at.extend(c,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function B(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,a=0,o=t.toLowerCase().match(vt)||[];if(at.isFunction(n))for(;i=o[a++];)"+"===i.charAt(0)?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}f
}});var vt=/\S+/g,bt={};at.Callbacks=function(e){e="string"==typeof e?bt[e]||o(e):at.extend({},e);var t,n,i,a,r,s,c=[],l=!e.once&&[],d=function(o){for(n=e.memory&&o,i=!0,r=s||0,s=0,a=c.length,t=!0;c&&a>r;r++)if(c[r].apply(o[0],o[1])===!1&&e.stopOnFalse){n=!1;break}t=!1,c&&(l?l.length&&d(l.shift()):n?c=[]:u.disable())},u={add:function(){if(c){var i=c.length;!function o(t){at.each(t,function(t,n){var i=at.type(n);"function"===i?e.unique&&u.has(n)||c.push(n):n&&n.length&&"string"!==i&&o(n)})}(arguments),t?a=c.length:n&&(s=i,d(n))}return this},remove:function(){return c&&at.each(arguments,function(e,n){for(var i;(i=at.inArray(n,c,i))>-1;)c.splice(i,1),t&&(a>=i&&a--,r>=i&&r--)}),this},has:function(e){return e?at.inArray(e,c)>-1:!(!c||!c.length)},empty:function(){return c=[],a=0,this},disable:function(){return c=l=n=void 0,this},disabled:function(){return!c},lock:function(){return l=void 0,n||u.disable(),this},locked:function(){return!l},fireWith:function(e,n){return!c||i&&!l||(n=n||[],n=[e,n.slice?n.slice():n],t?l.push(n):d(n)),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!i}};return u},at.extend({Deferred:function(e){var t=[["resolve","done",at.Callbacks("once memory"),"resolved"],["reject","fail",at.Callbacks("once memory"),"rejected"],["notify","progress",at.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return a.done(arguments).fail(arguments),this},then:function(){var e=arguments;return at.Deferred(function(n){at.each(t,function(t,o){var r=at.isFunction(e[t])&&e[t];a[o[1]](function(){var e=r&&r.apply(this,arguments);e&&at.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?at.extend(e,i):i}},a={};return i.pipe=i.then,at.each(t,function(e,o){var r=o[2],s=o[3];i[o[1]]=r.add,s&&r.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),a[o[0]]=function(){return a[o[0]+"With"](this===a?i:this,arguments),this},a[o[0]+"With"]=r.fireWith}),i.promise(a),e&&e.call(a,a),a},when:function(e){var t,n,i,a=0,o=X.call(arguments),r=o.length,s=1!==r||e&&at.isFunction(e.promise)?r:0,c=1===s?e:at.Deferred(),l=function(e,n,i){return function(a){n[e]=this,i[e]=arguments.length>1?X.call(arguments):a,i===t?c.notifyWith(n,i):--s||c.resolveWith(n,i)}};if(r>1)for(t=new Array(r),n=new Array(r),i=new Array(r);r>a;a++)o[a]&&at.isFunction(o[a].promise)?o[a].promise().done(l(a,i,o)).fail(c.reject).progress(l(a,n,t)):--s;return s||c.resolveWith(i,o),c.promise()}});var wt;at.fn.ready=function(e){return at.ready.promise().done(e),this},at.extend({isReady:!1,readyWait:1,holdReady:function(e){e?at.readyWait++:at.ready(!0)},ready:function(e){if(e===!0?!--at.readyWait:!at.isReady){if(!ht.body)return setTimeout(at.ready);at.isReady=!0,e!==!0&&--at.readyWait>0||(wt.resolveWith(ht,[at]),at.fn.triggerHandler&&(at(ht).triggerHandler("ready"),at(ht).off("ready")))}}}),at.ready.promise=function(t){if(!wt)if(wt=at.Deferred(),"complete"===ht.readyState)setTimeout(at.ready);else if(ht.addEventListener)ht.addEventListener("DOMContentLoaded",s,!1),e.addEventListener("load",s,!1);else{ht.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&ht.documentElement}catch(i){}n&&n.doScroll&&!function a(){if(!at.isReady){try{n.doScroll("left")}catch(e){return setTimeout(a,50)}r(),at.ready()}}()}return wt.promise(t)};var $t,kt="undefined";for($t in at(nt))break;nt.ownLast="0"!==$t,nt.inlineBlockNeedsLayout=!1,at(function(){var e,t,n,i;n=ht.getElementsByTagName("body")[0],n&&n.style&&(t=ht.createElement("div"),i=ht.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(t),typeof t.style.zoom!==kt&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",nt.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(i))}),function(){var e=ht.createElement("div");if(null==nt.deleteExpando){nt.deleteExpando=
return e&&e.get?e.get(this):D.propHooks._default.get(this)},run:function(e){var t,n=D.propHooks[this.prop];return this.pos=t=this.options.duration?at.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):D.propHooks._default.set(this),this}},D.prototype.init.prototype=D.prototype,D.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=at.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){at.fx.step[e.prop]?at.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[at.cssProps[e.prop]]||at.cssHooks[e.prop])?at.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},D.propHooks.scrollTop=D.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},at.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},at.fx=D.prototype.init,at.fx.step={};var hn,fn,gn=/^(?:toggle|show|hide)$/,_n=new RegExp("^(?:([+-])=|)("+Mt+")([a-z%]*)$","i"),yn=/queueHooks$/,vn=[U],bn={"*":[function(e,t){var n=this.createTween(e,t),i=n.cur(),a=_n.exec(t),o=a&&a[3]||(at.cssNumber[e]?"":"px"),r=(at.cssNumber[e]||"px"!==o&&+i)&&_n.exec(at.css(n.elem,e)),s=1,c=20;if(r&&r[3]!==o){o=o||r[3],a=a||[],r=+i||1;do s=s||".5",r/=s,at.style(n.elem,e,r+o);while(s!==(s=n.cur()/i)&&1!==s&&--c)}return a&&(r=n.start=+r||+i||0,n.unit=o,n.end=a[1]?r+(a[1]+1)*a[2]:+a[2]),n}]};at.Animation=at.extend(F,{tweener:function(e,t){at.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,i=0,a=e.length;a>i;i++)n=e[i],bn[n]=bn[n]||[],bn[n].unshift(t)},prefilter:function(e,t){t?vn.unshift(e):vn.push(e)}}),at.speed=function(e,t,n){var i=e&&"object"==typeof e?at.extend({},e):{complete:n||!n&&t||at.isFunction(e)&&e,duration:e,easing:n&&t||t&&!at.isFunction(t)&&t};return i.duration=at.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in at.fx.speeds?at.fx.speeds[i.duration]:at.fx.speeds._default,(null==i.queue||i.queue===!0)&&(i.queue="fx"),i.old=i.complete,i.complete=function(){at.isFunction(i.old)&&i.old.call(this),i.queue&&at.dequeue(this,i.queue)},i},at.fn.extend({fadeTo:function(e,t,n,i){return this.filter(At).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var a=at.isEmptyObject(e),o=at.speed(t,n,i),r=function(){var t=F(this,at.extend({},e),o);(a||at._data(this,"finish"))&&t.stop(!0)};return r.finish=r,a||o.queue===!1?this.each(r):this.queue(o.queue,r)},stop:function(e,t,n){var i=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,a=null!=e&&e+"queueHooks",o=at.timers,r=at._data(this);if(a)r[a]&&r[a].stop&&i(r[a]);else for(a in r)r[a]&&r[a].stop&&yn.test(a)&&i(r[a]);for(a=o.length;a--;)o[a].elem!==this||null!=e&&o[a].queue!==e||(o[a].anim.stop(n),t=!1,o.splice(a,1));(t||!n)&&at.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=at._data(this),i=n[e+"queue"],a=n[e+"queueHooks"],o=at.timers,r=i?i.length:0;for(n.finish=!0,at.queue(this,e,[]),a&&a.stop&&a.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;r>t;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish})}}),at.each(["toggle","show","hide"],function(e,t){var n=at.fn[t];at.fn[t]=function(e,i,a){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(N(t,!0),e,i,a)}}),at.each({slideDown:N("show"),slideUp:N("hide"),slideToggle:N("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){at.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}}),at.timers=[],at.fx.tick=function(){var e,t=at.timers,n=0;for(hn=at.now();n<t.length;n++)e=t[n],e()||t[n]!==e||t.splice(n--,1);t.length||at.fx.stop(),hn=void 0},at.fx.timer=function(e){at.timers.push(e),e()?at.fx.start():at.timers.pop()},at.fx.interval=13,at.fx.start=functio
}function n(){c=!0}function i(){return c?(c=!1,""):s}function a(){var e,t,n,a=Array.prototype.slice.call(arguments),o=a.pop(),r=[],s=1==a.length,c=!0,p=i();for(t=0;t<a.length;t++)if(n=a[t]=p+a[t],void 0!==l[n])r.push(l[n]);else if(u){try{e=localStorage.getItem(n)}catch(m){u=!1}try{e=void 0===e||null===e?!1:JSON.parse(e)}catch(m){e=!1}r.push(l[n]=e)}else d?c=!1:r.push(l[n]=!1);return c?o(s?r[0]:r):void chrome.storage.local.get(a,function(e){var i;for(r=[],t=0;t<a.length;t++)n=a[t],i=e[n],i=void 0===i||null===i?!1:JSON.parse(i),r.push(l[n]=i);o(s?r[0]:r)})}function o(e,t){var n,a,o={},r=i();for(n in e)if(e.hasOwnProperty(n))if(a=e[n],n=r+n,l[n]=a,a=JSON.stringify(a),u)try{localStorage.setItem(n,a)}catch(s){u=!1}else o[n]=a;return u||!d?void(t&&t()):void chrome.storage.local.set(o,t)}function r(){var e,t,n,a=Array.prototype.slice.call(arguments),o=i();for("function"==typeof a[a.length-1]&&(n=a.pop()),e=0;e<a.length;e++)if(t=a[e]=o+a[e],delete l[t],u)try{localStorage.removeItem(t)}catch(r){u=!1}d?chrome.storage.local.remove(a,n):n&&n()}var s="",c=!1,l={},d=!!(e.chrome&&chrome.storage&&chrome.storage.local),u=!d&&!!e.localStorage;e.ConfigStorage={prefix:t,noPrefix:n,get:a,set:o,remove:r}}(this),function(){try{window==window.top||window.chrome&&chrome.app&&chrome.app.window?document.documentElement.style.display="block":top.location=self.location}catch(e){console.error("CJ protection",e)}if(window.safeConfirm=function(e,t){"string"==typeof e&&(e={message:e});var n=!1;try{n=confirm(e.message)}catch(i){n=!0}setTimeout(function(){t(n)},10)},window.applicationCache&&!Config.Modes.packed&&window.addEventListener){var t=window.applicationCache,n=!1,i=!1,a=function(e){clearTimeout(i),i=setTimeout(function(){try{t.update()}catch(e){console.log("appCache.update: "+e)}},e||3e5)},o=function(){t.addEventListener("updateready",function(){t.status==t.UPDATEREADY&&(n||(safeConfirm({type:"WEBOGRAM_UPDATED_RELOAD",message:"A new version of Webogram is downloaded. Launch it?"},function(e){e?window.location.reload():n=!0}),a()))},!1),t.addEventListener("noupdate",function(){a()},!1),t.addEventListener("error",function(){a()},!1)};a(3e3),window.addEventListener("load",o)}}(),function(){var e=[Config.Navigator.osX?"osx":"non_osx",Config.Navigator.retina?"is_2x":"is_1x"];Config.Modes.ios_standalone&&e.push("ios_standalone"),$(document.body).addClass(e.join(" ")),ConfigStorage.get("current_layout","i18n_locale",function(e){var t=e[0],n=e[1],i="en-us",a={dom:!1,i18n_ng:!1,i18n_messages:!1,i18n_fallback:!1},o=function(){var e,t=!0;for(e in a)if(a.hasOwnProperty(e)&&a[e]===!1){t=!1;break}t&&(a.boot=!1,angular.bootstrap(document,["myApp"]))};switch(t){case"mobile":Config.Mobile=!0;break;case"desktop":Config.Mobile=!1;break;default:Config.Mobile=Config.Navigator.mobile||$(window).width()<480}$("head").append('<link rel="stylesheet" href="css/'+(Config.Mobile?"mobile.css":"desktop.css")+'" />'),n||(n=(navigator.language||"").toLowerCase(),n=Config.I18n.aliases[n]||n);for(var r=0;r<Config.I18n.supported.length;r++)if(Config.I18n.supported[r]==n){Config.I18n.locale=n;break}a.i18n_ng=Config.I18n.locale==i,$.getJSON("js/locales/"+Config.I18n.locale+".json").success(function(e){Config.I18n.messages=e,a.i18n_messages=!0,Config.I18n.locale==i&&(a.i18n_fallback=!0),o()}),Config.I18n.locale!=i&&$.getJSON("js/locales/"+i+".json").success(function(e){Config.I18n.fallback_messages=e,a.i18n_fallback=!0,o()}),$(document).ready(function(){a.dom=!0,a.i18n_ng?o():$("<script>").appendTo("body").on("load",function(){a.i18n_ng=!0,o()}).attr("src","vendor/angular/i18n/angular-locale_"+Config.I18n.locale+".js")})})}(),function(e,t,n){"use strict";var i,a,o,r,s,c,l,d,u,p,m,h,f,g,_,y,v,b,w,$,k,C,S,M,x,A,T,E,I,D,P;S={paneClass:"nano-pane",sliderClass:"nano-slider",contentClass:"nano-content",iOSNativeScrolling:!1,preventPageScrolling:!1,disableResize:!1,alwaysVisible:!1,flashDelay:1500,sliderMinHeight:20,sliderMaxHeight:null,documentContext:null,windowContext:null},b="scrollbar",v="scroll",u="mousedown",p="mouseenter",m="mousemove",f="mousewheel",h="mouseup",y="resize",s="drag",
}var n=i("$injector"),a=i("ng"),o=t(e,"angular",Object);return o.$$minErr=o.$$minErr||i,t(o,"module",function(){var e={};return function(i,o,r){var s=function(e,t){if("hasOwnProperty"===e)throw a("badname","hasOwnProperty is not a valid {0} name",t)};return s(i,"module"),o&&e.hasOwnProperty(i)&&(e[i]=null),t(e,i,function(){function e(e,n,i,a){return a||(a=t),function(){return a[i||"push"]([e,n,arguments]),l}}if(!o)throw n("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",i);var t=[],a=[],s=[],c=e("$injector","invoke","push",a),l={_invokeQueue:t,_configBlocks:a,_runBlocks:s,requires:o,name:i,provider:e("$provide","provider"),factory:e("$provide","factory"),service:e("$provide","service"),value:e("$provide","value"),constant:e("$provide","constant","unshift"),animation:e("$animateProvider","register"),filter:e("$filterProvider","register"),controller:e("$controllerProvider","register"),directive:e("$compileProvider","directive"),config:c,run:function(e){return s.push(e),this}};return r&&c(r),l})}})}function dt(t){u(t,{bootstrap:J,copy:L,extend:u,equals:O,element:Ri,forEach:o,injector:Bt,noop:h,bind:R,toJson:H,fromJson:j,identity:f,isUndefined:_,isDefined:y,isString:b,isFunction:k,isObject:v,isNumber:w,isElement:I,isArray:Zi,version:na,isDate:$,lowercase:Ni,uppercase:Ui,callbacks:{counter:0},getTestability:et,$$minErr:i,$$csp:Ji,reloadWithDebugInfo:Q,$$hasClass:Ct}),Hi=lt(e);try{Hi("ngLocale")}catch(n){Hi("ngLocale",[]).provider("$locale",ln)}Hi("ng",["ngLocale"],["$provide",function(e){e.provider({$$sanitizeUri:On}),e.provider("$compile",Wt).directive({a:Qa,input:vo,textarea:vo,form:ao,script:cr,select:ur,style:mr,option:pr,ngBind:Fo,ngBindHtml:Ro,ngBindTemplate:Bo,ngClass:qo,ngClassEven:jo,ngClassOdd:Ho,ngCloak:zo,ngController:Vo,ngForm:oo,ngHide:nr,ngIf:Ko,ngInclude:Xo,ngInit:Yo,ngNonBindable:Jo,ngPluralize:Qo,ngRepeat:er,ngShow:tr,ngStyle:ir,ngSwitch:ar,ngSwitchWhen:or,ngSwitchDefault:rr,ngOptions:dr,ngTransclude:sr,ngModel:Ao,ngList:No,ngChange:To,pattern:Io,ngPattern:Io,required:Eo,ngRequired:Eo,minlength:Po,ngMinlength:Po,maxlength:Do,ngMaxlength:Do,ngValue:Uo,ngModelOptions:Oo}).directive({ngInclude:Zo}).directive(eo).directive(Wo),e.provider({$anchorScroll:Rt,$animate:Ma,$browser:jt,$cacheFactory:zt,$controller:Xt,$document:Zt,$exceptionHandler:Yt,$filter:Zn,$interpolate:sn,$interval:cn,$http:nn,$httpBackend:on,$location:$n,$log:kn,$parse:In,$rootScope:Un,$q:Dn,$$q:Pn,$sce:Hn,$sceDelegate:qn,$sniffer:jn,$templateCache:Vt,$templateRequest:zn,$$testability:Vn,$timeout:Wn,$window:Xn,$$rAF:Ln,$$asyncCallback:qt})}])}function ut(){return++aa}function pt(e){return e.replace(sa,function(e,t,n,i){return i?n.toUpperCase():n}).replace(ca,"Moz$1")}function mt(e){return!pa.test(e)}function ht(e){var t=e.nodeType;return 1===t||!t||9===t}function ft(e,t){var n,i,a,r,s=t.createDocumentFragment(),c=[];if(mt(e))c.push(t.createTextNode(e));else{for(n=n||s.appendChild(t.createElement("div")),i=(ma.exec(e)||["",""])[1].toLowerCase(),a=fa[i]||fa._default,n.innerHTML=a[1]+e.replace(ha,"<$1></$2>")+a[2],r=a[0];r--;)n=n.lastChild;c=F(c,n.childNodes),n=s.firstChild,n.textContent=""}return s.textContent="",s.innerHTML="",o(c,function(e){s.appendChild(e)}),s}function gt(e,n){n=n||t;var i;return(i=ua.exec(e))?[n.createElement(i[1])]:(i=ft(e,n))?i.childNodes:[]}function _t(e){if(e instanceof _t)return e;var t;if(b(e)&&(e=Yi(e),t=!0),!(this instanceof _t)){if(t&&"<"!=e.charAt(0))throw da("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new _t(e)}t?xt(this,gt(e)):xt(this,e)}function yt(e){return e.cloneNode(!0)}function vt(e,t){if(t||wt(e),e.querySelectorAll)for(var n=e.querySelectorAll("*"),i=0,a=n.length;a>i;i++)wt(n[i])}function bt(e,t,n,i){if(y(i))throw da("offargs","jqLite#off() does not support the `selector` argument");var a=$t(e),r=a&&a.events,s=a&&a.handle;if(s)if(t)o(t.split(" "),function(t){_(n)?(ra(e,t,r[t]),delete
}))}),n.length>0&&(e+=(-1==e.indexOf("?")?"?":"&")+n.join("&")),e}var C=i("$http"),S=[];return o(l,function(e){S.unshift(b(e)?p.get(e):p.invoke(e))}),m.pendingRequests=[],h("get","delete","head","jsonp"),f("post","put","patch"),m.defaults=r,m}]}function an(t){if(8>=Bi&&(!t.match(/^(get|post|head|put|delete|options)$/i)||!e.XMLHttpRequest))return new e.ActiveXObject("Microsoft.XMLHTTP");if(e.XMLHttpRequest)return new e.XMLHttpRequest;throw i("$httpBackend")("noxhr","This browser does not support XMLHttpRequest.")}function on(){this.$get=["$browser","$window","$document",function(e,t,n){return rn(e,an,e.defer,t.angular.callbacks,n[0])}]}function rn(e,t,n,i,a){function r(e,t,n){var o=a.createElement("script"),r=null;return o.type="text/javascript",o.src=e,o.async=!0,r=function(e){ra(o,"load",r),ra(o,"error",r),a.body.removeChild(o),o=null;var s=-1,c="unknown";e&&("load"!==e.type||i[t].called||(e={type:"error"}),c=e.type,s="error"===e.type?404:200),n&&n(s,c)},oa(o,"load",r),oa(o,"error",r),a.body.appendChild(o),r}var s=-1;return function(a,c,l,d,u,p,m,f){function g(){v=s,w&&w(),$&&$.abort()}function _(t,i,a,o,r){C&&n.cancel(C),w=$=null,0===i&&(i=a?200:"file"==Gn(c).protocol?404:0),i=1223===i?204:i,r=r||"",t(i,a,o,r),e.$$completeOutstandingRequest(h)}var v;if(e.$$incOutstandingRequestCount(),c=c||e.url(),"jsonp"==Ni(a)){var b="_"+(i.counter++).toString(36);i[b]=function(e){i[b].data=e,i[b].called=!0};var w=r(c.replace("JSON_CALLBACK","angular.callbacks."+b),b,function(e,t){_(d,e,i[b].data,"",t),i[b]=h})}else{var $=t(a);if($.open(a,c,!0),o(u,function(e,t){y(e)&&$.setRequestHeader(t,e)}),$.onreadystatechange=function(){if($&&4==$.readyState){var e=null,t=null,n="";v!==s&&(e=$.getAllResponseHeaders(),t="response"in $?$.response:$.responseText),v===s&&10>Bi||(n=$.statusText),_(d,v||$.status,t,e,n)}},m&&($.withCredentials=!0),f)try{$.responseType=f}catch(k){if("json"!==f)throw k}$.send(l||null)}if(p>0)var C=n(g,p);else E(p)&&p.then(g)}}function sn(){var e="{{",t="}}";this.startSymbol=function(t){return t?(e=t,this):e},this.endSymbol=function(e){return e?(t=e,this):t},this.$get=["$parse","$exceptionHandler","$sce",function(n,i,a){function o(e){return"\\\\\\"+e}function r(o,r,p,m){function h(n){return n.replace(l,e).replace(d,t)}function f(e){try{return T(A(e))}catch(t){var n=Ta("interr","Can't interpolate: {0}\n{1}",o,t.toString());i(n)}}m=!!m;for(var g,y,v,b=0,w=[],$=[],C=o.length,S=[],M=[];C>b;){if(-1==(g=o.indexOf(e,b))||-1==(y=o.indexOf(t,g+s))){b!==C&&S.push(h(o.substring(b)));break}b!==g&&S.push(h(o.substring(b,g))),v=o.substring(g+s,y),w.push(v),$.push(n(v,f)),b=y+c,M.push(S.length),S.push("")}if(p&&S.length>1)throw Ta("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce",o);if(!r||w.length){var x=function(e){for(var t=0,n=w.length;n>t;t++){if(m&&_(e[t]))return;S[M[t]]=e[t]}return S.join("")},A=function(e){return p?a.getTrusted(p,e):a.valueOf(e)},T=function(e){if(null==e)return"";switch(typeof e){case"string":break;case"number":e=""+e;break;default:e=H(e)}return e};return u(function(e){var t=0,n=w.length,a=new Array(n);try{for(;n>t;t++)a[t]=$[t](e);return x(a)}catch(r){var s=Ta("interr","Can't interpolate: {0}\n{1}",o,r.toString());i(s)}},{exp:o,expressions:w,$$watchDelegate:function(e,t,n){var i;return e.$watchGroup($,function(n,a){var o=x(n);k(t)&&t.call(this,o,n!==a?i:o,e),i=o},n)}})}}var s=e.length,c=t.length,l=new RegExp(e.replace(/./g,o),"g"),d=new RegExp(t.replace(/./g,o),"g");return r.startSymbol=function(){return e},r.endSymbol=function(){return t},r}]}function cn(){this.$get=["$rootScope","$window","$q","$$q",function(e,t,n,i){function a(a,r,s,c){var l=t.setInterval,d=t.clearInterval,u=0,p=y(c)&&!c,m=(p?i:n).defer(),h=m.promise;return s=y(s)?s:0,h.then(null,null,a),h.$$intervalId=l(function(){m.notify(u++),s>0&&u>=s&&(m.resolve(u),d(h.$$intervalId),delete o[h.$$intervalId]),p||e.$apply()},r),o[h.$$intervalId]=m,h}var o={};return a.cancel=function(e){return e&
var o=0>e;e=Math.abs(e);var r=e+"",s="",c=[],l=!1;if(-1!==r.indexOf("e")){var d=r.match(/([\d\.]+)e(-?)(\d+)/);d&&"-"==d[2]&&d[3]>a+1?(r="0",e=0):(s=r,l=!0)}if(l)a>0&&e>-1&&1>e&&(s=e.toFixed(a));else{var u=(r.split(Ga)[1]||"").length;_(a)&&(a=Math.min(Math.max(t.minFrac,u),t.maxFrac)),e=+(Math.round(+(e.toString()+"e"+a)).toString()+"e"+-a),0===e&&(o=!1);var p=(""+e).split(Ga),m=p[0];p=p[1]||"";var h,f=0,g=t.lgSize,y=t.gSize;if(m.length>=g+y)for(f=m.length-g,h=0;f>h;h++)(f-h)%y===0&&0!==h&&(s+=n),s+=m.charAt(h);for(h=f;h<m.length;h++)(m.length-h)%g===0&&0!==h&&(s+=n),s+=m.charAt(h);for(;p.length<a;)p+="0";a&&"0"!==a&&(s+=i+p.substr(0,a))}return c.push(o?t.negPre:t.posPre),c.push(s),c.push(o?t.negSuf:t.posSuf),c.join("")}function ti(e,t,n){var i="";for(0>e&&(i="-",e=-e),e=""+e;e.length<t;)e="0"+e;return n&&(e=e.substr(e.length-t)),i+e}function ni(e,t,n,i){return n=n||0,function(a){var o=a["get"+e]();return(n>0||o>-n)&&(o+=n),0===o&&-12==n&&(o=12),ti(o,t,i)}}function ii(e,t){return function(n,i){var a=n["get"+e](),o=Ui(t?"SHORT"+e:e);return i[o][a]}}function ai(e){var t=-1*e.getTimezoneOffset(),n=t>=0?"+":"";return n+=ti(Math[t>0?"floor":"ceil"](t/60),2)+ti(Math.abs(t%60),2)}function oi(e){var t=new Date(e,0,1).getDay();return new Date(e,0,(4>=t?5:12)-t)}function ri(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function si(e){return function(t){var n=oi(t.getFullYear()),i=ri(t),a=+i-+n,o=1+Math.round(a/6048e5);return ti(o,e)}}function ci(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}function li(e){function t(e){var t;if(t=e.match(n)){var i=new Date(0),a=0,o=0,r=t[8]?i.setUTCFullYear:i.setFullYear,s=t[8]?i.setUTCHours:i.setHours;t[9]&&(a=p(t[9]+t[10]),o=p(t[9]+t[11])),r.call(i,p(t[1]),p(t[2])-1,p(t[3]));var c=p(t[4]||0)-a,l=p(t[5]||0)-o,d=p(t[6]||0),u=Math.round(1e3*parseFloat("0."+(t[7]||0)));return s.call(i,c,l,d,u),i}return e}var n=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(n,i,a){var r,s,c="",l=[];if(i=i||"mediumDate",i=e.DATETIME_FORMATS[i]||i,b(n)&&(n=Za.test(n)?p(n):t(n)),w(n)&&(n=new Date(n)),!$(n))return n;for(;i;)s=Xa.exec(i),s?(l=F(l,s,1),i=l.pop()):(l.push(i),i=null);return a&&"UTC"===a&&(n=new Date(n.getTime()),n.setMinutes(n.getMinutes()+n.getTimezoneOffset())),o(l,function(t){r=Ka[t],c+=r?r(n,e.DATETIME_FORMATS):t.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}}function di(){return function(e){return H(e,!0)}}function ui(){return function(e,t){if(w(e)&&(e=e.toString()),!Zi(e)&&!b(e))return e;if(t=1/0===Math.abs(Number(t))?Number(t):p(t),b(e))return t?t>=0?e.slice(0,t):e.slice(t,e.length):"";var n,i,a=[];for(t>e.length?t=e.length:t<-e.length&&(t=-e.length),t>0?(n=0,i=t):(n=e.length+t,i=e.length);i>n;n++)a.push(e[n]);return a}}function pi(e){return function(t,n,i){function o(e,t){for(var i=0;i<n.length;i++){var a=n[i](e,t);if(0!==a)return a}return 0}function r(e,t){return t?function(t,n){return e(n,t)}:e}function s(e,t){var n=typeof e,i=typeof t;return n==i?($(e)&&$(t)&&(e=e.valueOf(),t=t.valueOf()),"string"==n&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t?0:t>e?-1:1):i>n?-1:1}if(!a(t))return t;if(!n)return t;n=Zi(n)?n:[n],n=n.map(function(t){var n=!1,i=t||f;if(b(t)&&(("+"==t.charAt(0)||"-"==t.charAt(0))&&(n="-"==t.charAt(0),t=t.substring(1)),i=e(t),i.constant)){var a=i();return r(function(e,t){return s(e[a],t[a])},n)}return r(function(e,t){return s(i(e),i(t))},n)});for(var c=[],l=0;l<t.length;l++)c.push(t[l]);return c.sort(r(o,i))}}function mi(e){return k(e)&&(e={link:e}),e.restrict=e.restrict||"AC",g(e)}function hi(e,t){e.$name=t}function fi(e,t,i,a,r){var s=this,c=[],l=s.$$parentForm=e.parent().controller("form")||to;s.$error={},s.$$success={},s.$pending=n,s.$name=r(t.name||t.ngForm||"")(i),s.$dirty=!1,s.$pristine=!0,s.$valid=!0,s.$invalid=!1,s.$submitted=!1,l.$addControl(s),s.$rollbackViewValue=function(){o(c,function(e){e.$rollbackViewValue()})},s.$commitViewValue=function(){o(c,function(e){e.$commitViewValue()})},s.$addControl=function(e){ot(e.$name,"input"),c.push(e),e.$name&&(s[e.$name]=e)},s.$$r
})}}}}),o(["src","srcset","href"],function(e){var t=Gt("ng-"+e);eo[t]=function(){return{priority:99,link:function(n,i,a){var o=e,r=e;"href"===e&&"[object SVGAnimatedString]"===Vi.call(i.prop("href"))&&(r="xlinkHref",a.$attr[r]="xlink:href",o=null),a.$observe(t,function(t){return t?(a.$set(r,t),void(Bi&&o&&i.prop(o,a[r]))):void("href"===e&&a.$set(r,null))})}}}});var to={$addControl:h,$$renameControl:hi,$removeControl:h,$setValidity:h,$$setPending:h,$setDirty:h,$setPristine:h,$setSubmitted:h,$$clearControlValidity:h},no="ng-submitted";fi.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var io=function(e){return["$timeout",function(t){var i={name:"form",restrict:e?"EAC":"E",controller:fi,compile:function(e){return e.addClass($o).addClass(bo),{pre:function(e,i,a,o){if(!a.action){var r=function(t){e.$apply(function(){o.$commitViewValue(),o.$setSubmitted()}),t.preventDefault?t.preventDefault():t.returnValue=!1};oa(i[0],"submit",r),i.on("$destroy",function(){t(function(){ra(i[0],"submit",r)},0,!1)})}var s=o.$$parentForm,c=o.$name;c&&(An(e,c,o,c),a.$observe(a.name?"name":"ngForm",function(t){c!==t&&(An(e,c,n,c),c=t,An(e,c,o,c),s.$$renameControl(o,c))})),s!==to&&i.on("$destroy",function(){s.$removeControl(o),c&&An(e,c,n,c),u(o,to)})}}}};return i}]},ao=io(),oo=io(!0),ro=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,so=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,co=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,lo=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,uo=/^(\d{4})-(\d{2})-(\d{2})$/,po=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,mo=/^(\d{4})-W(\d\d)$/,ho=/^(\d{4})-(\d\d)$/,fo=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,go=/(\s+|^)default(\s+|$)/,_o=new i("ngModel"),yo={text:_i,date:wi("date",uo,bi(uo,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":wi("datetimelocal",po,bi(po,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:wi("time",fo,bi(fo,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:wi("week",mo,vi,"yyyy-Www"),month:wi("month",ho,bi(ho,["yyyy","MM"]),"yyyy-MM"),number:ki,url:Ci,email:Si,radio:Mi,checkbox:Ai,hidden:h,button:h,submit:h,reset:h,file:h},vo=["$browser","$sniffer","$filter","$parse",function(e,t,n,i){return{restrict:"E",require:["?ngModel"],link:{pre:function(a,o,r,s){s[0]&&(yo[Ni(r.type)]||yo.text)(a,o,r,s[0],t,e,n,i)}}}}],bo="ng-valid",wo="ng-invalid",$o="ng-pristine",ko="ng-dirty",Co="ng-untouched",So="ng-touched",Mo="ng-pending",xo=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(e,t,i,a,r,s,c,l,d,u){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=n,this.$name=u(i.name||"",!1)(e);var p=r(i.ngModel),m=null,f=this,g=function(){var t=p(e);return f.$options&&f.$options.getterSetter&&k(t)&&(t=t()),t},v=function(){var t;f.$options&&f.$options.getterSetter&&k(t=p(e))?t(f.$modelValue):p.assign(e,f.$modelValue)};this.$$setOptions=function(e){if(f.$options=e,!(p.assign||e&&e.getterSetter))throw _o("nonassign","Expression '{0}' is non-assignable. Element: {1}",i.ngModel,z(a))},this.$render=h,this.$isEmpty=function(e){return _(e)||""===e||null===e||e!==e};var b=a.inheritedData("$formController")||to,$=0;Ti({ctrl:this,$element:a,set:function(e,t){e[t]=!0},unset:function(e,t){delete e[t]},parentForm:b,$animate:s}),this.$setPristine=function(){f.$dirty=!1,f.$pristine=!0,s.removeClass(a,ko),s.addClass(a,$o)},this.$setUntouched=function(){f.$touched=!1,f.$untouched=!0,s.setClass(a,Co,So)},this.$setTouched=function(){f.$touched=!0,f.$untouched=!1,s.setClass(a,So,Co)},this.$rollbackViewValue=function(){c.cancel(m),f.$viewValue=f.$$lastCommittedViewValue,f.$render()},this.$validate=function(){w(f.$modelValue)&&isNaN(f.$
}y.data(h,_);var D=b.$watch(function(){return $.totalPendingRequests},function(e){0===e&&(D(),b.$$postDigest(function(){b.$$postDigest(function(){_.running=!1})}))}),P=0,N=a.classNameFilter(),L=N?function(e){return N.test(e)}:function(){return!0};return{enter:function(n,i,a){return n=t.element(n),i=r(i),a=r(a),k(n,!0),e.enter(n,i,a),C(function(e){return A("enter","ng-enter",s(n),i,a,l,e)})},leave:function(n){return n=t.element(n),T(n),k(n,!0),this.enabled(!1,n),C(function(t){return A("leave","ng-leave",s(n),null,null,function(){e.leave(n)},t)})},move:function(n,i,a){return n=t.element(n),i=r(i),a=r(a),T(n),k(n,!0),e.move(n,i,a),C(function(e){return A("move","ng-move",s(n),i,a,l,e)})},addClass:function(e,t){return this.setClass(e,t,[])},removeClass:function(e,t){return this.setClass(e,[],t)},setClass:function(n,i,a){var o="$$animateClasses";if(n=t.element(n),n=s(n),k(n))return e.setClass(n,i,a);i=p(i)?i:i.split(" "),a=p(a)?a:a.split(" ");var r=n.data(o);return r?(r.add=r.add.concat(i),r.remove=r.remove.concat(a),r.promise):(n.data(o,r={add:i,remove:a}),r.promise=C(function(t){var i=n.data(o);n.removeData(o);var a=n.data(h)||{},r=S(n,i,a.active);return r?A("setClass",r,n,null,null,function(){e.setClass(n,r[0],r[1])},t):t()}))},cancel:function(e){e.$$cancelFn()},enabled:function(e,t){switch(arguments.length){case 2:if(e)E(t);else{var n=t.data(h)||{};n.disabled=!0,t.data(h,n)}break;case 1:_.disabled=!e;break;default:e=!_.disabled}return!!e}}}]),a.register("",["$window","$sniffer","$timeout","$$animateReflow",function(i,a,r,s){function c(e,t){D&&D(),V.push(t),D=s(function(){d(V,function(e){e()}),V=[],D=null,j={}})}function u(e,n){var i=o(e);e=t.element(i),K.push(e);var a=Date.now()+n;G>=a||(r.cancel(W),G=a,W=r(function(){h(K),K=[]},n,!1))}function h(e){d(e,function(e){var t=e.data(B);t&&d(t.closeAnimationFns,function(e){e()})})}function f(e,t){var n=t?j[t]:null;if(!n){var a=0,o=0,r=0,s=0;d(e,function(e){if(e.nodeType==m){var t=i.getComputedStyle(e)||{},n=t[x+P];a=Math.max(g(n),a);var c=t[x+L];o=Math.max(g(c),o);{t[T+L]}s=Math.max(g(t[T+L]),s);var l=g(t[T+P]);l>0&&(l*=parseInt(t[T+U],10)||1),r=Math.max(l,r)}}),n={total:0,transitionDelay:o,transitionDuration:a,animationDelay:s,animationDuration:r},t&&(j[t]=n)}return n}function g(e){var n=0,i=t.isString(e)?e.split(/\s*,\s*/):[];return d(i,function(e){n=Math.max(parseFloat(e)||0,n)}),n}function _(e){var t=e.parent(),n=t.data(F);return n||(t.data(F,++z),n=z),n+"-"+o(e).getAttribute("class")}function y(e,t,n){var i=["ng-enter","ng-leave","ng-move"].indexOf(n)>=0,a=_(t),r=a+" "+n,s=j[r]?++j[r].total:0,c={};if(s>0){var l=n+"-stagger",d=a+" "+l,u=!j[d];u&&t.addClass(l),c=f(t,d),u&&t.removeClass(l)}t.addClass(n);var p=t.data(B)||{},m=f(t,r),h=m.transitionDuration,g=m.animationDuration;if(i&&0===h&&0===g)return t.removeClass(n),!1;var y=i&&h>0,v=g>0&&c.animationDelay>0&&0===c.animationDuration,$=p.closeAnimationFns||[];t.data(B,{stagger:c,cacheKey:r,running:p.running||0,itemIndex:s,blockTransition:y,closeAnimationFns:$});var k=o(t);return y&&b(k,!0),v&&w(k,!0),!0}function v(e,t,n,i){function a(){t.off(U,s),t.removeClass(p),t.removeClass(m),N&&r.cancel(N),S(t,n);var e=o(t);for(var i in g)e.style.removeProperty(g[i])}function s(e){e.stopPropagation();var t=e.originalEvent||e,n=t.$manualTimeStamp||t.timeStamp||Date.now(),a=parseFloat(t.elapsedTime.toFixed(R));Math.max(n-L,0)>=D&&a>=x&&i()}var c=o(t),l=t.data(B);if(-1==c.getAttribute("class").indexOf(n)||!l)return void i();l.blockTransition&&b(c,!1);var p="",m="";d(n.split(" "),function(e,t){var n=(t>0?" ":"")+e;p+=n+"-active",m+=n+"-pending"});var h="",g=[],_=l.itemIndex,y=l.stagger,v=0;if(_>0){var $=0;y.transitionDelay>0&&0===y.transitionDuration&&($=y.transitionDelay*_);var k=0;y.animationDelay>0&&0===y.animationDuration&&(k=y.animationDelay*_,g.push(I+"animation-play-state")),v=Math.round(100*Math.max($,k))/100}v||t.addClass(p);var C=l.cacheKey+" "+p,M=f(t,C),x=Math.max(M.transitionDuration,M.animationDuration);if(0===x)return t.removeClass(p),S(t,n),void i();var T=Math.max(M.transitionDelay,M.animationDelay),D=T*H;if(g.length>0){var P
return s(n,t[0],t),n};return{scope:!1,link:function(e,t,n){var i=n.playlist,a=n.mediaPlayer||n.playerControl,r=new c(t),s=e[i];if(s=void 0===i?[]:void 0===e[i]?e[i]=[]:e[i],void 0!==a&&e.$eval(a+" = player",{player:r}),"AUDIO"!==t[0].tagName&&"VIDEO"!==t[0].tagName)return new Error("player directive works only when attached to an <audio>/<video> type tag");var l=[],d=t.find("source");1===d.length?s.unshift({src:d[0].src,type:d[0].type,media:d[0].media}):d.length>1&&(angular.forEach(d,function(e){l.push({src:e.src,type:e.type,media:e.media})}),s.unshift(l)),void 0===i?r.$attachPlaylist(s):s.length?(o(r)(s,void 0,e),e.$watch(i,o(r),!0)):e.$watch(i,o(r),!0)}}}]),angular.module("mediaPlayer.helpers",[]).factory("mp.throttle",["$timeout",function(e){return function(t,n,i,a){var o,r=0;"boolean"!=typeof n&&(a=i,i=n,n=void 0);var s=function(){var s=this,c=+new Date-r,l=arguments,d=function(){r=+new Date,i.apply(s,l)},u=function(){o=void 0};a&&!o&&d(),o&&e.cancel(o),void 0===a&&c>t?d():n!==!0&&(o=e(a?u:d,void 0===a?t-c:t))};return s}}]);var dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr="0".charCodeAt(0),vv=0;9>=vv;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigIntege
for(var i=goog.math.Long.fromNumber(Math.pow(n,8)),a=goog.math.Long.ZERO,o=0;o<e.length;o+=8){var r=Math.min(8,e.length-o),s=parseInt(e.substring(o,o+r),n);if(8>r){var c=goog.math.Long.fromNumber(Math.pow(n,r));a=a.multiply(c).add(goog.math.Long.fromNumber(s))}else a=a.multiply(i),a=a.add(goog.math.Long.fromNumber(s))}return a},goog.math.Long.TWO_PWR_16_DBL_=65536,goog.math.Long.TWO_PWR_24_DBL_=1<<24,goog.math.Long.TWO_PWR_32_DBL_=goog.math.Long.TWO_PWR_16_DBL_*goog.math.Long.TWO_PWR_16_DBL_,goog.math.Long.TWO_PWR_31_DBL_=goog.math.Long.TWO_PWR_32_DBL_/2,goog.math.Long.TWO_PWR_48_DBL_=goog.math.Long.TWO_PWR_32_DBL_*goog.math.Long.TWO_PWR_16_DBL_,goog.math.Long.TWO_PWR_64_DBL_=goog.math.Long.TWO_PWR_32_DBL_*goog.math.Long.TWO_PWR_32_DBL_,goog.math.Long.TWO_PWR_63_DBL_=goog.math.Long.TWO_PWR_64_DBL_/2,goog.math.Long.ZERO=goog.math.Long.fromInt(0),goog.math.Long.ONE=goog.math.Long.fromInt(1),goog.math.Long.NEG_ONE=goog.math.Long.fromInt(-1),goog.math.Long.MAX_VALUE=goog.math.Long.fromBits(-1,2147483647),goog.math.Long.MIN_VALUE=goog.math.Long.fromBits(0,-2147483648),goog.math.Long.TWO_PWR_24_=goog.math.Long.fromInt(1<<24),goog.math.Long.prototype.toInt=function(){return this.low_},goog.math.Long.prototype.toNumber=function(){return this.high_*goog.math.Long.TWO_PWR_32_DBL_+this.getLowBitsUnsigned()},goog.math.Long.prototype.toString=function(e){var t=e||10;if(2>t||t>36)throw Error("radix out of range: "+t);if(this.isZero())return"0";if(this.isNegative()){if(this.equals(goog.math.Long.MIN_VALUE)){var n=goog.math.Long.fromNumber(t),i=this.div(n),a=i.multiply(n).subtract(this);return i.toString(t)+a.toInt().toString(t)}return"-"+this.negate().toString(t)}for(var o=goog.math.Long.fromNumber(Math.pow(t,6)),a=this,r="";;){var s=a.div(o),c=a.subtract(s.multiply(o)).toInt(),l=c.toString(t);if(a=s,a.isZero())return l+r;for(;l.length<6;)l="0"+l;r=""+l+r}},goog.math.Long.prototype.getHighBits=function(){return this.high_},goog.math.Long.prototype.getLowBits=function(){return this.low_},goog.math.Long.prototype.getLowBitsUnsigned=function(){return this.low_>=0?this.low_:goog.math.Long.TWO_PWR_32_DBL_+this.low_},goog.math.Long.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(goog.math.Long.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var e=0!=this.high_?this.high_:this.low_,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high_?t+33:t+1},goog.math.Long.prototype.isZero=function(){return 0==this.high_&&0==this.low_},goog.math.Long.prototype.isNegative=function(){return this.high_<0},goog.math.Long.prototype.isOdd=function(){return 1==(1&this.low_)},goog.math.Long.prototype.equals=function(e){return this.high_==e.high_&&this.low_==e.low_},goog.math.Long.prototype.notEquals=function(e){return this.high_!=e.high_||this.low_!=e.low_},goog.math.Long.prototype.lessThan=function(e){return this.compare(e)<0},goog.math.Long.prototype.lessThanOrEqual=function(e){return this.compare(e)<=0},goog.math.Long.prototype.greaterThan=function(e){return this.compare(e)>0},goog.math.Long.prototype.greaterThanOrEqual=function(e){return this.compare(e)>=0},goog.math.Long.prototype.compare=function(e){if(this.equals(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.subtract(e).isNegative()?-1:1},goog.math.Long.prototype.negate=function(){return this.equals(goog.math.Long.MIN_VALUE)?goog.math.Long.MIN_VALUE:this.not().add(goog.math.Long.ONE)},goog.math.Long.prototype.add=function(e){var t=this.high_>>>16,n=65535&this.high_,i=this.low_>>>16,a=65535&this.low_,o=e.high_>>>16,r=65535&e.high_,s=e.low_>>>16,c=65535&e.low_,l=0,d=0,u=0,p=0;return p+=a+c,u+=p>>>16,p&=65535,u+=i+s,d+=u>>>16,u&=65535,d+=n+r,l+=d>>>16,d&=65535,l+=t+o,l&=65535,goog.math.Long.fromBits(u<<16|p,l<<16|d)},goog.math.Long.prototype.subtract=function(e){return this.add(e.negate())},goog.math.Long.prototype.multiply=function(e){if(this.isZero())return goog.math.Long.ZERO;if(e.isZero())return goog.math.Long.ZERO;if(this.equals(goog.math.Long.MIN_VALUE))return e.isOdd()?goog.math.Long.MIN_VALUE:goog.math.Long.ZERO;if(e.equals(goog.math.Long.MIN_VA
}},function(e){t.reject(e)}):(t.reject(new Error("Set_client_DH_params_answer server_nonce mismatch")),!1):(t.reject(new Error("Set_client_DH_params_answer nonce mismatch")),!1)},function(e){t.reject(e)})},function(e){t.reject(e)})}function m(t){if(void 0!==g[t])return g[t];for(var n=[],i=0;16>i;i++)n.push(nextRandomInt(255));if(!e.chooseServer(t))return r.reject(new Error("No server found for dc "+t));var a={dcID:t,nonce:n,deferred:r.defer()};return s(function(){l(a)}),g[t]=a.deferred.promise,g[t]["catch"](function(){delete g[t]}),g[t]}var h=navigator.userAgent.match(/Chrome\/(\d+(\.\d+)?)/),f=h&&parseFloat(h[1])||!1,g={};return{auth:m}}]).factory("MtpNetworkerFactory",["MtpDcConfigurator","MtpTimeManager","MtpSecureRandom","Storage","CryptoWorker","$http","$q","$timeout","$interval","$rootScope",function(e,t,n,i,a,o,r,s,c,l){function d(e,t,n,i){i=i||{},this.dcID=e,this.iii=p++,this.authKey=t,this.authKeyID=sha1Hash(t).slice(-8),this.serverSalt=n,this.upload=i.fileUpload||i.fileDownload||!1,this.updateSession(),this.currentRequests=0,this.checkConnectionPeriod=0,this.sentMessages={},this.serverMessages=[],this.clientMessages=[],this.pendingMessages={},this.pendingAcks=[],this.pendingResends=[],this.connectionInited=!1,this.pendingTimeouts=[],this.longPollInt=c(this.checkLongPoll.bind(this),1e4),this.checkLongPoll(),m||(m=!0,l.offline=!0,l.offlineConnecting=!0),Config.Navigator.mobile&&this.setupMobileSleep()}var u,p=0,m=!1,h=navigator.userAgent.match(/Chrome\/(\d+(\.\d+)?)/),f=h&&parseFloat(h[1])||!1;return l.retryOnline=function(){$(document.body).trigger("online")},d.prototype.updateSession=function(){this.seqNo=0,this.sessionID=new Array(8),n.nextBytes(this.sessionID)},d.prototype.setupMobileSleep=function(){var e=this;l.$watch("idle.isIDLE",function(t){t?e.sleepAfter=tsNow()+3e4:(delete e.sleepAfter,e.checkLongPoll())}),l.$on("push_received",function(){e.sleepAfter&&(e.sleepAfter=tsNow()+3e4,e.checkLongPoll())})},d.prototype.updateSentMessage=function(e){var n=this.sentMessages[e];if(!n)return!1;var i=this;if(n.container){var a=[];angular.forEach(n.inner,function(e){var t=i.updateSentMessage(e);t&&a.push(t.msg_id)}),n.inner=a}return n.msg_id=t.generateID(),n.seq_no=this.generateSeqNo(n.notContentRelated||n.container),this.sentMessages[n.msg_id]=n,delete i.sentMessages[e],n},d.prototype.generateSeqNo=function(e){var t=2*this.seqNo;return e||(t++,this.seqNo++),t},d.prototype.wrapMtpCall=function(e,n,i){var a=new TLSerialization({mtproto:!0});a.storeMethod(e,n);var o=t.generateID(),r=this.generateSeqNo(),s={msg_id:o,seq_no:r,body:a.getBytes()};return Config.Modes.debug&&console.log(dT(),"MT call",e,n,o,r),this.pushMessage(s,i)},d.prototype.wrapMtpMessage=function(e,n){n=n||{};var i=new TLSerialization({mtproto:!0});i.storeObject(e,"Object");var a=t.generateID(),o=this.generateSeqNo(n.notContentRelated),r={msg_id:a,seq_no:o,body:i.getBytes()};return Config.Modes.debug&&console.log(dT(),"MT message",e,a,o),this.pushMessage(r,n)},d.prototype.wrapApiCall=function(e,n,i){var a=new TLSerialization(i);this.connectionInited||(a.storeInt(479200567,"invokeWithLayer18"),a.storeInt(1769565673,"initConnection"),a.storeInt(Config.App.id,"api_id"),a.storeString(navigator.userAgent||"Unknown UserAgent","device_model"),a.storeString(navigator.platform||"Unknown Platform","system_version"),a.storeString(Config.App.version,"app_version"),a.storeString(navigator.language||"en","lang_code")),i.afterMessageID&&(a.storeInt(3416209197,"invokeAfterMsg"),a.storeLong(i.afterMessageID,"msg_id")),i.resultType=a.storeMethod(e,n);var o=t.generateID(),r=this.generateSeqNo(),s={msg_id:o,seq_no:r,body:a.getBytes(),isAPI:!0};return Config.Modes.debug?console.log(dT(),"Api call",e,n,o,r,i):console.log(dT(),"Api call",e),this.pushMessage(s,i)},d.prototype.checkLongPoll=function(){var e=this.cleanupSent();if(this.longPollPending&&tsNow()<this.longPollPending||this.offline)return!1;var t=this;i.get("dc").then(function(n){e&&(n!=t.dcID||t.upload||t.sleepAfter&&tsNow()>t.sleepAfter)||t.sendLongPoll()})},d.prototype.sendLongPoll=function(){var e=25e3,t=this;t
}]).service("AppPeersManager",["AppUsersManager","AppChatsManager",function(e,t){return{getInputPeer:function(e){var t="u"==e.charAt(0),n=e.substr(1).split("_");return t?{_:"inputPeerForeign",user_id:n[0],access_hash:n[1]}:{_:"inputPeerChat",chat_id:n[0]}},getInputPeerByID:function(t){return t>0?{_:"inputPeerForeign",user_id:t,access_hash:e.getUser(t).access_hash||0}:0>t?{_:"inputPeerChat",chat_id:-t}:void 0},getPeerSearchText:function(n){var i;if(n>0)i=e.getUserSearchText(n);else if(0>n){var a=t.getChat(-n);i=a.title||""}return i},getOutputPeer:function(e){return e>0?{_:"peerUser",user_id:e}:{_:"peerChat",chat_id:-e}},getPeerID:function(e){if(angular.isObject(e))return e.user_id?e.user_id:-e.chat_id;var t="u"==e.charAt(0),n=e.substr(1).split("_");return t?n[0]:-n[0]||0},getPeer:function(n){return n>0?e.getUser(n):t.getChat(-n)},getPeerPhoto:function(n,i,a){return n>0?e.getUserPhoto(n,i):t.getChatPhoto(-n,a)}}}]).service("SearchIndexManager",function(){function e(){return{shortIndexes:{},fullTexts:{}}}function t(e){e=e.replace(a," ").replace(o,"").toLowerCase();for(var t in r)r.hasOwnProperty(t)&&(e=e.replace(r[t],t));return e}function n(e,n,i){if(void 0!==i.fullTexts[e])return!1;if(n=t(n),!n.length)return!1;var a=i.shortIndexes;i.fullTexts[e]=n,angular.forEach(n.split(" "),function(t){var n,i,o=Math.min(t.length,3);for(i=1;o>=i;i++)n=t.substr(0,i),void 0===a[n]?a[n]=[e]:a[n].push(e)})}function i(e,n){var i=n.shortIndexes,a=n.fullTexts;e=t(e);var o,r,s,c,l,d=e.split(" "),u=!1;for(r=0;r<d.length;r++){if(o=i[d[r].substr(0,3)],!o){u=[];break}(u===!1||u.length>o.length)&&(u=o)}for(o={},s=0;s<u.length;s++){for(l=!0,c=a[u[s]],r=0;r<d.length;r++)if(-1==c.indexOf(d[r])){l=!1;break}l&&(o[u[s]]=!0)}return o}var a=/[`~!@#$%^&*()\-_=+\[\]\\|{}'";:\/?.>,<\s]+/g,o=/^\s+|\s$/g,r={a:/[åáâäà]/g,e:/[éêëè]/g,i:/[íîïì]/g,o:/[óôöò]/g,u:/[úûüù]/g,c:/ç/g,ss:/ß/g};return{createIndex:e,indexObject:n,cleanSearchText:t,search:i}}).service("AppMessagesManager",["$q","$rootScope","$location","$filter","ApiUpdatesManager","AppUsersManager","AppChatsManager","AppPeersManager","AppPhotosManager","AppVideoManager","AppDocsManager","AppAudioManager","MtpApiManager","MtpApiFileManager","RichTextProcessor","NotificationsManager","SearchIndexManager","PeersSelectService","Storage","_",function(e,t,n,i,a,o,r,s,c,l,d,u,p,m,h,f,g,_,y,v){function b(t,n,i){var a=K;if(angular.isString(t)&&t.length){if(!i||tt.query!==t){tt.query=t;var c=g.search(t,et);tt.dialogs=[],angular.forEach(K.dialogs,function(e){c[e.peerID]&&tt.dialogs.push(e)}),tt.count=tt.dialogs.length}a=tt}else tt.query=!1;var l=0;if(n>0)for(l=0;l<a.dialogs.length&&!(n>a.dialogs[l].top_message);l++);return null!==a.count&&a.dialogs.length==a.count||a.dialogs.length>=l+(i||1)?e.when({count:a.count,dialogs:a.dialogs.slice(l,l+(i||20))}):(i=i||20,p.invokeApi("messages.getDialogs",{offset:l,limit:i,max_id:n||0}).then(function(e){if(o.saveApiUsers(e.users),r.saveApiChats(e.chats),E(e.messages),n>0)for(l=0;l<a.dialogs.length&&!(n>a.dialogs[l].top_message);l++);return a.count=e.count||e.dialogs.length,a.dialogs.splice(l,a.dialogs.length-l),angular.forEach(e.dialogs,function(e){var t=s.getPeerID(e.peer),n=s.getPeerSearchText(t);g.indexObject(t,n,et),a.dialogs.push({peerID:t,top_message:e.top_message,unread_count:e.unread_count}),void 0===G[t]&&(G[t]={count:null,history:[e.top_message],pending:[]}),f.savePeerSettings(t,e.notify_settings)}),{count:a.count,dialogs:a.dialogs.slice(l,l+i)}}))}function w(e,t,n,i){return p.invokeApi("messages.getHistory",{peer:e,offset:i||0,limit:n||0,max_id:t||0}).then(function(e){return o.saveApiUsers(e.users),r.saveApiChats(e.chats),E(e.messages),e})}function $(e,t,n,i){return w(e,t,n).then(function(a){i.count=a.count||a.messages.length;var o=0;if(t>0)for(o=0;o<i.history.length&&!(t>i.history[o]);o++);return i.history.splice(o,i.history.length-o),angular.forEach(a.messages,function(e){i.history.push(e.id)}),n-=a.messages.length,n>0&&i.history.length<i.count?(t=i.history[i.history.length-1],$(e,t,n,i)):!0})}function k(t,n,i,a,o){var r=s.getPeerID(t),c=G[r],l=
if(l.to_id.chat_id&&!i.hasChat(l.to_id.chat_id))return console.log("Chat not found",l.to_id.chat_id,"getDiff"),s(),!1}angular.forEach(e.updates,function(e){d(e)});break;default:console.warn(dT(),"Unknown update message",e)}return r(),h&&f.seq>=h.seqAwaiting&&(console.log(dT(),"cancel pending getDiff",h.seqAwaiting),clearTimeout(h.timeout),h=!1),!0}function l(){m=!0,h&&(clearTimeout(h.timeout),h=!1),o.invokeApi("updates.getDifference",{pts:f.pts,date:f.date,qts:0}).then(function(e){if("updates.differenceEmpty"==e._)return console.log(dT(),"apply empty diff",e.seq),f.date=e.date,f.seq=e.seq,m=!1,r(),!1;n.saveApiUsers(e.users),i.saveApiChats(e.chats),angular.forEach(e.other_updates,function(e){d(e)}),angular.forEach(e.new_messages,function(e){d({_:"updateNewMessage",message:e,pts:f.pts})});var t=e.intermediate_state||e.state;f.seq=t.seq,f.pts=t.pts,f.date=t.date,console.log(dT(),"apply diff",f.seq,f.pts),"updates.differenceSlice"==e._?l(!0):m=!1})}function d(t){t.pts&&(f.pts=t.pts),e.$broadcast("apiUpdate",t)}function u(e,t){return(t=t||e)?m?(console.log(dT(),"Seq decline",t),!1):t!=f.seq+1?(t>f.seq&&(console.warn(dT(),"Seq hole",t,h&&h.seqAwaiting),h||(h={seqAwaiting:t,timeout:setTimeout(function(){l()},5e3)})),!1):(f.seq=e,!0):!0}function p(){t.setUpdatesProcessor(c),o.invokeApi("updates.getState",{noErrorBox:!0}).then(function(e){f.seq=e.seq,f.pts=e.pts,f.date=e.date,m=!1})}var m=!0,h=!1,f={},g={};return{processUpdateMessage:c,attach:p}}]).service("RichTextProcessor",["$sce","$sanitize",function(e,t){function n(e){return e.replace(/&/g,"&amp;").replace(/([^\#-~| |!])/g,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function i(e){for(var t,n,i,a,o=0;o<Config.EmojiCategories.length;o++)if(a=Config.EmojiCategorySpritesheetDimens[o][1],t=Config.EmojiCategories[o].indexOf(e),t>-1)return n=Math.floor(t/a),i=t%a,{category:o,row:n,column:i};return console.error("emoji not found in spritesheet",e),null}function a(a,o){if(!a||!a.length)return"";o=o||{},a=a.replace(/\ufe0f/g,"",a);for(var s,u,p,m=a,g=[],_=!1;s=m.match(h);)g.push(n(m.substr(0,s.index))),s[1]?o.noLinks?g.push(n(s[0])):s[3]?g.push('<a href="',n("mailto:"+s[3]+s[4]),'" target="_blank">',n(s[3]+s[4]),"</a>"):g.push('<a href="',n(s[2]+"://"+s[4]),'" target="_blank">',n(s[2]+"://"+s[4]),"</a>"):s[5]?g.push(o.noLinebreaks?" ":"<br/>"):s[6]?(r=c[s[6]])&&(p=i(r))?(u=n(l[r][1][0]),_=!0,g.push('<span class="emoji emoji-',p.category,"-",d*p.column,"-",d*p.row,'" ','title="',u,'">',":",u,":</span>")):g.push(n(s[6])):s[8]&&(o.noLinks?g.push(s[7],n(s[8])):g.push(s[7],'<a href="#/im?q=',encodeURIComponent(s[8]),'">',n(s[8]),"</a>")),m=m.substr(s.index+s[0].length);if(g.push(n(m)),a=t(g.join("")),_&&(a=a.replace(/<span class="emoji emoji-(\d)-(\d+)-(\d+)"(.+?)<\/span>/g,'<span class="emoji emoji-spritesheet-$1" style="background-position: -$2px -$3px;" $4</span>')),!o.noLinks){var y=a.match(f),v=y&&y[1];if(v){var b=Config.Modes.chrome_packed?"webview":"iframe";a=a+'<div class="im_message_iframe_video"><'+b+' type="text/html" frameborder="0" src="http://www.youtube.com/embed/'+v+'?autoplay=0&amp;controls=2"></'+b+"></div>"}}return e.trustAs("html",a)}function o(e,t){if(u)return e;if(!e||!e.length)return"";t=t||{},e=e.replace(/\ufe0f/g,"",e);for(var n,i,a=e,e=[];n=a.match(h);)e.push(a.substr(0,n.index)),e.push(n[6]?(r=c[n[6]])&&(i=l[r][1][0])?":"+i+":":n[0]:n[0]),a=a.substr(n.index+n[0].length);return e.push(a),e.join("")}var r,s=[],c={},l=Config.Emoji,d=18,u=-1!=navigator.userAgent.search(/OS X|iPhone|iPad|iOS|Android/i);for(r in l)s.push(l[r][0]),c[l[r][0]]=r;var p="a-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u00ff\\u0100-\\u024f\\u0253\\u0254\\u0256\\u0257\\u0259\\u025b\\u0263\\u0268\\u026f\\u0272\\u0289\\u028b\\u02bb\\u0300-\\u036f\\u1e00-\\u1eff\\u0400-\\u04ff\\u0500-\\u0527\\u2de0-\\u2dff\\ua640-\\ua69f\\u0591-\\u05bf\\u05c1-\\u05c2\\u05c4-\\u05c5\\u05c7\\u05d0-\\u05ea\\u05f0-\\u05f4\\ufb1d-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufb4f\\u0610-\\u061a\\u0620-\\u065f\\u066e-\\u06d3\\u06d5-\\u06dc\\
-1!==t&&e.historyState.typing.splice(t,1)},6e3))}}),e.$on("history_need_less",v),e.$on("history_need_more",b),i.$watch("idle.isIDLE",function(t){t||!e.curDialog||!e.curDialog.peerID||e.historyFilter.mediaType||e.skippedHistory||s.readHistory(e.curDialog.inputPeer)})}]).controller("AppImPanelController",["$scope",function(e){e.$on("user_update",angular.noop)}]).controller("AppImSendController",["$scope","$timeout","MtpApiManager","Storage","AppPeersManager","AppMessagesManager","ApiUpdatesManager","MtpApiFileManager",function(e,t,n,i,a,o){function r(n){return e.$broadcast("ui_message_before_send"),t(function(){var t=e.draftMessage.text;if(!angular.isString(t)||!t.length)return!1;t=t.replace(/:([a-z0-9\-\+\*_]+?):/gi,function(e,t){var n=$.emojiarea.reverseIcons[t];return void 0!==n?n:e});var n=0;do!function(e,t,n){setTimeout(function(){o.sendText(e,t)},n)}(e.curDialog.peerID,t.substr(0,4096),n),t=t.substr(4096),n+=100;while(t.length);s(),e.$broadcast("ui_message_send")}),cancelEvent(n)}function s(t){t?i.get("draft"+e.curDialog.peerID).then(function(t){e.draftMessage.text=t||"",e.$broadcast("ui_peer_draft")}):(e.draftMessage.text="",e.$broadcast("ui_peer_draft"))}function c(t){if(t&&t.length){e.historyFilter.mediaType||e.skippedHistory||o.readHistory(e.curDialog.inputPeer);var n={};n["draft"+e.curDialog.peerID]=t,i.set(n)}else i.remove("draft"+e.curDialog.peerID)}function l(){n.invokeApi("messages.setTyping",{peer:e.curDialog.inputPeer,action:{_:"sendMessageTypingAction"}})}function d(t){if(angular.isArray(t)&&t.length)for(var n=0;n<t.length;n++)o.sendFile(e.curDialog.peerID,t[n],{isMedia:e.draftMessage.isMedia}),e.$broadcast("ui_message_send")}e.$watch("curDialog.peer",s),e.$on("user_update",angular.noop),e.$on("ui_typing",l),e.draftMessage={text:""},e.$watch("draftMessage.text",c),e.$watch("draftMessage.files",d),e.sendMessage=r}]).controller("AppLangSelectController",["$scope","_","Storage","ErrorService","AppRuntimeManager",function(e,t,n,i,a){e.supportedLocales=Config.I18n.supported,e.langNames=Config.I18n.languages,e.curLocale=Config.I18n.locale,e.form={locale:Config.I18n.locale},e.localeSelect=function(t){t=t||e.form.locale,e.curLocale!==t&&i.confirm({type:"APPLY_LANG_WITH_RELOAD"}).then(function(){n.set({i18n_locale:t}).then(function(){a.reload()})},function(){e.form.locale=e.curLocale})}}]).controller("PhotoModalController",["$q","$scope","$rootScope","$modalInstance","AppPhotosManager","AppMessagesManager","AppPeersManager","PeersSelectService","ErrorService",function(e,t,n,i,a,o,r,s,c){function l(n){var i=g.indexOf(t.messageID),r=i>=0?i+n:0,s=++v,c=r>=g.length?d():e.when();c.then(function(){s==v&&(t.messageID=g[r],t.photoID=o.getMessage(t.messageID).media.photo.id,t.photo=a.wrapForFull(t.photoID),u())})}function d(){return b?b:b=o.getSearch(m,h,f,_).then(function(e){e.history.length?(_=e.history[e.history.length-1],g=g.concat(e.history),y=g.length<e.count):y=!1,u(),b=!1})}function u(){var e=g.indexOf(t.messageID);t.nav.hasNext=e>0,t.nav.hasPrev=y||e<g.length-1,t.canForward=t.canDelete=t.messageID>0}if(t.photo=a.wrapForFull(t.photoID),t.nav={},t.download=function(){a.downloadPhoto(t.photoID)},(!t.messageID||Config.Mobile)&&(t.nav.next=function(){i.close()}),t.messageID){if(t.forward=function(){var e=t.messageID;s.selectPeer({confirm_type:"FORWARD_PEER"}).then(function(t){var i=r.getPeerID(t);o.forwardMessages(i,[e]).then(function(){n.$broadcast("history_focus",{peerString:t})})})},Config.Mobile)return t.canForward=!0,void(t.canDelete=!0);t["delete"]=function(){var e=t.messageID;c.confirm({type:"MESSAGE_DELETE"}).then(function(){o.deleteMessages([e])})};var p=o.getMessagePeer(o.getMessage(t.messageID)),m=r.getInputPeerByID(p),h="",f={_:"inputMessagesFilterPhotos"},g=[t.messageID],_=t.messageID,y=!0;u(),o.getSearch(m,h,f,0,1e3).then(function(e){e.history.indexOf(t.messageID)>=0&&(g=e.history,_=g[g.length-1],u())});var v=0,b=!1;t.nav.next=function(){return t.nav.hasNext?void l(-1):!1},t.nav.prev=function(){return t.nav.hasPrev?void l(1):!1},t.$on("history_delete",function(e,n){if(n.peerID==p){if(n.msgs[t.messageID])
}]),angular.module("myApp.directives",["myApp.filters"]).directive("myHead",function(){return{restrict:"AE",templateUrl:templateUrl("head")}}).directive("myLangFooter",function(){return{restrict:"AE",templateUrl:templateUrl("lang_footer")}}).directive("myDialog",function(){return{restrict:"AE",templateUrl:templateUrl("dialog")}}).directive("myMessage",["$filter","_",function(e,t){function n(e,t){var n,u,p=!1,m=!1,h=!1,f=!1,g=!1,_=!1,y=!1,v=function(){p!=(e.selectedMsgs[e.historyMessage.id]||!1)&&(p=!p,t.toggleClass(r,p))},b=function(){m!=e.historyMessage.grouped&&(m&&t.removeClass(m),m=e.historyMessage.grouped,m&&t.addClass(m)),_!=(e.historyMessage.needDate||!1)&&(_=!_,_?n?n.show():(n=$(a),$(n[0].firstChild).text(i(e.historyMessage.date)),u?n.insertBefore(u):n.prependTo(t)):n.hide())};v(),b(),e.$on("messages_select",v),e.$on("messages_regroup",b),e.$on("messages_focus",function(n,i){i==e.historyMessage.id!=h&&(h=!h,t.toggleClass(s,h))});var w;if(!e.historyMessage.out&&(e.historyMessage.unread||e.historyMessage.unreadAfter)){var k=function(){e.peerHistory.peerID==e.historyPeer.id&&y!=(e.historyUnreadAfter==e.historyMessage.id)&&(y=!y,y?u?u.show():u=$(o).prependTo(t):(u.hide(),w&&w()))};k(),w=e.$on("messages_unread_after",k)}if(e.historyMessage.unread){t.addClass(c);var C=e.$on("messages_read",function(){e.historyMessage.unread||(t.removeClass(c),C(),w&&!y&&w())})}if(e.historyMessage.error||e.historyMessage.pending){var S=function(){g!=(e.historyMessage.pending||!1)&&(g=!g,t.toggleClass(d,g)),f!=(e.historyMessage.error||!1)&&(f=!f,t.toggleClass(l,f)),f||g||M()},M=e.$on("messages_pending",S);S()}}var i=e("myDate"),a='<div class="im_message_date_split im_service_message_wrap"><div class="im_service_message"></div></div>',o='<div class="im_message_unread_split">'+t("unread_messages_split")+"</div>",r="im_message_selected",s="im_message_focus",c="im_message_unread",l="im_message_error",d="im_message_pending";return{templateUrl:templateUrl("message"),link:n}}]).directive("myServiceMessage",function(){return{templateUrl:templateUrl("message_service")}}).directive("myMessagePhoto",function(){return{templateUrl:templateUrl("message_attach_photo")}}).directive("myMessageVideo",function(){return{templateUrl:templateUrl("message_attach_video")}}).directive("myMessageDocument",function(){return{templateUrl:templateUrl("message_attach_document")}}).directive("myMessageAudio",function(){return{templateUrl:templateUrl("message_attach_audio")}}).directive("myMessageMap",function(){return{templateUrl:templateUrl("message_attach_map")}}).directive("myMessageContact",function(){return{templateUrl:templateUrl("message_attach_contact")}}).directive("myMessagePending",function(){return{templateUrl:templateUrl("message_attach_pending")}}).directive("myDialogs",["$modalStack","$transition","$window","$timeout",function(e,t,n,i){function a(t,a,o){function r(t){if(!m&&e.getTop())return!0;if(36==t.keyCode&&!t.shiftKey&&!t.ctrlKey&&t.altKey){var n=$(c).find(".im_dialog_wrap a");return n.length&&($(n[0]).trigger("mousedown"),c.scrollTop=0,$(s).nanoScroller({flash:!0})),cancelEvent(t)}if(27==t.keyCode||9==t.keyCode&&t.shiftKey&&!t.ctrlKey&&!t.metaKey)return m?l.value&&$(u).trigger("click"):(l.focus(),l.value&&l.select()),cancelEvent(t);if(m&&13==t.keyCode){var n=$(c).find(".im_dialog_selected")[0]||$(c).find(".im_dialog_wrap a")[0];return n&&$(n).trigger("mousedown"),cancelEvent(t)}var i,a,o,r=Config.Modes.packed;if(40==t.keyCode||38==t.keyCode?(i=40==t.keyCode,a=!i,o=!t.shiftKey&&t.altKey):r&&9==t.keyCode&&t.ctrlKey&&!t.metaKey&&(i=!t.shiftKey,a=!i,o=!0),i||a){if(!o&&(!m||t.metaKey))return!0;var d,n=!o&&$(c).find(".im_dialog_selected")[0]||$(c).find(".active a.im_dialog")[0],p=n&&n.parentNode;if(p){var d=n[i?"nextSibling":"previousSibling"];if(!d||!d.className||-1==d.className.indexOf("im_dialog_wrap")){var h=$(c).find(".im_dialog_wrap"),f=h.index(n.parentNode),g=f+(i?1:-1);d=h[g]}}else{var h=$(c).find(".im_dialog_wrap");d=i?h[0]:h[h.length-1]}if(o?d&&$(d).find("a").trigger("mousedown"):(p&&d&&$(p).find("a").removeClass("im_dialog_selected"),d&&$(d).
}),onContentLoaded(function(){i=!1}))})}return{link:e,scope:!0}});