}functionn(){c=!0}functioni(){returnc?(c=!1,""):s}functiona(){vare,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)&&void0!==l[n])r.push(l[n]);elseif(u){try{e=localStorage.getItem(n)}catch(m){u=!1}try{e=void0===e||null===e?!1:JSON.parse(e)}catch(m){e=!1}r.push(l[n]=e)}elsed?c=!1:r.push(l[n]=!1);returnc?o(s?r[0]:r):voidchrome.storage.local.get(a,function(e){vari;for(r=[],t=0;t<a.length;t++)n=a[t],i=e[n],i=void0===i||null===i?!1:JSON.parse(i),r.push(l[n]=i);o(s?r[0]:r)})}functiono(e,t){varn,a,o={},r=i();for(nine)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}elseo[n]=a;returnu||!d?void(t&&t()):voidchrome.storage.local.set(o,t)}functionr(){vare,t,n,a=Array.prototype.slice.call(arguments),o=i();for("function"==typeofa[a.length-1]&&(n=a.pop()),e=0;e<a.length;e++)if(t=a[e]=o+a[e],deletel[t],u)try{localStorage.removeItem(t)}catch(r){u=!1}d?chrome.storage.local.remove(a,n):n&&n()}vars="",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"==typeofe&&(e={message:e});varn=!1;try{n=confirm(e.message)}catch(i){n=!0}setTimeout(function(){t(n)},10)},window.applicationCache&&!Config.Modes.packed&&window.addEventListener){vart=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(){vare=[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){vart=e[0],n=e[1],i="en-us",a={dom:!1,i18n_ng:!1,i18n_messages:!1,i18n_fallback:!1},o=function(){vare,t=!0;for(eina)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(varr=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";vari,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();elseif(I(e)){varn=e[0],i=t.getComputedStyle(n);e="fixed"!==i.position?0:n.getBoundingClientRect().bottom}elsew(e)||(e=0);returne}functionr(e){if(e){e.scrollIntoView();varn=o();if(n){vari=e.getBoundingClientRect().top;t.scrollBy(0,i-n)}}elset.scrollTo(0,0)}functions(){vare,t=n.hash();t?(e=c.getElementById(t))?r(e):(e=a(c.getElementsByName(t)))?r(e):"top"===t&&r(null):r(null)}varc=t.document;returne&&i.$watch(function(){returnn.hash()},function(e,t){(e!==t||""!==e)&&Dt(function(){i.$evalAsync(s)})}),s}]}functionjt(){this.$get=["$$rAF","$timeout",function(e,t){returne.supported?function(t){returne(t)}:function(e){returnt(e,0,!1)}}]}functionHt(e,t,i,a){functionr(e){try{e.apply(null,R(arguments,1))}finally{if($--,0===$)for(;k.length;)try{k.pop()()}catch(t){i.error(t)}}}functions(e,t){!functionn(){o(C,function(e){e()}),S=t(n,e)}()}functionc(){l(),d()}functionl(){M=e.history.state,M=_(M)?null:M,L(M,P)&&(M=P),P=M}functiond(){(x!==p.url()||A!==M)&&(x=p.url(),A=M,o(I,function(e){e(p.url(),M)}))}functionu(e){try{returndecodeURIComponent(e)}catch(t){returne}}varp=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)};varS,C=[];p.addPollFn=function(e){return_(S)&&s(100,v),C.push(e),e};varM,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){varo=A===i;if(x===t&&(!a.history||o))return;varr=x&&_n(x)===_n(t);returnx=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}returnT||h.href.replace(/%27/g,"'")},p.state=function(){returnM};varI=[],D=!1,P=null;p.onUrlChange=function(t){returnD||(a.history&&zi(e).on("popstate",c),zi(e).on("hashchange",c),D=!0),I.push(t),t},p.$$checkUrlChange=d,p.baseHref=function(){vare=E.attr("href");returne?e.replace(/^(https?\:)?\/\/[^\/]*/,""):""};varN={},U="",O=p.baseHref();p.cookies=function(e,t){vara,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))));returnN}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){varn;return$++,n=v(function(){deletew[n],r(e)},t||0),w[n]=!0,n},p.defer.cancel=function(e){returnw[e]?(deletew[e],y(e),r(f),!0):!1}}functionVt(){this.$get=["$window","$log","$sniffer","$document",function(e,t,n,i){returnnewHt(e,i,t,n)}]}functionzt(){this.$get=function(){functione(e,n){functiona(e){e!=p&&(m?m==e&&(m=e.n):m=e,o(e.n,e.p),o(e,p),p=e,p.n=null)}functiono(e,t){e!=t&&(e&&(e.p=t),t&&(t.n=e))}if(eint)throwi("$cacheFactory")("iid","CacheId '{0}' is already taken!",e);varr=0,s=u({},n,{id:e}),c={},l=n&&n.capacity||Number.MAX_VALUE,d={},p=null,m=null;returnt[e]={put:function(e,t){if(l<Number.MAX_VALUE){varn=d[e]||(d[e]={key:e});a(n)}if(!_(t))returneinc||r++,c[e]=t,r>l&&this.remove(m.key),t},get:function(e){if(l<Number.MAX_VALUE){vart=d[e];if(!t)return;a(t)}returnc[e]},remove:function(e){if(l<Number.MAX_VALUE){vart=d[e];if(!t)return;t==p&&(p=t.p),t==m&&(m=t.n),o(t.n,t.p),deleted[e]}deletec[e],r--},removeAll:function(){c={},r=0,d={},p=m=null},destroy:function(){c=null,s=null,d=null,deletet[e]},info:function(){returnu({},s,{size:r})}}}vart={};returne.info=function(){vare={};returno(t,function(t,n){e[n]=t.info()}),e},e.get=function(e){returnt[e]},e}}functionWt(){this.$get=["$cacheFactory",function(e){returne("templates")}]}functionGt(e,i){functiona(e,t){varn=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,i={};returno(e,function(e,a){varo=e.match(n);if(!o)throwRa("iscp","Invalidi
}}),l.absUrl()!=m&&a.url(l.absUrl(),!0);varh=!0;returna.onUrlChange(function(e,t){i.$evalAsync(function(){varn=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(){vare=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}]}functionMn(){vare=!0,t=this;this.debugEnabled=function(t){returnv(t)?(e=t,this):e},this.$get=["$window",function(n){functioni(e){returneinstanceofError&&(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}functiona(e){vart=n.console||{},a=t[e]||t.log||f,r=!1;try{r=!!a.apply}catch(s){}returnr?function(){vare=[];returno(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(){varn=a("debug");returnfunction(){e&&n.apply(t,arguments)}}()}}]}functionAn(e,t){if("__defineGetter__"===e||"__defineSetter__"===e||"__lookupGetter__"===e||"__lookupSetter__"===e||"__proto__"===e)throwXa("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",t);returne}functionxn(e,t){if(e){if(e.constructor===e)throwXa("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e.window===e)throwXa("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",t);if(e.children&&(e.nodeName||e.prop&&e.attr&&e.find))throwXa("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",t);if(e===Object)throwXa("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",t)}returne}functionEn(e,t){if(e){if(e.constructor===e)throwXa("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e===Ja||e===Qa||e===eo)throwXa("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",t)}}functionTn(e){returne.constant}functionIn(e,t,n,i){xn(e,i);for(vara,o=t.split("."),r=0;o.length>1;r++){a=An(o.shift(),i);vars=xn(e[a],i);s||(s={},e[a]=s),e=s}returna=An(o.shift(),i),xn(e[a],i),e[a]=n,n}functionDn(e){return"constructor"==e}functionPn(e,t,i,a,o,r,s){An(e,r),An(t,r),An(i,r),An(a,r),An(o,r);varc=function(e){returnxn(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;returnfunction(r,s){varc=s&&s.hasOwnProperty(e)?s:r;returnnull==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)}}functionNn(e,t){returnfunction(n,i){returne(n,i,xn,t)}}functionUn(e,t,i){vara=t.expensiveChecks,r=a?so:ro,s=r[e];if(s)returns;varc=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){varo,r=0;doo=Pn(c[r++],c[r++],c[r++],c[r++],c[r++],i,a)(e,t),t=n,e=o;while(l>r);returno};else{vard="";a&&(d+="s = eso(s, fe);\nl = eso(l, fe);\n");varu=a;o(c,function(e,t){An(e,i);varn=(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;";varp=newFunction("s","l","eso","fe",d);p.toString=g(d),u&&(p=Nn(p,i)),s=p}returns.sharedGetter=!0,s.assign=function(t,n){returnIn(t,e,n,e)},r[e]=s,s}functionOn(e){returnk(e.valueOf)?e.valueOf():co.call(e)}functionLn(){vare=ct(),t=ct();this.$get=["$filter","$sniffer",function(n,i){functiona(e){vart=e;returne.sharedGetter&&(t=function(t,n){returne(t,n)},t.literal=e.literal,t.constant=e.constant,t.assign=e.assign),t}functionr(e,t){for(varn=0,i=e.length;i>n;n++){vara=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){varc;a.$validators.max=function(e){returna.$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()})}}functionEi(e,t,n,i,a,o){ki(e,t,n,i,a,o),wi(i),i.$$parserName="url",i.$validators.url=function(e){returni.$isEmpty(e)||xo.test(e)}}functionTi(e,t,n,i,a,o){ki(e,t,n,i,a,o),wi(i),i.$$parserName="email",i.$validators.email=function(e){returni.$isEmpty(e)||Eo.test(e)}}functionIi(e,t,n,i){_(n.name)&&t.attr("name",l());vara=function(e){t[0].checked&&i.$setViewValue(n.value,e&&e.type)};t.on("click",a),i.$render=function(){vare=n.value;t[0].checked=e==i.$viewValue},n.$observe("value",i.$render)}functionDi(e,t,n,a,o){varr;if(v(a)){if(r=e(a),!r.constant)throwi("ngModel")("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,a);returnr(t)}returno}functionPi(e,t,n,i,a,o,r,s){varc=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){returne!==c},i.$formatters.push(function(e){returnL(e,c)}),i.$parsers.push(function(e){returne?c:l})}functionNi(e){functiont(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));varl;l=s.$pending&&s.$pending[e]?n:s.$error[e]?!1:s.$$success[e]?!0:null,r(e,l),p.$setValidity(e,l,s)}functioni(e,t,n){s[e]||(s[e]={}),d(s[e],t,n)}functiona(e,t,i){s[e]&&u(s[e],t,i),Ui(s[e])&&(s[e]=n)}functiono(e,t){t&&!l[e]?(m.addClass(c,e),l[e]=!0):!t&&l[e]&&(m.removeClass(c,e),l[e]=!1)}functionr(e,t){e=e?"-"+tt(e,"-"):"",o(Fo+e,t===!0),o(qo+e,t===!1)}vars=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}functionUi(e){if(e)for(vartine)return!1;return!0}functionOi(e,t){returne="ngClass"+e,["$animate",function(n){functioni(e,t){varn=[];e:for(vari=0;i<e.length;i++){for(vara=e[i],o=0;o<t.length;o++)if(a==t[o])continuee;n.push(a)}returnn}functiona(e){if(na(e))returne;if(b(e))returne.split(" ");if(y(e)){vart=[];returno(e,function(e,n){e&&(t=t.concat(n.split(" ")))}),t}returne}return{restrict:"AC",link:function(r,s,c){functionl(e){vart=u(e,1);c.$addClass(t)}functiond(e){vart=u(e,-1);c.$removeClass(t)}functionu(e,t){varn=s.data("$classCounts")||{},i=[];returno(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(" ")}functionp(e,t){vara=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)}functionm(e){if(t===!0||r.$index%2===t){varn=a(e||[]);if(f){if(!L(e,f)){vari=a(f);p(i,n)}}elsel(n)}f=O(e)}varf;r.$watch(c[e],m,!0),c.$observe("class",function(){m(r.$eval(c[e]))}),"ngClass"!==e&&r.$watch("$index",function(n,i){varo=1&n;if(o!==(1&i)){vars=a(r.$eval(c[e]));o===t?l(s):d(s)}})}}}]}varLi=/^\/(.+)\/([a-z]*)$/,Bi="validity",Ri=function(e){returnb(e)?e.toLowerCase():e},Fi=Object.prototype.hasOwnProperty,qi=function(e){returnb(e)?e.toUpperCase():e},ji=function(e){returnb(e)?e.replace(/[A-Z]/g,function(e){returnString.fromCharCode(32|e.charCodeAt(0))}):e},Hi=function(e){returnb(e)?e.replace(/[a-z]/g,function(e){returnString.fromCharCode(-33&e.charCodeAt(0))}):e};"i"!=="I".toLowerCase()&&(Ri=ji,qi=Hi);varVi,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=[];varta,na=Array.isArray,ia=function(e){returnb(e)?e.trim():e},aa=function(e){returne.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},oa=function(){if(v(oa.isActive_))returnoa.isActive_;vare=!(!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){vara=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){varr,s=a.ngPattern||a.pattern;a.$observe("pattern",function(e){if(b(e)&&e.length>0&&(e=newRegExp(e)),e&&!e.test)throwi("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){returno.$isEmpty(e)||_(r)||r.test(e)}}}}},Jo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){if(i){vara=0;n.$observe("maxlength",function(e){a=p(e)||0,i.$validate()}),i.$validators.maxlength=function(e,t){returni.$isEmpty(e)||t.length<=a}}}}},Qo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){if(i){vara=0;n.$observe("minlength",function(e){a=p(e)||0,i.$validate()}),i.$validators.minlength=function(e,t){returni.$isEmpty(e)||t.length>=a}}}}},er=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(e,t,i,a){varr=t.attr(i.$attr.ngList)||", ",s="false"!==i.ngTrim,c=s?ia(r):r,l=function(e){if(!_(e)){vart=[];returne&&o(e.split(c),function(e){e&&t.push(s?ia(e):e)}),t}};a.$parsers.push(l),a.$formatters.push(function(e){returnna(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){returntr.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){vari=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(){returni.$options.updateOnDefault=!0," "}))):this.$options.updateOnDefault=!0}]}},ar=["$compile",function(e){return{restrict:"AC",compile:function(t){returne.$$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){returnt.$$addBindingClass(i),function(i,a,o){varr=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){varo=t(a.ngBindHtml),r=t(a.ngBindHtml,function(e){return(e||"").toString()});returnn.$$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){vart=Kt("ng-"+e);pr[t]=["$parse","$rootScope",function(n,i){return{restrict:"A",compile:function(a,o){varr=n(o[t],null,!0);returnfunction(t,n){n.on(e,function(n){vara=function(){r(t,{$event:n})};mr[e]&&i.$$phase?t.$evalAsync(a):t.$apply(a)})}}}}]});varfr=["$animate",function(e){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,rest
returne=p(e)?e:e.split(/\s+/),d(e,function(e,i){e&&e.length>0&&(n+=(i>0?" ":"")+e+t)}),n}varE,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");varN,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){returno=o||{},o.from=n,o.to=i,M("animate",e,t,a,o)},enter:function(e,t,n){returnn=n||{},M("enter",e,"ng-enter",t,n)},leave:function(e,t,n){returnn=n||{},M("leave",e,"ng-leave",t,n)},move:function(e,t,n){returnn=n||{},M("move",e,"ng-move",t,n)},beforeSetClass:function(e,t,n,i,a){a=a||{};varo=x(n,"-remove")+" "+x(t,"-add"),r=S("setClass",e,o,a.from);returnr?(u(e,i),r):(c(),voidi())},beforeAddClass:function(e,t,n,i){i=i||{};vara=S("addClass",e,x(t,"-add"),i.from);returna?(u(e,n),a):(c(),voidn())},beforeRemoveClass:function(e,t,n,i){i=i||{};vara=S("removeClass",e,x(t,"-remove"),i.from);returna?(u(e,n),a):(c(),voidn())},setClass:function(e,t,n,i,a){a=a||{},n=x(n,"-remove"),t=x(t,"-add");varo=n+" "+t;returnC("setClass",e,o,i,a.to)},addClass:function(e,t,n,i){returni=i||{},C("addClass",e,x(t,"-add"),n,i.to)},removeClass:function(e,t,n,i){returni=i||{},C("removeClass",e,x(t,"-remove"),n,i.to)}}}])}])}(window,window.angular),function(e,t){"use strict";functionn(){this.$get=["$$sanitizeUri",function(e){returnfunction(t){varn=[];returno(t,c(n,function(t,n){return!/^unsafe/.test(e(t,n))})),n.join("")}}]}functioni(e){varn=[],i=c(n,t.noop);returni.chars(e),n.join("")}functiona(e){vart,n={},i=e.split(",");for(t=0;t<i.length;t++)n[i[t]]=!0;returnn}functiono(e,n){functioni(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);varc={};o.replace(p,function(e,t,n,i,a){varo=n||i||a||"";c[t]=r(o)}),n.start&&n.start(i,c,s)}functiona(e,i){vara,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"!=typeofe&&(e=null===e||"undefined"==typeofe?"":""+e);varo,s,c,v,y=[],w=e;for(y.last=function(){returny[y.length-1]};e;){if(v="",s=!0,y.last()&&A[y.last()]?(e=e.replace(newRegExp("(.*)<\\s*\\/\\s*"+y.last()+"[^>]*>","i"),function(e,t){returnt=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)throwl("badparse","The sanitizer was unable to parse the following block of html: {0}",e);w=e}a()}functionr(e){if(!e)return"";vart=N.exec(e),n=t[1],i=t[3],a=t[2];returna&&(P.innerHTML=a.replace(/</g,"<"),a="textContent"inP?P.textContent:P.innerText),n+a+i}functions(e){returne.replace(/&/g,"&").replace(v,function(e){vart=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(y,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}functionc(e,n){vari=!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){varr=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))}}}varl=t.$$minErr("$sanitize
}functiony(){i.cancel($),e.credentials.viaApp||(--e.callPending.remaining?$=i(y,1e3):(e.callPending.success=!1,r.invokeApi("auth.sendCall",{phone_number:e.credentials.phone_full,phone_code_hash:e.credentials.phone_code_hash},b).then(function(){e.callPending.success=!0})))}o.dismissAll(),d.start(),r.getUserID().then(function(e){returne?voidn.url("/im"):"http:"!=location.protocol||Config.Modes.http||-1==Config.App.domains.indexOf(location.hostname)?voidp.setAuthorized(!1):void(location.href=location.href.replace(/^http:/,"https:"))});varb={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(){vare=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")});varn=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&&(deletee.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($),deletee.credentials.phone_code_hash,deletee.credentials.phone_unoccupied,deletee.credentials.phone_code_valid,deletee.credentials.viaApp,deletee.callPending.remaining,deletee.callPending.success},e.logIn=function(t){varn="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)returnt.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)returnt.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"},deletee.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,_){functionv(){if(n.q){if(n.q!==y&&(e.search.query=y=n.q,void0!==e.curDialog))return!1}elsey=!1;n.p&&"@"==n.p.charAt(0)?(void0===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("histor