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.

22 lines
989 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
}function onCtrlEnter(e,t){$(e).on("keydown",function(e){return 13==e.keyCode&&(e.ctrlKey||e.metaKey)?(t(),cancelEvent(e)):void 0})}function setFieldSelection(e,t,n){e=$(e)[0];try{if(e.focus(),(void 0===t||t===!1)&&(t=e.value.length),(void 0===n||n===!1)&&(n=t),e.createTextRange){var i=e.createTextRange();i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i.select()}else e.setSelectionRange&&e.setSelectionRange(t,n)}catch(a){}}function getFieldSelection(e){if(e.selectionStart)return e.selectionStart;if(!document.selection)return 0;var t="",n=document.selection.createRange(),i=n.text,a=n.duplicate(),o=0;try{a.moveToElementText(e)}catch(r){return 0}return n.text=i+t,o=a.text.indexOf(t),n.moveStart("character",-1),n.text="",o}function getRichValue(e){if(!e)return"";var t=[],n=[];return getRichElementValue(e,t,n),n.length&&t.push(n.join("")),t.join("\n")}function getRichValueWithCaret(e){if(!e)return[];var t,n,i=[],a=[],o=window.getSelection?window.getSelection():!1;if(o&&o.rangeCount){var r=o.getRangeAt(0);r.startContainer&&r.startContainer==r.endContainer&&r.startOffset==r.endOffset&&(t=r.startContainer,n=r.startOffset)}getRichElementValue(e,i,a,t,n),a.length&&i.push(a.join(""));var s=i.join("\n"),c=s.indexOf("");return-1!=c&&(s=s.substr(0,c)+s.substr(c+1)),[s,c]}function getRichElementValue(e,t,n,i,a){if(3!=e.nodeType){if(1==e.nodeType){var o,r="DIV"==e.tagName||"P"==e.tagName;r&&n.length||"BR"==e.tagName?(t.push(n.join("")),n.splice(0,n.length)):"IMG"==e.tagName&&e.alt&&n.push(e.alt),i===e&&n.push("");for(var o=e.firstChild;o;)getRichElementValue(o,t,n,i,a),o=o.nextSibling;r&&n.length&&(t.push(n.join("")),n.splice(0,n.length))}}else if(i===e){var s=e.nodeValue;n.push(s.substr(0,a)+""+s.substr(a))}else n.push(e.nodeValue)}function setRichFocus(e,t){if(e.focus(),window.getSelection&&document.createRange){var n=document.createRange();t?n.selectNode(t):n.selectNodeContents(e),n.collapse(!1);var i=window.getSelection();i.removeAllRanges(),i.addRange(n)}else if(void 0!==document.body.createTextRange){var a=document.body.createTextRange();a.moveToElementText(t||e),a.collapse(!1),a.select()}}function onContentLoaded(e){setZeroTimeout(e)}function tsNow(e){var t=+new Date+(window.tsOffset||0);return e?Math.floor(t/1e3):t}function safeReplaceObject(e,t){for(var n in e)t.hasOwnProperty(n)||"$"==n.charAt(0)||delete e[n];for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function listMergeSorted(e,t){e=e||[],t=t||[];for(var n=angular.copy(e),i=e.length?e[e.length-1]:4294967295,a=0;a<t.length;a++)t[a]<i&&n.push(t[a]);return n}function listUniqSorted(e){e=e||[];for(var t=[],n=!1,i=0;i<e.length;i++)e[i]!==n&&t.push(e[i]),n=e[i];return t}function templateUrl(e){var t={confirm_modal:"desktop",error_modal:"desktop",media_modal_layout:"desktop",slider:"desktop"},n=t[e]||(Config.Mobile?"mobile":"desktop");return"partials/"+n+"/"+e+".html"}function encodeEntities(e){return e.replace(/&/g,"&amp;").replace(/([^\#-~| |!])/g,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function calcImageInBox(e,t,n,i,a){var o=n,r=i;return e/t>n/i?r=parseInt(t*n/e):(o=parseInt(e*i/t),o>n&&(r=parseInt(r*n/o),o=n)),a&&o>=e&&r>=t&&(o=e,r=t),{w:o,h:r}}function versionCompare(e,t){"string"!=typeof e&&(e=""),"string"!=typeof t&&(t=""),e=e.replace(/^\s+|\s+$/g,"").split("."),t=t.replace(/^\s+|\s+$/g,"").split(".");var n,i=Math.max(e.length,t.length);for(n=0;i>n;n++)if(e[n]!=t[n])return e[n]>t[n]?1:-1;return 0}function bigint(e){return new BigInteger(e.toString(16),16)}function bigStringInt(e){return new BigInteger(e,10)}function dHexDump(e){for(var t=[],n=0;n<e.length;n++)!n||n%2||t.push(n%16?n%4?" ":" ":"\n"),t.push((e[n]<16?"0":"")+e[n].toString(16));console.log(t.join(""))}function bytesToHex(e){e=e||[];for(var t=[],n=0;n<e.length;n++)t.push((e[n]<16?"0":"")+(e[n]||0).toString(16));return t.join("")}function bytesFromHex(e){var t,n=e.length,i=0,a=[];for(e.length%2&&(a.push(parseInt(e.charAt(0),16)),i++),t=i;n>t;t+=2)a.push(parseInt(e.substr(t,2),16));return a}function bytesToBase64(e){for(var t,n="",i=e.lengt
})})}function d(e){return e&&typeof e.getElementsByTagName!==G&&e}function u(){}function p(e){for(var t=0,n=e.length,i="";n>t;t++)i+=e[t].value;return i}function m(e,t,n){var i=t.dir,a=n&&"parentNode"===i,o=j++;return t.first?function(t,n,o){for(;t=t[i];)if(1===t.nodeType||a)return e(t,n,o)}:function(t,n,r){var s,c,l=[q,o];if(r){for(;t=t[i];)if((1===t.nodeType||a)&&e(t,n,r))return!0}else for(;t=t[i];)if(1===t.nodeType||a){if(c=t[R]||(t[R]={}),(s=c[i])&&s[0]===q&&s[1]===o)return l[2]=s[2];if(c[i]=l,l[2]=e(t,n,r))return!0}}}function f(e){return e.length>1?function(t,n,i){for(var a=e.length;a--;)if(!e[a](t,n,i))return!1;return!0}:e[0]}function h(e,n,i){for(var a=0,o=n.length;o>a;a++)t(e,n[a],i);return i}function g(e,t,n,i,a){for(var o,r=[],s=0,c=e.length,l=null!=t;c>s;s++)(o=e[s])&&(!n||n(o,i,a))&&(r.push(o),l&&t.push(s));return r}function _(e,t,n,a,o,r){return a&&!a[R]&&(a=_(a)),o&&!o[R]&&(o=_(o,r)),i(function(i,r,s,c){var l,d,u,p=[],m=[],f=r.length,_=i||h(t||"*",s.nodeType?[s]:s,[]),v=!e||!i&&t?_:g(_,p,e,s,c),y=n?o||(i?e:f||a)?[]:r:v;if(n&&n(v,y,s,c),a)for(l=g(y,m),a(l,[],s,c),d=l.length;d--;)(u=l[d])&&(y[m[d]]=!(v[m[d]]=u));if(i){if(o||e){if(o){for(l=[],d=y.length;d--;)(u=y[d])&&l.push(v[d]=u);o(null,y=[],l,c)}for(d=y.length;d--;)(u=y[d])&&(l=o?tt.call(i,u):p[d])>-1&&(i[l]=!(r[l]=u))}}else y=g(y===r?y.splice(f,y.length):y),o?o(null,r,y,c):Q.apply(r,y)})}function v(e){for(var t,n,i,a=e.length,o=$.relative[e[0].type],r=o||$.relative[" "],s=o?1:0,c=m(function(e){return e===t},r,!0),l=m(function(e){return tt.call(t,e)>-1},r,!0),d=[function(e,n,i){return!o&&(i||n!==x)||((t=n).nodeType?c(e,n,i):l(e,n,i))}];a>s;s++)if(n=$.relative[e[s].type])d=[m(f(d),n)];else{if(n=$.filter[e[s].type].apply(null,e[s].matches),n[R]){for(i=++s;a>i&&!$.relative[e[i].type];i++);return _(s>1&&f(d),s>1&&p(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ct,"$1"),n,i>s&&v(e.slice(s,i)),a>i&&v(e=e.slice(i)),a>i&&p(e))}d.push(n)}return f(d)}function y(e,n){var a=n.length>0,o=e.length>0,r=function(i,r,s,c,l){var d,u,p,m=0,f="0",h=i&&[],_=[],v=x,y=i||o&&$.find.TAG("*",l),b=q+=null==v?1:Math.random()||.1,w=y.length;for(l&&(x=r!==D&&r);f!==w&&null!=(d=y[f]);f++){if(o&&d){for(u=0;p=e[u++];)if(p(d,r,s)){c.push(d);break}l&&(q=b)}a&&((d=!p&&d)&&m--,i&&h.push(d))}if(m+=f,a&&f!==m){for(u=0;p=n[u++];)p(h,_,r,s);if(i){if(m>0)for(;f--;)h[f]||_[f]||(_[f]=X.call(c));_=g(_)}Q.apply(c,_),l&&!i&&_.length>0&&m+n.length>1&&t.uniqueSort(c)}return l&&(q=b,x=v),h};return a?i(r):r}var b,w,$,k,S,C,M,A,x,E,T,I,D,P,N,U,O,L,B,R="sizzle"+-new Date,F=e.document,q=0,j=0,H=n(),V=n(),z=n(),W=function(e,t){return e===t&&(T=!0),0},G="undefined",K=1<<31,Z={}.hasOwnProperty,Y=[],X=Y.pop,J=Y.push,Q=Y.push,et=Y.slice,tt=Y.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},nt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",it="[\\x20\\t\\r\\n\\f]",at="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ot=at.replace("w","w#"),rt="\\["+it+"*("+at+")(?:"+it+"*([*^$|!~]?=)"+it+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ot+"))|)"+it+"*\\]",st=":("+at+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+rt+")*)|.*)\\)|)",ct=new RegExp("^"+it+"+|((?:^|[^\\\\])(?:\\\\.)*)"+it+"+$","g"),lt=new RegExp("^"+it+"*,"+it+"*"),dt=new RegExp("^"+it+"*([>+~]|"+it+")"+it+"*"),ut=new RegExp("="+it+"*([^\\]'\"]*?)"+it+"*\\]","g"),pt=new RegExp(st),mt=new RegExp("^"+ot+"$"),ft={ID:new RegExp("^#("+at+")"),CLASS:new RegExp("^\\.("+at+")"),TAG:new RegExp("^("+at.replace("w","w*")+")"),ATTR:new RegExp("^"+rt),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+it+"*(even|odd|(([+-]|)(\\d*)n|)"+it+"*(?:([+-]|)"+it+"*(\\d+)|))"+it+"*\\)|)","i"),bool:new RegExp("^(?:"+nt+")$","i"),needsContext:new RegExp("^"+it+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+it+"*((?:-\\d)?\\d*)"+it+"*\\)|)(?=[^-]|$)","i")},ht=/^(?:input|select|textarea|button)$/i,gt=/^h\d$/i,_t=/^[^{]+\{\s*\[native \w/,vt=/^(?:#([\w-]+)|(\
if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(r=at.event.handlers.call(this,e,c),t=0;(a=r[t++])&&!e.isPropagationStopped();)for(e.currentTarget=a.elem,o=0;(i=a.handlers[o++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,n=((at.event.special[i.origType]||{}).handle||i.handler).apply(a.elem,s),void 0!==n&&(e.result=n)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,a,o,r=[],s=t.delegateCount,c=e.target;if(s&&c.nodeType&&(!e.button||"click"!==e.type))for(;c!=this;c=c.parentNode||this)if(1===c.nodeType&&(c.disabled!==!0||"click"!==e.type)){for(a=[],o=0;s>o;o++)i=t[o],n=i.selector+" ",void 0===a[n]&&(a[n]=i.needsContext?at(n,this).index(c)>=0:at.find(n,this,null,[c]).length),a[n]&&a.push(i);a.length&&r.push({elem:c,handlers:a})}return s<t.length&&r.push({elem:this,handlers:t.slice(s)}),r},fix:function(e){if(e[at.expando])return e;var t,n,i,a=e.type,o=e,r=this.fixHooks[a];for(r||(this.fixHooks[a]=r=Pt.test(a)?this.mouseHooks:Dt.test(a)?this.keyHooks:{}),i=r.props?this.props.concat(r.props):this.props,e=new at.Event(o),t=i.length;t--;)n=i[t],e[n]=o[n];return e.target||(e.target=o.srcElement||ft),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,r.filter?r.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,i,a,o=t.button,r=t.fromElement;return null==e.pageX&&null!=t.clientX&&(i=e.target.ownerDocument||ft,a=i.documentElement,n=i.body,e.pageX=t.clientX+(a&&a.scrollLeft||n&&n.scrollLeft||0)-(a&&a.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(a&&a.scrollTop||n&&n.scrollTop||0)-(a&&a.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&r&&(e.relatedTarget=r===e.target?t.toElement:r),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==f()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===f()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return at.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(e){return at.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,i){var a=at.extend(new at.Event,n,{type:e,isSimulated:!0,originalEvent:{}});i?at.event.trigger(a,null,t):at.event.dispatch.call(t,a),a.isDefaultPrevented()&&n.preventDefault()}},at.removeEvent=ft.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var i="on"+t;e.detachEvent&&(typeof e[i]===kt&&(e[i]=null),e.detachEvent(i,n))},at.Event=function(e,t){return this instanceof at.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?p:m):this.type=e,t&&at.extend(this,t),this.timeStamp=e&&e.timeStamp||at.now(),void(this[at.expando]=!0)):new at.Event(e,t)},at.Event.prototype={isDefaultPrevented:m,isPropagationStopped:m,isImmediatePropagationStopped:m,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=p,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=p,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=p,e&&e.stopImmediatePropagation&&e.stopImmediatePropa
else(n===kt||"boolean"===n)&&(this.className&&at._data(this,"__className__",this.className),this.className=this.className||e===!1?"":at._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,i=this.length;i>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Tn," ").indexOf(t)>=0)return!0;return!1}}),at.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){at.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),at.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var In=at.now(),Dn=/\?/,Pn=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;at.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,i=null,a=at.trim(t+"");return a&&!at.trim(a.replace(Pn,function(e,t,a,o){return n&&t&&(i=0),0===i?e:(n=a||t,i+=!o-!a,"")}))?Function("return "+a)():at.error("Invalid JSON: "+t)},at.parseXML=function(t){var n,i;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(i=new DOMParser,n=i.parseFromString(t,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(a){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||at.error("Invalid XML: "+t),n};var Nn,Un,On=/#.*$/,Ln=/([?&])_=[^&]*/,Bn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Rn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fn=/^(?:GET|HEAD)$/,qn=/^\/\//,jn=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hn={},Vn={},zn="*/".concat("*");try{Un=location.href}catch(Wn){Un=ft.createElement("a"),Un.href="",Un=Un.href}Nn=jn.exec(Un.toLowerCase())||[],at.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Un,type:"GET",isLocal:Rn.test(Nn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":at.parseJSON,"text xml":at.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?q(q(e,at.ajaxSettings),t):q(at.ajaxSettings,e)},ajaxPrefilter:R(Hn),ajaxTransport:R(Vn),ajax:function(e,t){function n(e,t,n,i){var a,d,_,v,b,$=t;2!==y&&(y=2,s&&clearTimeout(s),l=void 0,r=i||"",w.readyState=e>0?4:0,a=e>=200&&300>e||304===e,n&&(v=j(u,w,n)),v=H(u,v,w,a),a?(u.ifModified&&(b=w.getResponseHeader("Last-Modified"),b&&(at.lastModified[o]=b),b=w.getResponseHeader("etag"),b&&(at.etag[o]=b)),204===e||"HEAD"===u.type?$="nocontent":304===e?$="notmodified":($=v.state,d=v.data,_=v.error,a=!_)):(_=$,(e||!$)&&($="error",0>e&&(e=0))),w.status=e,w.statusText=(t||$)+"",a?f.resolveWith(p,[d,$,w]):f.rejectWith(p,[w,$,_]),w.statusCode(g),g=void 0,c&&m.trigger(a?"ajaxSuccess":"ajaxError",[w,u,a?d:_]),h.fireWith(p,[w,$]),c&&(m.trigger("ajaxComplete",[w,u]),--at.active||at.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,a,o,r,s,c,l,d,u=at.ajaxSetup({},t),p=u.context||u,m=u.context&&(p.nodeType||p.jquery)?at(p):at.event,f=at.Deferred(),h=at.Callbacks("once memory"),g=u.statusCode||{},_={},v={},y=0,b="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===y){if(!d)for(d={};t=Bn.exec(r);)d[t[1].toLowerCase()]=t[2];t=d[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===y?r:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return y||(e=v[n]=v[n]||e,_[e]=t),this},overrideMimeType:function(e)
}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],"xt_"!=n.substr(0,3)&&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,f,h,g,_,v,y,b,w,$,k,S,C,M,A,x,E,T,I,D,P;C={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",y="scroll",u="mousedown",p="mouseenter",m="mousemove",h="mousewheel",f="mouseup
if(k(e))e=e();else if(I(e)){var n=e[0],i=t.getComputedStyle(n);e="fixed"!==i.position?0:n.getBoundingClientRect().bottom}else w(e)||(e=0);return e}function r(e){if(e){e.scrollIntoView();var n=o();if(n){var i=e.getBoundingClientRect().top;t.scrollBy(0,i-n)}}else t.scrollTo(0,0)}function s(){var e,t=n.hash();t?(e=c.getElementById(t))?r(e):(e=a(c.getElementsByName(t)))?r(e):"top"===t&&r(null):r(null)}var c=t.document;return e&&i.$watch(function(){return n.hash()},function(e,t){(e!==t||""!==e)&&Dt(function(){i.$evalAsync(s)})}),s}]}function jt(){this.$get=["$$rAF","$timeout",function(e,t){return e.supported?function(t){return e(t)}:function(e){return t(e,0,!1)}}]}function Ht(e,t,i,a){function r(e){try{e.apply(null,R(arguments,1))}finally{if($--,0===$)for(;k.length;)try{k.pop()()}catch(t){i.error(t)}}}function s(e,t){!function n(){o(C,function(e){e()}),S=t(n,e)}()}function c(){l(),d()}function l(){M=e.history.state,M=_(M)?null:M,L(M,P)&&(M=P),P=M}function d(){(x!==p.url()||A!==M)&&(x=p.url(),A=M,o(I,function(e){e(p.url(),M)}))}function u(e){try{return decodeURIComponent(e)}catch(t){return e}}var p=this,m=t[0],h=e.location,g=e.history,v=e.setTimeout,y=e.clearTimeout,w={};p.isMock=!1;var $=0,k=[];p.$$completeOutstandingRequest=r,p.$$incOutstandingRequestCount=function(){$++},p.notifyWhenNoOutstandingRequests=function(e){o(C,function(e){e()}),0===$?e():k.push(e)};var S,C=[];p.addPollFn=function(e){return _(S)&&s(100,v),C.push(e),e};var M,A,x=h.href,E=t.find("base"),T=null;l(),A=M,p.url=function(t,n,i){if(_(i)&&(i=null),h!==e.location&&(h=e.location),g!==e.history&&(g=e.history),t){var o=A===i;if(x===t&&(!a.history||o))return;var r=x&&_n(x)===_n(t);return x=t,A=i,!a.history||r&&o?(r||(T=t),n?h.replace(t):h.href=t):(g[n?"replaceState":"pushState"](i,"",t),l(),A=M),p}return T||h.href.replace(/%27/g,"'")},p.state=function(){return M};var I=[],D=!1,P=null;p.onUrlChange=function(t){return D||(a.history&&zi(e).on("popstate",c),zi(e).on("hashchange",c),D=!0),I.push(t),t},p.$$checkUrlChange=d,p.baseHref=function(){var e=E.attr("href");return e?e.replace(/^(https?\:)?\/\/[^\/]*/,""):""};var N={},U="",O=p.baseHref();p.cookies=function(e,t){var a,o,r,s,c;if(!e){if(m.cookie!==U)for(U=m.cookie,o=U.split("; "),N={},s=0;s<o.length;s++)r=o[s],c=r.indexOf("="),c>0&&(e=u(r.substring(0,c)),N[e]===n&&(N[e]=u(r.substring(c+1))));return N}t===n?m.cookie=encodeURIComponent(e)+"=;path="+O+";expires=Thu, 01 Jan 1970 00:00:00 GMT":b(t)&&(a=(m.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path="+O).length+1,a>4096&&i.warn("Cookie '"+e+"' possibly not set or overflowed because it was too large ("+a+" > 4096 bytes)!"))},p.defer=function(e,t){var n;return $++,n=v(function(){delete w[n],r(e)},t||0),w[n]=!0,n},p.defer.cancel=function(e){return w[e]?(delete w[e],y(e),r(f),!0):!1}}function Vt(){this.$get=["$window","$log","$sniffer","$document",function(e,t,n,i){return new Ht(e,i,t,n)}]}function zt(){this.$get=function(){function e(e,n){function a(e){e!=p&&(m?m==e&&(m=e.n):m=e,o(e.n,e.p),o(e,p),p=e,p.n=null)}function o(e,t){e!=t&&(e&&(e.p=t),t&&(t.n=e))}if(e in t)throw i("$cacheFactory")("iid","CacheId '{0}' is already taken!",e);var r=0,s=u({},n,{id:e}),c={},l=n&&n.capacity||Number.MAX_VALUE,d={},p=null,m=null;return t[e]={put:function(e,t){if(l<Number.MAX_VALUE){var n=d[e]||(d[e]={key:e});a(n)}if(!_(t))return e in c||r++,c[e]=t,r>l&&this.remove(m.key),t},get:function(e){if(l<Number.MAX_VALUE){var t=d[e];if(!t)return;a(t)}return c[e]},remove:function(e){if(l<Number.MAX_VALUE){var t=d[e];if(!t)return;t==p&&(p=t.p),t==m&&(m=t.n),o(t.n,t.p),delete d[e]}delete c[e],r--},removeAll:function(){c={},r=0,d={},p=m=null},destroy:function(){c=null,s=null,d=null,delete t[e]},info:function(){return u({},s,{size:r})}}}var t={};return e.info=function(){var e={};return o(t,function(t,n){e[n]=t.info()}),e},e.get=function(e){return t[e]},e}}function Wt(){this.$get=["$cacheFactory",function(e){return e("templates")}]}function Gt(e,i){function a(e,t){var n=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,i={};return o(e,function(e,a){var o=e.match(n);if(!o)throw Ra("iscp","Invalid i
}}),l.absUrl()!=m&&a.url(l.absUrl(),!0);var h=!0;return a.onUrlChange(function(e,t){i.$evalAsync(function(){var n=l.absUrl(),a=l.$$state;l.$$parse(e),l.$$state=t,i.$broadcast("$locationChangeStart",e,n,t,a).defaultPrevented?(l.$$parse(n),l.$$state=a,s(n,!1,a)):(h=!1,c(n,a))}),i.$$phase||i.$digest()}),i.$watch(function(){var e=a.url(),t=a.state(),n=l.$$replace,r=e!==l.absUrl()||l.$$html5&&o.history&&t!==l.$$state;(h||r)&&(h=!1,i.$evalAsync(function(){i.$broadcast("$locationChangeStart",l.absUrl(),e,l.$$state,t).defaultPrevented?(l.$$parse(e),l.$$state=t):(r&&s(l.absUrl(),n,t===l.$$state?null:l.$$state),c(e,t))})),l.$$replace=!1}),l}]}function Mn(){var e=!0,t=this;this.debugEnabled=function(t){return v(t)?(e=t,this):e},this.$get=["$window",function(n){function i(e){return e instanceof Error&&(e.stack?e=e.message&&-1===e.stack.indexOf(e.message)?"Error: "+e.message+"\n"+e.stack:e.stack:e.sourceURL&&(e=e.message+"\n"+e.sourceURL+":"+e.line)),e}function a(e){var t=n.console||{},a=t[e]||t.log||f,r=!1;try{r=!!a.apply}catch(s){}return r?function(){var e=[];return o(arguments,function(t){e.push(i(t))}),a.apply(t,e)}:function(e,t){a(e,null==t?"":t)}}return{log:a("log"),info:a("info"),warn:a("warn"),error:a("error"),debug:function(){var n=a("debug");return function(){e&&n.apply(t,arguments)}}()}}]}function An(e,t){if("__defineGetter__"===e||"__defineSetter__"===e||"__lookupGetter__"===e||"__lookupSetter__"===e||"__proto__"===e)throw Xa("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",t);return e}function xn(e,t){if(e){if(e.constructor===e)throw Xa("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e.window===e)throw Xa("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",t);if(e.children&&(e.nodeName||e.prop&&e.attr&&e.find))throw Xa("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",t);if(e===Object)throw Xa("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",t)}return e}function En(e,t){if(e){if(e.constructor===e)throw Xa("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e===Ja||e===Qa||e===eo)throw Xa("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",t)}}function Tn(e){return e.constant}function In(e,t,n,i){xn(e,i);for(var a,o=t.split("."),r=0;o.length>1;r++){a=An(o.shift(),i);var s=xn(e[a],i);s||(s={},e[a]=s),e=s}return a=An(o.shift(),i),xn(e[a],i),e[a]=n,n}function Dn(e){return"constructor"==e}function Pn(e,t,i,a,o,r,s){An(e,r),An(t,r),An(i,r),An(a,r),An(o,r);var c=function(e){return xn(e,r)},l=s||Dn(e)?c:h,d=s||Dn(t)?c:h,u=s||Dn(i)?c:h,p=s||Dn(a)?c:h,m=s||Dn(o)?c:h;return function(r,s){var c=s&&s.hasOwnProperty(e)?s:r;return null==c?c:(c=l(c[e]),t?null==c?n:(c=d(c[t]),i?null==c?n:(c=u(c[i]),a?null==c?n:(c=p(c[a]),o?null==c?n:c=m(c[o]):c):c):c):c)}}function Nn(e,t){return function(n,i){return e(n,i,xn,t)}}function Un(e,t,i){var a=t.expensiveChecks,r=a?so:ro,s=r[e];if(s)return s;var c=e.split("."),l=c.length;if(t.csp)s=6>l?Pn(c[0],c[1],c[2],c[3],c[4],i,a):function(e,t){var o,r=0;do o=Pn(c[r++],c[r++],c[r++],c[r++],c[r++],i,a)(e,t),t=n,e=o;while(l>r);return o};else{var d="";a&&(d+="s = eso(s, fe);\nl = eso(l, fe);\n");var u=a;o(c,function(e,t){An(e,i);var n=(t?"s":'((l&&l.hasOwnProperty("'+e+'"))?l:s)')+"."+e;(a||Dn(e))&&(n="eso("+n+", fe)",u=!0),d+="if(s == null) return undefined;\ns="+n+";\n"}),d+="return s;";var p=new Function("s","l","eso","fe",d);p.toString=g(d),u&&(p=Nn(p,i)),s=p}return s.sharedGetter=!0,s.assign=function(t,n){return In(t,e,n,e)},r[e]=s,s}function On(e){return k(e.valueOf)?e.valueOf():co.call(e)}function Ln(){var e=ct(),t=ct();this.$get=["$filter","$sniffer",function(n,i){function a(e){var t=e;return e.sharedGetter&&(t=function(t,n){return e(t,n)},t.literal=e.literal,t.constant=e.constant,t.assign=e.assign),t}function r(e,t){for(var n=0,i=e.length;i>n;n++){var a=e[n];a.constant||(a.inputs?r(a.inputs,t):-1===t.indexOf(a)&&t.push(
},i.$observe("min",function(e){v(e)&&!w(e)&&(e=parseFloat(e,10)),s=w(e)&&!isNaN(e)?e:n,a.$validate()})}if(i.max||i.ngMax){var c;a.$validators.max=function(e){return a.$isEmpty(e)||_(c)||c>=e},i.$observe("max",function(e){v(e)&&!w(e)&&(e=parseFloat(e,10)),c=w(e)&&!isNaN(e)?e:n,a.$validate()})}}function Ei(e,t,n,i,a,o){ki(e,t,n,i,a,o),wi(i),i.$$parserName="url",i.$validators.url=function(e){return i.$isEmpty(e)||xo.test(e)}}function Ti(e,t,n,i,a,o){ki(e,t,n,i,a,o),wi(i),i.$$parserName="email",i.$validators.email=function(e){return i.$isEmpty(e)||Eo.test(e)}}function Ii(e,t,n,i){_(n.name)&&t.attr("name",l());var a=function(e){t[0].checked&&i.$setViewValue(n.value,e&&e.type)};t.on("click",a),i.$render=function(){var e=n.value;t[0].checked=e==i.$viewValue},n.$observe("value",i.$render)}function Di(e,t,n,a,o){var r;if(v(a)){if(r=e(a),!r.constant)throw i("ngModel")("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,a);return r(t)}return o}function Pi(e,t,n,i,a,o,r,s){var c=Di(s,e,"ngTrueValue",n.ngTrueValue,!0),l=Di(s,e,"ngFalseValue",n.ngFalseValue,!1),d=function(e){i.$setViewValue(t[0].checked,e&&e.type)};t.on("click",d),i.$render=function(){t[0].checked=i.$viewValue},i.$isEmpty=function(e){return e!==c},i.$formatters.push(function(e){return L(e,c)}),i.$parsers.push(function(e){return e?c:l})}function Ni(e){function t(e,t,c){t===n?i("$pending",e,c):a("$pending",e,c),E(t)?t?(u(s.$error,e,c),d(s.$$success,e,c)):(d(s.$error,e,c),u(s.$$success,e,c)):(u(s.$error,e,c),u(s.$$success,e,c)),s.$pending?(o(Wo,!0),s.$valid=s.$invalid=n,r("",null)):(o(Wo,!1),s.$valid=Ui(s.$error),s.$invalid=!s.$valid,r("",s.$valid));var l;l=s.$pending&&s.$pending[e]?n:s.$error[e]?!1:s.$$success[e]?!0:null,r(e,l),p.$setValidity(e,l,s)}function i(e,t,n){s[e]||(s[e]={}),d(s[e],t,n)}function a(e,t,i){s[e]&&u(s[e],t,i),Ui(s[e])&&(s[e]=n)}function o(e,t){t&&!l[e]?(m.addClass(c,e),l[e]=!0):!t&&l[e]&&(m.removeClass(c,e),l[e]=!1)}function r(e,t){e=e?"-"+tt(e,"-"):"",o(Fo+e,t===!0),o(qo+e,t===!1)}var s=e.ctrl,c=e.$element,l={},d=e.set,u=e.unset,p=e.parentForm,m=e.$animate;l[qo]=!(l[Fo]=c.hasClass(Fo)),s.$setValidity=t}function Ui(e){if(e)for(var t in e)return!1;return!0}function Oi(e,t){return e="ngClass"+e,["$animate",function(n){function i(e,t){var n=[];e:for(var i=0;i<e.length;i++){for(var a=e[i],o=0;o<t.length;o++)if(a==t[o])continue e;n.push(a)}return n}function a(e){if(na(e))return e;if(b(e))return e.split(" ");if(y(e)){var t=[];return o(e,function(e,n){e&&(t=t.concat(n.split(" ")))}),t}return e}return{restrict:"AC",link:function(r,s,c){function l(e){var t=u(e,1);c.$addClass(t)}function d(e){var t=u(e,-1);c.$removeClass(t)}function u(e,t){var n=s.data("$classCounts")||{},i=[];return o(e,function(e){(t>0||n[e])&&(n[e]=(n[e]||0)+t,n[e]===+(t>0)&&i.push(e))}),s.data("$classCounts",n),i.join(" ")}function p(e,t){var a=i(t,e),o=i(e,t);a=u(a,1),o=u(o,-1),a&&a.length&&n.addClass(s,a),o&&o.length&&n.removeClass(s,o)}function m(e){if(t===!0||r.$index%2===t){var n=a(e||[]);if(f){if(!L(e,f)){var i=a(f);p(i,n)}}else l(n)}f=O(e)}var f;r.$watch(c[e],m,!0),c.$observe("class",function(){m(r.$eval(c[e]))}),"ngClass"!==e&&r.$watch("$index",function(n,i){var o=1&n;if(o!==(1&i)){var s=a(r.$eval(c[e]));o===t?l(s):d(s)}})}}}]}var Li=/^\/(.+)\/([a-z]*)$/,Bi="validity",Ri=function(e){return b(e)?e.toLowerCase():e},Fi=Object.prototype.hasOwnProperty,qi=function(e){return b(e)?e.toUpperCase():e},ji=function(e){return b(e)?e.replace(/[A-Z]/g,function(e){return String.fromCharCode(32|e.charCodeAt(0))}):e},Hi=function(e){return b(e)?e.replace(/[a-z]/g,function(e){return String.fromCharCode(-33&e.charCodeAt(0))}):e};"i"!=="I".toLowerCase()&&(Ri=ji,qi=Hi);var Vi,zi,Wi,Gi,Ki=[].slice,Zi=[].splice,Yi=[].push,Xi=Object.prototype.toString,Ji=i("ng"),Qi=e.angular||(e.angular={}),ea=0;Vi=t.documentMode,f.$inject=[],h.$inject=[];var ta,na=Array.isArray,ia=function(e){return b(e)?e.trim():e},aa=function(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},oa=function(){if(v(oa.isActive_))return oa.isActive_;var e=!(!t.querySelector("[ng-csp]")&
a.$$setOptions(i[2]&&i[2].$options),o.$addControl(a),n.$observe("name",function(e){a.$name!==e&&o.$$renameControl(a,e)}),e.$on("$destroy",function(){o.$removeControl(a)})},post:function(e,t,n,i){var a=i[0];a.$options&&a.$options.updateOn&&t.on(a.$options.updateOn,function(e){a.$$debounceViewValueCommit(e&&e.type)}),t.on("blur",function(){a.$touched||e.$apply(function(){a.$setTouched()})})}}}}},Zo=g({restrict:"A",require:"ngModel",link:function(e,t,n,i){i.$viewChangeListeners.push(function(){e.$eval(n.ngChange)})}}),Yo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){i&&(n.required=!0,i.$validators.required=function(e){return!n.required||!i.$isEmpty(e)},n.$observe("required",function(){i.$validate()}))}}},Xo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,a,o){if(o){var r,s=a.ngPattern||a.pattern;a.$observe("pattern",function(e){if(b(e)&&e.length>0&&(e=new RegExp(e)),e&&!e.test)throw i("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",s,e,V(t));r=e||n,o.$validate()}),o.$validators.pattern=function(e){return o.$isEmpty(e)||_(r)||r.test(e)}}}}},Jo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){if(i){var a=0;n.$observe("maxlength",function(e){a=p(e)||0,i.$validate()}),i.$validators.maxlength=function(e,t){return i.$isEmpty(e)||t.length<=a}}}}},Qo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){if(i){var a=0;n.$observe("minlength",function(e){a=p(e)||0,i.$validate()}),i.$validators.minlength=function(e,t){return i.$isEmpty(e)||t.length>=a}}}}},er=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(e,t,i,a){var r=t.attr(i.$attr.ngList)||", ",s="false"!==i.ngTrim,c=s?ia(r):r,l=function(e){if(!_(e)){var t=[];return e&&o(e.split(c),function(e){e&&t.push(s?ia(e):e)}),t}};a.$parsers.push(l),a.$formatters.push(function(e){return na(e)?e.join(r):n}),a.$isEmpty=function(e){return!e||!e.length}}}},tr=/^(true|false|\d+)$/,nr=function(){return{restrict:"A",priority:100,compile:function(e,t){return tr.test(t.ngValue)?function(e,t,n){n.$set("value",e.$eval(n.ngValue))}:function(e,t,n){e.$watch(n.ngValue,function(e){n.$set("value",e)})}}}},ir=function(){return{restrict:"A",controller:["$scope","$attrs",function(e,t){var i=this;this.$options=e.$eval(t.ngModelOptions),this.$options.updateOn!==n?(this.$options.updateOnDefault=!1,this.$options.updateOn=ia(this.$options.updateOn.replace(Oo,function(){return i.$options.updateOnDefault=!0," "}))):this.$options.updateOnDefault=!0}]}},ar=["$compile",function(e){return{restrict:"AC",compile:function(t){return e.$$addBindingClass(t),function(t,i,a){e.$$addBindingInfo(i,a.ngBind),i=i[0],t.$watch(a.ngBind,function(e){i.textContent=e===n?"":e})}}}}],or=["$interpolate","$compile",function(e,t){return{compile:function(i){return t.$$addBindingClass(i),function(i,a,o){var r=e(a.attr(o.$attr.ngBindTemplate));t.$$addBindingInfo(a,r.expressions),a=a[0],o.$observe("ngBindTemplate",function(e){a.textContent=e===n?"":e})}}}}],rr=["$sce","$parse","$compile",function(e,t,n){return{restrict:"A",compile:function(i,a){var o=t(a.ngBindHtml),r=t(a.ngBindHtml,function(e){return(e||"").toString()});return n.$$addBindingClass(i),function(t,i,a){n.$$addBindingInfo(i,a.ngBindHtml),t.$watch(r,function(){i.html(e.getTrustedHtml(o(t))||"")})}}}}],sr=Oi("",!0),cr=Oi("Odd",0),lr=Oi("Even",1),dr=vi({compile:function(e,t){t.$set("ngCloak",n),e.removeClass("ng-cloak")}}),ur=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],pr={},mr={blur:!0,focus:!0};o("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(e){var t=Kt("ng-"+e);pr[t]=["$parse","$rootScope",function(n,i){return{restrict:"A",compile:function(a,o){var r=n(o[t],null,!0);return function(t,n){n.on(e,function(n){var a=function(){r(t,{$event:n})};mr[e]&&i.$$phase?t.$evalAsync(a):t.$apply(a)})}}}}]});var fr=["$animate",function(e){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,rest
return e=p(e)?e:e.split(/\s+/),d(e,function(e,i){e&&e.length>0&&(n+=(i>0?" ":"")+e+t)}),n}var E,T,I,D,P="";e.ontransitionend===n&&e.onwebkittransitionend!==n?(P="-webkit-",E="WebkitTransition",T="webkitTransitionEnd transitionend"):(E="transition",T="transitionend"),e.onanimationend===n&&e.onwebkitanimationend!==n?(P="-webkit-",I="WebkitAnimation",D="webkitAnimationEnd animationend"):(I="animation",D="animationend");var N,U="Duration",O="Property",L="Delay",B="IterationCount",R="PlayState",F="$$ngAnimateKey",q="$$ngAnimateCSS3Data",j=3,H=1.5,V=1e3,z={},W=0,G=[],K=null,Z=0,Y=[];return{animate:function(e,t,n,i,a,o){return o=o||{},o.from=n,o.to=i,M("animate",e,t,a,o)},enter:function(e,t,n){return n=n||{},M("enter",e,"ng-enter",t,n)},leave:function(e,t,n){return n=n||{},M("leave",e,"ng-leave",t,n)},move:function(e,t,n){return n=n||{},M("move",e,"ng-move",t,n)},beforeSetClass:function(e,t,n,i,a){a=a||{};var o=x(n,"-remove")+" "+x(t,"-add"),r=S("setClass",e,o,a.from);return r?(u(e,i),r):(c(),void i())},beforeAddClass:function(e,t,n,i){i=i||{};var a=S("addClass",e,x(t,"-add"),i.from);return a?(u(e,n),a):(c(),void n())},beforeRemoveClass:function(e,t,n,i){i=i||{};var a=S("removeClass",e,x(t,"-remove"),i.from);return a?(u(e,n),a):(c(),void n())},setClass:function(e,t,n,i,a){a=a||{},n=x(n,"-remove"),t=x(t,"-add");var o=n+" "+t;return C("setClass",e,o,i,a.to)},addClass:function(e,t,n,i){return i=i||{},C("addClass",e,x(t,"-add"),n,i.to)},removeClass:function(e,t,n,i){return i=i||{},C("removeClass",e,x(t,"-remove"),n,i.to)}}}])}])}(window,window.angular),function(e,t){"use strict";function n(){this.$get=["$$sanitizeUri",function(e){return function(t){var n=[];return o(t,c(n,function(t,n){return!/^unsafe/.test(e(t,n))})),n.join("")}}]}function i(e){var n=[],i=c(n,t.noop);return i.chars(e),n.join("")}function a(e){var t,n={},i=e.split(",");for(t=0;t<i.length;t++)n[i[t]]=!0;return n}function o(e,n){function i(e,i,o,s){if(i=t.lowercase(i),S[i])for(;y.last()&&C[y.last()];)a("",y.last());k[i]&&y.last()==i&&a("",i),s=b[i]||!!s,s||y.push(i);var c={};o.replace(p,function(e,t,n,i,a){var o=n||i||a||"";c[t]=r(o)}),n.start&&n.start(i,c,s)}function a(e,i){var a,o=0;if(i=t.lowercase(i))for(o=y.length-1;o>=0&&y[o]!=i;o--);if(o>=0){for(a=y.length-1;a>=o;a--)n.end&&n.end(y[a]);y.length=o}}"string"!=typeof e&&(e=null===e||"undefined"==typeof e?"":""+e);var o,s,c,v,y=[],w=e;for(y.last=function(){return y[y.length-1]};e;){if(v="",s=!0,y.last()&&A[y.last()]?(e=e.replace(new RegExp("(.*)<\\s*\\/\\s*"+y.last()+"[^>]*>","i"),function(e,t){return t=t.replace(h,"$1").replace(_,"$1"),n.chars&&n.chars(r(t)),""}),a("",y.last())):(0===e.indexOf("<!--")?(o=e.indexOf("--",4),o>=0&&e.lastIndexOf("-->",o)===o&&(n.comment&&n.comment(e.substring(4,o)),e=e.substring(o+3),s=!1)):g.test(e)?(c=e.match(g),c&&(e=e.replace(c[0],""),s=!1)):f.test(e)?(c=e.match(u),c&&(e=e.substring(c[0].length),c[0].replace(u,a),s=!1)):m.test(e)&&(c=e.match(d),c?(c[4]&&(e=e.substring(c[0].length),c[0].replace(d,i)),s=!1):(v+="<",e=e.substring(1))),s&&(o=e.indexOf("<"),v+=0>o?e:e.substring(0,o),e=0>o?"":e.substring(o),n.chars&&n.chars(r(v)))),e==w)throw l("badparse","The sanitizer was unable to parse the following block of html: {0}",e);w=e}a()}function r(e){if(!e)return"";var t=N.exec(e),n=t[1],i=t[3],a=t[2];return a&&(P.innerHTML=a.replace(/</g,"&lt;"),a="textContent"in P?P.textContent:P.innerText),n+a+i}function s(e){return e.replace(/&/g,"&amp;").replace(v,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(y,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function c(e,n){var i=!1,a=t.bind(e,e.push);return{start:function(e,o,r){e=t.lowercase(e),!i&&A[e]&&(i=e),i||x[e]!==!0||(a("<"),a(e),t.forEach(o,function(i,o){var r=t.lowercase(o),c="img"===e&&"src"===r||"background"===r;D[r]!==!0||E[r]===!0&&!n(i,c)||(a(" "),a(o),a('="'),a(s(i)),a('"'))}),a(r?"/>":">"))},end:function(e){e=t.lowercase(e),i||x[e]!==!0||(a("</"),a(e),a(">")),e==i&&(i=!1)},chars:function(e){i||a(s(e))}}}var l=t.$$minErr("$sanitize
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];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFlipBit,BigInteger.prototype.add=bnAdd,BigInteger.prototype.subtract=bnSubtract,BigInteger.prototype.multiply=bnMultiply,BigInteger.prototype.divide=bnDivide,BigInteger.prototype.remainder=bnRemainder,BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder,BigInteger.prototype.modPow=bnModPow,BigInteger.prototype.modInverse=bnModInverse,BigInteger.prototype.pow=bnP
for(t=0,n=s.length;n>t;++t)for(e=s[t],i=0,a=e.length;a>i;++i)c[o++]=e[i];for(t=32768,n=this.a;n>t;++t)c[o++]=r[t];return this.i=[],this.buffer=c},o.prototype.A=function(){var e,t=this.a;return p?this.w?(e=new Uint8Array(t),e.set(this.b.subarray(0,t))):e=this.b.subarray(0,t):(this.b.length>t&&(this.b.length=t),e=this.b),this.buffer=e},l.prototype.F=function(){return this.s||this.g(),this.m.slice()},l.prototype.g=function(){for(var t=this.input.length;this.c<t;){var a=new i,r=d,s=d,c=d,l=d,u=d,m=d,f=d,h=d,g=d,_=this.input,v=this.c;switch(a.u=_[v++],a.v=_[v++],(31!==a.u||139!==a.v)&&e(Error("invalid file signature:"+a.u+","+a.v)),a.p=_[v++],a.p){case 8:break;default:e(Error("unknown compression method: "+a.p))}if(a.h=_[v++],h=_[v++]|_[v++]<<8|_[v++]<<16|_[v++]<<24,a.H=new Date(1e3*h),a.N=_[v++],a.M=_[v++],0<(4&a.h)&&(a.I=_[v++]|_[v++]<<8,v+=a.I),0<(8&a.h)){for(f=[],m=0;0<(u=_[v++]);)f[m++]=String.fromCharCode(u);a.name=f.join("")}if(0<(16&a.h)){for(f=[],m=0;0<(u=_[v++]);)f[m++]=String.fromCharCode(u);a.J=f.join("")}0<(2&a.h)&&(a.B=65535&n(_,0,v),a.B!==(_[v++]|_[v++]<<8)&&e(Error("invalid header crc16"))),r=_[_.length-4]|_[_.length-3]<<8|_[_.length-2]<<16|_[_.length-1]<<24,_.length-v-4-4<512*r&&(l=r),s=new o(_,{index:v,bufferSize:l}),a.data=c=s.g(),v=s.c,a.K=g=(_[v++]|_[v++]<<8|_[v++]<<16|_[v++]<<24)>>>0,n(c,d,d)!==g&&e(Error("invalid CRC-32 checksum: 0x"+n(c,d,d).toString(16)+" / 0x"+g.toString(16))),a.L=r=(_[v++]|_[v++]<<8|_[v++]<<16|_[v++]<<24)>>>0,(4294967295&c.length)!==r&&e(Error("invalid input size: "+(4294967295&c.length)+" / "+r)),this.m.push(a),this.c=v}this.s=!0;var y,b,w,$=this.m,k=0,S=0;for(y=0,b=$.length;b>y;++y)S+=$[y].data.length;if(p)for(w=new Uint8Array(S),y=0;b>y;++y)w.set($[y].data,k),k+=$[y].data.length;else{for(w=[],y=0;b>y;++y)w[y]=$[y].data;w=Array.prototype.concat.apply([],w)}return w},t("Zlib.Gunzip",l),t("Zlib.Gunzip.prototype.decompress",l.prototype.g),t("Zlib.Gunzip.prototype.getMembers",l.prototype.F)}.call(this),this.goog={provide:function(){},math:{}},goog.provide("goog.math.Long"),goog.math.Long=function(e,t){this.low_=0|e,this.high_=0|t},goog.math.Long.IntCache_={},goog.math.Long.fromInt=function(e){if(e>=-128&&128>e){var t=goog.math.Long.IntCache_[e];if(t)return t}var n=new goog.math.Long(0|e,0>e?-1:0);return e>=-128&&128>e&&(goog.math.Long.IntCache_[e]=n),n},goog.math.Long.fromNumber=function(e){return isNaN(e)||!isFinite(e)?goog.math.Long.ZERO:e<=-goog.math.Long.TWO_PWR_63_DBL_?goog.math.Long.MIN_VALUE:e+1>=goog.math.Long.TWO_PWR_63_DBL_?goog.math.Long.MAX_VALUE:0>e?goog.math.Long.fromNumber(-e).negate():new goog.math.Long(e%goog.math.Long.TWO_PWR_32_DBL_|0,e/goog.math.Long.TWO_PWR_32_DBL_|0)},goog.math.Long.fromBits=function(e,t){return new goog.math.Long(e,t)},goog.math.Long.fromString=function(e,t){if(0==e.length)throw Error("number format error: empty string");var n=t||10;if(2>n||n>36)throw Error("radix out of range: "+n);if("-"==e.charAt(0))return goog.math.Long.fromString(e.substring(1),n).negate();if(e.indexOf("-")>=0)throw Error('number format error: interior "-" character: '+e);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
}function Dt(e,t,n){e[t]=((((4278255360&e[t])>>>0)+((4278255360&n)>>>0)&4278255360)>>>0|(16711935&e[t])+(16711935&n)&16711935)>>>0}function Pt(e,t){return((4278124286&(e^t))>>>1)+((e&t)>>>0)>>>0}function Nt(e){return 256>e&&e>0?e:0>=e?0:~e>>24&255}function Ut(e,t){return Nt(e+parseInt((e-t)/2,10))}function Ot(){return ki}function Lt(e,t){return e&=255,t&=255,e>127&&(e-=256),t>127&&(t-=256),e*t>>>5}function Bt(e,t,n,i,a,o,r){var s=f,c=8>>e.n,l=e.U,d=e.u;if(8>c){e=(1<<e.n)-1;for(var u=(1<<c)-1,s=t;n>s;++s){t=0;for(var p=f,p=0;l>p;++p)0==(p&e)&&(t=i[a++]>>8&255),o[r++]=d[t&u],t>>=c}}else for(s=t;n>s;++s)for(p=0;l>p;++p)o[r++]=d[i[a++]>>8&255]}function Rt(e,t,n,i,a){for(n=t+n;n>t;){var o=e[t++];i[a++]=o>>16&255,i[a++]=o>>8&255,i[a++]=o>>0&255,i[a++]=o>>24&255}}function Ft(e,t,n,i,a){for(n=t+n;n>t;){var o=e[t++];i[a++]=o>>16&240|o>>12&15,i[a++]=o>>0&240|o>>28&15}}function qt(e,t,n,i,a){for(n=t+n;n>t;){var o=e[t++];i[a++]=o>>24&255,i[a++]=o>>16&255,i[a++]=o>>8&255,i[a++]=o>>0&255}}function jt(e,t,n,i){return E(e,8)!=_i?0:(t[0]=E(e,vi)+1,n[0]=E(e,vi)+1,i[0]=E(e,1),E(e,yi),1)}function Ht(e,t){var n=f;return 4>e?e+1:(n=e-2>>1,(2+(1&e)<<n)+E(t,n)+1)}function Vt(e,t){if(t.Q+8>t.ya){var n=e.Y,i=0;for(u(n!=m);0!=n[i].s;){var a=n,o=t,r=o.T>>o.g&1;o.L?o.fa=1:(++o.g,8<=o.g&&A(o),o.Q==o.ya&&32==o.g&&(o.L=1)),i=i+a[i].s+r}return n[i].kc}for(n=e.Y,i=0,u(n!=m);0!=n[i].s;)a=n,o=t.T>>t.g&1,++t.g,i=i+a[i].s+o;return n[i].kc}function zt(e,t){if(e!=m)for(var n=f,i=f,n=0;t>n;++n)for(var a=e[n].va,i=0;$i>i;++i)D(a[i])}function Wt(e,t,n){return t=0==e.eb?0:e.ac[e.bd+e.Ec*(n>>e.eb)+(t>>e.eb)],u(t<e.hc),e.Db[+t]}function Gt(n,i,a,o){var r=n.Na,s=n.O,c=s+i,l=a,d=o;for(o=n.Xa,a=n.vb,t(o,a,l,d,n.l*i);0<r--;){i=n.nc[r];var p=s,h=c,g=l,v=d,d=o,l=a;switch(u(h>p),u(h<=i.Vb),i.Qc){case Ii:for(g=0,i=l+(h-p)*i.U;i>l;){var h=d,v=l,y=h[v]>>8&255,b=(16711935&h[v])>>>0,b=b+(y<<16|y),b=16711935&b;d[l++]=((4278255360&h[v])>>>0|b)>>>0,32==p&&g++}break;case Ei:var w=i,$=p,g=h,v=d,y=l,b=w.U;if(0==$){var k=f;for(Dt(v,y,ki),k=1;b>k;++k)Dt(v,y+k,v[y+k-1]);y+=b,++$}for(var S=(1<<w.n)-1,C=St(b,w.n),M=w.u,w=+($>>w.n)*C;g>$;){var A=M,x=w,E=m;for(Dt(v,y,v[y-b+0]),E=Io[A[x++]>>8&15],k=1;b>k;++k){var T=_;0==(k&S)&&(E=Io[A[x++]>>8&15]),T=E(v[y+k-1],v,y+k-b),Dt(v,y+k,T)}y+=b,++$,0==($&S)&&(w+=C)}h!=i.Vb&&(i=i.U,t(d,l-i,d,l+(h-p-1)*i,i));break;case Ti:for(g=i.U,v=(1<<i.n)-1,y=St(g,i.n),b=i.u,i=+(p>>i.n)*y;h>p;){for(k=b,$=i,S=e(Do),C=f,C=0;g>C;++C)0==(C&v)&&(M=k[$++],w=S,w.Cc=M>>0&255,w.Bc=M>>8&255,w.Kc=M>>16&255),M=d[l+C],w=M>>>8,A=M>>>16,x=M,A+=Lt(S.Cc,w),A&=255,x+=Lt(S.Bc,w),x+=Lt(S.Kc,A),x&=255,d[l+C]=(4278255360&M|A<<16|x)>>>0;l+=g,++p,0==(p&v)&&(i+=y)}break;case Di:g==d&&0<i.n?(g=(h-p)*St(i.U,i.n),v=l+(h-p)*i.U-g,memmove(d,v,d,l,g),Bt(i,p,h,d,v,d,l)):Bt(i,p,h,g,v,d,l)}l=o,d=a}}function Kt(e,t){var n=e.V,i=e.Ha+e.l*e.O,a=t-e.O;if(!(0>=a)){Gt(e,a,n,i);var o=e.N,n=e.Xa,r=[e.vb],i=e.O,a=t,s=r,c=o.width;if(u(a>i),u(o.t<o.Ka),a>o.K&&(a=o.K),i<o.k){var l=o.k-i,i=o.k;s[0]+=c*l}if(i>=a?i=0:(s[0]+=o.t,o.w=i-o.k,o.m=o.Ka-o.t,o.h=a-i,i=1),i){if(r=r[0],i=e.Ib,a=o.width,i.J<Zn){var d=i.c.RGBA,s=d.ma,p=d.Sa+e.xa*d.f;if(o.I)n=EmitRescaledRows(e,n,r,a,o.h,s,p,d.f);else{for(var c=i.J,l=o.m,o=o.h,d=d.f,m=o;0<m--;){var f=n,h=r,g=l,_=s,v=p;switch(c){case Bn:for(g=h+g;g>h;){var y=f[h++];_[v++]=y>>16&255,_[v++]=y>>8&255,_[v++]=y>>0&255}break;case Rn:Rt(f,h,g,_,v);break;case zn:Rt(f,h,g,_,v),WebPApplyAlphaMultiply(_,0,g,1,0);break;case Fn:for(g=h+g;g>h;)y=f[h++],_[v++]=y>>0&255,_[v++]=y>>8&255,_[v++]=y>>16&255;break;case qn:qt(f,h,g,_,v);break;case Wn:qt(f,h,g,_,v),WebPApplyAlphaMultiply(_,0,g,1,0);break;case jn:qt(f,h,g,_,v);break;case Gn:qt(f,h,g,_,v),WebPApplyAlphaMultiply(_,1,g,1,0);break;case Hn:Ft(f,h,g,_,v);break;case Kn:Ft(f,h,g,_,v),WebPApplyAlphaMultiply4444(_,g,1,0);break;case Vn:for(g=h+g;g>h;)y=f[h++],_[v++]=y>>16&248|y>>13&7,_[v++]=y>>5&224|y>>3&31;break;default:u(0)}r+=a,p+=d}n=o}e.xa+=n}else e.xa=o.I?EmitRescaledRowsYUVA(e,n,r,a,o.h):EmitRowsYUVA(e,n,r,a,o.m,o.h);u(e.xa<=i.height)}e.O=t,u(e.O<=e.v)}}function Zt(e,t,n,i,a,o){var r=1,s=0,c=0,l=e.o,d=e.cb,p=d.Db,h=n,g=n;n+=i*a,a=Mi+Ai;v
this.WebPGetDecoderVersion=this.Ld=function(){return 512};var $o=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ko=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],So=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Co=d([la,da],"");c(4,h);var Mo=[[0,0,0,0],[1,0,0,0],[0,1,0,0],[1,1,0,0],[0,0,1,0],[1,0,1,0],[0,1,1,0],[1,1,1,0],[0,0,0,1],[1,0,0,1],[0,1,0,1],[1,1,0,1],[0,0,1,1],[1,0,1,1],[0,1,1,1],[1,1,1,1]],Ao=134480385,xo=16,Eo=-227,To=482,Io=[Ot,function(e){return e},function(e,t,n){return t[n+0]},function(e,t,n){return t[n+1]},function(e,t,n){return t[n-1]},function(e,t,n){return Pt(Pt(e,t[n+1]),t[n+0])},function(e,t,n){return Pt(e,t[n-1])},function(e,t,n){return Pt(e,t[n+0])},function(e,t,n){return Pt(t[n-1],t[n+0])},function(e,t,n){return Pt(t[n+0],t[n+1])},function(e,t,n){return Pt(Pt(e,t[n-1]),Pt(t[n+0],t[n+1]))},function(e,t,n){return 0>=Math.abs((e>>24&255)-(t[n-1]>>24&255))-Math.abs((t[n+0]>>24&255)-(t[n-1]>>24&255))+(Math.abs((e>>16&255)-(t[n-1]>>16&255))-Math.abs((t[n+0]>>16&255)-(t[n-1]>>16&255)))+(Math.abs((e>>8&255)-(t[n-1]>>8&255))-Math.abs((t[n+0]>>8&255)-(t[n-1]>>8&255)))+(Math.abs((255&e)-(255&t[n-1]))-Math.abs((255&t[n+0])-(255&t[n-1])))?t[n+0]:e},function(e,t,n){return(Nt((e>>24&255)+(t[n+0]>>24&255)-(t[n-1]>>24&255))<<24|Nt((e>>16&255)+(t[n+0]>>16&255)-(t[n-1]>>16&255))<<16|Nt((e>>8&255)+(t[n+0]>>8&255)-(t[n-1]>>8&255))<<8|Nt((255&e)+(255&t[n+0])-(255&t[n-1])))>>>0},function(e,t,n){var i=t[n-1];return e=Pt(e,t[n+0]),(Ut(e>>24&255,i>>24&255)<<24|Ut(e>>16&255,i>>16&255)<<16|Ut(e>>8&255,i>>8&255)<<8|Ut(e>>0&255,i>>0&255))>>>0},Ot,Ot],Do={Cc:h,Bc:h,Kc:h},Po=16,No=16,Uo=16,Oo=[2,3,7],Lo=[3,3,11],Bo=0,Ro=1,Fo=2,qo=3,jo=4,Ho=[Mi+Ai,Mi,Mi,Mi,40],Vo=19,zo=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Wo=120,Go=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Ko=1<<xo-1,Zo=c(256,0),Yo=c(256,0),Xo=c(256,g),Jo=c(256,g),Qo=c(To-Eo,h),er=c(To-Eo,h),tr=0,nr=Array(Xn),ir=[function(e,t,n,i,a,o,r,s,c,l,d,u,p){mn(e,t,n,i,a,o,r,s,c,l,d,u,p,Ct,3)},fn,function(e,t,n,i,a,o,r,s,c,l,d,u,p){mn(e,t,n,i,a,o,r,s,c,l,d,u,p,Et,3)},hn,gn,_n,function(e,t,n,i,a,o,r,s,c,l,d,u,p){mn(e,t,n,i,a,o,r,s,c,l,d,u,p,Mt,2)},fn,hn,gn,_n];this.Hd=function(e,t,n,i){return Nn(Bn,e,t,n,i)},this.Id=function(e,t,n,i){return Nn(Rn,e,t,n,i)},this.Jd=function(e,t,n,i){return Nn(Hn,e,t,n,i)},this.Ed=function(e,t,n,i){return Nn(jn,e,t,n,i)},this.Fd=function(e,t,n,i){return Nn(Fn,e,t,n,i)},this.Gd=function(e,t,n,i){return Nn(qn,e,t,n,i)},this.WebPDecode=this.Dd=function(t,n,i){var a=e(di),o="VP8StatusCode";return i==m?ti:(o=Un(t,[0],[n],i.input),o!=Qn?o==ri?ni:o:(a.j=i.j,a.Qa=i.Qa,o=Pn(t,0,[n],a)))}}}();var _logTimer=(new Date).getTime();!function(e){function t(){return{shortIndexes:{},fullTexts:{}}}function n(e){return e=e.replace(o," ").replace(r,""),e=e.replace(/[^A-Za-z0-9]/g,function(e){return Config.LatinizeMap[e]||e}),e=e.toLowerCase()}function i(e,t,i){if(void 0!==i.fullTexts[e])return!1;if(t=n(t),!t.length)return!1;var a=i.shortIndexes;i.fullTexts[e]=t,angular.forEach(t.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 a(e,t){var i=t.shortIndexes,a=t.fullTexts;e=n(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 o=/[`~!@#$%^&*()\-_=+\[\]\\|{}'";:\/?.>,<\s]+/g,r=/^\s+|\s$/g;e.SearchIndexManager={createIndex:t,indexObject:i,cleanSearchText:n,search:a}}(window),function(e){function t(e){var t=(tsNow(),new WebPDecoder),n=t.WebPDecoderConfig,i=n.j,r=n.input;if(!t.WebPInitDecoderConfig(n)
if("resPQ"!=o._)throw new Error("resPQ response invalid: "+o._);if(!bytesCmp(e.nonce,o.nonce))throw new Error("resPQ nonce mismatch");if(e.serverNonce=o.server_nonce,e.pq=o.pq,e.fingerprints=o.server_public_key_fingerprints,console.log(dT(),"Got ResPQ",bytesToHex(e.serverNonce),bytesToHex(e.pq),e.fingerprints),e.publicKey=t.select(e.fingerprints),!e.publicKey)throw new Error("No public key found");console.log(dT(),"PQ factorization start",e.pq),a.factorize(e.pq).then(function(t){e.p=t[0],e.q=t[1],console.log(dT(),"PQ factorization done",t[2]),d(e)},function(e){console.log("Worker error",e,e.stack),n.reject(e)})},function(e){console.log(dT(),"req_pq error",e.message),n.reject(e)}),s(function(){t.prepare()})}function d(e){var t=e.deferred;e.newNonce=new Array(32),n.nextBytes(e.newNonce);var i=new TLSerialization({mtproto:!0});i.storeObject({_:"p_q_inner_data",pq:e.pq,p:e.p,q:e.q,nonce:e.nonce,server_nonce:e.serverNonce,new_nonce:e.newNonce},"P_Q_inner_data","DECRYPTED_DATA");var a=sha1BytesSync(i.getBuffer()).concat(i.getBytes()),o=new TLSerialization({mtproto:!0});o.storeMethod("req_DH_params",{nonce:e.nonce,server_nonce:e.serverNonce,p:e.p,q:e.q,public_key_fingerprint:e.publicKey.fingerprint,encrypted_data:rsaEncrypt(e.publicKey,a)}),console.log(dT(),"Send req_DH_params"),c(e.dcID,o.getBuffer()).then(function(n){var i=n.fetchObject("Server_DH_Params","RESPONSE");if("server_DH_params_fail"!=i._&&"server_DH_params_ok"!=i._)return t.reject(new Error("Server_DH_Params response invalid: "+i._)),!1;if(!bytesCmp(e.nonce,i.nonce))return t.reject(new Error("Server_DH_Params nonce mismatch")),!1;if(!bytesCmp(e.serverNonce,i.server_nonce))return t.reject(new Error("Server_DH_Params server_nonce mismatch")),!1;if("server_DH_params_fail"==i._){var a=sha1BytesSync(e.newNonce).slice(-16);return bytesCmp(a,i.new_nonce_hash)?(t.reject(new Error("server_DH_params_fail")),!1):(t.reject(new Error("server_DH_params_fail new_nonce_hash mismatch")),!1)}try{u(e,i.encrypted_answer)}catch(o){return t.reject(o),!1}p(e)},function(e){t.reject(e)})}function u(e,t){e.localTime=tsNow(),e.tmpAesKey=sha1BytesSync(e.newNonce.concat(e.serverNonce)).concat(sha1BytesSync(e.serverNonce.concat(e.newNonce)).slice(0,12)),e.tmpAesIv=sha1BytesSync(e.serverNonce.concat(e.newNonce)).slice(12).concat(sha1BytesSync([].concat(e.newNonce,e.newNonce)),e.newNonce.slice(0,4));var n=aesDecryptSync(t,e.tmpAesKey,e.tmpAesIv),a=n.slice(0,20),o=n.slice(20),r=bytesToArrayBuffer(o),s=new TLDeserialization(r,{mtproto:!0}),c=s.fetchObject("Server_DH_inner_data");if("server_DH_inner_data"!=c._)throw new Error("server_DH_inner_data response invalid: "+constructor);if(!bytesCmp(e.nonce,c.nonce))throw new Error("server_DH_inner_data nonce mismatch");if(!bytesCmp(e.serverNonce,c.server_nonce))throw new Error("server_DH_inner_data serverNonce mismatch");console.log(dT(),"Done decrypting answer"),e.g=c.g,e.dhPrime=c.dh_prime,e.gA=c.g_a,e.serverTime=c.server_time,e.retry=0;var l=s.getOffset();if(!bytesCmp(a,sha1BytesSync(o.slice(0,l))))throw new Error("server_DH_inner_data SHA1-hash mismatch");i.applyServerTime(e.serverTime,e.localTime)}function p(e){var t=e.deferred,i=bytesFromHex(e.g.toString(16));e.b=new Array(256),n.nextBytes(e.b),a.modPow(i,e.b,e.dhPrime).then(function(n){var i=new TLSerialization({mtproto:!0});i.storeObject({_:"client_DH_inner_data",nonce:e.nonce,server_nonce:e.serverNonce,retry_id:[0,e.retry++],g_b:n},"Client_DH_Inner_Data");var o=sha1BytesSync(i.getBuffer()).concat(i.getBytes()),r=aesEncryptSync(o,e.tmpAesKey,e.tmpAesIv),s=new TLSerialization({mtproto:!0});s.storeMethod("set_client_DH_params",{nonce:e.nonce,server_nonce:e.serverNonce,encrypted_data:r}),console.log(dT(),"Send set_client_DH_params"),c(e.dcID,s.getBuffer()).then(function(n){var i=n.fetchObject("Set_client_DH_params_answer");return"dh_gen_ok"!=i._&&"dh_gen_retry"!=i._&&"dh_gen_fail"!=i._?(t.reject(new Error("Set_client_DH_params_answer response invalid: "+i._)),!1):bytesCmp(e.nonce,i.nonce)?bytesCmp(e.serverNonce,i.server_nonce)?void a.modPow(e.gA,e.b,e.dhPrime).then(function(n){var a=sha1BytesSync(n)
return O})}function m(e){var t=L[e];return t?(t.first_name||"")+" "+(t.last_name||"")+" "+(t.phone||"")+" "+(t.username||""):!1}function f(e){return p().then(function(t){if(angular.isString(e)&&e.length){for(var n=SearchIndexManager.search(e,F),i=[],a=0;a<t.length;a++)n[t[a]]&&i.push(t[a]);t=i}return t})}function h(e){return e&&e.toLowerCase()||""}function g(e){var t=h(e),n=B[t];return n&&h(L[n].username)==t?o.when(n):s.invokeApi("contacts.resolveUsername",{username:e}).then(function(e){return v(e),e.id})}function _(e){angular.forEach(e,v)}function v(t,n){if(angular.isObject(t)&&!(n&&angular.isObject(L[t.id])&&L[t.id].first_name)){var a=t.id;t.phone&&(t.rPhone=i("phoneNumber")(t.phone)),t.num=Math.abs(a)%8+1,t.first_name?(t.rFirstName=c.wrapRichText(t.first_name,{noLinks:!0,noLinebreaks:!0}),t.rFullName=c.wrapRichText(t.first_name+" "+(t.last_name||""),{noLinks:!0,noLinebreaks:!0})):(t.rFirstName=c.wrapRichText(t.last_name,{noLinks:!0,noLinebreaks:!0})||t.rPhone||u("user_first_name_deleted"),t.rFullName=c.wrapRichText(t.last_name,{noLinks:!0,noLinebreaks:!0})||t.rPhone||u("user_name_deleted")),t.username&&(B[h(t.username)]=a),t.sortName=SearchIndexManager.cleanSearchText(t.first_name+" "+(t.last_name||""));var o=t.sortName.split(" "),r=o.shift(),s=o.pop();t.initials=r.charAt(0)+(s?s.charAt(0):r.charAt(1)),t.sortStatus=y(t.status);var l=L[a];void 0===l?l=L[a]=t:safeReplaceObject(l,t),e.$broadcast("user_update",a),void 0!==R[a]&&safeReplaceObject(R[a],t&&t.photo&&t.photo.photo_small||{empty:!0})}}function y(e){if(e){var t=e.expires||e.was_online;if(t)return t;{tsNow(!0)+q}switch(e._){case"userStatusRecently":return tsNow(!0)+q-259200;case"userStatusLastWeek":return tsNow(!0)+q-604800;case"userStatusLastMonth":return tsNow(!0)+q-2592e3}}return 0}function b(e){return angular.isObject(e)?e:L[e]||{id:e,deleted:!0,num:1}}function w(e){return angular.isObject(L[e])}function $(e,t){var n=b(e);return 333e3==e?{placeholder:"img/placeholders/DialogListAvatarSystem@2x.png"}:(void 0===R[e]&&(R[e]=n&&n.photo&&n.photo.photo_small||{empty:!0}),{num:n.num,placeholder:"img/placeholders/"+t+"Avatar"+n.num+"@2x.png",location:R[e]})}function k(e){var t=b(e);return"u"+e+(t.access_hash?"_"+t.access_hash:"")}function S(e){var t=b(e);return"userSelf"==t._?{_:"inputUserSelf"}:{_:"inputUserForeign",user_id:e,access_hash:t.access_hash||0}}function C(){var t=tsNow(!0)+q;angular.forEach(L,function(n){n.status&&"userStatusOnline"==n.status._&&n.status.expires<t&&(n.status=n.status.wasStatus||{_:"userStatusOffline",was_online:n.status.expires},delete n.status.wasStatus,e.$broadcast("user_update",n.id))})}function M(t){var n=b(t);if(n&&n.status&&"userStatusOnline"!=n.status._&&"userStatusEmpty"!=n.status._){var i;"userStatusOffline"!=n.status._&&(delete n.status.wasStatus,i!=angular.copy(n.status)),n.status={_:"userStatusOnline",expires:tsNow(!0)+q+60,wasStatus:i},n.sortStatus=y(n.status),e.$broadcast("user_update",t)}}function A(e){var t=b(e);return t}function x(n,i){var a=e.$new();a.userID=n,a.override=i||{};t.open({templateUrl:templateUrl("user_modal"),controller:"UserModalController",scope:a,windowClass:"user_modal_window mobile_modal"})}function E(e,t,n){return s.invokeApi("contacts.importContacts",{contacts:[{_:"inputPhoneContact",client_id:"1",phone:e,first_name:t,last_name:n}],replace:!1}).then(function(e){_(e.users);var t=!1;return angular.forEach(e.imported,function(e){D(t=e.user_id,!0)}),t||!1})}function T(e){var t,n,i=[];for(t=0;t<e.length;t++)for(n=0;n<e[t].phones.length;n++)i.push({_:"inputPhoneContact",client_id:(t<<16|n).toString(10),phone:e[t].phones[n],first_name:e[t].first_name,last_name:e[t].last_name});return s.invokeApi("contacts.importContacts",{contacts:i,replace:!1}).then(function(e){_(e.users);var t=[];return angular.forEach(e.imported,function(e){D(e.user_id,!0),t.push(e.user_id)}),t})}function I(e){var t=[];return angular.forEach(e,function(e){t.push({_:"inputUserContact",user_id:e})}),s.invokeApi("contacts.deleteContacts",{id:t}).then(function(){angular.forEach(e,function(e){D(e,!1)})})}function D(t,n){if(angular.isArray(O))
})}function d(e){if(g[e]){var n=g[e],i=$(window).width()-(Config.Mobile?20:32),o=$(t).height()-(Config.Mobile?150:116);i>800&&(i-=208);var r=c(n,i,o);r&&!r.preloaded&&(r.preloaded=!0,r.size?a.downloadFile(r.location.dc_id,{_:"inputFileLocation",volume_id:r.location.volume_id,local_id:r.location.local_id,secret:r.location.secret},r.size):a.downloadSmallFile(r.location))}}function u(e){return g[e]||{_:"photoEmpty"}}function p(e){var t=angular.copy(g[e])||{_:"photoEmpty"},n=Math.min(_-80,Config.Mobile?210:260),i=Math.min(v-100,Config.Mobile?210:260),a=c(t,n,i),o={placeholder:"img/placeholders/PhotoThumbConversation.gif",width:n,height:i};if(a&&"photoSizeEmpty"!=a._){var r=calcImageInBox(a.w,a.h,n,i);o.width=r.w,o.height=r.h,o.location=a.location,o.size=a.size}else o.width=100,o.height=100;return t.thumb=o,t}function m(e){var n=p(e),i=$(window).width()-(Config.Mobile?0:32),a=$(t).height()-(Config.Mobile?0:116);!Config.Mobile&&i>800&&(i-=208);var o=c(n,i,a),r={placeholder:"img/placeholders/PhotoThumbModal.gif"};if(r.width=i,r.height=a,o&&"photoSizeEmpty"!=o._){var s=calcImageInBox(o.w,o.h,i,a,!0);r.width=s.w,r.height=s.h,r.modalWidth=Math.max(r.width,Math.min(400,i)),r.location=o.location,r.size=o.size}return n.full=r,n}function f(t,i){if(!t||"0"===t)return!1;var a=n.$new(!0);a.photoID=t;var o="PhotoModalController";i&&i.p>0?(o="UserpicModalController",a.userID=i.p):i&&i.p<0?(o="ChatpicModalController",a.chatID=-i.p):i&&i.m>0&&(a.messageID=i.m);e.open({templateUrl:templateUrl("photo_modal"),windowTemplateUrl:templateUrl("media_modal_layout"),controller:o,scope:a,windowClass:"photo_modal_window"})}function h(e){var n=g[e],i="jpg",o="image/jpeg",s="photo"+e+"."+i,l=Math.max(screen.width||0,$(window).width()-36,800),d=Math.max(screen.height||0,$(t).height()-150,800),u=c(n,l,d),p={_:"inputFileLocation",volume_id:u.location.volume_id,local_id:u.location.local_id,secret:u.location.secret};r.chooseSave(s,i,o).then(function(e){e&&a.downloadFile(u.location.dc_id,p,u.size,{mime:o,toFileEntry:e}).then(function(){},function(e){console.log("photo download failed",e)})},function(){var e=a.getCachedFile(p);return e?r.download(e,o,s):void a.downloadFile(u.location.dc_id,p,u.size,{mime:o}).then(function(e){r.download(e,o,s)},function(e){console.log("photo download failed",e)})})}var g={},_=$(window).width(),v=$(window).height();return n.preloadPhoto=d,n.openPhoto=f,{savePhoto:s,preloadPhoto:d,getUserPhotos:l,getPhoto:u,choosePhotoSize:c,wrapForHistory:p,wrapForFull:m,openPhoto:f,downloadPhoto:h}}]).service("AppVideoManager",["$sce","$rootScope","$modal","$window","MtpApiFileManager","AppUsersManager","FileManager","qSync",function(e,t,n,i,a,o,r,s){function c(e){h[e.id]=e,e.thumb&&"photoCachedSize"==e.thumb._&&(a.saveSmallFile(e.thumb.location,e.thumb.bytes),e.thumb.size=e.thumb.bytes.length,delete e.thumb.bytes,e.thumb._="photoSize")}function l(e){if(void 0!==g[e])return g[e];var t=angular.copy(h[e]),n=Math.min(_-80,Config.Mobile?210:150),i=Math.min(v-100,Config.Mobile?210:150),a=t.thumb,o={placeholder:"img/placeholders/VideoThumbConversation.gif",width:n,height:i};return a&&"photoSizeEmpty"!=a._&&(a.w/a.h>n/i?o.height=parseInt(a.h*n/a.w):(o.width=parseInt(a.w*i/a.h),o.width>n&&(o.height=parseInt(o.height*n/o.width),o.width=n)),o.location=a.location,o.size=a.size),t.thumb=o,g[e]=t}function d(e){var t=l(e),n=Math.min($(window).width()-(Config.Mobile?0:60),542),a=$(i).height()-(Config.Mobile?92:150),o={placeholder:"img/placeholders/VideoThumbModal.gif",width:n,height:a};if(t.w&&t.h){var r=calcImageInBox(t.w,t.h,n,a);o.width=r.w,o.height=r.h}else o.height=o.width=Math.min(n,a);return t.full=o,t.fullThumb=angular.copy(t.thumb),t.fullThumb.width=o.width,t.fullThumb.height=o.height,t}function u(e,i){var a=t.$new(!0);return a.videoID=e,a.messageID=i,n.open({templateUrl:templateUrl("video_modal"),windowTemplateUrl:templateUrl("media_modal_layout"),controller:"VideoModalController",scope:a,windowClass:"video_modal_window"})}function p(e){var t=h[e],n=g[e]||t||{},i={_:"inputVideoFileLocation",id:e,access_hash:t.access_hash};void 0===n.downloaded&&a.ge
})))}o.dismissAll(),d.start(),r.getUserID().then(function(e){return e?void n.url("/im"):"http:"!=location.protocol||Config.Modes.http||-1==Config.App.domains.indexOf(location.hostname)?void p.setAuthorized(!1):void(location.href=location.href.replace(/^http:/,"https:"))});var b={dcID:2,createNetworker:!0},w=!1;e.credentials={phone_country:"",phone_country_name:"",phone_number:"",phone_full:""},e.progress={},e.callPending={},e.about={},e.chooseCountry=function(){var e=a.open({templateUrl:templateUrl("country_select_modal"),controller:"CountrySelectModalController",windowClass:"countries_modal_window mobile_modal"});e.result.then(g)},e.$watch("credentials.phone_country",_),e.$watch("credentials.phone_number",_),f();var $;e.sendCode=function(){i.cancel($),s.confirm({type:"LOGIN_PHONE_CORRECT",country_code:e.credentials.phone_country,phone_number:e.credentials.phone_number}).then(function(){e.progress.enabled=!0,onContentLoaded(function(){e.$broadcast("ui_height")});var n=tsNow();r.invokeApi("auth.sendCode",{phone_number:e.credentials.phone_full,api_id:Config.App.id,api_hash:Config.App.hash},b).then(function(t){e.progress.enabled=!1,e.credentials.phone_code_hash=t.phone_code_hash,e.credentials.phone_occupied=t.phone_registered,e.credentials.viaApp="auth.sentAppCode"==t._,e.callPending.remaining=t.send_call_timeout||60,e.error={},e.about={},y(),onContentLoaded(function(){e.$broadcast("ui_height")})},function(t){switch(e.progress.enabled=!1,console.log("sendCode error",t),t.type){case"PHONE_NUMBER_INVALID":e.error={field:"phone"},t.handled=!0}})["finally"](function(){(t.idle.isIDLE||tsNow()-n>6e4)&&c.notify({title:"Telegram",message:"Your authorization key was successfully generated! Open the app to log in.",tag:"auth_key"})})})},e.sendSms=function(){e.credentials.viaApp&&(delete e.credentials.viaApp,r.invokeApi("auth.sendSms",{phone_number:e.credentials.phone_full,phone_code_hash:e.credentials.phone_code_hash},b).then(y))},e.editPhone=function(){i.cancel($),delete e.credentials.phone_code_hash,delete e.credentials.phone_unoccupied,delete e.credentials.phone_code_valid,delete e.credentials.viaApp,delete e.callPending.remaining,delete e.callPending.success},e.logIn=function(t){var n="auth.signIn",i={phone_number:e.credentials.phone_full,phone_code_hash:e.credentials.phone_code_hash,phone_code:e.credentials.phone_code};t&&(n="auth.signUp",angular.extend(i,{first_name:e.credentials.first_name||"",last_name:e.credentials.last_name||""})),e.progress.enabled=!0,r.invokeApi(n,i,b).then(v,function(t){if(e.progress.enabled=!1,400==t.code&&"PHONE_NUMBER_UNOCCUPIED"==t.type)return t.handled=!0,e.credentials.phone_code_valid=!0,e.credentials.phone_unoccupied=!0,void(e.about={});if(400==t.code&&"PHONE_NUMBER_OCCUPIED"==t.type)return t.handled=!0,e.logIn(!1);switch(t.type){case"FIRSTNAME_INVALID":e.error={field:"first_name"},t.handled=!0;break;case"LASTNAME_INVALID":e.error={field:"last_name"},t.handled=!0;break;case"PHONE_CODE_INVALID":e.error={field:"phone_code"},delete e.credentials.phone_code_valid,t.handled=!0}})},l.checkUpdate(),u.start()}]).controller("AppIMController",["$scope","$location","$routeParams","$modal","$rootScope","$modalStack","MtpApiManager","AppUsersManager","AppChatsManager","AppPeersManager","ContactsSelectService","ChangelogNotifyService","ErrorService","AppRuntimeManager","HttpsMigrateService","LayoutSwitchService","LocationParamsService","AppStickersManager",function(e,t,n,i,a,o,r,s,c,l,d,u,p,m,f,h,g,_){function v(){if(n.q){if(n.q!==y&&(e.search.query=y=n.q,void 0!==e.curDialog))return!1}else y=!1;n.p&&"@"==n.p.charAt(0)?(void 0===e.curDialog&&(e.curDialog={}),s.resolveUsername(n.p.substr(1)).then(function(t){e.curDialog={peer:s.getUserString(t),messageID:n.m||!1}})):e.curDialog={peer:n.p||!1,messageID:n.m||!1}}e.$on("$routeUpdate",v),e.$on("history_focus",function(n,i){if(o.dismissAll(),i.peerString==e.curDialog.peer&&i.messageID==e.curDialog.messageID)e.$broadcast(i.messageID?"ui_history_change_scroll":"ui_history_focus");else{var a=l.getPeerID(i.peerString),r=i.peerString;if(a>0){var c=s.getUser(a).username;c
c.sendOther(a,{_:"inputMediaContact",phone_number:e.user.phone,first_name:e.user.first_name,last_name:e.user.last_name,user_id:e.user.id}),1==t.length&&n.$broadcast("history_focus",{peerString:t[0]})})})}}]).controller("ChatModalController",["$scope","$timeout","$rootScope","$modal","AppUsersManager","AppChatsManager","AppPhotosManager","MtpApiManager","MtpApiFileManager","NotificationsManager","AppMessagesManager","AppPeersManager","ApiUpdatesManager","ContactsSelectService","ErrorService",function(e,t,n,i,a,o,r,s,c,l,d,u,p,m,f){function h(t){d.onStatedMessage(t),n.$broadcast("history_focus",{peerString:e.chatFull.peerString})}function g(t){t&&t.type&&0===t.type.indexOf("image")&&(e.photo.updating=!0,c.uploadFile(t).then(function(t){return s.invokeApi("messages.editChatPhoto",{chat_id:e.chatID,photo:{_:"inputChatUploadedPhoto",file:t,crop:{_:"inputPhotoCropAuto"}}}).then(function(e){h(e)})})["finally"](function(){e.photo.updating=!1}))}e.chatFull=o.wrapForFull(e.chatID,{}),e.settings={notifications:!0},o.getChatFull(e.chatID).then(function(t){e.chatFull=o.wrapForFull(e.chatID,t),e.$broadcast("ui_height"),l.savePeerSettings(-e.chatID,t.notify_settings),l.getPeerMuted(-e.chatID).then(function(t){e.settings.notifications=!t,e.$watch("settings.notifications",function(t,n){return t===n?!1:void l.getPeerSettings(-e.chatID).then(function(n){n.mute_until=t?0:2e9,l.updatePeerSettings(-e.chatID,n)})})})}),e.leaveGroup=function(){s.invokeApi("messages.deleteChatUser",{chat_id:e.chatID,user_id:{_:"inputUserSelf"}}).then(h)},e.returnToGroup=function(){s.invokeApi("messages.addChatUser",{chat_id:e.chatID,user_id:{_:"inputUserSelf"}}).then(h)},e.inviteToGroup=function(){var t=[];angular.forEach(e.chatFull.participants.participants,function(e){t.push(e.user_id)}),m.selectContacts({disabled:t}).then(function(t){angular.forEach(t,function(t){s.invokeApi("messages.addChatUser",{chat_id:e.chatID,user_id:a.getUserInput(t),fwd_limit:100}).then(function(e){p.processUpdateMessage({_:"updates",seq:e.seq,users:e.users,chats:e.chats,updates:[{_:"updateNewMessage",message:e.message,pts:e.pts}]})})}),n.$broadcast("history_focus",{peerString:e.chatFull.peerString})})},e.kickFromGroup=function(t){var n=a.getUser(t);s.invokeApi("messages.deleteChatUser",{chat_id:e.chatID,user_id:{_:"inputUserForeign",user_id:t,access_hash:n.access_hash||"0"}}).then(h)},e.flushHistory=function(){f.confirm({type:"HISTORY_FLUSH"}).then(function(){d.flushHistory(u.getInputPeerByID(-e.chatID)).then(function(){n.$broadcast("history_focus",{peerString:e.chatFull.peerString})})})},e.photo={},e.$watch("photo.file",g),e.deletePhoto=function(){e.photo.updating=!0,s.invokeApi("messages.editChatPhoto",{chat_id:e.chatID,photo:{_:"inputChatPhotoEmpty"}}).then(function(e){h(e)})["finally"](function(){e.photo.updating=!1})},e.editTitle=function(){var t=n.$new();t.chatID=e.chatID,i.open({templateUrl:templateUrl("chat_edit_modal"),controller:"ChatEditModalController",scope:t,windowClass:"md_simple_modal_window mobile_modal"})}}]).controller("SettingsModalController",["$rootScope","$scope","$timeout","$modal","AppUsersManager","AppChatsManager","AppPhotosManager","MtpApiManager","Storage","NotificationsManager","MtpApiFileManager","ApiUpdatesManager","ChangelogNotifyService","AppRuntimeManager","ErrorService","_",function(e,t,n,i,a,o,r,s,c,l,d,u,p,m,f){function h(e){e&&e.type&&0===e.type.indexOf("image")&&(t.photo.updating=!0,d.uploadFile(e).then(function(e){s.invokeApi("photos.uploadProfilePhoto",{file:e,caption:"",geo_point:{_:"inputGeoPointEmpty"},crop:{_:"inputPhotoCropAuto"}}).then(function(e){a.saveApiUsers(e.users),r.savePhoto(e.photo),s.getUserID().then(function(e){u.processUpdateMessage({_:"updateShort",update:{_:"updateUserPhoto",user_id:e,date:tsNow(!0),photo:a.getUser(e).photo,previous:!0}}),t.photo=a.getUserPhoto(e,"User")})})})["finally"](function(){delete t.photo.updating}))}t.profile={},t.photo={},t.version=Config.App.version,s.getUserID().then(function(e){t.profile=a.getUser(e),t.photo=a.getUserPhoto(e,"User")}),s.invokeApi("users.getFullUser",{id:{_:"inputUserSelf"}}).
}]),function(e,t,n,i){function a(e){ConfigStorage.get("emojis_popular",function(t){var n=[];if(t&&t.length){for(var i=0,a=t.length;a>i;i++)n.push({code:t[i][0],rate:t[i][1]});return void e(n)}ConfigStorage.get("emojis_recent",function(t){t=t||b||[];for(var i,a,o=0,r=t.length;r>o;o++)i=t[o],Array.isArray(i)&&(i=i[0]),":"==i.charAt(0)&&(i=i.substr(1,i.length-2)),(a=g[i])&&n.push({code:a,rate:1});e(n)})})}function o(e){a(function(t){for(var n=!1,i=t.length,a=[],o=0;i>o;o++)t[o].code==e&&(n=!0,t[o].rate++),a.push([t[o].code,t[o].rate]);n?a.sort(function(e,t){return t[1]-e[1]}):(a.length>41&&(a=a.slice(0,41)),a.push([e,1])),ConfigStorage.set({emojis_popular:a})})}function r(){if(y===!1){y=SearchIndexManager.createIndex();var e;for(e in g)g.hasOwnProperty(e)&&SearchIndexManager.indexObject(g[e],e,y)}}function s(e){r();var t,n=SearchIndexManager.search(e,y),i=[];for(t in n)n.hasOwnProperty(t)&&i.push(t);return i}var c,l,d,u,p,m,f,h,t={},g={},_={},v={},y=!1,b="joy,kissing_heart,heart,heart_eyes,blush,grin,+1,relaxed,pensive,smile,sob,kiss,unamused,flushed,stuck_out_tongue_winking_eye,see_no_evil,wink,smiley,cry,stuck_out_tongue_closed_eyes,scream,rage,smirk,disappointed,sweat_smile,kissing_closed_eyes,speak_no_evil,relieved,grinning,yum,laughing,ok_hand,neutral_face,confused".split(",");for(c=0,f=n.length;f>c;c++)for(m=i[c][1],l=0,h=n[c].length;h>l;l++)d=n[c][l],p=Config.Emoji[d],u=p[1][0],t[d]=[p[0],u],g[u]=d,_[d]=[c,l,Math.floor(l/m),l%m];e.EmojiHelper={emojis:t,shortcuts:g,spritesheetPositions:_,stickers:v,getPopularEmoji:a,pushPopularEmoji:o,indexEmojis:r,searchEmojis:s}}(window,Config.Emoji,Config.EmojiCategories,Config.EmojiCategorySpritesheetDimens),EmojiTooltip.prototype.onMouseEnter=function(e){this.hideTimeout?(clearTimeout(this.hideTimeout),delete this.hideTimeout):e&&!this.showTimeout&&(this.showTimeout=setTimeout(this.show.bind(this),500))},EmojiTooltip.prototype.onMouseLeave=function(e){if(this.hideTimeout)e&&this.showTimeout&&(clearTimeout(this.showTimeout),delete this.showTimeout);else{var t=this;this.hideTimeout=setTimeout(function(){t.hide()},500)}},EmojiTooltip.prototype.createTooltip=function(){if(this.tooltipEl)return!1;var e=this;return this.tooltipEl=$('<div class="composer_emoji_tooltip noselect"><div class="composer_emoji_tooltip_tabs"></div><div class="composer_emoji_tooltip_content_wrap nano mobile_scrollable_wrap"><div class="composer_emoji_tooltip_content nano-content clearfix"></div></div><div class="composer_emoji_tooltip_footer"><a class="composer_emoji_tooltip_settings"></a></div><div class="composer_emoji_tooltip_tail"><i class="icon icon-tooltip-tail"></i></div></div>').appendTo(document.body),this.tabsEl=$(".composer_emoji_tooltip_tabs",this.tooltip),this.contentWrapEl=$(".composer_emoji_tooltip_content_wrap",this.tooltip),this.contentEl=$(".composer_emoji_tooltip_content",this.tooltip),this.footerEl=$(".composer_emoji_tooltip_footer",this.tooltip),this.settingsEl=$(".composer_emoji_tooltip_settings",this.tooltip),angular.forEach(["recent","smile","flower","bell","car","grid","stickers"],function(t,n){$('<a class="composer_emoji_tooltip_tab composer_emoji_tooltip_tab_'+t+'"></a>').on("mousedown",function(t){return e.selectTab(n),cancelEvent(t)}).on("mouseenter mouseleave",function(t){clearTimeout(e.selectTabTimeout),"mouseenter"==t.type&&(e.selectTabTimeout=setTimeout(function(){e.selectTab(n)},300))}).appendTo(e.tabsEl)}),Config.Mobile||this.contentWrapEl.nanoScroller({preventPageScrolling:!0,tabIndex:-1}),this.contentEl.on("mousedown",function(t){t=t.originalEvent||t;var n,i,a=$(t.target);return(a.hasClass("emoji")||a.hasClass("composer_sticker_image"))&&(a=$(a[0].parentNode)),(n=a.attr("data-code"))&&(e.onEmojiSelected&&e.onEmojiSelected(n),EmojiHelper.pushPopularEmoji(n)),(i=a.attr("data-sticker"))&&e.onStickerSelected&&e.onStickerSelected(i),cancelEvent(t)}),this.tooltipEl.on("mouseenter mouseleave",function(t){"mouseenter"==t.type?e.onMouseEnter():e.onMouseLeave()}),this.selectTab(0),!0},EmojiTooltip.prototype.selectTab=function(e){return this.tab===e?!1:($(".active",this.tabsEl).remove
}),_=setTimeout(function(){$(k).hide(),g=!1,_=!1},300))),cancelEvent(t)}var g,_,v=$("textarea",n)[0],y=$(".composer_emoji_insert_btn",n)[0],b=$(".composer_emoji_panel",n)[0],w=$("input",n),k=$(".im_send_dropbox_wrap",n)[0],S=$(".im_send_field_wrap",n)[0],C=$(".im_submit",n)[0];new EmojiTooltip(y,{getStickers:function(e){o.getStickers().then(function(){o.getStickersImages().then(function(t){e(t)})})},onEmojiSelected:function(t){e.$apply(function(){A.onEmojiSelected(t)})},onStickerSelected:function(t){e.$apply(function(){e.draftMessage.sticker=t})}});var M;b&&(M=new EmojiPanel(b,{onEmojiSelected:function(e){A.onEmojiSelected(e)}}));var A=new MessageComposer(v,{onTyping:function(){e.$emit("ui_typing")},getSendOnEnter:function(){return E},onMessageSubmit:c,onFilePaste:m}),x=A.richTextareaEl[0];x&&$(x).attr("placeholder",i($(v).attr("placeholder"))(e)).on("keydown keyup",d),w.on("change",function(){var t=this;e.$apply(function(){e.draftMessage.files=Array.prototype.slice.call(t.files),e.draftMessage.isMedia=$(t).hasClass("im_media_attach_input")||Config.Mobile,setTimeout(function(){try{t.value=""}catch(e){}},1e3)})});var E=!0;e.$on("settings_changed",s),s(),$(C).on("mousedown touchstart",c);var T=x&&x.offsetHeight;$(document).on("keydown",u),$("body").on("dragenter dragleave dragover drop",h),$(document).on("paste",f),Config.Navigator.touch||(e.$on("ui_peer_change",p),e.$on("ui_history_focus",p),e.$on("ui_history_change",p)),e.$on("ui_peer_change",A.resetTyping.bind(A)),e.$on("ui_peer_draft",function(){x&&(A.setValue(e.draftMessage.text||""),d()),A.focus()});var I=!1;e.$on("ui_message_before_send",function(){I=!0,l()}),e.$on("ui_message_send",function(){I=!1,p()}),e.$on("$destroy",function(){$(document).off("paste",f),$(document).off("keydown",u),$("body").off("dragenter dragleave dragover drop",h),$(C).off("mousedown touchstart"),w.off("change")}),Config.Navigator.touch||p()}return{link:s,scope:{draftMessage:"="}}}]).directive("myLoadThumb",["MtpApiFileManager","FileManager",function(e,t){function n(n,i,a){var o=0,r=e.getCachedFile(n.thumb&&n.thumb.location&&!n.thumb.location.empty&&n.thumb.location);r&&i.attr("src",t.getUrl(r,"image/jpeg")),n.thumb&&n.thumb.width&&n.thumb.height&&(i.attr("width",n.thumb.width),i.attr("height",n.thumb.height));var s=n.$watchCollection("thumb.location",function(a){n.thumb&&n.thumb.width&&n.thumb.height&&(i.attr("width",n.thumb.width),i.attr("height",n.thumb.height),n.$emit("ui_height"));var r=++o;if(!a||a.empty)return i.attr("src",n.thumb&&n.thumb.placeholder||"img/blank.gif"),void c();var s=e.getCachedFile(a);return s?(i.attr("src",t.getUrl(s,"image/jpeg")),void c()):(i.attr("src")||i.attr("src",n.thumb.placeholder||"img/blank.gif"),void e.downloadSmallFile(n.thumb.location).then(function(e){r==o&&(i.attr("src",t.getUrl(e,"image/jpeg")),c())},function(e){console.log("Download image failed",e,n.thumb.location,i[0]),r==o&&(i.attr("src",n.thumb.placeholder||"img/blank.gif"),c())}))}),c=a.watch?angular.noop:function(){setTimeout(function(){n.$destroy(),s()},0)}}return{link:n,scope:{thumb:"="}}}]).directive("myLoadFullPhoto",["MtpApiFileManager","FileManager","_",function(e,t,n){function i(i,a){var o=$("img",a)[0],r=$(".img_fullsize_with_progress_wrap",a).add(".img_fullsize_progress_wrap",a).add($(o)),s=function(){r.css({width:i.fullPhoto.width,height:i.fullPhoto.height}),i.$emit("ui_height",!0)},c=0;i.$watchCollection("fullPhoto.location",function(){var a=e.getCachedFile(i.thumbLocation),r=++c;if(a?(o.src=t.getUrl(a,"image/jpeg"),s()):o.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",i.fullPhoto.location){var l;if(i.fullPhoto.size){var d={_:"inputFileLocation",volume_id:i.fullPhoto.location.volume_id,local_id:i.fullPhoto.location.local_id,secret:i.fullPhoto.location.secret};l=e.downloadFile(i.fullPhoto.location.dc_id,d,i.fullPhoto.size)}else l=e.downloadSmallFile(i.fullPhoto.location);i.progress={enabled:!0,percent:0},l.then(function(e){r==c&&(i.progress.enabled=!1,o.src=t.getUrl(e,"image/jpeg"),s())},function(e){console.log("Download image failed",e,i.fullP