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.

20 lines
903 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 l=32767&this[e],c=this[e++]>>15,d=s*l+c*r;l=r*l+((32767&d)<<15)+n[i]+(1073741823&a),a=(l>>>30)+(d>>>15)+s*c+(a>>>30),n[i++]=1073741823&l}return a}function am3(e,t,n,i,a,o){for(var r=16383&t,s=t>>14;--o>=0;){var l=16383&this[e],c=this[e++]>>14,d=s*l+c*r;l=r*l+((16383&d)<<14)+n[i]+a,a=(l>>28)+(d>>14)+s*c,n[i++]=268435455&l}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 onContentLoaded(e){setTimeout(e,0)}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){return"partials/"+(Config.Mobile?"mobile":"desktop")+"/"+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.length,a=0,o=0;i>o;o++)t=o%3,a|=e[o]<<(16>>>t&24),(2===t||i-o===1)&&(n+=String.fromCharCode(uint6ToBase64(a>>>18&63),uint6ToBase64(a>>>12&63),uint6ToBase64(a>>>6&63),uint6ToBase64(63&a)),a=0);return n.replace(/A(?=A$|$)/g,"=")}function uint6ToBase64(e){return 26>e?e+65:52>e?e+71:62>e?e-4:62===e?43:63===e?47:65}function base64ToBlob(e,t){for(var n=1024,i=atob(e),a=i.length,o=Math.ceil(a/n),r=new Array(o),s=0;o>s;++s){for(var l=s*n,c=Math.min(l+n,a),d=new Array(c-l),u=l,p=0;c>u;++p,++u)d[p]=i[u].charCodeAt(0);r[s]=new Uint8Array(d)}return blobConstruct(r,t)}function dataUrlToBlob(e){var t=e.split(","),n=t[1],i=t[0].split(":")[1].split(";")[0],a=base64ToBlob(n,i);return a}function blobConstruct(e,t){var n;try{n=new Blob(e,{type:t})}catch(i){var a=new BlobBuilder;angular.forEach(e,function(e){a.append(e)}),n=a.getBlob(t)}return n}function bytesCmp(e,t){var n=e.length;if(n!=t.length)return!1;for(var i=0;n>i;i++)if(e[i]!=t[i])return!1;return!0}function bytesXor(e,t){for(var n=e.length,i=[],a=0;n>a;++a)i[a]=e[a]^t[a];return i}function bytesToWords(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,n=e.length,i=[];for(t=0;n>t;t++)i[t>>>2]|=e[t]<<24-t%4*8;return new CryptoJS.lib.WordArray.init(i,n)}function bytesFromWords(e){for(var t=e.words,n=e.sigBytes,i=[],a=0;n>a;a++)i.push(t[a>>>2]>>>24-a%4*8&255);return i}function bytesFromBigInt(e,t){for(var n=e.toByteArray();!n[0]&&(!t||n.length>t);)n=n.slice(1);return n}function bytesFromLeemonBigInt(e){var t=bigInt2str(e,16);return bytesFromHex(t)}function bytesToArrayBuffer(e){return new Uint8Array(e).buffer}function convertToArrayBuffer(e){return e instanceof ArrayBuffer?e:void 0!==e.buffer&&e.buffer.byteLength==e.length*e.BYTES_PER_ELEMENT?e.buffer:bytesToArrayBuffer(e)}function convertToUint8Array(e){return void 0!==e.buffer?e:new Uint8Array(e)}function convertToByteArray(e){if(Array.isArray(e))return e;e=convertToUint8Array(e);for(var t=[],n=0,i=e.length;i>n;n++)t.push(e[n]);return t}function bytesFromArrayBuffer(e){for(var t=e.byteLength,n=new Uint8Array(e),i=[],a=0;t>a;++a)i[a]=n[a];return i}function bufferConcat(e,t){var n=e.byteLength||e.l
return i!==i||n?t:0>i?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)};try{Q.apply(X=et.call(F.childNodes),F.childNodes),X[F.childNodes.length].nodeType}catch(kt){Q={apply:X.length?function(e,t){J.apply(e,et.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}w=t.support={},C=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},I=t.setDocument=function(e){var t,n=e?e.ownerDocument||e:F,i=n.defaultView;return n!==D&&9===n.nodeType&&n.documentElement?(D=n,P=n.documentElement,N=!C(n),i&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",function(){I()},!1):i.attachEvent&&i.attachEvent("onunload",function(){I()})),w.attributes=a(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=a(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=_t.test(n.getElementsByClassName)&&a(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),w.getById=a(function(e){return P.appendChild(e).id=R,!n.getElementsByName||!n.getElementsByName(R).length}),w.getById?($.find.ID=function(e,t){if(typeof t.getElementById!==G&&N){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},$.filter.ID=function(e){var t=e.replace(wt,$t);return function(e){return e.getAttribute("id")===t}}):(delete $.find.ID,$.filter.ID=function(e){var t=e.replace(wt,$t);return function(e){var n=typeof e.getAttributeNode!==G&&e.getAttributeNode("id");return n&&n.value===t}}),$.find.TAG=w.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==G?t.getElementsByTagName(e):void 0}:function(e,t){var n,i=[],a=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[a++];)1===n.nodeType&&i.push(n);return i}return o},$.find.CLASS=w.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==G&&N?t.getElementsByClassName(e):void 0},O=[],L=[],(w.qsa=_t.test(n.querySelectorAll))&&(a(function(e){e.innerHTML="<select msallowclip=''><option selected=''></option></select>",e.querySelectorAll("[msallowclip^='']").length&&L.push("[*^$]="+it+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||L.push("\\["+it+"*(?:value|"+nt+")"),e.querySelectorAll(":checked").length||L.push(":checked")}),a(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&L.push("name"+it+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||L.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),L.push(",.*:")})),(w.matchesSelector=_t.test(U=P.matches||P.webkitMatchesSelector||P.mozMatchesSelector||P.oMatchesSelector||P.msMatchesSelector))&&a(function(e){w.disconnectedMatch=U.call(e,"div"),U.call(e,"[s!='']:x"),O.push("!=",st)}),L=L.length&&new RegExp(L.join("|")),O=O.length&&new RegExp(O.join("|")),t=_t.test(P.compareDocumentPosition),B=t||_t.test(P.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},W=t?function(e,t){if(e===t)return E=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&i||!w.sortDetached&&t.compareDocumentPosition(e)===i?e===n||e.ownerDocument===F&&B(F,e)?-1:t===n||t.ownerDocument===F&&B(F,t)?1:T?tt.call(T,e)-tt.call(T,t):0:4&i?-1:1)}:function(e,t){if(e===t)return E=!0,0;var i,a=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===n?-1:t===n?1:o?-1:s?1:T?tt.call(T,e)-tt.call(T,t):0;if(o===s)return r(e,t);for(i=e;i=i.parentNode;)l.unshift(i);for(i=t;i=i.parentNode;)c.unshift(i);for(;l[a]===c[a];)a++;return a?r(l[a],c[a]):l[a]===F?-1:c[a]===F?1:0},n):D},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.
return(!a||a!==i&&!at.contains(i,a))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),nt.submitBubbles||(at.event.special.submit={setup:function(){return at.nodeName(this,"form")?!1:void at.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=at.nodeName(t,"input")||at.nodeName(t,"button")?t.form:void 0;n&&!at._data(n,"submitBubbles")&&(at.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),at._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&at.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return at.nodeName(this,"form")?!1:void at.event.remove(this,"._submit")}}),nt.changeBubbles||(at.event.special.change={setup:function(){return It.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(at.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),at.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),at.event.simulate("change",this,e,!0)})),!1):void at.event.add(this,"beforeactivate._change",function(e){var t=e.target;It.test(t.nodeName)&&!at._data(t,"changeBubbles")&&(at.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||at.event.simulate("change",this.parentNode,e,!0)}),at._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return at.event.remove(this,"._change"),!It.test(this.nodeName)}}),nt.focusinBubbles||at.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){at.event.simulate(t,e.target,at.event.fix(e),!0)};at.event.special[t]={setup:function(){var i=this.ownerDocument||this,a=at._data(i,t);a||i.addEventListener(e,n,!0),at._data(i,t,(a||0)+1)},teardown:function(){var i=this.ownerDocument||this,a=at._data(i,t)-1;a?at._data(i,t,a):(i.removeEventListener(e,n,!0),at._removeData(i,t))}}}),at.fn.extend({on:function(e,t,n,i,a){var o,r;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=void 0);for(o in e)this.on(o,t,n,e[o],a);return this}if(null==n&&null==i?(i=t,n=t=void 0):null==i&&("string"==typeof t?(i=n,n=void 0):(i=n,n=t,t=void 0)),i===!1)i=m;else if(!i)return this;return 1===a&&(r=i,i=function(e){return at().off(e),r.apply(this,arguments)},i.guid=r.guid||(r.guid=at.guid++)),this.each(function(){at.event.add(this,e,i,n,t)})},one:function(e,t,n,i){return this.on(e,t,n,i,1)},off:function(e,t,n){var i,a;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,at(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(a in e)this.off(a,t,e[a]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=void 0),n===!1&&(n=m),this.each(function(){at.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){at.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?at.event.trigger(e,t,n,!0):void 0}});var Ot="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Ut=/ jQuery\d+="(?:null|\d+)"/g,Bt=new RegExp("<(?:"+Ot+")[\\s/>]","i"),Rt=/^\s+/,Ft=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,qt=/<([\w:]+)/,Ht=/<tbody/i,jt=/<|&#?\w+;/,zt=/<(?:script|style|link)/i,Vt=/checked\s*(?:[^=]|=\s*.checked.)/i,Wt=/^$|\/(?:java|ecma)script/i,Gt=/^true\/(.*)/,Kt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Zt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:nt.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]}
l=u.global,l&&0===at.active++&&at.event.trigger("ajaxStart"),u.type=u.type.toUpperCase(),u.hasContent=!Fn.test(u.type),o=u.url,u.hasContent||(u.data&&(o=u.url+=(Dn.test(o)?"&":"?")+u.data,delete u.data),u.cache===!1&&(u.url=Un.test(o)?o.replace(Un,"$1_="+In++):o+(Dn.test(o)?"&":"?")+"_="+In++)),u.ifModified&&(at.lastModified[o]&&w.setRequestHeader("If-Modified-Since",at.lastModified[o]),at.etag[o]&&w.setRequestHeader("If-None-Match",at.etag[o])),(u.data&&u.hasContent&&u.contentType!==!1||t.contentType)&&w.setRequestHeader("Content-Type",u.contentType),w.setRequestHeader("Accept",u.dataTypes[0]&&u.accepts[u.dataTypes[0]]?u.accepts[u.dataTypes[0]]+("*"!==u.dataTypes[0]?", "+Vn+"; q=0.01":""):u.accepts["*"]);for(a in u.headers)w.setRequestHeader(a,u.headers[a]);if(u.beforeSend&&(u.beforeSend.call(p,w,u)===!1||2===v))return w.abort();b="abort";for(a in{success:1,error:1,complete:1})w[a](u[a]);if(c=F(zn,u,t,w)){w.readyState=1,l&&m.trigger("ajaxSend",[w,u]),u.async&&u.timeout>0&&(s=setTimeout(function(){w.abort("timeout")},u.timeout));try{v=1,c.send(_,n)}catch($){if(!(2>v))throw $;n(-1,$)}}else n(-1,"No Transport");return w},getJSON:function(e,t,n){return at.get(e,t,n,"json")},getScript:function(e,t){return at.get(e,void 0,t,"script")}}),at.each(["get","post"],function(e,t){at[t]=function(e,n,i,a){return at.isFunction(n)&&(a=a||i,i=n,n=void 0),at.ajax({url:e,type:t,dataType:a,data:n,success:i})}}),at.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){at.fn[t]=function(e){return this.on(t,e)}}),at._evalUrl=function(e){return at.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},at.fn.extend({wrapAll:function(e){if(at.isFunction(e))return this.each(function(t){at(this).wrapAll(e.call(this,t))});if(this[0]){var t=at(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return this.each(at.isFunction(e)?function(t){at(this).wrapInner(e.call(this,t))}:function(){var t=at(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=at.isFunction(e);return this.each(function(n){at(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){at.nodeName(this,"body")||at(this).replaceWith(this.childNodes)}).end()}}),at.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!nt.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||at.css(e,"display"))},at.expr.filters.visible=function(e){return!at.expr.filters.hidden(e)};var Gn=/%20/g,Kn=/\[\]$/,Zn=/\r?\n/g,Xn=/^(?:submit|button|image|reset|file)$/i,Yn=/^(?:input|select|textarea|keygen)/i;at.param=function(e,t){var n,i=[],a=function(e,t){t=at.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=at.ajaxSettings&&at.ajaxSettings.traditional),at.isArray(e)||e.jquery&&!at.isPlainObject(e))at.each(e,function(){a(this.name,this.value)});else for(n in e)z(n,e[n],t,a);return i.join("&").replace(Gn,"+")},at.fn.extend({serialize:function(){return at.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=at.prop(this,"elements");return e?at.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!at(this).is(":disabled")&&Yn.test(this.nodeName)&&!Xn.test(e)&&(this.checked||!Et.test(e))}).map(function(e,t){var n=at(this).val();return null==n?null:at.isArray(n)?at.map(n,function(e){return{name:t.name,value:e.replace(Zn,"\r\n")}}):{name:t.name,value:n.replace(Zn,"\r\n")}}).get()}}),at.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&V()||W()}:V;var Jn=0,Qn={},ei=at.ajaxSettings.xhr();e.ActiveXObject&&at(e).on("unload",function(){for(var e in Qn)Qn[e](void 0,!0)}),nt.cors=!!ei&&"withCredentials"in ei,ei=nt.ajax=!!ei,ei&&at.ajaxTransport(function(e){if(!e.crossDomain||nt.cors){var t;return{send:f
}function n(){l=!0}function i(){return l?(l=!1,""):s}function a(){var e,t,n,a=Array.prototype.slice.call(arguments),o=a.pop(),r=[],s=1==a.length,l=!0,p=i();for(t=0;t<a.length;t++)if(n=a[t]=p+a[t],"xt_"!=n.substr(0,3)&&void 0!==c[n])r.push(c[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(c[n]=e)}else d?l=!1:r.push(c[n]=!1);return l?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(c[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,c[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 c[t],u)try{localStorage.removeItem(t)}catch(r){u=!1}d?chrome.storage.local.remove(a,n):n&&n()}var s="",l=!1,c={},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,l,c,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
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]),c}}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=[],l=e("$injector","invoke","push",a),c={_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:l,run:function(e){return s.push(e),this}};return r&&l(r),c})}})}function dt(t){u(t,{bootstrap:J,copy:L,extend:u,equals:U,element:Vi,forEach:o,injector:Ft,noop:h,bind:F,toJson:H,fromJson:j,identity:f,isUndefined:_,isDefined:y,isString:b,isFunction:k,isObject:v,isNumber:w,isElement:I,isArray:na,version:ha,isDate:$,lowercase:Ri,uppercase:qi,callbacks:{counter:0},getTestability:et,$$minErr:i,$$csp:oa,reloadWithDebugInfo:Q}),Gi=ct(e);try{Gi("ngLocale")}catch(n){Gi("ngLocale",[]).provider("$locale",pn)}Gi("ng",["ngLocale"],["$provide",function(e){e.provider({$$sanitizeUri:jn}),e.provider("$compile",Gt).directive({a:bo,input:Ro,textarea:Ro,form:So,script:Er,select:Pr,style:Lr,option:Nr,ngBind:ar,ngBindHtml:rr,ngBindTemplate:or,ngClass:sr,ngClassEven:cr,ngClassOdd:lr,ngCloak:dr,ngController:ur,ngForm:Mo,ngHide:Cr,ngIf:hr,ngInclude:fr,ngInit:_r,ngNonBindable:yr,ngPluralize:vr,ngRepeat:br,ngShow:kr,ngStyle:Sr,ngSwitch:Mr,ngSwitchWhen:xr,ngSwitchDefault:Ar,ngOptions:Dr,ngTransclude:Tr,ngModel:Ko,ngList:er,ngChange:Zo,pattern:Yo,ngPattern:Yo,required:Xo,ngRequired:Xo,minlength:Qo,ngMinlength:Qo,maxlength:Jo,ngMaxlength:Jo,ngValue:nr,ngModelOptions:ir}).directive({ngInclude:gr}).directive(wo).directive(pr),e.provider({$anchorScroll:qt,$animate:Ba,$browser:zt,$cacheFactory:Vt,$controller:Yt,$document:Jt,$exceptionHandler:Qt,$filter:ti,$interpolate:dn,$interval:un,$http:rn,$httpBackend:ln,$location:Sn,$log:Mn,$parse:Un,$rootScope:Hn,$q:Bn,$$q:Rn,$sce:Gn,$sceDelegate:Wn,$sniffer:Kn,$templateCache:Wt,$templateRequest:Zn,$$testability:Xn,$timeout:Yn,$window:ei,$$rAF:qn,$$asyncCallback:Ht})}])}function ut(){return++ga}function pt(e){return e.replace(va,function(e,t,n,i){return i?n.toUpperCase():n}).replace(ba,"Moz$1")}function mt(e){return!Ca.test(e)}function ht(e){var t=e.nodeType;return t===ca||!t||t===pa}function ft(e,t){var n,i,a,r,s=t.createDocumentFragment(),l=[];if(mt(e))l.push(t.createTextNode(e));else{for(n=n||s.appendChild(t.createElement("div")),i=(Sa.exec(e)||["",""])[1].toLowerCase(),a=xa[i]||xa._default,n.innerHTML=a[1]+e.replace(Ma,"<$1></$2>")+a[2],r=a[0];r--;)n=n.lastChild;l=B(l,n.childNodes),n=s.firstChild,n.textContent=""}return s.textContent="",s.innerHTML="",o(l,function(e){s.appendChild(e)}),s}function gt(e,n){n=n||t;var i;return(i=ka.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=ia(e),t=!0),!(this instanceof _t)){if(t&&"<"!=e.charAt(0))throw $a("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 $a("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){if(y(n)){var i=r[t];if(N(i||[],n),i&&i.length>0)return}ya(e,t,s),delete r[t]});else for(t in
}function h(){o(arguments,function(e){m[e]=function(t,n){return m(u(n||{},{method:e,url:t}))}})}function f(){o(arguments,function(e){m[e]=function(t,n,i){return m(u(i||{},{method:e,url:t,data:n}))}})}function g(i,o,s){function l(e,n,i,a){function o(){u(n,e,i,a)}h&&(on(e)?h.put($,[e,n,tn(i),a]):h.remove($)),t?c.$applyAsync(o):(o(),c.$$phase||c.$apply())}function u(e,t,n,a){t=Math.max(t,0),(on(t)?g.resolve:g.reject)({data:e,status:t,headers:nn(n),config:i,statusText:a})}function p(){var e=m.pendingRequests.indexOf(i);-1!==e&&m.pendingRequests.splice(e,1)}var h,f,g=d.defer(),b=g.promise,$=w(i.url,i.params);if(m.pendingRequests.push(i),b.then(p,p),!i.cache&&!e.cache||i.cache===!1||"GET"!==i.method&&"JSONP"!==i.method||(h=v(i.cache)?i.cache:v(e.cache)?e.cache:C),h)if(f=h.get($),y(f)){if(E(f))return f.then(p,p),f;na(f)?u(f[1],f[0],O(f[2]),f[3]):u(f,200,{},"OK")}else h.put($,b);if(_(f)){var k=Qn(i.url)?r.cookies()[i.xsrfCookieName||e.xsrfCookieName]:n;k&&(s[i.xsrfHeaderName||e.xsrfHeaderName]=k),a(i.method,$,o,l,s,i.timeout,i.withCredentials,i.responseType)}return b}function w(e,t){if(!t)return e;var n=[];return s(t,function(e,t){null===e||_(e)||(na(e)||(e=[e]),o(e,function(e){v(e)&&(e=$(e)?e.toISOString():H(e)),n.push(Z(t)+"="+Z(e))}))}),n.length>0&&(e+=(-1==e.indexOf("?")?"?":"&")+n.join("&")),e}var C=l("$http"),S=[];return o(i,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=e,m}]}function sn(){return new e.XMLHttpRequest}function ln(){this.$get=["$browser","$window","$document",function(e,t,n){return cn(e,sn,e.defer,t.angular.callbacks,n[0])}]}function cn(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){ya(o,"load",r),ya(o,"error",r),a.body.removeChild(o),o=null;var s=-1,l="unknown";e&&("load"!==e.type||i[t].called||(e={type:"error"}),l=e.type,s="error"===e.type?404:200),n&&n(s,l)},_a(o,"load",r),_a(o,"error",r),a.body.appendChild(o),r}return function(a,s,l,c,d,u,p,m){function f(){v&&v(),b&&b.abort()}function g(t,i,a,o,r){k&&n.cancel(k),v=b=null,t(i,a,o,r),e.$$completeOutstandingRequest(h)}if(e.$$incOutstandingRequestCount(),s=s||e.url(),"jsonp"==Ri(a)){var _="_"+(i.counter++).toString(36);i[_]=function(e){i[_].data=e,i[_].called=!0};var v=r(s.replace("JSON_CALLBACK","angular.callbacks."+_),_,function(e,t){g(c,e,i[_].data,"",t),i[_]=h})}else{var b=t();b.open(a,s,!0),o(d,function(e,t){y(e)&&b.setRequestHeader(t,e)}),b.onload=function(){var e=b.statusText||"",t="response"in b?b.response:b.responseText,n=1223===b.status?204:b.status;0===n&&(n=t?200:"file"==Jn(s).protocol?404:0),g(c,n,t,b.getAllResponseHeaders(),e)};var w=function(){g(c,-1,null,null,"")};if(b.onerror=w,b.onabort=w,p&&(b.withCredentials=!0),m)try{b.responseType=m}catch($){if("json"!==m)throw $}b.send(l||null)}if(u>0)var k=n(f,u);else E(u)&&u.then(f)}}function dn(){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(c,e).replace(d,t)}function f(e){try{return T(A(e))}catch(t){var n=Wa("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+l,M.push(S.length),S.push("")}if(p&&S.length>1)throw Wa("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":brea
return o(i,function(e,n){r[n]=t(n,e)}),r}return e.factory(i+n,a)}var n="Filter";this.register=t,this.$get=["$injector",function(e){return function(t){return e.get(t+n)}}],t("currency",ii),t("date",hi),t("filter",ni),t("json",fi),t("limitTo",gi),t("lowercase",yo),t("number",ai),t("orderBy",_i),t("uppercase",vo)}function ni(){return function(e,t,n){if(!na(e))return e;var i=typeof n,a=[];a.check=function(e,t){for(var n=0;n<a.length;n++)if(!a[n](e,t))return!1;return!0},"function"!==i&&(n="boolean"===i&&n?function(e,t){return Qi.equals(e,t)}:function(e,t){if(e&&t&&"object"==typeof e&&"object"==typeof t){for(var i in e)if("$"!==i.charAt(0)&&Fi.call(e,i)&&n(e[i],t[i]))return!0;return!1}return t=(""+t).toLowerCase(),(""+e).toLowerCase().indexOf(t)>-1});var o=function(e,t){if("string"==typeof t&&"!"===t.charAt(0))return!o(e,t.substr(1));switch(typeof e){case"boolean":case"number":case"string":return n(e,t);case"object":switch(typeof t){case"object":return n(e,t);default:for(var i in e)if("$"!==i.charAt(0)&&o(e[i],t))return!0}return!1;case"array":for(var a=0;a<e.length;a++)if(o(e[a],t))return!0;return!1;default:return!1}};switch(typeof t){case"boolean":case"number":case"string":t={$:t};case"object":for(var r in t)!function(e){"undefined"!=typeof t[e]&&a.push(function(n){return o("$"==e?n:n&&n[e],t[e])})}(r);break;case"function":a.push(t);break;default:return e}for(var s=[],l=0;l<e.length;l++){var c=e[l];a.check(c,l)&&s.push(c)}return s}}function ii(e){var t=e.NUMBER_FORMATS;return function(e,n,i){return _(n)&&(n=t.CURRENCY_SYM),_(i)&&(i=2),null==e?e:oi(e,t.PATTERNS[1],t.GROUP_SEP,t.DECIMAL_SEP,i).replace(/\u00A4/g,n)}}function ai(e){var t=e.NUMBER_FORMATS;return function(e,n){return null==e?e:oi(e,t.PATTERNS[0],t.GROUP_SEP,t.DECIMAL_SEP,n)}}function oi(e,t,n,i,a){if(!isFinite(e)||v(e))return"";var o=0>e;e=Math.abs(e);var r=e+"",s="",l=[],c=!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,c=!0)}if(c)a>0&&e>-1&&1>e&&(s=e.toFixed(a));else{var u=(r.split(ho)[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(ho),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 l.push(o?t.negPre:t.posPre),l.push(s),l.push(o?t.negSuf:t.posSuf),l.join("")}function ri(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 si(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),ri(o,t,i)}}function li(e,t){return function(n,i){var a=n["get"+e](),o=qi(t?"SHORT"+e:e);return i[o][a]}}function ci(e){var t=-1*e.getTimezoneOffset(),n=t>=0?"+":"";return n+=ri(Math[t>0?"floor":"ceil"](t/60),2)+ri(Math.abs(t%60),2)}function di(e){var t=new Date(e,0,1).getDay();return new Date(e,0,(4>=t?5:12)-t)}function ui(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function pi(e){return function(t){var n=di(t.getFullYear()),i=ui(t),a=+i-+n,o=1+Math.round(a/6048e5);return ri(o,e)}}function mi(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}function hi(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 l=p(t[4]||0)-a,c=p(t[5]||0)-o,d=p(t[6]||0),u=Math.round(1e3*parseFloat("0."+(t[7]||0)));return s.call(i,l,c,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,l="",c=[];if(i=i||"mediumDate",i=e.DATETIME_FORMATS[i]||i,b(n)&&(n=_o.test(n)?p(n):t(n)),w(n)&&(n=new Date(n)),!$(n))return n;for(;i;)s=go.exec(i),s?(c=B(c,s,1),i=c.pop()):(c.push(i),i=null);return a&&"UTC"===a&&(n=new Date(n.getTime()),n.setMinute
return t},multiplicative:function(){for(var e,t=this.unary();e=this.expect("*","/","%");)t=this.binaryFn(t,e.fn,this.unary());return t},unary:function(){var e;return this.expect("+")?this.primary():(e=this.expect("-"))?this.binaryFn(oo.ZERO,e.fn,this.unary()):(e=this.expect("!"))?this.unaryFn(e.fn,this.unary()):this.primary()},fieldAccess:function(e){var t=this.text,n=this.expect().text,i=Ln(n,this.options,t);return u(function(t,n,a){return i(a||e(t,n))},{assign:function(i,a,o){var r=e(i,o);return r||e.assign(i,r={}),In(r,n,a,t)}})},objectIndex:function(e){var t=this.text,i=this.expression();return this.consume("]"),u(function(a,o){var r,s=e(a,o),l=i(a,o);return xn(l,t),s?r=An(s[l],t):n},{assign:function(n,a,o){var r=xn(i(n,o),t),s=An(e(n,o),t);return s||e.assign(n,s={}),s[r]=a}})},functionCall:function(e,t){var n=[];if(")"!==this.peekToken().text)do n.push(this.expression());while(this.expect(","));this.consume(")");var i=this.text,a=n.length?[]:null;return function(o,r){var s=t?t(o,r):o,l=e(o,r,s)||h;if(a)for(var c=n.length;c--;)a[c]=An(n[c](o,r),i);An(s,i),Tn(l,i);var d=l.apply?l.apply(s,a):l(a[0],a[1],a[2],a[3],a[4]);return An(d,i)}},arrayDeclaration:function(){var e=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;var t=this.expression();e.push(t)}while(this.expect(","));return this.consume("]"),u(function(t,n){for(var i=[],a=0,o=e.length;o>a;a++)i.push(e[a](t,n));return i},{literal:!0,constant:e.every(En),inputs:e})},object:function(){var e=[],t=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;var n=this.expect();e.push(n.string||n.text),this.consume(":");var i=this.expression();t.push(i)}while(this.expect(","));return this.consume("}"),u(function(n,i){for(var a={},o=0,r=t.length;r>o;o++)a[e[o]]=t[o](n,i);return a},{literal:!0,constant:t.every(En),inputs:t})}};var ro=lt(),so=lt(),lo=Object.prototype.valueOf,co=i("$sce"),uo={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Ra=i("$compile"),po=t.createElement("a"),mo=Jn(e.location.href,!0);ti.$inject=["$provide"],ii.$inject=["$locale"],ai.$inject=["$locale"];var ho=".",fo={yyyy:si("FullYear",4),yy:si("FullYear",2,0,!0),y:si("FullYear",1),MMMM:li("Month"),MMM:li("Month",!0),MM:si("Month",2,1),M:si("Month",1,1),dd:si("Date",2),d:si("Date",1),HH:si("Hours",2),H:si("Hours",1),hh:si("Hours",2,-12),h:si("Hours",1,-12),mm:si("Minutes",2),m:si("Minutes",1),ss:si("Seconds",2),s:si("Seconds",1),sss:si("Milliseconds",3),EEEE:li("Day"),EEE:li("Day",!0),a:mi,Z:ci,ww:pi(2),w:pi(1)},go=/((?:[^yMdHhmsaZEw']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|w+))(.*)/,_o=/^\-?\d+$/;hi.$inject=["$locale"];var yo=g(Ri),vo=g(qi);_i.$inject=["$parse"];var bo=g({restrict:"E",compile:function(e,t){return t.href||t.xlinkHref||t.name?void 0:function(e,t){var n="[object SVGAnimatedString]"===Yi.call(t.prop("href"))?"xlink:href":"href";t.on("click",function(e){t.attr(n)||e.preventDefault()})}}}),wo={};o(Ta,function(e,t){if("multiple"!=e){var n=Kt("ng-"+t);wo[n]=function(){return{restrict:"A",priority:100,link:function(e,i,a){e.$watch(a[n],function(e){a.$set(t,!!e)})}}}}}),o(Ia,function(e,t){wo[t]=function(){return{priority:100,link:function(e,n,i){if("ngPattern"===t&&"/"==i.ngPattern.charAt(0)){var a=i.ngPattern.match(Ui);if(a)return void i.$set("ngPattern",new RegExp(a[1],a[2]))}e.$watch(i[t],function(e){i.$set(t,e)})}}}}),o(["src","srcset","href"],function(e){var t=Kt("ng-"+e);wo[t]=function(){return{priority:99,link:function(n,i,a){var o=e,r=e;"href"===e&&"[object SVGAnimatedString]"===Yi.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(zi&&o&&i.prop(o,a[r]))):void("href"===e&&a.$set(r,null))})}}}});var $o={$addControl:h,$$renameControl:vi,$removeControl:h,$setValidity:h,$setDirty:h,$setPristine:h,$setSubmitted:h},ko="ng-submitted";bi.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Co=function(e){return["$timeout",function(t){var i={name:"form",restrict:e?"EAC":"E",controller:bi,compile:function(e){return e.addClass(Ho).addClass(Fo),{pre:function(e,i,a,o)
});var o=[],r=[];return d(t&&t.classes||[],function(e,t){var n=a[t],s=i[t]||{};e===!1?(n||"addClass"==s.event)&&r.push(t):e===!0&&(n&&"removeClass"!=s.event||o.push(t))}),o.length+r.length>0&&[o.join(" "),r.join(" ")]}function T(e){if(e){var t=[],n={},a=e.substr(1).split(".");(f.transitions||f.animations)&&t.push(i.get(u[""]));for(var o=0;o<a.length;o++){var r=a[o],s=u[r];s&&!n[r]&&(t.push(i.get(s)),n[r]=!0)}return t}}function E(e,n,i,a){function o(e,t){var n=e[t],i=e["before"+t.charAt(0).toUpperCase()+t.substr(1)];return n||i?("leave"==t&&(i=n,n=null),$.push({event:t,fn:n}),v.push({event:t,fn:i}),!0):void 0}function r(t,n,o){function r(e){if(n){if((n[e]||c)(),++p<s.length)return;n=null}o()}var s=[];d(t,function(e){e.fn&&s.push(e)});var p=0;d(s,function(t,o){var s=function(){r(o)};switch(t.event){case"setClass":n.push(t.fn(e,l,u,s,a));break;case"animate":n.push(t.fn(e,i,a.from,a.to,s));break;case"addClass":n.push(t.fn(e,l||i,s,a));break;case"removeClass":n.push(t.fn(e,u||i,s,a));break;default:n.push(t.fn(e,s,a))}}),n&&0===n.length&&o()}var s=e[0];if(s){a&&(a.to=a.to||{},a.from=a.from||{});var l,u;p(i)&&(l=i[0],u=i[1],l?u?i=l+" "+u:(i=l,n="addClass"):(i=u,n="removeClass"));var m="setClass"==n,h=m||"addClass"==n||"removeClass"==n||"animate"==n,f=e.attr("class"),g=f+" "+i;if(B(g)){var _=c,y=[],v=[],b=c,w=[],$=[],k=(" "+g).replace(/\s+/g,".");return d(T(k),function(e){var t=o(e,n);!t&&m&&(o(e,"addClass"),o(e,"removeClass"))}),{node:s,event:n,className:i,isClassBased:h,isSetClassOperation:m,applyStyles:function(){a&&e.css(t.extend(a.from||{},a.to||{}))},before:function(e){_=e,r(v,y,function(){_=c,e()})},after:function(e){b=e,r($,w,function(){b=c,e()})},cancel:function(){y&&(d(y,function(e){(e||c)(!0)}),_(!0)),w&&(d(w,function(e){(e||c)(!0)}),b(!0))}}}}}function I(e,n,i,a,o,r,s,l){function u(t){var a="$animate:"+t;$&&$[a]&&$[a].length>0&&w(function(){i.triggerHandler(a,{event:e,className:n})})}function p(){u("before")}function m(){u("after")}function h(){u("close"),l()}function f(){f.hasBeenRun||(f.hasBeenRun=!0,r())}function _(){if(!_.hasBeenRun){b&&b.applyStyles(),_.hasBeenRun=!0,s&&s.tempClasses&&d(s.tempClasses,function(e){i.removeClass(e)});var t=i.data(g);t&&(b&&b.isClassBased?P(i,n):(w(function(){var t=i.data(g)||{};D==t.index&&P(i,n,e)}),i.data(g,t))),h()}}var v=c,b=E(i,e,n,s);if(!b)return f(),p(),m(),_(),v;e=b.event,n=b.className;var $=t.element._data(b.node);if($=$&&$.events,a||(a=o?o.parent():i.parent()),N(i,a))return f(),p(),m(),_(),v;var k=i.data(g)||{},C=k.active||{},S=k.totalActive||0,M=k.last,x=!1;if(S>0){var A=[];if(b.isClassBased){if("setClass"==M.event)A.push(M),P(i,n);else if(C[n]){var T=C[n];T.event==e?x=!0:(A.push(T),P(i,n))}}else if("leave"==e&&C["ng-leave"])x=!0;else{for(var I in C)A.push(C[I]);k={},P(i,!0)}A.length>0&&d(A,function(e){e.cancel()})}if(!b.isClassBased||b.isSetClassOperation||"animate"==e||x||(x="addClass"==e==i.hasClass(n)),x)return f(),p(),m(),h(),v;C=k.active||{},S=k.totalActive||0,"leave"==e&&i.one("$destroy",function(){var e=t.element(this),n=e.data(g);if(n){var i=n.active["ng-leave"];i&&(i.cancel(),P(e,"ng-leave"))}}),i.addClass(y),s&&s.tempClasses&&d(s.tempClasses,function(e){i.addClass(e)});var D=O++;return S++,C[n]=b,i.data(g,{last:b,active:C,index:D,totalActive:S}),p(),b.before(function(t){var a=i.data(g);t=t||!a||!a.active[n]||b.isClassBased&&a.active[n].event!=e,f(),t===!0?_():(m(),b.after(_))}),b.cancel}function D(e){var n=o(e);if(n){var i=t.isFunction(n.getElementsByClassName)?n.getElementsByClassName(y):n.querySelectorAll("."+y);d(i,function(e){e=t.element(e);var n=e.data(g);n&&n.active&&d(n.active,function(e){e.cancel()})})}}function P(e,t){if(l(e,b))v.disabled||(v.running=!1,v.structural=!1);else if(t){var n=e.data(g)||{},i=t===!0;!i&&n.active&&n.active[t]&&(n.totalActive--,delete n.active[t]),(i||!n.totalActive)&&(e.removeClass(y),e.removeData(g))}}function N(e,n){if(v.disabled)return!0;if(l(e,b))return v.running;var i,a,o;do{if(0===n.length)break;var r=l(n,b),s=r?v:n.data(g)||{};if(s.disabled)return!0;if(r&&(o=!0),i!==!1){var c=n.data(_);t.isDefined(c)&&(i=c)}a=a||s.run
},dismiss:function(e){s.dismiss(d,e)}};if(t=angular.extend({},e.options,t),t.resolve=t.resolve||{},!t.template&&!t.templateUrl)throw new Error("One of template or templateUrl options is required.");var u=i.all([l(t)].concat(c(t.resolve)));return u.then(function(e){var i=(t.scope||n).$new();i.$close=d.close,i.$dismiss=d.dismiss;var o,l={},c=1;t.controller&&(l.$scope=i,l.$modalInstance=d,angular.forEach(t.resolve,function(t,n){l[n]=e[c++]}),o=r(t.controller,l),t.controllerAs&&(i[t.controllerAs]=o)),s.open(d,{scope:i,deferred:a,content:e[0],backdrop:t.backdrop,keyboard:t.keyboard,backdropClass:t.backdropClass,windowClass:t.windowClass,windowTemplateUrl:t.windowTemplateUrl,size:t.size})},function(e){a.reject(e)}),u.then(function(){o.resolve(!0)},function(){o.reject(!1)}),d},d}]};return e}),angular.module("ui.bootstrap.transition",[]).factory("$transition",["$q","$timeout","$rootScope",function(e,t,n){function i(e){for(var t in e)if(void 0!==o.style[t])return e[t]}var a=function(i,o,r){r=r||{};var s=e.defer(),l=a[r.animation?"animationEndEventName":"transitionEndEventName"],c=function(){n.$apply(function(){i.unbind(l,c),s.resolve(i)})};return l&&i.bind(l,c),t(function(){angular.isString(o)?i.addClass(o):angular.isFunction(o)?o(i):angular.isObject(o)&&i.css(o),l||s.resolve(i)}),s.promise.cancel=function(){l&&i.unbind(l,c),s.reject("Transition cancelled")},s.promise},o=document.createElement("trans"),r={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},s={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return a.transitionEndEventName=i(r),a.animationEndEventName=i(s),a}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(e){e.put("template/tooltip/tooltip-html-unsafe-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(e){e.put("template/tooltip/tooltip-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(e){e.put("template/modal/backdrop.html",'<div class="modal-backdrop fade {{ backdropClass }}"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(e){e.put("template/modal/window.html",'<div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal_close_wrap" ng-click="close($event)">\n <div class="modal_close"></div>\n </div>\n <div class="modal-dialog" ng-class="{\'modal-sm\': size == \'sm\', \'modal-lg\': size == \'lg\'}"><div class="modal-content" modal-transclude></div></div>\n</div>')}]),angular.module("mediaPlayer",["mediaPlayer.helpers"]).constant("mp.playerDefaults",{currentTrack:0,ended:void 0,network:void 0,playing:!1,seeking:!1,tracks:0,volume:1,formatDuration:"00:00",formatTime:"00:00",loadPercent:0}).directive("mediaPlayer",["$rootScope","$interpolate","$timeout","mp.throttle","mp.playerDefaults",function(e,t,n,i,a){function o(e){return function(t,i){var a,o=null;if(e.$attachPlaylist(t),void 0===t&&void 0!==i)return e.pause();if(e.currentTrack){a=i?i[e.currentTrack-1]:-1;for(var r=0;r<t.length;r++)if(angular.equals(t[r],a)){o=r;break}null!==o?(e.currentTrack=o+1,e.tracks=t.length):(e.pause(),t.length?n(function(){e.$clearSourceList(),e.$addSourceList(t[0]),e.load(),e.tracks=t.length}):e.reset())}else t.length?(e.$clearSourceList(),e.$addSourceList(t[0]),e.load(),e.tracks=t.length)
return(4294967295^i)>>>0}function i(){}function a(e){var t,n,i,a,o,r,s,l,c,d=e.length,u=0,m=Number.POSITIVE_INFINITY;for(l=0;d>l;++l)e[l]>u&&(u=e[l]),e[l]<m&&(m=e[l]);for(t=1<<u,n=new(p?Uint32Array:Array)(t),i=1,a=0,o=2;u>=i;){for(l=0;d>l;++l)if(e[l]===i){for(r=0,s=a,c=0;i>c;++c)r=r<<1|1&s,s>>=1;for(c=r;t>c;c+=o)n[c]=i<<16|l;++a}++i,a<<=1,o<<=1}return[n,u,m]}function o(t,n){switch(this.i=[],this.j=32768,this.d=this.f=this.c=this.n=0,this.input=p?new Uint8Array(t):t,this.o=!1,this.k=$,this.w=!1,(n||!(n={}))&&(n.index&&(this.c=n.index),n.bufferSize&&(this.j=n.bufferSize),n.bufferType&&(this.k=n.bufferType),n.resize&&(this.w=n.resize)),this.k){case w:this.a=32768,this.b=new(p?Uint8Array:Array)(32768+this.j+258);break;case $:this.a=0,this.b=new(p?Uint8Array:Array)(this.j),this.e=this.D,this.q=this.A,this.l=this.C;break;default:e(Error("invalid inflate mode"))}}function r(t,n){for(var i,a=t.f,o=t.d,r=t.input,s=t.c;n>o;)i=r[s++],i===d&&e(Error("input buffer is broken")),a|=i<<o,o+=8;return i=a&(1<<n)-1,t.f=a>>>n,t.d=o-n,t.c=s,i}function s(e,t){for(var n,i,a,o=e.f,r=e.d,s=e.input,l=e.c,c=t[0],u=t[1];u>r&&(n=s[l++],n!==d);)o|=n<<r,r+=8;return i=c[o&(1<<u)-1],a=i>>>16,e.f=o>>a,e.d=r-a,e.c=l,65535&i}function l(e){function t(e,t,n){var i,a,o,l;for(l=0;e>l;)switch(i=s(this,t)){case 16:for(o=3+r(this,2);o--;)n[l++]=a;break;case 17:for(o=3+r(this,3);o--;)n[l++]=0;a=0;break;case 18:for(o=11+r(this,7);o--;)n[l++]=0;a=0;break;default:a=n[l++]=i}return n}var n,i,o,l,c=r(e,5)+257,d=r(e,5)+1,u=r(e,4)+4,m=new(p?Uint8Array:Array)(M.length);for(l=0;u>l;++l)m[M[l]]=r(e,3);n=a(m),i=new(p?Uint8Array:Array)(c),o=new(p?Uint8Array:Array)(d),e.l(a(t.call(e,c,n,i)),a(t.call(e,d,n,o)))}function c(e){this.input=e,this.c=0,this.m=[],this.s=!1}var d=void 0,u=this,p="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array;new(p?Uint8Array:Array)(256);var m;for(m=0;256>m;++m)for(var h=m,f=7,h=h>>>1;h;h>>>=1)--f;var g=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,
},truncate:function(){n=[]},finalize:function(){var i=blobConstruct(n,e);return t&&t(i),i}};return i}function d(e,t){return void 0!==e.toURL?e.toURL(t):e instanceof Blob?URL.createObjectURL(e):"data:"+t+";base64,"+bytesToBase64(e)}function u(e){var n;try{var i=new FileReader;i.onloadend=function(){n.resolve(i.result)},i.readAsDataURL(e)}catch(a){return t.reject(a)}return n=t.defer(),n.promise}function p(e,t){if(h&&e instanceof Blob){var t=e.type||e.mimeType||t||"";if(!t.match(/image\/(jpeg|gif|png|bmp)|video\/quicktime/))return u(e)}return i.when(d(e,t))}function m(e,t,i){if(window.navigator&&void 0!==navigator.msSaveBlob)return window.navigator.msSaveBlob(e,i),!1;if(window.navigator&&navigator.getDeviceStorage){var a="sdcard";switch(t.split("/")[0]){case"video":a="videos";break;case"audio":a="music";break;case"image":a="pictures"}var o=navigator.getDeviceStorage(a),r=o.addNamed(e,i);return r.onsuccess=function(){console.log("Device storage save result",this.result)},void(r.onerror=function(){})}p(e,t).then(function(e){var t=document.createElementNS("http://www.w3.org/1999/xhtml","a");t.href=e,t.target="_blank",t.download=i,t.dataset&&(t.dataset.downloadurl=["video/quicktime",i,e].join(":")),$(t).css({position:"absolute",top:1,left:1}).appendTo("body");try{var a=document.createEvent("MouseEvents");a.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),t.dispatchEvent(a)}catch(o){console.error("Download click error",o);try{console.error("Download click error",o),t[0].click()}catch(o){window.open(e,"_blank")}}n(function(){$(t).remove()},100)})}e.URL=e.URL||e.webkitURL,e.BlobBuilder=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder;var h=-1!=navigator.userAgent.indexOf("Safari")&&-1==navigator.userAgent.indexOf("Chrome"),f=!0;try{blobConstruct([],"")}catch(g){f=!1}return{isAvailable:a,copy:o,write:r,getFileWriter:l,getFakeFileWriter:c,chooseSave:s,getUrl:d,getDataUrl:u,getFileCorrectUrl:p,download:m}}]).service("IdbFileStorage",["$q","$window","FileManager",function(e,t,n){function i(){return m}function a(){if(c)return c;try{var t=indexedDB.open(d,p),n=e.defer(),i=function(e){e.createObjectStore(u)};if(!t)throw new Exception}catch(a){return m=!1,e.reject(a)}return t.onsuccess=function(){db=t.result,db.onerror=function(e){m=!1,console.error("Error creating/accessing IndexedDB database",e),n.reject(e)},db.setVersion&&db.version!=p?db.setVersion(p).onsuccess=function(){i(db),n.resolve(db)}:n.resolve(db)},t.onerror=function(e){m=!1,console.error("Error creating/accessing IndexedDB database",e),n.reject(e)},t.onupgradeneeded=function(e){i(e.target.result)},c=n.promise}function o(t,n){return a().then(function(i){if(!h)return r(i,t,n);try{var a=i.transaction([u],IDBTransaction.READ_WRITE||"readwrite").objectStore(u),o=a.put(n,t)}catch(s){return h?(h=!1,r(i,t,n)):(m=!1,e.reject(s))}var l=e.defer();return o.onsuccess=function(){l.resolve(n)},o.onerror=function(e){l.reject(e)},l.promise})}function r(t,n,i){try{var a=new FileReader;a.readAsDataURL(i)}catch(o){return m=!1,e.reject()}var r=e.defer();return a.onloadend=function(){try{var e=t.transaction([u],IDBTransaction.READ_WRITE||"readwrite").objectStore(u),o=e.put(a.result,n)}catch(s){return m=!1,void r.reject(s)}o.onsuccess=function(){r.resolve(i)},o.onerror=function(e){r.reject(e)}},r.promise}function s(t){return a().then(function(n){var i=e.defer(),a=n.transaction([u],IDBTransaction.READ||"readonly").objectStore(u),o=a.get(t);return o.onsuccess=function(e){var t=e.target.result;void 0===t?i.reject():i.resolve("string"==typeof t&&"data:"===t.substr(0,5)?dataUrlToBlob(t):t)},o.onerror=function(e){i.reject(e)},i.promise})}function l(t,i){var a=n.getFakeFileWriter(i,function(e){o(t,e)});return e.when(a)}t.indexedDB=t.indexedDB||t.webkitIndexedDB||t.mozIndexedDB||t.OIndexedDB||t.msIndexedDB,t.IDBTransaction=t.IDBTransaction||t.webkitIDBTransaction||t.OIDBTransaction||t.msIDBTransaction;var c,d="cachedFiles",u="files",p=1,m=void 0!==t.indexedDB&&void 0!==t.IDBTransaction&&-1==navigator.userAgent.indexOf("Safari"),h=m||!1;return a(),{isAvailable:i,saveFile:o,getFile:s,g
l.storeIntBytes(a.authKeyID,64,"auth_key_id"),l.storeIntBytes(t.msgKey,128,"msg_key"),l.storeRawBytes(t.bytes,"encrypted_data");var c,d=b?l.getBuffer():l.getArray();try{n=angular.extend(n||{},{responseType:"arraybuffer",transformRequest:null}),c=r.post(e.chooseServer(a.dcID,a.upload),d,n)}catch(u){c=s.reject(u)}return c.then(function(e){return e.data&&e.data.byteLength?e:s.reject({code:406,type:"NETWORK_BAD_RESPONSE"})},function(e){return 404==e.status&&-1!=(e.data||"").indexOf("nginx/0.3.33")&&i.remove("dc"+a.dcID+"_server_salt","dc"+a.dcID+"_auth_key").then(function(){o.reload()}),e.message||e.type||(e={code:406,type:"NETWORK_BAD_REQUEST"}),s.reject(e)})})},u.prototype.parseResponse=function(e){var t=this,n=new TLDeserialization(e),i=n.fetchIntBytes(64,!1,"auth_key_id");if(!bytesCmp(i,this.authKeyID))throw new Error("Invalid server auth_key_id: "+bytesToHex(i));var o=n.fetchIntBytes(128,!0,"msg_key"),r=n.fetchRawBytes(e.byteLength-n.getOffset(),!0,"encrypted_data");return this.getDecryptedMessage(o,r).then(function(e){var n=new TLDeserialization(e,{mtproto:!0}),i=(n.fetchIntBytes(64,!1,"salt"),n.fetchIntBytes(64,!1,"session_id")),r=n.fetchLong("message_id"),s=n.fetchInt("seq_no"),l=n.fetchRawBytes(!1,!0,"message_data"),c=convertToUint8Array(e).subarray(0,n.getOffset());return a.sha1Hash(c).then(function(e){if(!bytesCmp(o,bytesFromArrayBuffer(e).slice(-16)))throw console.warn(o,bytesFromArrayBuffer(e)),new Error("server msgKey mismatch");var n=bytesToArrayBuffer(l),a={mtproto:!0,override:{mt_message:function(e,t){e.msg_id=this.fetchLong(t+"[msg_id]"),e.seqno=this.fetchInt(t+"[seqno]"),e.bytes=this.fetchInt(t+"[bytes]");var n=this.getOffset();try{e.body=this.fetchObject("Object",t+"[body]")}catch(i){console.error(dT(),"parse error",i.message,i.stack),e.body={_:"parse_error",error:i}}this.offset!=n+e.bytes&&(console.warn(dT(),"set offset",this.offset,n,e.bytes),this.offset=n+e.bytes)},mt_rpc_result:function(e,n){e.req_msg_id=this.fetchLong(n+"[req_msg_id]");var i=t.sentMessages[e.req_msg_id],a=i&&i.resultType||"Object";e.result=this.fetchObject(a,n+"[result]")}}},c=new TLDeserialization(n,a),d=c.fetchObject("","INPUT");return{response:d,messageID:r,sessionID:i,seqNo:s}})})},u.prototype.applyServerSalt=function(e){var t=longToBytes(e),n={};return n["dc"+this.dcID+"_server_salt"]=bytesToHex(t),i.set(n),this.serverSalt=t,!0},u.prototype.sheduleRequest=function(e){this.offline&&this.checkConnection("forced shedule");var t=tsNow()+e;return e&&this.nextReq&&this.nextReq<=t?!1:(l.cancel(this.nextReqPromise),e>0?this.nextReqPromise=l(this.performSheduledRequest.bind(this),e||0):setZeroTimeout(this.performSheduledRequest.bind(this)),void(this.nextReq=t))},u.prototype.ackMessage=function(e){this.pendingAcks.push(e),this.sheduleRequest(3e4)},u.prototype.reqResendMessage=function(e){console.log(dT(),"Req resend",e),this.pendingResends.push(e),this.sheduleRequest(100)},u.prototype.cleanupSent=function(){var e=this,t=!1;return angular.forEach(this.sentMessages,function(n,i){if(n.notContentRelated&&void 0===e.pendingMessages[i])delete e.sentMessages[i];else if(n.container){for(var a=0;a<n.inner.length;a++)if(void 0!==e.sentMessages[n.inner[a]])return void(t=!0);delete e.sentMessages[i]}else t=!0}),!t},u.prototype.processMessageAck=function(e){var t=this.sentMessages[e];return t&&!t.acked?(delete t.body,t.acked=!0,!0):!1},u.prototype.processError=function(e){var t=(e.error_message||"").match(/^([A-Z_0-9]+\b)(: (.+))?/)||[];return e.error_code=uintToInt(e.error_code),{code:!e.error_code||e.error_code<=0?500:e.error_code,type:t[1]||"UNKNOWN",description:t[3]||"CODE#"+e.error_code+" "+e.error_message,originalError:e}},u.prototype.processMessage=function(e,n,a){switch(e._){case"msg_container":for(var o=e.messages.length,r=0;o>r;r++)this.processMessage(e.messages[r],n,a);break;case"bad_server_salt":console.log(dT(),"Bad server salt",e);var s=this.sentMessages[e.bad_msg_id];if(!s||s.seq_no!=e.bad_msg_seqno)throw console.log(e.bad_msg_id,e.bad_msg_seqno),new Error("Bad server salt for invalid message");this.applyServerSalt(e.new_server_salt),t
void 0===c&&(c=X[e]={count:null,history:[],pending:[]}),p.getUserID().then(function(u){i={_:"message",id:o,from_id:u,to_id:s.getOutputPeer(e),flags:3,date:tsNow(!0)+st,message:n,media:{_:"messageMediaEmpty"},random_id:l,pending:!0};var m=function(e){var n=K[o];e?(i.error=!0,n&&(n.error=!0)):(delete i.error,n&&delete n.error),t.$broadcast("messages_pending")};i.send=function(){m(!1);var t={};et[e]&&(t.afterMessageID=et[e].messageID),p.invokeApi("messages.sendMessage",{peer:d,message:n,random_id:r},t).then(function(e){i.date=e.date,i.id=e.id,a.processUpdateMessage({_:"updates",users:[],chats:[],seq:e.seq,updates:[{_:"updateMessageID",random_id:l,id:e.id},{_:"updateNewMessage",message:i,pts:e.pts}]})},function(){m(!0)})["finally"](function(){et[e]===t&&delete et[e]}),et[e]=t},D([i]),c.pending.unshift(o),t.$broadcast("history_append",{peerID:e,messageID:o,my:!0}),i.send()}),J[l]=[e,o]}}function N(n,i,o){o=o||{};var r,l,c=nt--,d=[nextRandomInt(4294967295),nextRandomInt(4294967295)],u=bigint(d[0]).shiftLeft(32).add(bigint(d[1])).toString(),h=X[n],f=s.getInputPeerByID(n);o.isMedia?["image/jpeg","image/png","image/bmp"].indexOf(i.type)>=0?(r="photo",l="photo."+i.type.split("/")[1]):"video/"==i.type.substr(0,6)?(r="video",l="video.mp4"):"audio/"==i.type.substr(0,6)?(r="audio",l="audio."+("ogg"==i.type.split("/")[1]?"ogg":"mp3")):(r="document",l="document."+i.type.split("/")[1]):(r="document",l="document."+i.type.split("/")[1]),void 0===h&&(h=X[n]={count:null,history:[],pending:[]}),p.getUserID().then(function(o){var g={_:"messageMediaPending",type:r,file_name:i.name||l,size:i.size,progress:{percent:1,total:i.size}},_={_:"message",id:c,from_id:o,to_id:s.getOutputPeer(n),flags:3,date:tsNow(!0)+st,message:"",media:g,random_id:u,pending:!0},y=function(e){var n=K[c];e?(_.error=!0,n&&(n.error=!0)):(delete _.error,n&&delete n.error),t.$broadcast("messages_pending")};_.send=function(){var o=e.defer();tt.then(function(){var e=!1,s=m.uploadFile(i);s.then(function(t){t.name=l,e=!0;var n;switch(r){case"photo":n={_:"inputMediaUploadedPhoto",file:t};break;case"video":n={_:"inputMediaUploadedVideo",file:t,duration:0,w:0,h:0,mime_type:i.type};break;case"audio":n={_:"inputMediaUploadedAudio",file:t,duration:0,mime_type:i.type};break;case"document":default:n={_:"inputMediaUploadedDocument",file:t,file_name:i.name,mime_type:i.type}}p.invokeApi("messages.sendMedia",{peer:f,media:n,random_id:d}).then(function(e){_.date=e.message.date,_.id=e.message.id,_.media=e.message.media,a.processUpdateMessage({_:"updates",users:e.users,chats:e.chats,seq:e.seq,updates:[{_:"updateMessageID",random_id:u,id:e.message.id},{_:"updateNewMessage",message:_,pts:e.pts}]})},function(){y(!0)})},function(){y(!0)},function(e){g.progress.done=e.done,g.progress.percent=Math.max(1,Math.floor(100*e.done/e.total)),t.$broadcast("history_update",{peerID:n})}),g.progress.cancel=function(){e||(o.resolve(),s.cancel(),U(u))},s["finally"](function(){o.resolve()})}),tt=o.promise},D([_]),h.pending.unshift(c),t.$broadcast("history_append",{peerID:n,messageID:c,my:!0}),_.send()}),J[u]=[n,c]}function L(e,n){var i=nt--,o=[nextRandomInt(4294967295),nextRandomInt(4294967295)],r=bigint(o[0]).shiftLeft(32).add(bigint(o[1])).toString(),c=X[e],d=s.getInputPeerByID(e);void 0===c&&(c=X[e]={count:null,history:[],pending:[]}),p.getUserID().then(function(u){var m;switch(n._){case"inputMediaContact":m=angular.extend({},n,{_:"messageMediaContact"});break;case"inputMediaPhoto":m={photo:l.getPhoto(n.id.id)}}var h={_:"message",id:i,from_id:u,to_id:s.getOutputPeer(e),flags:3,date:tsNow(!0)+st,message:"",media:m,random_id:r,pending:!0},f=function(e){var n=K[i];e?(h.error=!0,n&&(n.error=!0)):(delete h.error,n&&delete n.error),t.$broadcast("messages_pending")};h.send=function(){p.invokeApi("messages.sendMedia",{peer:d,media:n,random_id:o}).then(function(e){h.date=e.message.date,h.id=e.message.id,h.media=e.message.media,a.processUpdateMessage({_:"updates",users:e.users,chats:e.chats,seq:e.seq,updates:[{_:"updateMessageID",random_id:r,id:e.message.id},{_:"updateNewMessage",message:h,pts:e.pts}]})},function(){f(!0)
}),!x||"Notification"in window&&"granted"!==Notification.permission?!1:void c.get("notify_nodesktop","notify_novibrate").then(function(t){if(t[0]){if(I&&!t[1])return void navigator.vibrate([200,100,200])}else{var n,i=++T,a=e.key||"k"+i;if("Notification"in window)n=new Notification(e.title,{icon:e.image||"",body:e.message||"",tag:e.tag||""});else if("mozNotification"in navigator)n=navigator.mozNotification.createNotification(e.title,e.message||"",e.image||"");else{if(!C)return;window.external.msSiteModeClearIconOverlay(),window.external.msSiteModeSetIconOverlay("img/icons/icon16.png",e.title),window.external.msSiteModeActivate(),n={index:i}}n.onclick=function(){n.close(),d.focus(),b(),e.onclick&&e.onclick()},n.onclose=function(){delete A[a],b()},n.show&&n.show(),A[a]=n}})}function y(e){var t="img/sound_a.wav",n=$("#notify_sound").html('<audio autoplay="autoplay"><source src="'+t+'" type="audio/mpeg" /><embed hidden="true" autostart="true" loop="false" volume="'+100*e+'" src="'+t+'" /></audio>');n.find("audio")[0].volume=e}function v(e){var t=A[e];if(t){E>0&&E--;try{t.close?t.close():C&&t.index==T&&window.external.msSiteModeClearIconOverlay()}catch(n){}delete E[e]}}function b(){C?window.external.msSiteModeClearIconOverlay():angular.forEach(A,function(e){try{e.close&&e.close()}catch(t){}}),A={},E=0}function w(){if(U)return!1;if(navigator.push&&Config.Navigator.ffos&&Config.Modes.packed){var e=navigator.push.register();e.onsuccess=function(){clearTimeout(R),console.log(dT(),"Push registered",e.result),U=e.result,r.invokeApi("account.registerDevice",{token_type:4,token:U,device_model:navigator.userAgent||"Unknown UserAgent",system_version:navigator.platform||"Unknown Platform",app_version:Config.App.version,app_sandbox:!1,lang_code:navigator.language||"en"})},e.onerror=function(e){console.error("Push register error",e,e.toString()),R=setTimeout(w,B),B=Math.min(3e4,1.5*B)}}}function k(){return I}navigator.vibrate=navigator.vibrate||navigator.mozVibrate||navigator.webkitVibrate;var C=!1;try{window.external&&window.external.msIsSiteMode()&&(C=!0)}catch(S){}var M,x=C||"Notification"in window||"mozNotification"in navigator,A={},T=0,E=0,I=!!navigator.vibrate,D={},P=$('link[rel="icon"]:first'),N=$('<link rel="icon" href="favicon_unread.ico" type="image/x-icon" />'),L=o.pluralize("page_title_pluralize_notifications"),O=document.title;e.$watch("idle.isIDLE",function(e){e||b(),Config.Navigator.mobile||(i.cancel(M),e?(O=document.title,M=i(function(){var e=tsNow();if(!E||e%2e3>1e3){document.title=O;var t=$('link[rel="icon"]:first');-1!=t.attr("href").indexOf("favicon_unread")&&t.replaceWith(P)}else document.title=L(E),$('link[rel="icon"]:first').replaceWith(N)},1e3)):(document.title=O,$('link[rel="icon"]:first').replaceWith(P)))}),e.$on("apiUpdate",function(e,t){switch(t._){case"updateNotifySettings":if("notifyPeer"==t.peer._){var n=s.getPeerID(t.peer.peer);p(n,t.notify_settings)}}});var U=!1;return window.navigator.mozSetMessageHandler&&(window.navigator.mozSetMessageHandler("push",function(t){console.log(dT(),"received push",t),e.$broadcast("push_received")}),window.navigator.mozSetMessageHandler("push-register",function(e){console.log(dT(),"received push",e),U=!1,w()})),{start:f,notify:_,cancel:v,clear:b,getPeerSettings:u,getPeerMuted:h,savePeerSettings:p,updatePeerSettings:m,getVibrateSupport:k,testSound:y};var B,R}]).service("ErrorService",["$rootScope","$modal","$window",function(e,t,n){function i(n,i){if(r>=1)return console.log("Skip error box, too many open",r,n,i),!1;i=i||{};var a=e.$new();angular.extend(a,n),r++;var o=t.open({templateUrl:templateUrl("error_modal"),scope:a,windowClass:i.windowClass||"error_modal_window"});return o.result["finally"](function(){r--}),o}function a(e,t){return i({title:e,description:t})}function o(n,i){i=i||{};var a=e.$new();angular.extend(a,n);var o=t.open({templateUrl:templateUrl("confirm_modal"),scope:a,windowClass:i.windowClass||"confirm_modal_window"});return o.result}var r=0;return n.safeConfirm=function(e,t){"string"==typeof e&&(e={message:e}),o(e).then(function(e){t(e||!0)},function(){t(!1)
}})}function d(e){var n=0>e?[-1,-2]:[1,2],i=_.indexOf(t.messageID);angular.forEach(n,function(e){var t=_[i+e];if(void 0!==t&&void 0===y[t]){y[t]=!0;var n=o.getMessage(t),r=n.media.photo.id;a.preloadPhoto(r)}})}function u(){return $?$:$=o.getSearch(h,f,g,v).then(function(t){return t.history.length?(v=t.history[t.history.length-1],_=_.concat(t.history),b=_.length<t.count):b=!1,p(t.count),$=!1,t.history.length?e.reject():void d(1)})}function p(e){var n=_.indexOf(t.messageID);b?e&&(t.count=Math.max(e,_.length)):t.count=_.length,t.pos=t.count-n,t.nav.hasNext=n>0,t.nav.hasPrev=b||n<_.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){t.forward=function(){var e=t.messageID;s.selectPeers({confirm_type:"FORWARD_PEER"}).then(function(t){angular.forEach(t,function(i){var a=r.getPeerID(i);o.forwardMessages(a,[e]).then(function(){1==t.length&&n.$broadcast("history_focus",{peerString:i})})})})},t.goToMessage=function(){var e=t.messageID,a=o.getMessagePeer(o.getMessage(e)),s=r.getPeerString(a);i.dismiss(),n.$broadcast("history_focus",{peerString:s,messageID:e})},t["delete"]=function(){var e=t.messageID;l.confirm({type:"MESSAGE_DELETE"}).then(function(){o.deleteMessages([e])})};var m=o.getMessagePeer(o.getMessage(t.messageID)),h=r.getInputPeerByID(m),f="",g={_:"inputMessagesFilterPhotos"},_=[t.messageID],y={},v=t.messageID,b=!0;y[t.messageID]=!0,p(),o.getSearch(h,f,g,0,1e3).then(function(e){e.history.indexOf(t.messageID)>=0&&(_=e.history,v=_[_.length-1],p(),d(1)),u()},u);var w=0,$=!1;t.nav.next=function(){return t.nav.hasNext?void c(-1):!1},t.nav.prev=function(){return t.nav.hasPrev?void c(1):!1},t.$on("history_delete",function(e,n){if(n.peerID==m){if(n.msgs[t.messageID])if(t.nav.hasNext)t.nav.next();else{if(!t.nav.hasPrev)return i.dismiss();t.nav.prev()}for(var a=[],o=0;o<_.length;o++)n.msgs[_[o]]||a.push(_[o]);_=a}})}}]).controller("UserpicModalController",["$q","$scope","$rootScope","$modalInstance","MtpApiManager","AppPhotosManager","AppUsersManager","AppPeersManager","AppMessagesManager","ApiUpdatesManager","PeersSelectService","ErrorService",function(e,t,n,i,a,o,r,s,l,c,d,u){function p(n,i){var a=_.indexOf(t.photoID),r=a>=0?a+n:0,s=++$,l=r>=_.length?h():e.when();l.then(function(){if(s==$){t.photoID=_[r],t.photo=o.wrapForFull(t.photoID),t.photo.thumb={location:o.choosePhotoSize(t.photo,0,0).location};var e;i&&(_.splice(a,1),e=t.count-1),f(e),v[t.photoID]=!0,f(),n>0&&w&&_.indexOf(t.photoID)+1>=_.length?h():m(n)}})}function m(e){var n=0>e?[-1,-2]:[1,2],i=_.indexOf(t.photoID);angular.forEach(n,function(e){var t=_[i+e];void 0!==t&&void 0===v[t]&&(v[t]=!0,o.preloadPhoto(t))})}function h(){return k?k:k=o.getUserPhotos(g,y).then(function(t){return t.photos.length?(y=t.photos[t.photos.length-1],_=_.concat(t.photos),w=_.length<t.count):w=!1,f(t.count),k=!1,t.photos.length?e.reject():void m(1)})}function f(e){var n=_.indexOf(t.photoID);w?e&&(t.count=Math.max(e,_.length)):t.count=_.length,t.pos=t.count-n,t.nav.hasNext=n>0,t.nav.hasPrev=w||n<_.length-1,t.canDelete=t.photo.user_id==b}t.photo=o.wrapForFull(t.photoID),t.photo.thumb={location:o.choosePhotoSize(t.photo,0,0).location},t.nav={},t.canForward=!0;var g=r.getUserInput(t.userID),_=[t.photoID],y=t.photoID,v={},b=0,w=!0;f(),o.getUserPhotos(g,0,1e3).then(function(e){e.photos.indexOf(t.photoID)>=0&&(_=e.photos,y=_[_.length-1]),w=_.length<e.count,f()}),a.getUserID().then(function(e){b=e,t.canDelete=t.photo.user_id==b});var $=0,k=!1;t.nav.next=function(){return t.nav.hasNext?void p(-1):!1},t.nav.prev=function(){return t.nav.hasPrev?void p(1):!1},t.forward=function(){d.selectPeers({confirm_type:"FORWARD_PEER"}).then(function(e){angular.forEach(e,function(i){var a=s.getPeerID(i);l.sendOther(a,{_:"inputMediaPhoto",id:{_:"inputPhoto",id:t.photoID,access_hash:t.photo.access_hash}}),1==e.length&&n.$broadcast("history_focus",{peerString:e[0]})})})},t["delete"]=function(){var e=t.photoID,n=r.getUser(b),o=function(){return t.nav.hasNext||t.nav.hasPrev?void p(t.nav.hasNext?-1:1,!0):i.dismiss()};u.con
}]),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("myFooter",function(){return{restrict:"AE",templateUrl:templateUrl("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(l);var C=e.$on("messages_read",function(){e.historyMessage.unread||(t.removeClass(l),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(c,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",l="im_message_unread",c="im_message_error",d="im_message_pending";return{templateUrl:templateUrl("message"),link:n}}]).directive("myExternalEmbed",function(){function e(e,s,l){var c=e.$eval(l.myExternalEmbed);if(c){var d="",u=!1;switch(c[0]){case"youtube":var p=c[1];d='<div class="im_message_media_embed im_message_video_embed"><'+r+' type="text/html" frameborder="0" src="https://www.youtube.com/embed/'+p+'?autoplay=0&amp;controls=2" webkitallowfullscreen mozallowfullscreen allowfullscreen></'+r+"></div>";break;case"vimeo":var p=c[1];d='<div class="im_message_media_embed im_message_video_embed"><'+r+' type="text/html" frameborder="0" src="https://player.vimeo.com/video/'+p+'?title=0&amp;byline=0&amp;portrait=0" webkitallowfullscreen mozallowfullscreen allowfullscreen></'+r+"></div>";break;case"instagram":var m=c[1];d='<div class="im_message_media_embed im_message_insta_embed"><'+r+' type="text/html" frameborder="0" src="https://instagram.com/p/'+m+'/embed/"></'+r+"></div>";break;case"vine":var h=c[1];d='<div class="im_message_media_embed im_message_vine_embed"><'+r+' type="text/html" frameborder="0" src="https://vine.co/v/'+h+'/embed/simple"></'+r+"></div>";break;case"soundcloud":var f=c[1];d='<div class="im_message_media_embed im_message_soundcloud_embed"><'+r+' type="text/html" frameborder="0" src="https://w.soundcloud.com/player/?url='+encodeEntities(encodeURIComponent(f))+'&amp;auto_play=false&amp;hide_related=true&amp;show_comments=false&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></'+r+"></div>";break;case"twitter":d='<div class="im_message_twitter_embed"><blockquote class="twitter-tweet" lang="en"><a href="'+c[1]+'"></a></blockquote></div>',u=function(){t?window.twttr&&twttr.widgets.load(s[0]):(t=!0,$("<script>").appendTo("body").on("load",function(){twttr.events.bind("loaded",function(){for(var e=0;e<a.length;e++)a[e].$emit("ui_height");a=[]})}).attr("src","https://platform.twitter.com/widgets.js")),a.push(e)};break;case"facebook":d='<div class="im_message_facebook_embed"><div class="fb-post" data-href="'+c[1]+'" data-width="300"></div></div>',u=function(){n?window.FB&&FB.XFBM
else{if(e.audio.progress&&e.audio.progress.enabled)return;var n;n="audio"==e.audio._?i.downloadAudio(e.audio.id):a.downloadDoc(e.audio.id),n.then(function(){onContentLoaded(function(){var n=$("audio",t)[0];if(n){var i=!1,a=function(e){i||e.target&&e.target.error&&e.target.error.code!=e.target.error.MEDIA_ERR_DECODE&&e.target.error.code!=e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED||(i=!0,o.show({error:{type:"MEDIA_TYPE_NOT_SUPPORTED",originalError:e.target&&e.target.error}}))};n.addEventListener("error",a,!0),$(n).on("$destroy",function(){i=!0,n.removeEventListener("error",a)})}r(e.mediaPlayer.player),e.mediaPlayer.player.setVolume(c),e.mediaPlayer.player.play()})})}},e.seek=function(t){e.mediaPlayer&&e.mediaPlayer.player?e.mediaPlayer.player.seek(t):e.togglePlay()},e.setVolume=function(t){c=t,n.set({audio_volume:t}),e.mediaPlayer&&e.mediaPlayer.player&&e.mediaPlayer.player.setVolume(t)}}var l=!1,c=.5;n.get("audio_volume").then(function(e){e>0&&1>=e&&(c=e)});return{link:s,scope:{audio:"="},templateUrl:templateUrl("audio_player")}}]).directive("mySlider",["$window",function(e){function t(t,n,i){var a=$(".tg_slider_wrap",n),o=$(".tg_slider_track_fill",n),r=$(".tg_slider_thumb",n),s=a.width(),l=Math.ceil(r.width()),c=i.sliderModel,d=i.sliderOnchange,u=0,p=1,m=!1,h=!1;i.sliderMin&&t.$watch(i.sliderMin,function(e){u=e||0}),i.sliderMax&&t.$watch(i.sliderMax,function(e){p=e||1});var f=function(e){e=e.originalEvent||e;var n=(e.touches&&e.touches[0]?e.touches[0].pageX:e.pageX)-h;return n=Math.min(s,Math.max(0,n)),m=u+n/s*(p-u),d?t.$eval(d,{value:m}):t.$eval(c+"="+m),r.css("left",Math.max(0,n-l)),o.css("width",n),cancelEvent(e)},g=function(){$(e).off("mousemove touchmove",f),$(e).off("mouseup touchend touchcancel touchleave",g)};t.$watch(c,function(e){if(e!=m&&void 0!==e){var t=Math.max(0,(e-u)/(p-u));if(s){var n=Math.ceil(s*t);n=Math.min(s,Math.max(0,n)),r.css("left",Math.max(0,n-l)),o.css("width",n)}else r.css("left",100*t+"%"),o.css("width",100*t+"%");m=!1}}),n.on("dragstart selectstart",cancelEvent),n.on("mousedown touchstart",function(i){if(!s&&(s=a.width(),!s))return console.error("empty width"),cancelEvent(i);g(),i=i.originalEvent||i;var _;if(i.touches&&i.touches[0])h=n.position().left,_=i.touches[0].pageX-h;else if(void 0!==i.offsetX)_=i.offsetX,h=i.pageX-_;else{if(void 0===i.layerX)return cancelEvent(i);_=i.layerX,h=i.pageX-_}return m=u+_/s*(p-u),d?t.$eval(d,{value:m}):t.$eval(c+"="+m),r.css("left",Math.max(0,_-l)),o.css("width",_),$(e).on("mousemove touchmove",f),$(e).on("mouseup touchend touchcancel touchleave",g),cancelEvent(i)})}return{link:t,templateUrl:templateUrl("slider")}}]).directive("myLabeledInput",function(){function e(e,t){var n=$(".md-input:first",t),i=($(".md-input-label:first",t),n[0]&&"SPAN"==n[0].tagName),a=!1,o=function(){i?t.toggleClass("md-input-has-value",n.html().length>0):t.toggleClass("md-input-has-value",a||n.val().length>0)};o(),onContentLoaded(function(){o(),setZeroTimeout(function(){t.addClass("md-input-animated")})}),i||n.on("blur focus",function(e){a="focus"==e.type,t.toggleClass("md-input-focused",a),o()})}return{link:e}}).directive("mySubmitOnEnter",function(){function e(e,t){t.on("keydown",function(e){13==e.keyCode&&t.trigger("submit")})}return{link:e}}).directive("myScrollToOn",function(){return{link:function(e,t,n){var i=n.myScrollToOn,a=function(){onContentLoaded(function(){console.log(111,t,t.offset().top),$("html, body").animate({scrollTop:t.offset().top},200)})};"$init"==i?a():e.$on(i,a)}}}),angular.module("myApp.directives").directive("myDialogsListMobile",["$window","$timeout",function(e,t){function n(n,i,a){function o(){return d&&d.offsetHeight||(d=$(c)[0]),a.modal?void $(i).css({height:$(e).height()-(d?d.offsetHeight:58)-46}):(l&&l.offsetHeight||(l=$(".tg_page_head")[0]),r&&r.offsetHeight||(r=$(".im_dialogs_col_wrap")[0]),void $(i).css({height:$(e).height()-(l?l.offsetHeight:46)-(d?d.offsetHeight:58)-parseInt($(r).css("paddingBottom")||0)}))}var r=$(".im_dialogs_col_wrap")[0],s=i[0],l=$(".tg_page_head")[0],c=a.modal?".mobile_modal_body .im_dialogs_panel":".im_dialogs_panel",d=$(