PageSourceSearch

https://gmig.ru/index_files/mosTizer.js

js gmig.ru collected 2026-10-02 05:00:09 UTC 12,301 bytes, 2 lines download raw bytes

1!function(){var e=setTimeout;function n(){}function t(e){if(!(this instanceof t))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(e,this)}function r(e,n){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,t._immediateFn(function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null!==t){var r;try{r=t(e._value)}catch(e){return void i(n.promise,e)}o(n.promise,r)}else(1===e._state?o:i)(n.promise,e._value)})):e._deferreds.push(n)}function o(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var r=n.then;if(n instanceof t)return e._state=3,e._value=n,void a(e);if("function"==typeof r)return void s((o=r,c=n,function(){o.apply(c,arguments)}),e)}e._state=1,e._value=n,a(e)}catch(n){i(e,n)}var o,c}function i(e,n){e._state=2,e._value=n,a(e)}function a(e){2===e._state&&0===e._deferreds.length&&t._immediateFn(function(){e._handled||t._unhandledRejectionFn(e._value)});for(var n=0,o=e._deferreds.length;n<o;n++)r(e,e._deferreds[n]);e._deferreds=null}function c(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}function s(e,n){var t=!1;try{e(function(e){t||(t=!0,o(n,e))},function(e){t||(t=!0,i(n,e))})}catch(e){if(t)return;t=!0,i(n,e)}}t.prototype.catch=function(e){return this.then(null,e)},t.prototype.then=function(e,t){var o=new this.constructor(n);return r(this,new c(e,t,o)),o},t.prototype.finally=function(e){var n=this.constructor;return this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){return n.reject(t)})})},t.all=function(e){return new t(function(n,t){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return n([]);var o=r.length;function i(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,function(n){i(e,n)},t)}r[e]=a,0==--o&&n(r)}catch(e){t(e)}}for(var a=0;a<r.length;a++)i(a,r[a])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(n){n(e)})},t.reject=function(e){return new t(function(n,t){t(e)})},t.race=function(e){return new t(function(n,t){for(var r=0,o=e.length;r<o;r++)e[r].then(n,t)})},t._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(n){e(n,0)},t._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var u=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();function d(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,c)}s((r=r.apply(e,n||[])).next())})}u.Promise||(u.Promise=t),"function"==typeof SuppressedError&&SuppressedError;const l=(f=window.location.hostname,/^(local.)?([a-z]+-)?([act]-tech|newmos).mos.ru$|^([actr].)?local.mos-team.ru$/.test(f)?`${window.location.protocol}//${window.location.hostname}`:"https://www.mos.ru");var f;const v=l;function p({element:e,containerId:n}){return null!=e?e:n?document.getElementById(n):null}function m(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)e[r]=t[r]}return e}var h=function e(n,t){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=m({},t,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+n.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],r={},o=0;o<t.length;o++){var i=t[o].split("="),a=i.slice(1).join("=");try{var c=decodeURIComponent(i[0]);if(r[c]=n.read(a,c),e===c)break}catch(e){}}return e?r[e]:r}},remove:function(e,n){r(e,"",m({},n,{expires:-1}))},withAttributes:function(n){return e(this.converter,m({},this.attributes,n))},withConverter:function(n){return e(m({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decode
1URIComponent)}},{path:"/"});function w(){return w=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},w.apply(this,arguments)}var y,g=["eventLoc","eventRef"];function b({id:e,campaignId:n,tags:t,platformId:r}){return{banner_id:e.toString(10),campaign_id:n.toString(10),place_id:r.toString(10),place_group_id:JSON.stringify(t.map(e=>e.id.toString(10)))}}function _(e,n){var t,r;const o=new Date;let i,a;try{i=null===(t=window.top)||void 0===t?void 0:t.location.href,a=null===(r=window.top)||void 0===r?void 0:r.navigator.userAgent}catch(e){i=window.location.href,a=window.navigator.userAgent}const c={user_id:"",type:"schmetterling",payload:Object.assign({event_name:e,mos_id:h.get("mos_id"),client_id:h.get("_ym_uid"),url:i,useragent:a,isad:h.get("_ym_isad")},b(n)),created_at:o.toLocaleString("ru-RU",{timeZone:"Europe/Moscow"}).replace(/(\d+).(\d+).(\d+), (.+)/,"$3-$2-$1 $4")};fetch(`${l}/api/analytics-forwarder/v1/events`,{method:"POST",body:JSON.stringify(c),headers:{"Content-Type":"application/json"}}).catch(()=>{}),function(e){var n=function(e){var n=e.eventLoc,t=e.eventRef,r=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n.indexOf(t=i[r])>=0||(o[t]=e[t]);return o}(e,g),o=window!==window.parent,i=o&&n||window.location.href,a=o&&t||window.document.referrer;return encodeURIComponent(JSON.stringify(w({eventDst:"stats",mosId:document.cookie.replace(/(?:(?:^|.*;\s*)mos_id\s*=\s*([^;]*).*$)|^.*$/,"$1")||null,eventTime:Math.round(Date.now()/1e3),eventLoc:i,eventRef:a},r)))}(e);(new Image).src="https://stats.mos.ru/eds.gif?o="+n}(Object.assign(Object.assign({},function({id:e,url:n,targetTypes:t,platformId:r},o){return{b_id:e,eventSrc:n,eventObject:{b_pl:r,type:(null==t?void 0:t.includes("segment"))?"stats":"editorial",click:o===y.CLICK||void 0,view:o===y.VIEW||void 0,load:o===y.LOAD||void 0}}}(n,e)),{eventType:"b_net",eventTime:o.getTime()}))}!function(e){e.VIEW="1",e.CLICK="2",e.LOAD="3"}(y||(y={}));const E=[];function j(e){const n="string"==typeof e;return E.find(({createArgs:{containerId:t,element:r}})=>n&&t&&t===e||!n&&r&&r.isEqualNode(e)||n&&(null==r?void 0:r.id)&&r.id===e)}function O(e){var n;if(!e||!(null===(n=e.params)||void 0===n?void 0:n.platform))throw Error("Некорректные аргументы для инициализации");const{onError:t}=e;(function(e){return d(this,void 0,void 0,function*(){const n=p(e),{params:{platform:t},onLoad:r,onRender:o}=e;if(!n)throw new Error("Контейнер не найден");const{banner:i}=yield function(e){var n;return d(this,void 0,void 0,function*(){const t=`${l}/api/schmetterling/v2/frontend/json/ru`,r=encodeURIComponent(null!==(n=h.get("mos_id"))&&void 0!==n?n:""),o=encodeURIComponent(window.location.href);return(i=`${t}/platforms/${e}?targetUrl=${o}${r?`&mosId=${r}`:""}`,fetch(i,{method:"GET",body:void 0}).then(e=>e.status<200||e.status>=300?Promise.reject(e.statusText):e.json())).then(n=>{var t,r,o;return"failed"===(null==n?void 0:n.status)?Promise.reject(new Error(null!==(r=null===(t=null==n?void 0:n.error)||void 0===t?void 0:t.message)&&void 0!==r?r:`Ошибка получения баннера для площадки ${e}`)):(null==n?void 0:n.banner)?(null===(o=null==n?void 0:n.banner)||void 0===o?void 0:o.html)?n:Promise.reject(new Error(`Данных не найдено для площадки ${e}`)):Promise.reject(new Error(`Баннер не найден для площадки ${e}`))});var i})}(t);if(!i)throw new Error(`Баннер не найден для площадки ${t}`);_(y.LOAD,i),r&&(yield r());const a=function(e,n,t,r){e.innerHTML="";const o=document.createElement("iframe");return o.setAttribute("scrolling","no"),o.style.border="none",o.style.display="inline-block",o.style.width="1px",o.style.minWidth="100%",o.style.height="100%",o.srcdoc=n,o.onload=()=>{t&&o.contentDocument&&o.contentDocument.body.addEventListener("click",t),r&&r()},e.appendChild(o),o}(n,function({html:e,url:n}){return e=e.replace(/<head>/i,`<head><base href="${v}">`),n?e.replace(/<a(.*?)href=["'].*?["']/g,"<a$1"):e}(i),function(e){if(!e.url)return;let n="_blank";try{const t=new URL(e.url).hostname===window.location.hostname;n=t?"_parent":"_blank"}catch(e){}return t=>{var r;t.isTrusted&&(_(y.CLICK,e),window.open(null!==(r=e.url)&&void 0!==r?r:"",n))}}(i),o),c=function(e,n){const t=new IntersectionObserver(e=>{e[0].isIntersecting&&(t.disconnect(),_(y.VIEW,i))},{root:null,rootMargin:"0px",threshold:.5});return t.observe(e),t}(a);return{createArgs:e,data:i,observer:c}})})(e).then(n=>{var t,{createArgs:r}=n,o=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["createArgs"]);t=Object.assign(Object.assign({},o),{createArgs:Object.assign(Object.assign({},r),{element:p(e)})}),E.push(t)}
1).catch(e=>{t&&t(e)})}function C(e,n=!1){const t=j(e),r=t&&p(t.createArgs);r&&(t.observer&&t.observer.disconnect(),n||(r.innerHTML=""),E.splice(E.indexOf(t),1))}var I=/*#__PURE__*/Object.freeze({__proto__:null,create:O,destroy:C,reload:function(e){if(e){const n=j(e);n&&(C(e,!0),O(n.createArgs))}else n=({createArgs:e})=>{e.element&&C(e.element,!0),O(e)},E.forEach(e=>n(e));var n}});function $(){return $=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},$.apply(this,arguments)}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e,n){var t=n||{bubbles:!1,cancelable:!1,detail:void 0},r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r},window.Event&&(CustomEvent.prototype=window.Event.prototype),window.CustomEvent=CustomEvent);var A=function(e){return e},R=new WeakMap,T={init:function(){var e;window.mosTizer=T,e=T.renderAll,"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",function(){e()}),document.dispatchEvent(new CustomEvent("mosTizer.initialized"))},renderAll:function(e){var n;void 0===e&&(void 0===n&&(n=window.document),e=n.querySelectorAll("[data-mos-teaser]")),e.length&&[].forEach.call(e,function(e){return T.renderBanner(e)})},reloadAll:function(){I.reload()},getBanner:function(e){return R.get(e)},renderBanner:function(e,n){var t=void 0===n?{}:n,r=t.onLoad,o=void 0===r?A:r,i=t.onError,a=void 0===i?A:i,c=t.onRender,s=void 0===c?A:c;if(R.has(e))return R.get(e);R.set(e,{reload:A});try{var u=JSON.parse(e.dataset.mosTeaser).placementParams,d={params:{platform:u.p1},element:e,onError:a,onLoad:o,onRender:function(){e.dispatchEvent(new CustomEvent("bannerRendered")),s(e)}};I.create(d);var l=$({},d,{iframe:{},windowListeners:{},bannerId:"mosTizerBanner_"+u.p1,destroy:function(){I.destroy(e)}});return R.set(e,l),l}catch(e){}},reloadBanner:function(e){T.getBanner(e)?I.reload(e):T.renderBanner(e)},destroyBanner:function(e){T.getBanner(e)&&(I.destroy(e),R.delete(e))}};void 0===window.Schmetterling&&(window.Schmetterling=I),window.mosTizer||T.init()}();
2//# sourceMappingURL=mosTizer.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.