var IS_CLIENT_SIDE="undefined"!=typeof window,IS_ANDROID_WEBVIEW=Boolean(IS_CLIENT_SIDE&&window.AndroidBridge),IS_IOS_WEBVIEW=Boolean(IS_CLIENT_SIDE&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.VKWebAppClose),IS_WEB=IS_CLIENT_SIDE&&!IS_ANDROID_WEBVIEW&&!IS_IOS_WEBVIEW,androidBridge=IS_CLIENT_SIDE?window.AndroidBridge:void 0,iosBridge=IS_IOS_WEBVIEW?window.webkit.messageHandlers:void 0;function _bridgeSend(e,t){androidBridge&&androidBridge[e]?androidBridge[e](JSON.stringify(t)):iosBridge&&iosBridge[e]&&"function"==typeof iosBridge[e].postMessage&&iosBridge[e].postMessage(t)}function _bridgeSupports(e){return IS_ANDROID_WEBVIEW?androidBridge&&"function"==typeof androidBridge[e]:!!IS_IOS_WEBVIEW&&(iosBridge&&iosBridge[e]&&"function"==typeof iosBridge[e].postMessage)}var IS_BRIDGE_AVAILABLE=!IS_WEB&&_bridgeSupports("VKWebAppConversionHit");if(function(e){if(!e.fastXDM){var t={},o={},i=[],n={};e.fastXDM={_id:0,helperUrl:"https://vk.com/js/api/xdmHelper.js",Server:function(o,i,n){this.methods=o||{},this.filter=i,this.options=n||{},this.id=e.fastXDM._id++,this.key=function(){for(var e="",t=0;t<5;t++)e+=Math.ceil(15*Math.random()).toString(16);return e}(),this.frameName="fXD"+this.key,this.server=!0,this.methods["%init%"]=this.methods.__fxdm_i=function(){d((function(t){for(var o in this.methods)if(this.methods[o]instanceof e.fastXDM.Server){var i=this.methods[o];"p"===t.protocol&&t.send(this,t.json.stringify(["%proxy%",[o,i.key]])),this.methods[o]=function(){this.callMethod.apply(this,arguments)}.bind(i)}}),this),e.fastXDM.run(this.id),this.methods.onInit&&this.methods.onInit()},t[this.key]=[p,this]},Client:function(i,n){if(this.methods=i||{},this.options=n||{},this.id=e.fastXDM._id++,this.client=!0,e.fastXDM.run(this.id),0!==window.name.indexOf("fXD"))throw Error("Wrong window.name property.");this.key=window.name.substring(3,8),this.caller=window.parent,o[this.key]||(o[this.key]={}),this.methods["%proxy%"]=function(e,t){e&&t&&this.caller.frames["fXD"+t]&&(o[this.key][e]={key:t,frame:{contentWindow:this.caller.frames["fXD"+t]}})}.bind(this),t[this.key]=[p,this],e.fastXDM.on("helper",(function(){e.fastXDM.onClientStart(this)}),this),d((function(e){e.send(this,e.json.stringify(["%init%"]));var t=this.methods;setTimeout((function(){t.onInit&&t.onInit()}),0)}),this)},onMessage:function(e){var o=e.data;if(!o)return!1;if("string"!=typeof o&&!(o instanceof String))return!1;var i=o.substr(0,5);if(t[i]){var n=t[i][1];!n||n.filter&&!n.filter(e.origin)||t[i][0](o.substr(6),n,e.origin)}},setJSON:function(e){n.json=e},getJSON:function(e){if(!e)return n.json;d((function(t){e(t.json)}))},getProxyToServer:function(e,t){return o[e]&&o[e][t]},setEnv:function(e){for(var t in e)n[t]=e[t];l()},_q:{},on:function(e,t,o){this._q[e]||(this._q[e]=[]),-1==this._q[e]?t.apply(o):this._q[e].push([t,o])},run:function(e){for(var t=(this._q[e]||[]).length,o=0;o";var n=i.firstChild,r=this;return setTimeout((function(){n.frameBorder="0",t&&u(n,t),e.insertBefore(n,e.firstChild),r.start(n)}),0),n},e.fastXDM.Client.prototype.callMethod=e.fastXDM.Server.prototype.callMethod=function(){for(var t=Array.prototype.slice.call(arguments),o=t.shift(),i=0,n=t.length;i/g,">").replace(/"/g,""").replace(/'/g,"'"):e.replace(/'/g,"'").replace(/"/g,'"').replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&");break;case"object":if("[object Array]"===Object.prototype.toString.apply(e)){o=[];for(var i=0,n=e.length;i>16)+(t>>16)+(o>>16)<<16|65535&o},i=function(e,t,i,n,r,s){return o(function(e,t){return e<>>32-t}(o(o(t,e),o(n,s)),r),i)},n=function(e,t,o,n,r,s,a){return i(t&o|~t&n,e,t,r,s,a)},r=function(e,t,o,n,r,s,a){return i(t&n|o&~n,e,t,r,s,a)},s=function(e,t,o,n,r,s,a){return i(t^o^n,e,t,r,s,a)},a=function(e,t,o,n,r,s,a){return i(o^(t|~n),e,t,r,s,a)};return function(e){for(var t,o="0123456789abcdef",i="",n=0,r=e.length;n>>4&15)+o.charAt(15&t);return i}(function(e){for(var t="",o=0,i=32*e.length;o>5]>>>o%32&255);return t}(function(e,t){var i,d,l,p,u=1732584193,c=-271733879,h=-1732584194,f=271733878;e[t>>5]|=128<>>9<<4)]=t;for(var g=0,m=e.length;g>2);for(t=0,o=i.length;t>5]|=(255&e.charCodeAt(t/8))<>>6&31,128|63&t):t<=65535?i+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(i+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return i}(e)),8*t.length)))}),VK.extend=function(e,t,o){for(var i in t)(o||void 0===e[i])&&(e[i]=t[i]);return e},VK.extend(VK,{_domain:{base:"https://vk.com",login:"https://login.vk.com",main:"https://oauth.vk.com",api:"https://api.vk.com"}},!0),VK.xdConnectionCallbacks)setTimeout((function(){for(var e;e=VK.xdConnectionCallbacks.pop();)e()}),0),VK.Widgets&&!VK.Widgets._constructor&&(VK.Widgets=!1);else{function obj2qs(e){if(!e)return"";var t=[];for(var o in e)e.hasOwnProperty(o)&&t.push(encodeURIComponent(o)+"="+encodeURIComponent(e[o].toString()||""));return t.length?"?"+t.join("&"):""}VK.extend(VK,{version:1,_apiId:null,_session:null,_userStatus:"unknown",_path:{login:"authorize",proxy:"fxdm_oauth_proxy.html"},_rootId:"vk_api_transport",_nameTransportPath:"",xdReady:!1,access:{FRIENDS:2,PHOTOS:4,AUDIO:8,VIDEO:16,MATCHES:32,QUESTIONS:64,WIKI:128}}),VK.init=function(e){var t,o;if(VK._apiId=null,!e.apiId)throw Error("VK.init() called without an apiId");if(VK._apiId=e.apiId,e.onlyWidgets)return!0;e.nameTransportPath&&""!==e.nameTransportPath&&(VK._nameTransportPath=e.nameTransportPath),(o=document.getElementById(VK._rootId))||((o=document.createElement("div")).id=VK._rootId,(t=document.body).insertBefore(o,t.childNodes[0])),o.style.position="absolute",o.style.top="-10000px";var i=VK.Cookie.load();i&&(VK.Auth._loadState="loaded",VK.Auth.setSession(i,i?"connected":"unknown"))},VK.Cookie||(VK.Cookie={_domain:null,load:function(){var e,t=document.cookie.match("\\bvk_app_"+VK._apiId+"=([^;]*)\\b");if(t){if("oauth"!=(e=this.decode(t[1])).secret)return!1;e.expire=parseInt(e.expire,10),VK.Cookie._domain="."+window.location.hostname}return e},setRaw:function(e,t,o,i){var n;n="vk_app_"+VK._apiId+"="+e;var r=i?(new Date).getTime()+1e3*i:1e3*t;n+=e&&0===t?"":"; expires="+new Date(r).toGMTString(),n+="; path=/",n+=o?"; domain=."+o:"",document.cookie=n,this._domain=o},set:function(e,t){e?this.setRaw(this.encode(e),e.expire,window.location.hostname,(t||{}).time):this.clear()},clear:function(){this.setRaw("",0,this._domain,0)},encode:function(e){var t,o=[];for(t in e)"user"!=t&&o.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return o.sort(),o.join("&")},decode:function(e){var t,o,i={},n=e.split("&");for(t=0;t3)return!1;var r=function(n){VK.Observer.unsubscribe("auth.sessionChange",r),delete t.access_token,n.session&&VK.Api.call(e,t,o,i+1)};VK.Observer.subscribe("auth.sessionChange",r),VK.Auth.getLoginStatus()}d||delete VK.Api._callbacks[l]},d?VK.xdReady?VK.XDM.remote.callMethod("apiCall",e,n,r):(VK.Observer.subscribe("xdm.init",(function(){VK.XDM.remote.callMethod("apiCall",e,n,r)})),VK.XDM.init()):(VK.Api._callbacks[l]=r,VK.Api.attachScript(VK._domain.api+"/method/"+e+"?"+n))}},queryLength:function(e){var t,o=100;for(t in e)o+=t.length+encodeURIComponent(e[t]).length+1;return o}},VK.api=function(e,t,o){VK.Api.call(e,t,o)}),VK.Auth||(VK.Auth={popup:null,lsCb:{},setSession:function(e,t,o,i){var n=!VK._session&&e,r=VK._session&&!e,s=VK._session&&e&&VK._session.mid!=e.mid,a=n||r||VK._session&&e&&VK._session.sid!=e.sid,d=t!=VK._userStatus,l={session:e,status:t,settings:o};return VK._session=e,VK._userStatus=t,VK.Cookie.set(e,i),(a||d||s)&&setTimeout((function(){d&&VK.Observer.publish("auth.statusChange",l),(r||s)&&VK.Observer.publish("auth.logout",l),(n||s)&&VK.Observer.publish("auth.login",l),a&&VK.Observer.publish("auth.sessionChange",l)}),0),l},login:function(e,t){if(!VK._apiId)return!1;var o=VK._domain.main+"/"+VK._path.login+"?client_id="+VK._apiId+"&display=popup&redirect_uri=close.html&response_type=token&openapi=1";t&&parseInt(t,10)>0&&(o+="&scope="+t),VK.Observer.unsubscribe("auth.onLogin"),VK.Observer.subscribe("auth.onLogin",e),VK.UI.popup({width:665,height:370,url:o});var i=function(){VK.Auth.getLoginStatus((function(e){VK.Observer.publish("auth.onLogin",e),VK.Observer.unsubscribe("auth.onLogin")}),!0)};VK.UI.popupOpened=!0;var n=function(){if(!VK.UI.popupOpened)return!1;try{if(!VK.UI.active.top||VK.UI.active.closed)return VK.UI.popupOpened=!1,i(),!0}catch(e){return VK.UI.popupOpened=!1,i(),!0}setTimeout(n,100)};setTimeout(n,100)},logout:function(e){VK.Auth.revokeGrants(e)},revokeGrants:function(e){var t=function(o){VK.Observer.unsubscribe("auth.statusChange",t),e&&e(o)};if(VK.Observer.subscribe("auth.statusChange",t),VK._session&&VK._session.sid){var o=VK._domain.login+"?act=openapi&oauth=1&aid="+parseInt(VK._apiId,10)+"&location="+encodeURIComponent(window.location.hostname)+"&do_logout=1&token="+VK._session.sid;if(VK.Api.supportCORS()){VK.Api.makeRequest(o+"&new=1",(function(){VK.Auth.setSession(null,"unknown")}))}else VK.Api.attachScript(o)}VK.Cookie.clear()},getSession:function(){return VK._session},getLoginStatus:function(cb,force){if(VK._apiId){if(cb){if(!force&&"loaded"==VK.Auth._loadState)return void cb({status:VK._userStatus,session:VK._session});VK.Observer.subscribe("auth.loginStatus",cb)}if(force||"loading"!=VK.Auth._loadState){VK.Auth._loadState="loading";var url=VK._domain.login+"?act=openapi&oauth=1&aid="+parseInt(VK._apiId,10)+"&location="+encodeURIComponent(window.location.hostname);if(VK.Api.supportCORS()){var loginCallback=function(response){if(this.JSON||(this.JSON={}),response="function"!=typeof JSON.parse?eval(response):JSON.parse(response),VK.Auth._loadState="loaded",response&&response.auth){var session={mid:response.user.id,sid:response.access_token,sig:response.sig,secret:response.secret,expire:response.expire};force&&(session.user=response.user);var status="connected"}else{var session=null,status=response.user?"not_authorized":"unknown";VK.Cookie.clear()}VK.Auth.setSession(session,status,!1,response),VK.Observer.publish("auth.loginStatus",{session:session,status:status}),VK.Observer.unsubscribe("auth.loginStatus")};VK.Api.makeRequest(url+"&new=1",loginCallback)}else{for(var rnd=parseInt(1e7*Math.random(),10);VK.Auth.lsCb[rnd];)rnd=parseInt(1e7*Math.random(),10);VK.Auth.lsCb[rnd]=function(e){if(delete VK.Auth.lsCb[rnd],VK.Auth._loadState="loaded",e&&e.auth){var t={mid:e.user.id,sid:e.access_token,sig:e.sig,secret:e.secret,expire:e.expire};force&&(t.user=e.user);var o="connected"}else{t=null,o=e.user?"not_authorized":"unknown";VK.Cookie.clear()}VK.Auth.setSession(t,o,!1,e),VK.Observer.publish("auth.loginStatus",{session:t,status:o}),VK.Observer.unsubscribe("auth.loginStatus")},VK.Api.attachScript(url+"&rnd="+rnd)}}}}}),VK.App||(VK.App={_appOpened:!1,_addToGroupPopup:null,open:function(e,t){!VK.App._appOpened&&VK._apiId&&(VK._session?VK.App._openApp(e,t):VK.Auth.login((function(o){o&&o.session&&VK.App._openApp(e,t)})))},_openApp:function(e,t){var o,i,n=[];if(t=t||{},e&&VK._apiId&&!VK.App._appOpened){if("[object Object]"===Object.prototype.toString.call(t.data))try{t.data=JSON.stringify(t.data)}catch(e){t.data=""}for(var r in o=VK._domain.base+"/apps?act=open_external_app_openapi&aid="+VK._apiId,t.aid=VK._apiId,t){var s="";t.hasOwnProperty(r)&&(void 0!==t[r]&&(s=encodeURIComponent(t[r])),n.push(encodeURIComponent(r)+"="+s))}o+="&url="+e,o+="&q="+encodeURIComponent(n.join("&")),i=VK.Util.Box(o,{},{closeExternalApp:function(){VK.App._result?(VK.Observer.publish("app.done",VK.App._result),VK.App._result=null):VK.Observer.publish("app.closed"),i.hide(),VK.App._appOpened=!1},externalAppDone:function(e,t){t?VK.App._result=e:(VK.Observer.publish("app.done",e),i.hide(),VK.App._appOpened=!1,VK.App._result=null)}}),i.show(),VK.App._appOpened=!0,VK.App._result=null}},addToGroup:function(e){this._addToGroupPopup&&!this._addToGroupPopup.closed||(this._onAddToGroupDone&&VK.Util.removeEvent("message",this._onAddToGroupDone,window),this._onAddToGroupDone=function(e){e.origin===VK._domain.base&&"app.addToGroup"===e.data.method&&(VK.Observer.publish("app.addToGroupDone",{app_id:e.data.app_id,group_ids:e.data.group_ids}),VK.Util.removeEvent("message",this._onAddToGroupDone,window),this._onAddToGroupDone=null)}.bind(this),window.postMessage&&VK.Util.addEvent("message",this._onAddToGroupDone,window),this._addToGroupPopup=VK.UI.popup({url:VK._domain.base+"/add_community_app.php?aid="+e,width:560,height:650}))}})}VK.UI||(VK.UI={active:null,_buttons:[],popup:function(e){var t,o=void 0!==window.screenX?window.screenX:window.screenLeft,i=void 0!==window.screenY?window.screenY:window.screenTop,n=void 0!==window.outerWidth?window.outerWidth:document.body.clientWidth,r=void 0!==window.outerHeight?window.outerHeight:document.body.clientHeight-22,s=e.width,a=e.height,d=parseInt(o+(n-s)/2,10),l=parseInt(i+(r-a)/2.5,10);return t="width="+s+",height="+a+",left="+(d=window.screen&&window.screenX&&screen.left&&screen.left>1e3?0:d)+",top="+l,this.active=window.open(e.url,"vk_openapi",t),this.active},button:function(e,t){var o;"string"==typeof e&&(e=document.getElementById(e)),this._buttons.push(e),index=this._buttons.length-1,o='
Войти
Контакте
',e.innerHTML=o,e.style.width=e.childNodes[0].offsetWidth+"px"},_change:function(e,t){for(var o=document.getElementById("openapi_UI_"+t).rows[0],i=[o.cells[0].firstChild.firstChild,o.cells[2].firstChild.firstChild],n=0;n<2;++n){var r=i[n];0===e?(r.style.backgroundColor="#6D8DB1",r.style.borderTopColor="#7E9CBC",r.style.borderLeftColor=r.style.borderRightColor=r.style.borderBottomColor="#5C82AB"):1==e?(r.style.backgroundColor="#7693B6",r.style.borderTopColor="#88A4C4",r.style.borderLeftColor=r.style.borderRightColor=r.style.borderBottomColor="#6088B4"):2==e&&(r.style.backgroundColor="#6688AD",r.style.borderBottomColor="#7495B8",r.style.borderLeftColor=r.style.borderRightColor=r.style.borderTopColor="#51779F")}0===e||2==e?o.cells[2].firstChild.style.backgroundPosition="0px -42px":1==e&&(o.cells[2].firstChild.style.backgroundPosition="0px -63px")}}),VK.XDM||(VK.XDM={remote:null,init:function(){if(this.remote)return!1;var e=VK._domain.api+"/"+VK._path.proxy;this.remote=new fastXDM.Server({onInit:function(){VK.xdReady=!0,VK.Observer.publish("xdm.init")}}),this.remote.append(document.getElementById(VK._rootId),{src:e})},xdHandler:function(code){try{eval("VK."+code)}catch(e){}}}),VK.Observer||(VK.Observer={_subscribers:function(){return this._subscribersMap||(this._subscribersMap={}),this._subscribersMap},publish:function(e){var t,o,i=Array.prototype.slice.call(arguments),n=(e=i.shift(),this._subscribers()[e]);if(n)for(t=0,o=n.length;ti[1]-120&&"top"!=o.tooltipPos||"vertical"==c||"bottom"==o.tooltipPos?(d.style.top=n+_+2+"px",l.callMethod("show",!1,c+"_"+g)):(d.style.top=n-128+"px",l.callMethod("show",!0,c+"_"+g)),VK.Util.ss(d,{left:(v?0:i[0])-("full"==c||"button"==c?32:2)+"px",display:"block",opacity:1,filter:"none"}),d.setAttribute("vkhidden","no"),b=!0}}function K(e){b&&!e||!l||(l.callMethod("hide"),a.callMethod("hide"),w=setTimeout((function(){d.style.display="none"}),400))}"vertical"!=c&&"button"!=c&&"mini"!=c||delete o.width,h&&(y.auto_width=1);var x=VK.Widgets._constructor("widget_like.php",e,o,y,{initTooltip:function(e){l=new fastXDM.Server({onInit:e?function(){V()}:function(){},proxy:a,showBox:function(e,t){VK.Util.Box(VK.Util.getAbsUrl(e),[t.width,t.height],{proxy:l}).show()}},!1,{safe:!0}),(d=l.append(v?r:document.body,{src:s.src+"&act=a_like_tooltip",scrolling:"no",allowTransparency:!0,id:s.id+"_tt",style:{position:"absolute",padding:0,display:"none",opacity:.01,filter:"alpha(opacity=1)",border:"0",width:"274px",height:"130px",zIndex:5e3,overflow:"hidden"}})).setAttribute("vkhidden","yes"),d.onmouseover=function(){clearTimeout(p),b=!0},d.onmouseout=function(){clearTimeout(p),b=!1,p=setTimeout((function(){K()}),200)}},showTooltip:V,hideTooltip:K,destroy:function(){a.destroy();try{s.src="about: blank;"}catch(e){}if(s.parentNode.removeChild(s),d){try{d.src="about: blank;"}catch(e){}d.parentNode.removeChild(d)}l&&l.destroy()},showBox:function(e,t){VK.Util.Box(VK.Util.getAbsUrl(e),[],{proxy:a}).show()},proxy:function(){l&&l.callMethod.apply(l,arguments)}},{startHeight:_,minWidth:m},(function(e,t,o){a=o,VK.Util.ss(r=e,{height:_+"px",width:m+"px",position:"relative",clear:"both"}),VK.Util.ss(s=t,{height:_+"px",width:m+"px",overflow:"hidden",zIndex:150}),r.onmouseover=function(){clearTimeout(p),b=!0},r.onmouseout=function(){clearTimeout(p),b=!1,p=setTimeout((function(){K()}),200)}}));return t.push(x),x},e.destroyAll=function(){for(var e=null;t[0];)(e=VK.Widgets.RPC[t.pop()])&&e.methods.destroy()},e}(VK.Widgets.Like),VK.Widgets.Poll=function(e,t,o){var i=VK.Util.getPageData();if(!o)throw Error("No poll id passed");var n,r={poll_id:o,url:(t=VK.Util.parseOptions(t)).pageUrl||i.url||location.href,title:t.pageTitle||i.title,description:t.pageDescription||i.description};return t.preview&&(r.is_preview=1,delete t.preview),void 0!==t.share&&(r.share=t.share?1:0),VK.Widgets._constructor("al_widget_poll.php",e,t,r,{showBox:function(e,t){VK.Util.Box(VK.Util.getAbsUrl(e),[],{proxy:n}).show()}},{startHeight:144,minWidth:300},(function(e,t,o){n=o}))},VK.Widgets.App=function(e,t,o){if(!t)throw Error("No app id passed");o=VK.Util.parseOptions(o);var i,n=void 0,r=void 0,s={aid:t,mode:parseInt(o.mode,10)||1};switch(s.mode){case 1:o.width=150,n=251;break;case 2:o.width=o.width?Math.max(200,Math.min(1e4,parseInt(o.width,10))):200,r=n=193;break;case 3:o.width=o.width?Math.max(50,Math.min(1e4,parseInt(o.width,10))):void 0,r=n=o.height={18:18,20:20,22:22,24:24,30:30}[parseInt(o.height,10)||30]}return i=o.width,VK.Widgets._constructor("widget_app.php",e,o,s,{},{startHeight:n,height:r,minWidth:i})},VK.Widgets.Community=VK.Widgets.Group=function(e,t,o){if(t=VK.Util.parseOptions(t),!(o=parseInt(o,10)))throw Error("No group_id passed");t.mode=parseInt(t.mode,10).toString();var i,n,r={gid:o,mode:t.mode?t.mode:"0"},s=3==t.mode?185:1==t.mode?141:0|t.height||290;function a(){return i.callMethod("mouseUp"),!1}function d(e){return i.callMethod("mouseMove",{screenY:e.screenY}),!1}return t.wall&&(r.wall=t.wall),r.color1=t.color1||"",r.color2=t.color2||"",r.color3=t.color3||"",r.class_name=t.class_name||"",t.no_head&&(r.no_head=1),t.no_cover&&(r.no_cover=1),t.wide&&(r.wide=1,(!t.width||t.width<300)&&(t.width=300)),0|!t.width&&(t.width=200),VK.Widgets._constructor("widget_community.php",e,t,r,{showBox:function(e,t){VK.Util.Box(VK.Util.getAbsUrl(e),[],{proxy:i}).show()},startDrag:function(){n=window.document.body.style.cursor,window.document.body.style.cursor="pointer",VK.Util.addEvent("mousemove",d),VK.Util.addEvent("mouseup",a)},stopDrag:function(){window.document.body.style.cursor=n,VK.Util.removeEvent("mousemove",d),VK.Util.removeEvent("mouseup",a)},auth:function(){VK.Auth.login(null,1)}},{minWidth:120,startHeight:s},(function(e,t,o){i=o}))},VK.Widgets.Auth=function(e,t){VK.Util.getPageData();if(!VK._apiId)throw Error("VK not initialized. Please use VK.init");return(t=VK.Util.parseOptions(t)).width||(t.width=200),t.type?type=1:type=0,VK.Widgets._constructor("widget_auth.php",e,t,{},{makeAuth:function(e){if(e.session&&(VK.Auth._loadState="loaded",VK.Auth.setSession(e.session,"connected"),VK.Observer.publish("auth.loginStatus",{session:e.session,status:"connected"}),VK.Observer.unsubscribe("auth.loginStatus")),t.onAuth)t.onAuth(e);else{if(t.authUrl)var o=t.authUrl;else o=window.location.href;-1==o.indexOf("?")?o+="?":o+="&";var i=[];for(var n in e)"session"!=n&&i.push(n+"="+decodeURIComponent(e[n]).replace(/&/g,"%26").replace(/\#/g,"%23").replace(/\?/,"%3F"));window.location.href=o+i.join("&")}}},{startHeight:134})},VK.Widgets.Subscribe=function(e,t,o){if(!(o=parseInt(o,10)))throw Error("No owner_id passed");var i,n={oid:o};return(t=VK.Util.parseOptions(t)).mode&&(n.mode=t.mode),t.soft&&(n.soft=t.soft),VK.Widgets._constructor("widget_subscribe.php",e,t,n,{showBox:function(e,t){VK.Util.Box(VK.Util.getAbsUrl(e),[],{proxy:i}).show()},auth:function(){VK.Auth.login(null,1)}},{minWidth:220,startHeight:22},(function(e,t,o){i=o}))},VK.Widgets.ContactUs=function(e,t,o){if(!(o=parseInt(o,10)))throw Error("No group or user id passed");t=VK.Util.parseOptions(t);var i={oid:o,height:{18:18,20:20,22:22,24:24,30:30}[parseInt(t.height,10)||24],text:(t.text||"").substr(0,140)};return VK.Widgets._constructor("widget_contactus.php",e,t,i,{},{startHeight:i.height,height:i.height},(function(e,t,o){0}))},VK.Widgets.Bookmarks=function(e,t){t=VK.Util.parseOptions(t);var o={height:{18:18,20:20,22:22,24:24,30:30}[parseInt(t.height,10)||30],url:t.url||window.location.href};return VK.Widgets._constructor("widget_bookmarks.php",e,t,o,{},{startHeight:o.height,height:o.height},(function(e,t,o){0}))},VK.Widgets.Playlist=function(e,t,o,i,n){var r,s={oid:parseInt(t,10),pid:parseInt(o,10),hash:i||""};if(!s.oid)throw Error("No owner id passed");if(!s.pid)throw Error("No playlist id passed");return n=VK.Util.parseOptions(n),VK.Widgets._constructor("widget_playlist.php",e,n,s,{showBox:function(e,t){VK.Util.Box(VK.Util.getAbsUrl(e),[],{proxy:r}).show()}},{minWidth:200},(function(e,t,o){r=o}))},VK.Widgets.Ads=function(e,t,o){t=VK.Util.parseOptions(t),o=o||{};var i,n={},r={},s={},a=document.getElementById(e),d={},l={},p={};for(var u in o){var c=-1!=function(e,t,o){for(var i=o||0,n=(e||[]).length;i",r=document.createElement("iframe");function s(){if(!o)try{var e=r.contentWindow.document.body.firstChild.getBoundingClientRect(),t=Math.ceil(e.bottom-e.top);t&&(r.style.height=t,a.style.height=t)}catch(e){}}r.onload=s,r.id=(i?i.id:"vkwidget-"+Math.round(1e6*Math.random()))+"_ads_html_handler",r.src="about:blank",r.width="100%",r.height="100%",r.scrolling="no",r.frameBorder="0",r.allowTransparency=!0,r.style.overflow="hidden",r.style.width=t,r.style.height=o,a.style.width=t,a.style.height=o,a.appendChild(r),r.contentWindow.vk_ads_html_handler=n,r.src='javascript:window["vk_ads_html_handler"]'}(l.ads_handler_empty_html,l.ads_ad_unit_width,l.ads_ad_unit_height)}}(e)},s.newAdsOnInitLoader=function(e){!function(e){if("vk__adsLight"in window)window.vk__adsLight&&vk__adsLight.userHandlers&&vk__adsLight.userHandlers.onInit&&vk__adsLight.userHandlers.onInit(!1);else{window.vk__adsLight=!1;var t=VK.Api&&VK.Api.attachScript||VK.addScript;if(Array.isArray(e))e.forEach((function(e){t(VK._domain.base+e)}));else{var o=parseInt(e);t(VK._domain.base+jsc("/web/ads_light.js?")+o)}}}(JSON.parse(e.replace(/'/g,"'").replace(/"/g,'"').replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")))},VK.Widgets._constructor("ads_rotate.php",e,t,n,s,r,(function(e,t,o){a=e,i=t}))},VK.Widgets.AllowMessagesFromCommunity=function(e,t,o){if(!(o=parseInt(o,10))||o<0)throw Error("No group id passed");t=VK.Util.parseOptions(t);var i={height:{22:22,24:24,30:30}[parseInt(t.height,10)||24],key:t.key?t.key.substr(0,256):"",group_id:o};return VK.Widgets._constructor("widget_allow_messages_from_community.php",e,t,i,{},{startHeight:i.height,height:i.height},(function(e,t,o){0}))},VK.Widgets.Article=function(e,t,o){var i,n={url:t};return o=VK.Util.parseOptions(o),VK.Widgets._constructor("widget_article.php",e,o,n,{showBox:function(e){VK.Util.Box(VK.Util.getAbsUrl(e),[],{proxy:i}).show()}},{},(function(e,t,o){i=o}))},VK.Widgets.Podcast=function(e,t,o){var i={episode:t};return o=VK.Util.parseOptions(o),VK.Widgets._constructor("widget_podcast.php",e,o,i,{showBox:function(e){VK.Util.Box(VK.Util.getAbsUrl(e),[],{proxy:rpc}).show()}},{minWidth:300,startHeight:150})},VK.Widgets.CommunityMessages=function(e){if(e)return e;var t={},o={},i={no_button:{width:0,height:0},blue_circle:{width:50,height:50,margin:{bottom:20}}},n={left:{bottom:0,left:20},right:{bottom:0,right:20}};return e=function(r,s,a){(a=VK.Util.parseOptions(a)).width=300,a.height=399,a.expandTimeout=parseInt(a.expandTimeout)||0;var d={gid:s};a.expanded=parseInt(a.expanded)||0,(!a.from_dev&&null!=function(e){if(!window.localStorage)return null;return localStorage.getItem("vk_community_widget_"+e)}("expanded")||a.expanded)&&(a.shown=1),a.shown&&(d.shown=1),a.welcomeScreen||(d.disable_welcome_screen=1),d.ref_source_info=a.ref_source_info,d.ref_source_link=location.href;var l=a.buttonType;-1==Object.keys(i).indexOf(l)&&(l="blue_circle"),"no_button"==l&&(a.disableButtonTooltip=1),a.disableButtonTooltip&&(d.disable_tooltip=1),a.tooltipButtonText&&(d.tooltip_text=a.tooltipButtonText),a.disableNewMessagesSound&&(d.disable_new_messages_sound=1),t[r]&&e.destroy(r),d.domain=document.domain,a.no_loading=1,a.disableNewMessagesSound&&a.disableExpandChatSound||(a.enable_autoplay=1),a.disableExpandChatSound&&(d.disable_expand_chat_sound=1),a.expandTimeout&&(d.expand_timeout=a.expandTimeout),a.__alpha_new_widget&&(d.__alpha_new_widget=1);var p,u,c,h=!1,f=0,g=[0,0];V(a.widgetPosition),d.button_position=a.widgetPosition,window.addEventListener("message",(function(e){var t=document.getElementById(r),o=t.getElementsByTagName("iframe")[0];if(e.data&&"VKReforgedWidgetResize"===e.data.action){var i=e.data.params.width,n=e.data.params.height;o.width=i,o.height=n,t.style.width=i+"px",t.style.height=n+"px",t.style.margin=n>50?"0":"0 0 20px"}e.data&&"VKReforgedWidgetLogout"===e.data.action&&(o.parentNode.removeChild(o),t.style={})}),!1);var m=0,_={};function y(e){clearTimeout(o.titleTimer),o.titleTimer=setTimeout((function(){1==o.changeTitleMode?document.title=o.oldTitle||"":document.title=o.title,o.changeTitleMode=1==o.changeTitleMode?0:1,y()}),e?0:1500)}function v(){a.disableTitleChange||(clearTimeout(o.titleTimer),o.oldTitle?document.title=o.oldTitle:null===o.oldTitle&&(document.title=""),o.title="")}function b(){var e=document.getElementById(r),t=e.getElementsByTagName("iframe")[0];e.style.width=t.width="372px",e.style.height=t.height="399px",e.style.margin="0px 0px 0px 0px"}function w(){var e=document.getElementById(r),t=e.getElementsByTagName("iframe")[0],o=i[l],n=o.width+g[0],s=Math.max(o.height,g[1]);e.style.width=n+"px",e.style.height=s+"px";var a=o.margin?o.margin:{};e.style.margin="0px "+(a.right||0)+"px "+(a.bottom||0)+"px 0px",t&&(t.style.boxShadow="none",t.width=n,t.height=s)}function V(e){p=e,-1==Object.keys(n).indexOf(p)&&(p="right"),K(),x("changeButtonPosition",p)}function K(){var e=document.getElementById(r);if(e){var t=["left","right","top","bottom"];for(var o in t)e.style[t[o]]="";var i=n[p];for(var o in i)e.style[o]=i[o]+"px";m&&(f?b():w())}}function x(){u&&u.callMethod.apply(u,arguments)}function I(e){e&&"[object Object]"===Object.prototype.toString.call(e)||(e={}),null==e.welcomeScreen&&(e.welcomeScreen=a.welcomeScreen);var t=document.getElementById(r).getElementsByTagName("iframe")[0];t&&t.contentWindow.postMessage({handler:"VKReforgedWidgetExpand"},VK._domain.base),clearTimeout(_.showTimer),x("expand",e)}function C(e){x("setSourceData",VK.extend({link:location.href},e))}return t[r]=VK.Widgets._constructor("reforged_widget.php",r,a,d,{onStartLoading:function(){var e=document.getElementById(r);e.style.position="fixed",e.style["z-index"]=1e4,K()},onReady:function(){m=1,a.expandTimeout>0&&!a.shown&&(_.showTimer=setTimeout((function(){I({playSong:!a.disableExpandChatSound,noSaveState:1})}),a.expandTimeout))},showBox:function(e){if(h)try{h.hide();try{h.iframe.src="about: blank;"}catch(e){}h.iframe.parentNode.removeChild(h.iframe)}catch(e){}(h=VK.Util.Box(VK.Util.getAbsUrl(e),[],{proxy:u},{zIndex:10002})).show()},setTooltipSize:function(e){g=e,f||w()},expand:function(e){var t,o;e=e||{},f=1,b(),e.noSaveState||(t="expanded",o=1,window.localStorage&&localStorage.setItem("vk_community_widget_"+t,o))},minimize:function(){setTimeout((function(){var e;f=0,w(),e="expanded",window.localStorage&&localStorage.removeItem("vk_community_widget_"+e)}),120)},canNotWrite:function(e){a.onCanNotWrite&&a.onCanNotWrite(e)},destroy:function(){u.destroy();try{c.src="about: blank;"}catch(e){}try{c.parentNode.removeChild(c)}catch(e){}},fatalError:function(t,o){var i={code:t,widget:2,public_id:o};1903==t&&(i.referrer_domain=document.domain);var n=[];for(var s in i)n.push(s+"="+i[s]);e.destroy(r),VK.Util.Box(VK.Util.getAbsUrl("blank.php?"+n.join("&"))).show()},setPageTitle:function(e){a.disableTitleChange||(v(),o.oldTitle=document.title||null,o.title=e,o.changeTitleMode=0,y(1))},resetPageTitle:function(){v()},newMessage:function(){!document.hasFocus||document.hasFocus()||a.disableNewMessagesSound||x("playNewMsgSong")}},{},(function(e,t,o){u=o,c=t,a.shown?b():w()})),VK.Util.addEvent("popstate",C.bind(this,{}),window),VK.Util.addEvent("hashchange",C.bind(this,{}),window),{expand:I,minimize:function(){x("minimize");var e=document.getElementById(r).getElementsByTagName("iframe")[0];e&&e.contentWindow.postMessage({handler:"VKReforgedWidgetMinimize"},VK._domain.base)},destroy:function(){v();var t=document.getElementById(r).getElementsByTagName("iframe")[0];t&&t.contentWindow.postMessage({handler:"VKReforgedWidgetDestroy"},VK._domain.base),e.destroy(r)},setSourceData:C,changeButtonPosition:V,stopTitleAnimation:v}},e.destroy=function(e){if(t[e]){var o=VK.Widgets.RPC[t[e]];o&&o.methods.destroy(),delete t[e]}},e.expand=function(e){console.log(t[e])},e}(VK.Widgets.CommunityMessages),VK.Widgets._constructor=function(e,t,o,i,n,r,s,a,d){var l=document.getElementById(t);if(a=a||++VK.Widgets.count,!l){if((d=d||0)>10)throw Error("VK.Widgets: object #"+t+" not found.");return setTimeout((function(){VK.Widgets._constructor(e,t,o,i,n,r,s,a,d+1)}),500),a}r=r||{},n=n||{},(o=o||{}).preview&&(i.preview=1,delete o.preview);var p,u,c,h,f,g,m="auto"===o.width?0|(l.clientWidth||l.offsetWidth||r.minWidth):parseInt(o.width||0,10);"silent_code"===i.act?(m="1px",l.style.opacity=0,l.style.display="none",l.style.position="absolute"):m=m?Math.max(r.minWidth||200,Math.min(r.maxWidth||1e4,m))+"px":"100%",l.style.width=m,o.height?(i.height=o.height,l.style.height=o.height+"px"):l.style.height=(r.startHeight||200)+"px","100%"===m&&(i.startWidth=0|(l.clientWidth||l.offsetWidth)),i.url||(i.url=o.pageUrl||location.href.replace(/#.*$/,"")),p=VK._domain.base+"/"+e,u="",o.noDefaultParams||(u+="&app="+(VK._apiId||"0")+"&width="+encodeURIComponent(m)),u+="&_ver="+VK.version,VK._iframeAppWidget&&(i.iframe_app=1);var _=VK.Util.getPageData();for(g in i.url=i.url||_.url||"",i.referrer=i.referrer||document.referrer||"",i.title=i.title||_.title||document.title||"",i){if("title"==g&&i[g].length>80&&(i[g]=i[g].substr(0,80)+"..."),"description"==g&&i[g].length>160&&(i[g]=i[g].substr(0,160)+"..."),"number"==typeof i[g])c=i[g];else try{c=encodeURIComponent(i[g])}catch(e){c=""}u+="&"+g+"="+c}p+="?"+(u+="&"+(+new Date).toString(16)).substr(1),n.onStartLoading&&n.onStartLoading(),o.no_loading||VK.Widgets.loading(l,!0),n.showLoader=function(e){VK.Util.Loader(e)},n.publish=function(){var e=Array.prototype.slice.call(arguments);e.push(a),VK.Observer.publish.apply(VK.Observer,e)},n.onInit=function(){VK.Widgets.loading(l,!1),n.onReady&&n.onReady(),o.onReady&&o.onReady()},n.resize=function(e,t){l.style.height=e+"px";var o=document.getElementById("vkwidget"+a);o&&(o.style.height=e+"px")},n.resizeWidget=function(e,t){e=parseInt(e),t=parseInt(t);var i=document.getElementById("vkwidget"+a);isFinite(e)&&(l.style.width=e+"px",i&&(i.style.width=e+"px")),isFinite(t)&&(l.style.height=t+"px",i&&(i.style.height=t+"px")),o.onResizeWidget&&o.onResizeWidget()},n.updateVersion=function(e){e>1&&VK.Api.attachScript("//vk.com/js/api/openapi_update.js?"+parseInt(e))},h=VK.Widgets.RPC[a]=new fastXDM.Server(n,(function(e){return!e||(e=e.toLowerCase()).match(/(\.|\/)vk\.com($|\/|\?)/)}),{safe:!0});var y={overflow:"hidden"};o.custom_style&&"object"==typeof o.custom_style&&(y=VK.extend(y,o.custom_style));var v="";return o.enable_autoplay&&(v='allow="autoplay"'),f=VK.Widgets.RPC[a].append(l,{src:p,width:-1!=m.indexOf("%")?m:parseInt(m)||m,height:r.startHeight||"100%",scrolling:"no",id:"vkwidget"+a,allowTransparency:o.allowTransparency||!1,style:y},v),s&&setTimeout((function(){s(l,f||l.firstChild,h)}),10),a}),VK.Util||(VK.Util={getPageData:function(){if(!VK._pData){var e,t=document.getElementsByTagName("meta"),o={},i=["description","title","url","image","app_id"];for(var n in t)if(t[n].getAttribute&&t[n].getAttribute&&((e=t[n].getAttribute("name"))||(e=t[n].getAttribute("property"))))for(var r in i)e!=i[r]&&e!="og:"+i[r]&&e!="vk:"+i[r]||(o[i[r]]=t[n].content);o.app_id&&!VK._apiId&&(VK._apiId=o.app_id),o.title=o.title||document.title||"",o.description=o.description||"",o.image=o.image||"",!o.url&&VK._iframeAppWidget&&VK._apiId&&(o.url="/app"+VK._apiId,VK._browserHash&&(o.url+=VK._browserHash));var s=location.href.replace(/#.*$/,"");o.url&&o.url.indexOf(s)||(o.url=s),VK._pData=o}return VK._pData},getStyle:function(e,t){var o,i=document.defaultView||window;if(i.getComputedStyle){t=t.replace(/([A-Z])/g,"-$1").toLowerCase();var n=i.getComputedStyle(e,null);n&&(o=n.getPropertyValue(t))}else if(e.currentStyle){var r=t.replace(/\-(\w)/g,(function(e,t){return t.toUpperCase()}));o=e.currentStyle[t]||e.currentStyle[r]}return o},getAbsUrl:function(e){return VK._domain.base+"/"+e.replace(/^\s*\/?/,"")},parseOptions:function(e){return"[object Object]"!==Object.prototype.toString.call(e)&&(e={}),e.base_domain&&(VK._domain.base=e.base_domain),e.login_domain&&(VK._domain.login=e.login_domain),e},getXY:function(e,t){if(e&&void 0!==e){var o=0,i=0;if(void 0!==e.getBoundingClientRect){var n=e.getBoundingClientRect();o=n.left,i=n.top,t=!0}else if(e.offsetParent)do{o+=e.offsetLeft,i+=e.offsetTop,t&&(o-=e.scrollLeft,i-=e.scrollTop)}while(e=e.offsetParent);return t&&(i+=window.pageYOffset||window.scrollNode&&scrollNode.scrollTop||document.documentElement.scrollTop,o+=window.pageXOffset||window.scrollNode&&scrollNode.scrollLeft||document.documentElement.scrollLeft),[o,i]}},Loader:function e(t){e.loader||((e.loader=document.createElement("DIV")).innerHTML='
',document.body.insertBefore(e.loader,document.body.firstChild)),e.loader.style.display=t?"block":"none"},Box:function(e,t,o,i){o=o||{};var n=document.body.style.overflow;VK.Util.Loader(!0);var r=/(^|\.)(vk\.com|vkontakte\.ru)$/.test(location.hostname),s=new fastXDM.Server(VK.extend(o,{onInit:function(){a.style.background="transparent",a.style.visibility="visible",document.body.style.overflow="hidden",a.setAttribute("allowfullscreen",1),r&&(document.body.className+=" layers_shown"),VK.Util.Loader()},hide:function(){a.style.display="none"},tempHide:function(){a.style.left="-10000px",a.style.top="-10000px",a.style.width="10px",a.style.height="10px",r&&(document.body.className=document.body.className.replace(/\b\s*?layers_shown\s*\b/," ")),document.body.style.overflow=n},destroy:function(){try{a.src="about: blank;"}catch(e){}a.parentNode.removeChild(a),r&&(document.body.className=document.body.className.replace(/\b\s*?layers_shown\s*\b/," ")),document.body.style.overflow=n},resize:function(e,t){}},!0),!1,{safe:!0}),a=s.append(document.body,{src:e.replace(/&/g,"&"),scrolling:"no",allowTransparency:!0,style:{position:"fixed",left:0,top:0,zIndex:i&&i.zIndex||1002,background:VK._domain.base+"/images/upload.gif center center no-repeat transparent",padding:"0",border:"0",width:"100%",height:"100%",overflow:"hidden",visibility:"hidden"}});return{show:function(e,t){a.style.display="block",document.body.style.overflow="hidden"},hide:function(){a.style.display="none",document.body.style.overflow=n},iframe:a,rpc:s}},addEvent:function(e,t,o){(o=o||window.document).addEventListener?o.addEventListener(e,t,!1):o.attachEvent&&o.attachEvent("on"+e,t)},removeEvent:function(e,t,o){(o=o||window.document).removeEventListener?o.removeEventListener(e,t,!1):o.detachEvent&&o.detachEvent("on"+e,t)},ss:function(e,t){VK.extend(e.style,t,!0)}}),VK.Retargeting||(VK.Retargeting={pixelCode:null,Init:function(e){return this.pixelCode=e,this},Event:function(e){if(this.pixelCode)if(IS_BRIDGE_AVAILABLE)_bridgeSend("VKWebAppRetargetingPixel",{pixel_code:this.pixelCode,event:e});else{var t=VK.Util.getPageData(),o=t.url.substr(0,500),i=t.title&&t.title.substr(0,500)||"";(window.Image?new Image:document.createElement("img")).src=VK._domain.base+"/rtrg?p="+this.pixelCode+(e?"&event="+encodeURIComponent(e):"")+(o?"&metatag_url="+encodeURIComponent(o):"")+(i?"&metatag_title="+encodeURIComponent(i):"")}},Hit:function(){this.Event()},Add:function(e){this.pixelCode&&e&&(IS_BRIDGE_AVAILABLE?_bridgeSend("VKWebAppRetargetingPixel",{pixel_code:this.pixelCode,target_group_id:e}):(window.Image?new Image:document.createElement("img")).src=VK._domain.base+"/rtrg?p="+this.pixelCode+"&audience="+encodeURIComponent(e))},ProductEvent:function(e,t,o,i){if(this.pixelCode&&t&&e){var n=!0;void 0!==(i=i||{}).show_errors&&(n=!!i.show_errors);var r="0";void 0!==i.errors_ignore&&(r=i.errors_ignore?"1":"0");var s=VK.Util.getPageData(),a=s.url.substr(0,500),d=s.title&&s.title.substr(0,500)||"",l=VK._domain.base+"/rtrg",p=o?JSON.stringify(o):"",u={p:this.pixelCode,products_event:t,price_list_id:e,e:"1",i:r,metatag_url:a,metatag_title:d};if(p&&(u.products_params=p),IS_BRIDGE_AVAILABLE)_bridgeSend("VKWebAppRetargetingPixel",{pixel_code:this.pixelCode,price_list_id:e,products_event:t,products_params:p});else{var c=l+"?"+Object.keys(u).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(u[e])})).join("&");VK.Api.makeRequest(c,this.onDone.bind(this,n))}}},onDone:function(e,t){if(t&&e){var o;try{o=JSON.parse(t)}catch(e){return}o&&o.errors&&this.showErrors(o.errors)}},showErrors:function(e){if(e||e.length){var t="VK Pixel Error ("+this.pixelCode+"): ";if("string"!=typeof e){var o=e.length;if(o)for(var i=0;i