mango.js 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. !function(a,E,o){"use strict";a.Mango.sbjs=function s(r,n,a){function o(i,e){if(!n[i]){if(!r[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(c)return c(i,!0);e=new Error("Cannot find module '"+i+"'");throw e.code="MODULE_NOT_FOUND",e}t=n[i]={exports:{}};r[i][0].call(t.exports,function(e){var t=r[i][1][e];return o(t||e)},t,t.exports,s,r,n,a)}return n[i].exports}for(var c="function"==typeof require&&require,e=0;e<a.length;e++)o(a[e]);return o}({1:[function(e,t,i){var s=e("./init");t.exports={init:function(e){this.get=s(e),e&&e.callback&&"function"==typeof e.callback&&e.callback(this.get)}}},{"./init":6}],2:[function(e,t,i){var s=e("./terms"),r=e("./helpers/utils"),n={containers:{current:"mgo_sb_current",current_extra:"mgo_sb_current_add",first:"mgo_sb_first",first_extra:"mgo_sb_first_add",session:"mgo_sb_session",udata:"mgo_sb_udata",promocode:"mgo_sb_promo"},service:{migrations:"mgo_sb_migrations"},delimiter:"|*|",aliases:{main:{type:"typ",source:"src",medium:"mdm",campaign:"cmp",content:"cnt",term:"trm",mango:"mango"},extra:{fire_date:"fd",entrance_point:"ep",referer:"rf"},session:{pages_seen:"pgs",current_page:"cpg"},udata:{visits:"vst",ip:"uip",agent:"uag"},promo:"code"},pack:{main:function(e){return n.aliases.main.type+"="+e.type+n.delimiter+n.aliases.main.source+"="+e.source+n.delimiter+n.aliases.main.medium+"="+e.medium+n.delimiter+n.aliases.main.campaign+"="+e.campaign+n.delimiter+n.aliases.main.content+"="+e.content+n.delimiter+n.aliases.main.term+"="+e.term+n.delimiter+n.aliases.main.mango+"="+e.mango},extra:function(e){return n.aliases.extra.fire_date+"="+r.setDate(new Date,e)+n.delimiter+n.aliases.extra.entrance_point+"="+E.location.href+n.delimiter+n.aliases.extra.referer+"="+(E.referrer||s.none)},user:function(e,t){return n.aliases.udata.visits+"="+e+n.delimiter+n.aliases.udata.ip+"="+t+n.delimiter+n.aliases.udata.agent+"="+navigator.userAgent},session:function(e){return n.aliases.session.pages_seen+"="+e+n.delimiter+n.aliases.session.current_page+"="+E.location.href},promo:function(e){return n.aliases.promo+"="+r.setLeadingZeroToInt(r.randomInt(e.min,e.max),e.max.toString().length)}}};t.exports=n},{"./helpers/utils":5,"./terms":9}],3:[function(e,t,i){var l=e("../data").delimiter;t.exports={encodeData:function(e){return encodeURIComponent(e).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(t){try{return decodeURIComponent(t).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(e){try{return unescape(t)}catch(e){return""}}},set:function(e,t,i,s,r){var n={};i&&(n.expires=60*i),n.domain=!s||r||s.match(/[а-яё]/)?"":s,o.Cookies.set(this.encodeData(e),this.encodeData(t),n)},get:function(e){e=o.Cookies.get(this.encodeData(e));return void 0!==e?this.decodeData(e):null},destroy:function(e,t,i){this.set(e,"",-1,t,i)},parse:function(e){var t=[],i={};if("string"==typeof e)t.push(e);else for(var s in e)e.hasOwnProperty(s)&&t.push(e[s]);for(var r=0;r<t.length;r++){i[this.unsbjs(t[r])]={};for(var n=this.get(t[r])?this.get(t[r]).split(l):[],a=0;a<n.length;a++){var o=n[a].split("="),c=o.splice(0,1);c.push(o.join("=")),i[this.unsbjs(t[r])][c[0]]=this.decodeData(c[1])}}return i},unsbjs:function(e){return e.replace("mgo_sb_","")}}},{"../data":2}],4:[function(e,t,i){t.exports={parse:function(e){for(var s=this.parseOptions,t=s.parser[s.strictMode?"strict":"loose"].exec(e),r={},i=14;i--;)r[s.key[i]]=t[i]||"";return r[s.q.name]={},r[s.key[12]].replace(s.q.parser,function(e,t,i){t&&(r[s.q.name][t]=i)}),r},parseOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},getParam:function(e){for(var t={},i=(e||a.location.search.substring(1)).split("&"),s=0;s<i.length;s++){var r,n=i[s].split("=");void 0===t[n[0]]?t[n[0]]=n[1]:"string"==typeof t[n[0]]?(r=[t[n[0]],n[1]],t[n[0]]=r):t[n[0]].push(n[1])}return t},getHost:function(e){return this.parse(e).host.replace("www.","")}}},{}],5:[function(e,t,i){t.exports={escapeRegexp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(e,t){var i=e.getTimezoneOffset()/60,s=e.getHours();return e.setHours(s+i+(t||0===t?t:-i)),e.getFullYear()+"-"+this.setLeadingZeroToInt(e.getMonth()+1,2)+"-"+this.setLeadingZeroToInt(e.getDate(),2)+" "+this.setLeadingZeroToInt(e.getHours(),2)+":"+this.setLeadingZeroToInt(e.getMinutes(),2)+":"+this.setLeadingZeroToInt(e.getSeconds(),2)},setLeadingZeroToInt:function(e,t){for(var i=e+"";i.length<t;)i="0"+i;return i},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},{}],6:[function(e,t,i){var x=e("./data"),v=e("./terms"),_=e("./helpers/cookies"),y=e("./helpers/uri"),w=e("./helpers/utils"),b=e("./params"),k=e("./migrations");t.exports=function(e){var s,o,r,n,a,c,l,t,d=b.fetch(e),u=y.getParam(),i=d.domain.host,h=d.domain.isolate,e=d.lifetime;function m(e){if(-1<y.getHost(E.referrer).indexOf("market.yandex")){var t=e,i={utm_source:"market.yandex.ru",utm_medium:v.referer.referral,utm_campaign:v.none,utm_content:y.getParam().frommarket||v.none};switch(t){case v.traffic.utm:s=v.traffic.utm;break;case v.traffic.referral:s=v.traffic.referral}return o=(void 0!==u.utm_source?u:i).utm_source,r=(void 0!==u.utm_medium?u:i).utm_medium,n=(void 0!==u.utm_campaign?u:i).utm_campaign,a=(void 0!==u.utm_content?u:i).utm_content,l=void 0!==u.mango?u.mango:v.none,c=g()||v.none,x.pack.main({type:s,source:o,medium:r,campaign:n,content:a,term:c,mango:l})}switch(e){case v.traffic.utm:s=v.traffic.utm,o=void 0!==u.utm_source?u.utm_source:void 0!==u.gclid?"google":void 0!==u.yclid?"yandex":v.none,r=void 0!==u.utm_medium?void 0===u.utm_source||"yandex"!==u.utm_source&&"yandex.ru"!==u.utm_source&&"ya.ru"!==u.utm_source||u.utm_medium!==v.referer.referral?u.utm_medium:(s=v.traffic.organic,o="yandex",v.referer.organic):void 0!==u.gclid||void 0!==u.yclid?"cpc":v.none,n=void 0!==u.utm_campaign?u.utm_campaign:void 0!==u[d.campaign_param]?u[d.campaign_param]:void 0!==u.gclid?"google_cpc":void 0!==u.yclid?"yandex_cpc":v.none,l=void 0!==u.mango?u.mango:v.none,a=u.utm_content||v.none,c=g()||v.none;break;case v.traffic.organic:s=v.traffic.organic,o=o||y.getHost(E.referrer),r=v.referer.organic,n=v.none,a=v.none,c=v.none,l=v.none;break;case v.traffic.referral:o=o||y.getHost(E.referrer),r=r||v.referer.referral,n=v.none,a=y.parse(E.referrer).path,c=v.none,l=v.none,"yandex"!==o&&"yandex.ru"!==o||r!==v.referer.referral?s=v.traffic.referral:(s=v.traffic.organic,o="yandex",r=v.referer.organic);break;case v.traffic.typein:s=v.traffic.typein,o=d.typein_attributes.source,r=d.typein_attributes.medium,n=v.none,a=v.none,c=v.none,l=v.none;break;default:s=v.oops,o=v.oops,r=v.oops,n=v.oops,a=v.oops,c=v.oops,l=v.oops}t={type:s,source:o,medium:r,campaign:n,content:a,term:c,mango:l};return x.pack.main(t)}function g(){var e=E.referrer;if(u.utm_term)return u.utm_term;if(!(e&&y.parse(e).host&&y.parse(e).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)))return!1;try{return y.getParam(y.parse(E.referrer).query).text}catch(e){return!1}}function p(e){var t=E.referrer;switch(e){case v.traffic.organic:return t&&f(t)&&function(e){var t=new RegExp("^(?:.*\\.)?"+w.escapeRegexp("yandex")+"\\..{2,9}$"),i=new RegExp("^(?:.*\\.)?"+w.escapeRegexp("ya")+"\\..{2,9}$"),s=new RegExp("^(?:.*\\.)?"+w.escapeRegexp("market.yandex")+"\\..{2,9}$"),r=new RegExp(".*"+w.escapeRegexp("text")+"=.*"),n=new RegExp("^(?:www\\.)?"+w.escapeRegexp("google")+"\\..{2,9}$");if(!y.parse(e).host.match(s)){if(y.parse(e).query&&(y.parse(e).host.match(t)||y.parse(e).host.match(i))&&y.parse(e).query.match(r))return o="yandex";if(y.parse(e).host.match(n))return o="google";if(y.parse(e))for(var a=0;a<d.organics.length;a++){if(y.parse(e).host.match(new RegExp("^(?:.*\\.)?"+w.escapeRegexp(d.organics[a].host)+"$","i")))return o=d.organics[a].display||d.organics[a].host,1;if(a+1===d.organics.length)return}}}(t);case v.traffic.referral:return t&&f(t)&&function(e){{if(!(0<d.referrals.length))return o=y.getHost(e),1;for(var t=0;t<d.referrals.length;t++){if(y.parse(e).host.match(new RegExp("^(?:.*\\.)?"+w.escapeRegexp(d.referrals[t].host)+"$","i")))return o=d.referrals[t].display||d.referrals[t].host,r=d.referrals[t].medium||v.referer.referral,1;if(t+1===d.referrals.length)return o=y.getHost(e),1}}}(t);default:return}}function f(e){var t;return d.domain?h?y.getHost(e)!==y.getHost(i):(t=new RegExp("^(?:.*\\.)?"+w.escapeRegexp(i)+"$","i"),!y.getHost(e).match(t)):y.getHost(e)!==y.getHost(E.location.href)}return k.go(e,i,h),_.set(x.containers.current,function(){var e;if(void 0!==u.utm_source||void 0!==u.utm_medium||void 0!==u.utm_campaign||void 0!==u.utm_content||void 0!==u.utm_term||void 0!==u.mango||void 0!==u.gclid||void 0!==u.yclid||void 0!==u[d.campaign_param])e=m(v.traffic.utm);else if(p(v.traffic.organic))e=m(v.traffic.organic);else if(!_.get(x.containers.session)&&p(v.traffic.referral))e=m(v.traffic.referral);else{if(_.get(x.containers.first)||_.get(x.containers.current))return _.get(x.containers.current);e=m(v.traffic.typein)}return e}(),e,i,h),_.get(x.containers.first)||_.set(x.containers.first,_.get(x.containers.current),e,i,h),_.get(x.containers.session)?(t=parseInt(_.parse(x.containers.session)[_.unsbjs(x.containers.session)][x.aliases.session.pages_seen])||1,t+=1):t=1,_.set(x.containers.session,x.pack.session(t),d.session_length,i,h),d.promocode&&!_.get(x.containers.promocode)&&_.set(x.containers.promocode,x.pack.promo(d.promocode),e,i,h),_.parse(x.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(e,t,i){var c=e("./data"),l=e("./helpers/cookies");t.exports={go:function(e,t,i){var s=this.migrations,r={l:e,d:t,i:i};if(l.get(c.containers.first)||l.get(c.service.migrations)){if(!l.get(c.service.migrations))for(a=0;a<s.length;a++)s[a].go(s[a].id,r)}else{for(var n=[],a=0;a<s.length;a++)n.push(s[a].id);var o="";for(a=0;a<n.length;a++)o+=n[a]+"=1",a<n.length-1&&(o+=c.delimiter);l.set(c.service.migrations,o,r.l,r.d,r.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(t,i){function e(e,t,i){return t||i?e:c.delimiter}var s=t+"=1",t=t+"=0";try{var r,n=[];for(r in c.containers)c.containers.hasOwnProperty(r)&&n.push(c.containers[r]);for(var a,o=0;o<n.length;o++)l.get(n[o])&&(a=l.get(n[o]).replace(/(\|)?\|(\|)?/g,e),l.destroy(n[o],i.d,i.i),l.destroy(n[o],i.d,!i.i),l.set(n[o],a,i.l,i.d,i.i));l.get(c.containers.session)&&l.set(c.containers.session,c.pack.session(0),i.l,i.d,i.i),l.set(c.service.migrations,s,i.l,i.d,i.i)}catch(e){l.set(c.service.migrations,t,i.l,i.d,i.i)}}}]}},{"./data":2,"./helpers/cookies":3}],8:[function(e,t,i){var n=e("./terms"),a=e("./helpers/uri");t.exports={fetch:function(e){var t=e||{},i={};if(i.lifetime=this.validate.checkFloat(t.lifetime)||6,i.lifetime=parseInt(30*i.lifetime*24*60),i.session_length=this.validate.checkInt(t.session_length)||30,i.timezone_offset=this.validate.checkInt(t.timezone_offset),i.campaign_param=t.campaign_param||!1,i.user_ip=t.user_ip||n.none,t.promocode?(i.promocode={},i.promocode.min=parseInt(t.promocode.min)||1e5,i.promocode.max=parseInt(t.promocode.max)||999999):i.promocode=!1,t.typein_attributes&&t.typein_attributes.source&&t.typein_attributes.medium?(i.typein_attributes={},i.typein_attributes.source=t.typein_attributes.source,i.typein_attributes.medium=t.typein_attributes.medium):i.typein_attributes={source:"(direct)",medium:"(none)"},t.domain&&this.validate.isString(t.domain)?i.domain={host:t.domain,isolate:!1}:t.domain&&t.domain.host?i.domain=t.domain:i.domain={host:a.getHost(E.location.hostname),isolate:!1},i.referrals=[],t.referrals&&0<t.referrals.length)for(var s=0;s<t.referrals.length;s++)t.referrals[s].host&&i.referrals.push(t.referrals[s]);if(i.organics=[],t.organics&&0<t.organics.length)for(var r=0;r<t.organics.length;r++)t.organics[r].host&&t.organics[r].param&&i.organics.push(t.organics[r]);return i.organics.push({host:"bing.com",param:"q",display:"bing"}),i.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),i.organics.push({host:"about.com",param:"q",display:"about"}),i.organics.push({host:"aol.com",param:"q",display:"aol"}),i.organics.push({host:"ask.com",param:"q",display:"ask"}),i.organics.push({host:"globososo.com",param:"q",display:"globo"}),i.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),i.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),i.organics.push({host:"tut.by",param:"query",display:"tut.by"}),i.referrals.push({host:"t.co",display:"twitter.com"}),i.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),i.referrals.push({host:"ya.ru",param:"text",display:"yandex"}),i},validate:{checkFloat:function(e){return!(!e||!this.isNumeric(parseFloat(e)))&&parseFloat(e)},checkInt:function(e){return!(!e||!this.isNumeric(parseInt(e)))&&parseInt(e)},isNumeric:function(e){return!isNaN(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)}}}},{"./helpers/uri":4,"./terms":9}],9:[function(e,t,i){t.exports={traffic:{utm:"utm",organic:"organic",referral:"referral",typein:"typein"},referer:{referral:"referral",organic:"organic",social:"social"},none:"(none)",oops:"(Houston, we have a problem)"}},{}]},{},[1])(1)}(window,document,window.Mango=window.Mango||{}),function(e,t){"use strict";var e=void 0===e?this:e,a=void 0;function i(e){if("object"!=typeof e.document)throw new Error("Cookies.js requires a `window` with a `document` object");function n(e,t,i){return 1===arguments.length?n.get(e):n.set(e,t,i)}return n._document=e.document,n._cacheKeyPrefix="cookey.",n._maxExpireDate=new Date("Fri, 31 Dec 9999 23:59:59 UTC"),e="http:"!==location.protocol,n.defaults={path:"/",secure:e,samesite:e?"None":"Lax"},n.get=function(e){n._cachedDocumentCookie!==n._document.cookie&&n._renewCache();e=n._cache[n._cacheKeyPrefix+e];return e===a?a:decodeURIComponent(e)},n.set=function(e,t,i){return(i=n._getExtendedOptions(i)).expires=n._getExpiresDate(t===a?-1:i.expires),n._document.cookie=n._generateCookieString(e,t,i),n},n.expire=function(e,t){return n.set(e,a,t)},n._getExtendedOptions=function(e){return{path:e&&e.path||n.defaults.path,domain:e&&e.domain||n.defaults.domain,expires:e&&e.expires||n.defaults.expires,secure:(e&&e.secure!==a?e:n.defaults).secure,samesite:e&&e.samesite||n.defaults.samesite}},n._isValidDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())},n._getExpiresDate=function(e,t){if(t=t||new Date,"number"==typeof e?e=e===1/0?n._maxExpireDate:new Date(t.getTime()+1e3*e):"string"==typeof e&&(e=new Date(e)),e&&!n._isValidDate(e))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return e},n._generateCookieString=function(e,t,i){e=(e=(e=e.replace(/[^#$&+\^`|]/g,encodeURIComponent)).replace(/\(/g,"%28").replace(/\)/g,"%29"))+"="+(t=(t+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent));return(e+=(i=i||{}).path?";path="+i.path:"")+(i.domain?";domain="+i.domain:"")+(i.expires?";expires="+i.expires.toUTCString():"")+(i.secure?";secure":"")+(i.samesite?";samesite="+i.samesite:"")},n._getCacheFromString=function(e){for(var t={},i=e?e.split("; "):[],s=0;s<i.length;s++){var r=n._getKeyValuePairFromCookieString(i[s]);t[n._cacheKeyPrefix+r.key]===a&&(t[n._cacheKeyPrefix+r.key]=r.value)}return t},n._getKeyValuePairFromCookieString=function(e){var t,i=(i=e.indexOf("="))<0?e.length:i,s=e.substr(0,i);try{t=decodeURIComponent(s)}catch(e){console&&"function"==typeof console.error&&console.error('Could not decode cookie with key "'+s+'"',e)}return{key:t,value:e.substr(i+1)}},n._renewCache=function(){n._cache=n._getCacheFromString(n._document.cookie),n._cachedDocumentCookie=n._document.cookie},n.enabled=(n._areEnabled=function(){var e="cookies.js",t="1"===n.set(e,1).get(e);return n.expire(e),t})(),n}e="object"==typeof e.document?i(e):i,t.Cookies=e}(window,(document,window.Mango=window.Mango||{})),function(e){"use strict";e.ClientConfig={calltrackingHost:"dct.mango-office.ru",umaHost:"uma.mango-office.ru",emtHost:"emt.mango-office.ru",callbackHost:"widgets.mango-office.ru",multichannelHost:"mcw.mango-office.ru",multichannelStaticHost:"widgets-mcw.mango-office.ru"},e.version=""}((window,document,window.Mango=window.Mango||{})),function(){"use strict";(window.Mango=window.Mango||{}).EventEmitter=class{constructor(){this.target=new EventTarget}on(e,t){return this.target.addEventListener(e,t)}once(e,t){return this.target.addEventListener(e,t,{once:!0})}off(e,t){return this.target.removeEventListener(e,t)}emit(e,t){return this.target.dispatchEvent(new CustomEvent(e,{detail:t,cancelable:!0}))}}}((window,document)),function(l,d,e){"use strict";e.Common=e.Common||{},e.Common.HttpClient=class{get(e){var t=this._getUrlParamsString(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});return fetch(t?e+"?"+t:e,{credentials:"same-origin"}).then(e=>e.json())}post(e,t){return fetch(e,{method:"POST",credentials:"same-origin",headers:{"Content-type":"application/json;charset=utf-8"},body:JSON.stringify(t)})}jsonp(o){let c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise((i,e)=>{const s=String(Math.floor(Math.random()*Date.now())),r="mgo"+s;c.callback=r,l[r]=function(e){delete l[r],delete c.callback;var t=d.getElementById(s);t.parentNode.removeChild(t),i(e)};var t=this._getUrlParamsString(c)?o+"?"+this._getUrlParamsString(c):o,n=d.createElement("script"),a=d.getElementsByTagName("head")[0]||d.body||d.documentElement;n.src=t,n.id=s,n.addEventListener("error",e),a.appendChild(n)})}handleResponse(e,i,s){return e.then(e=>{var{data:e,error:t}=e;return i(t?s:e)},e=>i(s))}_getUrlParamsObject(e,r){let n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];return Object.keys(r).map(e=>{var t,i=r[e],s=Array.isArray(r);return"object"==typeof i?this._getUrlParamsObject(e,i,[...n,e]):(t=n.map((e,t)=>0===t?e:"["+e+"]").join(""),this._encodeScalar(t+"["+(s?"":e)+"]",i))}).join("&")}_getUrlParamsArray(t,e){return e.map(e=>this._encodePair(t+" + '[]'",e))}_encodeScalar(e,t){return encodeURIComponent(e)+"="+encodeURIComponent(t)}_encodePair(e,t){return null!==t&&"object"==typeof t?this._getUrlParamsObject(e,t,[e]):Array.isArray(t)?this._getUrlParamsArray(e,t):this._encodeScalar(e,t)}_getUrlParamsString(t){return Object.keys(t).filter(e=>!this._isEmpty(t[e])).map(e=>this._encodePair(e,t[e])).join("&")}_isEmpty(e){return null==e}sendGet(e,t){return this.get(e,t)}}}(window,document,window.Mango=window.Mango||{}),function(t,r){"use strict";r.Common=r.Common||{};const i="mgo_uid",s="mgo_sid",n="mgo_cnt",a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,c=parseInt("x00",36);function l(e,t,i){for(var s=2<arguments.length&&void 0!==i?i:" ";e.length<t;)e+=s;return e}r.Common.Session=class{constructor(){this.isNew=!1,this.isNewUser=!1,this.domain=t.location.hostname.replace(/^www\./,"")}getSessionCount(){return parseInt(r.Cookies.get(n),10)||0}incrementSessionCount(){let e=this.getSessionCount();var t=a,i=this._getDomain();if(0===e&&!this.isNewUser)return r.Cookies.set(n,c,{expires:t,domain:i}),c;this.isNewUser&&0<e&&(e=0),this.isNew=0===e;var s=e+1;return r.Cookies.set(n,s,{expires:t,domain:i}),s}getUserId(){return r.Cookies.get(i)||this._createUserId()}getUserIp(){return r.Cookies.get("mgo_uip")}getSessionId(){return r.Cookies.get(s)||this._createSessionId()}setDomain(e){this._validateDomain(e)&&(this.domain=e.replace(/^www\./,""))}_createUserId(){var e=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:20;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var i="",s=0;s<e;s++)i+=t.charAt(Math.floor(Math.random()*t.length));return i}();return r.Cookies.set(i,e,{expires:o,domain:this._getDomain()}),this.isNewUser=!0,e}_createSessionId(){var e=function(e){var{randomPartSize:e=4,secondRandomPartSize:t=5,currDate:i=new Date,sessionsCountGetter:s}=e;var e=h(e),i=Math.round(i.getTime()/1e3).toString(36),r=d.toString(),n=u.toString(),s=function(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:" ";for(;e.length<t;)e=i+e;return e}(s().toString(36),3,"0"),t=h(t);return""+e+i+r+n+s+t}({sessionsCountGetter:()=>this.incrementSessionCount()});return r.Cookies.set(s,e,{expires:1800,domain:this._getDomain()}),e}refreshSession(e){var t=this.getSessionId(),e=e||1800;r.Cookies.set(s,t,{expires:e,domain:this._getDomain()})}_getDomain(){return this.domain.replace(/^www\./,"")}_validateDomain(e){return/^[a-zA-Z0-9]+([-.][a-zA-Z0-9]{2,})+$/.test(e)&&-1<t.location.hostname.indexOf(e)}};const d=1,u=1,h=e=>{return t=parseInt(l("1",e,"0"),36),e=parseInt(l("",e,"z"),36),(Math.floor(Math.random()*(e-t))+t).toString(36);var t}}((window,document),window.Mango=window.Mango||{}),function(x,e){"use strict";e.Utils=e.Utils||{},e.Utils.Dom={MAIL_PREFIX:"mailto:",PHONE_PREFIX:"tel:",stringEquals(e,t,i){return i?"string"==typeof e&&"string"==typeof t&&e.length===t.length&&e.toLowerCase()===t.toLowerCase():e===t},findAndReplaceContent(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"*";let s=3<arguments.length&&void 0!==arguments[3]&&arguments[3];return!!i&&(i=x.body.querySelectorAll(i),0!==(i=Array.prototype.slice.call(i).filter(e=>this.stringEquals(String(e.textContent).trim(),t,s))).length)&&(this._replaceContent(i,e),!0)},findAndReplaceMultiple(e){var t,i,s,r=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=new Set,a=new Map,o=new Map;for({find:t,content:i,selector:s}of e){var c=r?t&&t.toLowerCase():t;void 0===s||"*"===s?a.set(c,i):s&&(n.add(s),o.set(c,{content:i,selector:s}))}var l=[];if(a.size)for(const g of x.body.querySelectorAll("*")){var d=String(g.textContent).trim(),u=r?d&&d.toLowerCase():d,u=a.get(u);u&&l.push([d,g,u])}if(o.size){e=[...n].join(", ");for(const p of x.body.querySelectorAll(e)){var h=String(p.textContent).trim(),m=r?h&&h.toLowerCase():h,m=o.get(m);m&&p.matches(m.selector)&&l.push([h,p,m.content])}}if(0===l.length)return!1;e=l.reduce((e,t)=>{var[t,i,s]=t;return e[t]||(e[t]=[[],s]),e[t][0].push(i),e},{});for(const f of Object.values(e))this._replaceContent(...f);return!0},_replaceContent(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];let t=1<arguments.length?arguments[1]:void 0;e.forEach(e=>{e.hasAttribute("href")&&this._replaceAttributes(e,t),!e.firstElementChild&&e.firstChild&&(e.textContent=t)})},_replaceAttributes(e,t){var i=this._getHrefPrefix(e);i&&e.setAttribute("href",""+i+t)},_getHrefPrefix(e){return this._isEmailLink(e)?this.MAIL_PREFIX:this._isPhoneLink(e)?this.PHONE_PREFIX:""},_isEmailLink(e){return-1<e.getAttribute("href").indexOf(this.MAIL_PREFIX)},_isPhoneLink(e){return-1<e.getAttribute("href").indexOf(this.PHONE_PREFIX)}}}((window,document),window.Mango=window.Mango||{}),function(e){"use strict";e.Utils=e.Utils||{},e.Utils.EventChannels={UPDATE_CID:"updateCid"},e.Utils.EventBus={channels:new Map,subscribe(e,t){this.channels.has(e)||this.channels.set(e,[]),this.channels.get(e).push(t)},publish(e,t){this.channels.has(e)&&this.channels.get(e).forEach(e=>e(t))}}}((window,document,window.Mango=window.Mango||{})),function(e){"use strict";e.Utils=e.Utils||{};const i=new Map,t={LOAD_SCRIPT_TIME:"loadScript",BEFORE_LOAD_SCRIPT_TIME:"beforeLoadScript",BEFORE_LOAD_NUMBER_TIME:"beforeLoadNumber",LOAD_NUMBER_TIME:"loadNumber",SHOW_NUMBER_TIME:"showNumber"},s={MARKS:{MAIN_START:"main:start",GET_NUMBER:"getNumber",GOT_NUMBER:"gotNumber",SHOWED_NUMBER:"showedNumber"},MEASURES:t},r={INITIAL:"initial"};e.Utils.PF_REPORTS=r,e.Utils.PF_METRICS=s,e.Utils.Performance={mark(e){this._hasPerformanceSupport()&&performance.mark(e)},measure(e,t,i){this._hasPerformanceSupport()&&performance.measure(e,t,i)},getMeasure(e){return this._hasPerformanceSupport()&&(e=this.getByName(e,"measure"))?e.pop():null},getMeasures(){return this._hasPerformanceSupport()?performance.getEntriesByType("measure"):[]},getMark(e){return this._hasPerformanceSupport()&&(e=this.getByName(e,"mark"))?e.pop():null},getMarks(){return this._hasPerformanceSupport()?performance.getEntriesByType("mark"):[]},getResources(){return this._hasPerformanceSupport()?performance.getEntries().filter(e=>"resource"===e.entryType):[]},getByName(e,t){return this._hasPerformanceSupport()?performance.getEntriesByName(e,t):[]},_getMainScript(){var e=this.getResources();return 0!==e.length&&e.find(e=>e.name.includes("widgets/mango.js"))||{}},_calcMeasure(e,t,i){return this.measure(e,t,i),this.getMeasure(e)||{}},saveReport(e){var t;return!this._hasPerformanceSupport()||i.has(e)?null:((t=this._calculateReport(e))&&i.set(e,t),t)},getReport(e){return this._hasPerformanceSupport()?e?i.has(e)?i.get(e):null:Object.fromEntries(i):null},_calculateReport(e){return e!==r.INITIAL?null:(e=this._getMainScript(),{[t.BEFORE_LOAD_SCRIPT_TIME]:e.startTime,[t.LOAD_SCRIPT_TIME]:e.duration,[t.BEFORE_LOAD_NUMBER_TIME]:this._calcMeasure(t.BEFORE_LOAD_NUMBER_TIME,s.MARKS.MAIN_START,s.MARKS.GET_NUMBER).duration,[t.LOAD_NUMBER_TIME]:this._calcMeasure(t.LOAD_NUMBER_TIME,s.MARKS.GET_NUMBER,s.MARKS.GOT_NUMBER).duration,[t.SHOW_NUMBER_TIME]:this._calcMeasure(t.SHOW_NUMBER_TIME,s.MARKS.GOT_NUMBER,s.MARKS.SHOWED_NUMBER).duration})},_hasPerformanceSupport(){return Boolean(performance&&performance.mark&&performance.measure&&performance.getEntries&&performance.getEntriesByName)}}}((window,document,window.Mango=window.Mango||{})),function(e,t){"use strict";t.Analytics=t.Analytics||{};t.Analytics.ActivitySpy=class extends t.EventEmitter{constructor(e){super(),this.isActive=!1,this.isSpying=!1,this.startTime=e,this._updateActivity=this._updateActivity.bind(this)}start(){this.isSpying&&this.stop(),this.isSpying=!0,e.addEventListener("mousemove",this._updateActivity),e.addEventListener("scroll",this._updateActivity),e.addEventListener("keydown",this._updateActivity),this._intervalId=setInterval(t.Helpers.bind(this._onInterval,this),1e3),this.startTime=this.startTime||this._getCurrentTime(),this.activeTimeArray=[],this._activate()}stop(){this.isActive=!1,e.removeEventListener("mousemove",this._updateActivity),e.removeEventListener("scroll",this._updateActivity),e.removeEventListener("keydown",this._updateActivity),clearInterval(this._intervalId),this.isSpying=!1}_activate(){this.isActive=!0,this.startActivityTime=this._getCurrentTime(),this.emit("activity:on")}_deactivate(){this.isActive=!1,this.activeTimeArray.push({start:this.startActivityTime,end:this._getCurrentTime()}),this.emit("activity:off")}_updateActivity(){this.lastActivityTime=this._getCurrentTime()}_onInterval(){var e=this._getCurrentTime()-this.lastActivityTime;this.isActive&&3e4<=e&&this._deactivate(),!this.isActive&&e<3e4&&this._activate(),this.emit("tick",()=>{this.getTotalTime(),this.getActiveTime()})}getTotalTime(){return this._getCurrentTime()-this.startTime}getActiveTime(){var t=0;return _(this.activeTimeArray).forEach(function(e){t+=e.end-e.start}),this.isActive&&(t+=this._getCurrentTime()-this.startActivityTime),t}getTimeSinceLastActive(){var e;return this.isActive?0:this._getCurrentTime()-(null==(e=this.activeTimeArray[this.activeTimeArray.length-1])?void 0:e.end)}_getCurrentTime(){return(new Date).getTime()}}}((window,document),window.Mango=window.Mango||{}),function(e,t,i){"use strict";i.Analytics=i.Analytics||{};i.Analytics.CursorSpy=class extends i.EventEmitter{constructor(e,t,i){super(),this.isSpying=!1,this.pageY=0,this.oldPageY=0,this.diffPageY=0,this.scrollTopArea=0,this._intervalId="",this.speed=e||100,this.top=t||200,this.interval=i||100}start(){this.isSpying&&this.stop(),this.isSpying=!0,this._mouseMoveHandler=this._onMouseSpy.bind(this),t.addEventListener("mousemove",this._mouseMoveHandler),this._intervalId=setInterval(i.Helpers.bind(this._onInterval,this),this.interval)}stop(){this._mouseMoveHandler&&(t.removeEventListener("mousemove",this._mouseMoveHandler),this._mouseMoveHandler=null),clearInterval(this._intervalId),this.isSpying=!1}_onInterval(){this.diffPageY=this.oldPageY>this.pageY?this.oldPageY-this.pageY:0,this.scrollTopArea=e.scrollY+this.top,0<this.diffPageY&&this.diffPageY>this.speed&&this.pageY<this.scrollTopArea&&this.emit("cursor:up"),this._updateCoords()}_onMouseSpy(e){this.pageY=e.pageY}_updateCoords(){this.oldPageY=this.pageY}}}(window,document,window.Mango=window.Mango||{}),function(e,t){"use strict";t.Analytics=t.Analytics||{},t.Analytics.HashSpy=class extends t.EventEmitter{constructor(){super(),this._handleHashChange=this._handleHashChange.bind(this)}start(){e.addEventListener("hashchange",this._handleHashChange)}stop(){e.removeEventListener("hashchange",this._handleHashChange)}_handleHashChange(){this.emit("change")}}}(window,(document,window.Mango=window.Mango||{})),function(i,s,e){"use strict";e.Analytics=e.Analytics||{};e.Analytics.ScrollSpy=class extends e.EventEmitter{constructor(){super(),this.isSpying=!1}_initVariables(){this.scrollTop=0,this.scrollHeight=0,this.clientHeight=0,this.scrollStep=0,this.currentScroll=0,this.scrollPercent=0,this.currentScrollPercent=0,this.scrollTopStep=0,this.currentScrollTopStep=0}start(){this._initVariables(),this.isSpying&&this.stop(),this.isSpying=!0,this._scrollEventHandler()}stop(){this._scrollHandler&&(i.removeEventListener("scroll",this._scrollHandler),this._scrollHandler=null),this.isSpying=!1}_scrollEventHandler(){var e=s.body,t=s.documentElement;this.scrollHeight=Math.max(e.scrollHeight,t.scrollHeight),this.clientHeight=i.innerHeight,this.scrollStep=10*this.scrollHeight/100,this._getScrollParams(),0===i.scrollY&&this._getScrollPercent(),this._scrollHandler=this._onScroll.bind(this),i.addEventListener("scroll",this._scrollHandler)}_onScroll(){this._getScrollParams(),this.scrollTop>this.currentScroll&&this.scrollTopStep>this.currentScrollTopStep&&this._getScrollPercent(!0)}_getScrollParams(){this.scrollTop=i.scrollY+this.clientHeight,this.scrollTopStep=Math.floor(this.scrollTop/this.scrollStep)}_getScrollPercent(e){e&&(this.currentScroll=this.scrollTop,this.currentScrollTopStep=this.scrollTopStep),this.currentScrollPercent=this.scrollPercent,this.scrollPercent=Math.floor(this.scrollTop/(this.scrollHeight/100)),this.scrollPercent=this.scrollPercent-this.scrollPercent%10,this.currentScrollPercent!=this.scrollPercent&&this.emit("scroll",this.scrollPercent)}}}(window,document,window.Mango=window.Mango||{}),function(e,t){"use strict";t.Analytics=t.Analytics||{};var i=[".mango-call-site > button",".mango-call-site > a"].join(","),s=[".mango-callback > button.button-widget-open",".mango-callback > a.button-widget-open",".mango-callback > .selected-label button.button-widget-open"].join(",");t.Analytics.WidgetSpy=class extends t.EventEmitter{constructor(){super(),this.isSpying=!1,this._callSiteHandler=this._callSiteHandler.bind(this),this._callBackHandler=this._callBackHandler.bind(this)}start(){this.isSpying&&this.stop(),this.isSpying=!0,e.addEventListener("click",this._callSiteHandler),e.addEventListener("click",this._callBackHandler)}stop(){this.isSpying=!1,e.removeEventListener("click",this._callSiteHandler),e.removeEventListener("click",this._callBackHandler)}_callSiteHandler(e){null!=(e=e.target)&&e.matches(i)&&this.emit("callsite:open")}_callBackHandler(t){var e;null!=(e=t.target)&&e.matches(s)&&setTimeout(()=>{var e=t.target.parentElement.classList.contains(".selected-label")||t.target.parentElement;(1==e.length&&e.hasClass("widget-show")||0==e.length)&&this.emit("callback:open")},10)}}}((window,document),window.Mango=window.Mango||{}),function(e,t){"use strict";t.Analytics=t.Analytics||{},t.Analytics.Information=class{getPageTitle(){return e.title||""}}}((window,document),window.Mango=window.Mango||{}),function(e,t,r){"use strict";r.Analytics=r.Analytics||{},r.Analytics.Tracker=class{constructor(){this.session=r.session,this.httpClient=r.httpClient}track(e,t){var e=r.Helpers.extend(e,{sid:this.session.getSessionId(),uid:this.session.getUserId(),title:this._getPageTitle(),referrer:this._getReferrerUrl()}),i=(this.session.isNewUser&&(e.nu=Number(this.session.isNewUser)),this.session.getUserIp()),i=(i&&(e.uip=i),r.Helpers.isEmpty(e.url)&&(e.url=this._getPageUrl()),t?r.Urls.times():r.Urls.track());this.httpClient.jsonp(i,e)}hit(e){e=r.Helpers.extend(e,{type:"hit"});this.track(e)}times(e){this.track(e,!0)}form(e){e=r.Helpers.extend(e,{type:"form"});this.track(e)}pageview(e){var t={type:"pageview"};e&&(t.url=e),this.track(t)}event(e,t,i){var s={type:"event",event:e};r.Helpers.isNumber(t)&&(s.value=t),i&&r.Helpers.forEach(i,function(e,t){s["p_"+t]=e}),this.track(s)}_getPageUrl(){return e.location.href}_getPageTitle(){return t.title||""}_getPageDomain(){return e.location.hostname}_getPagePath(){return e.location.pathname}_getReferrerUrl(){return t.referrer}}}(window,document,window.Mango=window.Mango||{}),function(t){"use strict";t.Analytics=t.Analytics||{};t.Analytics.Module=class{start(){this._initTracker(),this._initActivitySpy(),this._initScrollSpy(),this._initCursorSpy(),this._initWidgetSpy(),this.tracker.pageview()}_initTracker(){this.tracker=new t.Analytics.Tracker}_initScrollSpy(){var e=new t.Analytics.ScrollSpy;e.on("scroll",e=>{e=e.detail;100===Number(e)&&this.tracker.event("scroll",e)}),e.start()}_initCursorSpy(){var e=new t.Analytics.CursorSpy;e.on("cursor:up",()=>{this.tracker.hit()}),e.start()}_initActivitySpy(){var e=new t.Analytics.ActivitySpy(t.startTime);e.on("activity:on",()=>{this._startLifecycle()}),e.on("activity:off",()=>{this._clearLifecycle()}),e.start()}_initWidgetSpy(){var e=new t.Analytics.WidgetSpy;e.on("callsite:open",()=>{this.tracker.event("callsite")}),e.on("callback:open",()=>{this.tracker.event("callback")}),e.start()}_startLifecycle(){this.lifecycleId&&this._clearLifecycle(),this.lifecycleId=setInterval(t.Helpers.bind(this._onLifecycle,this),3e4)}_clearLifecycle(){clearInterval(this.lifecycleId)}_onLifecycle(){this.tracker.hit()}getTracker(){return this.tracker||this._initTracker(),this.tracker}}}((window,document,window.Mango=window.Mango||{})),function(i,s){"use strict";s.CallTracking=s.CallTracking||{},s.CallTracking.CalltouchProvider=class{constructor(){this.cId=null}check(){return Boolean(i.ct)}updateClientId(t){s.Helpers.safeExec(()=>{var e=i.ct("calltracking_params"),e=e&&e.find(e=>e.siteId===t);e&&e.sessionId&&this.updateCid(e.sessionId)},()=>{})}updateCid(e){return this.cId&&this.cId===e||(this.cId=e,s.Utils.EventBus.publish(s.Utils.EventChannels.UPDATE_CID,{ctCid:this.cId})),this.cId}}}(window,(document,window.Mango=window.Mango||{})),function(t){"use strict";t.CallTracking=t.CallTracking||{};const e=15e3;t.CallTracking.clientIdsProvider=class{constructor(e){this.widgetId=e,this.ga=new t.CallTracking.GAProvider,this.metrika=new t.CallTracking.MetrikaProvider,this.roistat=new t.CallTracking.RoiStatProvider,this.jivo=new t.CallTracking.JivoProvider,this.fbpixel=new t.CallTracking.FbpixelProvider,this.calltouch=new t.CallTracking.CalltouchProvider,this._collectClientIds()}getAll(){return{gaCid:this.ga.cId,yaCid:this.metrika.cId,rsCid:this.roistat.cId,jsCid:this.jivo.cId,gaUid:this.ga.uId,fbBid:this.fbpixel.fbBid,fbCid:this.fbpixel.fbCid,ctSid:this.calltouch.cId}}_collectClientIds(){t.Helpers.wait(e,this.ga.check).then(e=>this.ga.ready(e,300)).then(()=>this.ga.updateClientId()),t.Helpers.wait(e,this.metrika.check).then(()=>this.metrika.updateClientId()),t.Helpers.wait(e,this.roistat.check).then(()=>this.roistat.updateClientId()),t.Helpers.wait(e,this.jivo.check).then(()=>this.jivo.updateClientId()),t.Helpers.wait(e,this.fbpixel.check).then(()=>this.fbpixel.updateClientId()),t.Helpers.wait(e,this.calltouch.check).then(()=>t.httpClient.jsonp(t.Urls.calltouch(this.widgetId))).then(e=>this.calltouch.updateClientId(e))}}}((window,document,window.Mango=window.Mango||{})),function(i,s){"use strict";s.CallTracking=s.CallTracking||{};s.CallTracking.FbpixelProvider=class{constructor(){this.fbBid=null,this.fbCid=null}check(){var e=s.Cookies.get("_fbp"),t=s.Cookies.get("_fbc");return Boolean(i.fbq)||e||t}updateClientId(){var e=s.Cookies.get("_fbp"),t=s.Cookies.get("_fbc");e&&this.updateIdByName(e,"fbBid"),t&&this.updateIdByName(t,"fbCid")}updateIdByName(e,t){if(this[t]&&this[t]===e)return this[t];this[t]=e,s.Utils.EventBus.publish(s.Utils.EventChannels.UPDATE_CID,{[t]:this[e]})}}}(window,(document,window.Mango=window.Mango||{})),function(n,a){"use strict";a.CallTracking=a.CallTracking||{};a.CallTracking.GAProvider=class{get uId(){var e=this.getTrackers()[0];return e&&e.get?e.get("userId"):null}constructor(){this.cId=null}check(){var e=n.GoogleAnalyticsObject;return n[e]||n._gaq}ready(s,r){return new Promise(i=>{if(!s)return i();var e=n.GoogleAnalyticsObject;let t=n[e];if(t){let e=setTimeout(i,r);void a.Helpers.safeExec(()=>{t(()=>{clearTimeout(e),i()})},()=>i())}else{let t=n._gaq;if(t){let e=setTimeout(i,r);void a.Helpers.safeExec(()=>{t.push(()=>{clearTimeout(e),i()})},()=>i())}else i()}})}getTracker(){var e=n.GoogleAnalyticsObject;return n[e]}getTrackers(){var e=this.getTracker();return e&&e.getAll?e.getAll():[]}updateClientId(){const e=a.Cookies.get("_ga");if(e){var t=a.Helpers.safeExec(()=>e.split("."),()=>[]);if(3<t.length)return void this.updateCid(t[2]+"."+t[3])}var t=a.Cookies.get("__utma");t&&2<(t=t.split(".")).length&&this.updateCid(t[1]+"."+t[2])}updateCid(e){return this.cId&&this.cId===e||(this.cId=e,a.Utils.EventBus.publish(a.Utils.EventChannels.UPDATE_CID,{gaCid:this.cId})),this.cId}}}(window,(document,window.Mango=window.Mango||{})),function(t,i){"use strict";i.CallTracking=i.CallTracking||{},i.CallTracking.JivoProvider=class{constructor(){this.cId=null}check(){return Boolean(t.jivo_api)}updateClientId(){const e=t.jivo_api;e&&i.Helpers.safeExec(()=>{e.getVisitorNumber((e,t)=>{this.updateCid(t)})},()=>{})}updateCid(e){return this.cId&&this.cId===e||(this.cId=e,i.Utils.EventBus.publish(i.Utils.EventChannels.UPDATE_CID,{jsCid:this.cId})),this.cId}}}(window,(document,window.Mango=window.Mango||{})),function(s,r){"use strict";r.CallTracking=r.CallTracking||{};const n="_ym_uid";r.CallTracking.MetrikaProvider=class{constructor(){this.cId=null}check(){var e=r.Cookies.get(n);return Boolean(s.Ya)||e}updateClientId(){var e=r.Cookies.get(n);if(e)this.updateCid(e);else{let e={};s.Ya&&s.Ya._metrika&&s.Ya._metrika.counters&&(e=s.Ya._metrika.counters);var t=Object.keys(e);if(t.length)for(var i in t)if(e[t[i]].getClientID())return void this.updateCid(e[t[i]].getClientID())}}updateCid(e){return this.cId&&this.cId===e||(this.cId=e,r.Utils.EventBus.publish(r.Utils.EventChannels.UPDATE_CID,{yaCid:this.cId})),this.cId}}}(window,(document,window.Mango=window.Mango||{})),function(e){"use strict";e.CallTracking=e.CallTracking||{};const h=["8 (xxx) xxx-xxxx","8 (xxx) xxx-xx-xx","8 (xxx) xxx xxxx","8 (xxx) xxx xx xx","8 (xxxx) xx-xx-xx","8 (xxxx) xx xx xx","8 xxx xxx xxxx","8 xxx xxx xx xx","+7 (xxx) xxx-xxxx","+7 (xxx) xxx-xx-xx","+7 (xxx) xxx xxxx","+7 (xxx) xxx xx xx","+7 (xxxx) xx-xx-xx","+7 (xxxx) xx xx xx","+7 xxx xxx xxxx","+7 xxx xxx xx xx","7 (xxx) xxx-xxxx","7 (xxx) xxx-xx-xx","7 (xxx) xxx xxxx","7 (xxx) xxx xx xx","7 (xxxx) xx-xx-xx","7 (xxxx) xx xx xx","7 xxx xxx xxxx","7 xxx xxx xx xx"];e.CallTracking.NumberFormatter=class{format(e,t){if(!e)return"";h.indexOf(t)<0&&(t=h[0]);let i=e.replace(/[^0-9]/g,"");if(i.length<10)return e;var s=i.substr(0,i.length-10),r=(i=i.substr(i.length-10,10)).substr(0,3),n=i.substr(3,3),a=i.substr(6,2),o=i.substr(8,2),c=i.substr(0,4),l=i.substr(4,2),d=i.substr(6,2),u=i.substr(8,2);switch(t){case"8 (xxx) xxx-xxxx":return`8 (${r}) ${n}-`+a+o;case"8 (xxx) xxx-xx-xx":return`8 (${r}) ${n}-${a}-`+o;case"8 (xxx) xxx xxxx":return`8 (${r}) ${n} `+a+o;case"8 (xxx) xxx xx xx":return`8 (${r}) ${n} ${a} `+o;case"8 (xxxx) xx-xx-xx":return`8 (${c}) ${l}-${d}-`+u;case"8 (xxxx) xx xx xx":return`8 (${c}) ${l} ${d} `+u;case"8 xxx xxx xxxx":return`8 ${r} ${n} `+a+o;case"8 xxx xxx xx xx":return`8 ${r} ${n} ${a} `+o;case"+7 (xxx) xxx-xxxx":return`+${s} (${r}) ${n}-`+a+o;case"+7 (xxx) xxx-xx-xx":return`+${s} (${r}) ${n}-${a}-`+o;case"+7 (xxx) xxx xxxx":return`+${s} (${r}) ${n} `+a+o;case"+7 (xxx) xxx xx xx":return`+${s} (${r}) ${n} ${a} `+o;case"+7 (xxxx) xx-xx-xx":return`+${s} (${c}) ${l}-${d}-`+u;case"+7 (xxxx) xx xx xx":return`+${s} (${c}) ${l} ${d} `+u;case"+7 xxx xxx xxxx":return`+${s} ${r} ${n} `+a+o;case"+7 xxx xxx xx xx":return`+${s} ${r} ${n} ${a} `+o;case"7 (xxx) xxx-xxxx":return s+` (${r}) ${n}-`+a+o;case"7 (xxx) xxx-xx-xx":return s+` (${r}) ${n}-${a}-`+o;case"7 (xxx) xxx xxxx":return s+` (${r}) ${n} `+a+o;case"7 (xxx) xxx xx xx":return s+` (${r}) ${n} ${a} `+o;case"7 (xxxx) xx-xx-xx":return s+` (${c}) ${l}-${d}-`+u;case"7 (xxxx) xx xx xx":return s+` (${c}) ${l} ${d} `+u;case"7 xxx xxx xxxx":return s+` ${r} ${n} `+a+o;case"7 xxx xxx xx xx":return s+` ${r} ${n} ${a} `+o;default:return e}}}}((window,document,window.Mango=window.Mango||{})),function(t,i){"use strict";i.CallTracking=i.CallTracking||{};const s="roistat_visit";i.CallTracking.RoiStatProvider=class{constructor(){this.cId=null}check(){var e=i.Cookies.get(s);return Boolean(t.roistat)||e}updateClientId(){var e=i.Cookies.get(s);e?this.updateCid(e):t.roistat&&this.updateCid(t.roistat.getVisit())}updateCid(e){return this.cId&&this.cId===e||(this.cId=e,i.Utils.EventBus.publish(i.Utils.EventChannels.UPDATE_CID,{rsCid:this.cId})),this.cId}}}(window,(document,window.Mango=window.Mango||{})),function(i){"use strict";i.CallTracking=i.CallTracking||{},i.CallTracking.UtmProvider=class{constructor(e){this.params=e||{},this.session=i.session,this.sb=i.sbjs,this.sb.init(this._getSourceBusterConfig())}getCurrent(){var e,t=i.Helpers.pick(this.sb.get.current,["src","mdm","cmp","cnt","trm","mango"]);try{t.trm="undefined"!==decodeURIComponent(t.trm)?decodeURIComponent(t.trm):"(none)"}catch(e){}return this.session.getSessionId(),!1===this.session.isNewUser&&t.src===this.session.domain&&"referral"===t.mdm&&(e=this.sb.get.first,t.src="referral"!==e.mdm&&e.src!==this.session.domain?e.src:"(direct)",t.mdm="referral"!==e.mdm?e.mdm:"(none)"),t}_getSourceBusterConfig(){var e={lifetime:6,session_length:30,timezone_offset:3};return e.domain={host:this.session.domain},e}}}((window,document,window.Mango=window.Mango||{})),function(u,h){"use strict";h.CallTracking=h.CallTracking||{};h.CallTracking.Widget=class extends h.EventEmitter{constructor(e){super(),this.params=e=e||{},this.id=e.id,this.ctRequestOptions={},this.params.domain&&h.session.setDomain(this.params.domain),h.Utils.EventBus.subscribe(h.Utils.EventChannels.UPDATE_CID,h.Helpers.debounce(this._updateCid.bind(this),3e3)),this.cookies=h.Cookies,this.ids=new h.CallTracking.clientIdsProvider(this.id),this.utm=new h.CallTracking.UtmProvider,this.activitySpy=new h.Analytics.ActivitySpy,this.hashSpy=new h.Analytics.HashSpy,this.intervalId=null,this.tracking=h.Analytics.Module.prototype.getTracker(),this.numbers=[],this.activitySpy.on("activity:on",()=>{this._requestSettings({noct:!this._isAutoLoad()})}),this.hashSpy.on("change",()=>this.activitySpy.start()),this.previousPhoneTextReplace={},this.sessionLength=null,this.sessionTimestamp=null,this.settingsStorageName="mgo_request_settings"}start(){this.activitySpy.start(),this.hashSpy.start()}_isAutoLoad(){return!(!this.params.elements&&!this.params.onReady)}postForm(i){let s={};["name","number","email","subject","comment"].forEach(function(e){var t;i.hasOwnProperty(e)&&(t="form"+e.substring(0,1).toUpperCase()+e.substring(1),s[t]=i[e])}),i.fid&&(s.fid=i.fid),i.customParam&&(s.customParam=i.customParam),i.number&&(s.formNumber=this._convertPhoneToE164(i.number)),s.subType=i.subType||null,s=h.Helpers.extend(s,{wid:this.id,url:u.location.href},this.utm.getCurrent(),this.ids.getAll()),this.tracking.form(s)}getNumber(e,t){return e?"function"==typeof e?(t=e,e={}):"string"==typeof e&&(e={hash:e}):e={},"string"!=typeof e.hash&&(e.hash=""),e.regionCode&&(e.region=e.regionCode,delete e.regionCode),e.countryCode&&(e.country=e.countryCode,delete e.countryCode),this._requestSettings(e,t)}getNumberByRegion(e,t,i){return"function"==typeof t&&(i=t,t=""),this._requestSettings({hash:t,region:e},i)}getNumberWithRedirect(e,t,i){return"function"==typeof t&&(i=t,t=""),this._requestSettings({hash:t,redirectNumber:e},i)}getExistsNumbers(e){this._executeCallback(this.numbers,e)}trackTime(){var e;h.session.isNew&&(e=h.Utils.Performance.saveReport(h.Utils.PF_REPORTS.INITIAL))&&this.tracking.times(h.Helpers.extend({wid:this.id},e))}getUtm(){return this.utm.getCurrent()}_collectRequestParams(e){var t=this.ids.getAll(),e=h.Helpers.extend({uid:h.session.getUserId(),sid:h.session.getSessionId(),url:u.location.href,title:u.title||"",is_cookies:this.cookies.enabled},this._ensureOptions(e)),i=(h.session.isNewUser&&(e.nu=Number(h.session.isNewUser)),h.session.getUserIp());return i&&(e.uip=i),this.params.customParam&&(e.custom=this.params.customParam),h.Helpers.extend(e,this.utm.getCurrent(),t)}_requestSettings(){let a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;var e=h.Urls.calltracking(this.id);this.ctRequestOptions=this._collectRequestParams(a),h.Utils.Performance.mark(h.Utils.PF_METRICS.MARKS.GET_NUMBER),h.httpClient.jsonp(e,this.ctRequestOptions).then(e=>{if(h.Utils.Performance.mark(h.Utils.PF_METRICS.MARKS.GOT_NUMBER),this._onSettingsLoad(e,this._ensureOptions(a),o,["formtracking","messengertracking","ecomanalytics"]),this.sessionLength=6e5,!h.Helpers.isEmpty(e)&&!this.sessionTimestamp){this._setSessionTimestamp();var t=h.Urls.settings(this.id),i=Date.now()-Number(this.sessionTimestamp)>this.sessionLength;const r=this._getSessionSettings();var s=["ecomSettings","formtracking","messengers"].every(e=>Object.keys(r).includes(e));const n={id:e.widget.widget_id,widget:e.widget,session:e.session};i||!s?(this._setSessionTimestamp(!0),h.httpClient.jsonp(t).then(e=>{this._setSessionSettings(e),this._initExcludedModules(["formtracking","ecomanalytics"],n,e)}),this._addMessengerTrackingModule({...n,loadFromStorage:!1})):(this._initExcludedModules(["formtracking","ecomanalytics"],n,r),this._addMessengerTrackingModule({...n,loadFromStorage:!0}))}})}_initExcludedModules(e,t,i){var s,r=[{name:"formtracking",shouldActivate:(null==i||null==(s=i.formtracking)?void 0:s.length)&&(null==i||null==(s=i.formtracking)?void 0:s.some(e=>e.active)),params:{...t,initialForms:null==i?void 0:i.formtracking}},{name:"ecomanalytics",shouldActivate:Boolean(null==i?void 0:i.ecomSettings),params:{...t,settings:null==i?void 0:i.ecomSettings}}];for(const a of e){var n=r.find(e=>e.name===a);n.shouldActivate&&(h.modules.add(n.name,n.params),h.modules.start(a))}}_ensureOptions(e){var t={};return(e=e||{}).hash&&(t.hash=e.hash),(e.region||this.params.region)&&(t.region=e.region||this.params.region,t.country="RU"),e.redirectNumber&&(t.redirect_number=e.redirectNumber),e.noct&&(t.noct=e.noct),t}_onSettingsLoad(i,s,r){let t=3<arguments.length&&void 0!==arguments[3]?arguments[3]:[];if(!h.Helpers.isEmpty(i)){var n=i.service&&i.service.filter(e=>!t.includes(e))||[],a={id:i.widget.widget_id,widget:i.widget,session:i.session};for(let e=0;e<n.length;e++){var o=n[e];h.modules.add(o,a),h.modules.start(o)}if(i.number){this.settings=i.widget;let e=i.number;var c=i.formattedNumber;let t=i.type;var l=i.session&&i.session.location,{redirect_number:s,hash:d=""}=s;s&&1!==t&&(t=3,e=s),this._saveNumber(e,c,t,d),h.session.refreshSession(60*this.settings.expire),!d&&this._isAutoLoad()&&(this._populateElementsByNumber(e,c),this._executeCallback({number:e,formattedNumber:c,type:t,hash:d,location:l},this.params.onReady)),h.Utils.Performance.mark(h.Utils.PF_METRICS.MARKS.SHOWED_NUMBER),this.trackTime(),!0===this.params.visitEvents&&this._notifyGA(e,i.type),this._executeCallback({number:e,formattedNumber:c,type:t,hash:d,location:l},r)}}}_addMessengerTrackingModule(e){Boolean(h.modules.getModule("messengertracking"))||h.modules.add("messengertracking",e),h.modules.start("messengertracking")}_setSessionTimestamp(e){var t=sessionStorage.getItem(this.settingsStorageName),t=Boolean(t)&&JSON.parse(t);this.sessionTimestamp=!e&&(null==t?void 0:t.timestamp)||Date.now(),null!=t&&t.timestamp&&!e||sessionStorage.setItem(this.settingsStorageName,JSON.stringify({...t,timestamp:String(this.sessionTimestamp)}))}_getSessionSettings(){return JSON.parse(sessionStorage.getItem(this.settingsStorageName))}_setSessionSettings(e){var t=JSON.parse(sessionStorage.getItem(this.settingsStorageName))||{};sessionStorage.setItem(this.settingsStorageName,JSON.stringify({...t,...e}))}_populateElementsByNumber(s,e){let r=()=>e;h.Helpers.isFunction(this.params.formatNumber)&&(r=this.params.formatNumber),h.Helpers.forEach(this.params.elements,e=>{let t=r(s,this.settings.number_template);var i;e.selector?(i=u.querySelectorAll(e.selector),this._tagType(i,s),i.forEach(e=>{e.innerHTML=t})):e.numberText&&(i=this.previousPhoneTextReplace[e.numberText]||e.numberText,this._replacePhoneText(e.selector||u.body.firstChild,i,t),this.previousPhoneTextReplace[e.numberText]=t&&t.replace(/[ \(\)-]/g,""))})}_saveNumber(e,t,i,s){s=s||"";var r=this.numbers.find(e=>e.hash===s);r?(r.number=e,r.formattedNumber=t,r.type=i):this.numbers.push({hash:s,number:e,formattedNumber:t,type:i})}_executeCallback(e,t){if(h.Helpers.isFunction(t))try{t(e)}catch(e){h.Log.error("[mango.js] Failed to execute callback.",e)}}_getPhoneInfo(e){if(!e||!e.length)return[];for(var t,i=[],s=/(\([+0-9][\) 0-9\-]{3,19}[0-9])|([+0-9][\(\) 0-9\-]{3,19}[0-9])/g;t=s.exec(e);)i.push({phone:this._cleanPhone(t[0]),startPosition:t.index,endPosition:t[0].length+t.index});return i}_cleanPhone(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],i=e.replace(/[ \(\)-]/g,"");switch(i[0]){case"8":return t?"+7"+i.slice(1):"7"+i.slice(1);case"+":return t?i:i.slice(1);default:return t?"+"+i:i}}_getNext(e){if(e.firstChild)return e.firstChild;if(e.nextSibling)return e.nextSibling;for(var t=e;t.parentNode&&t.parentNode!==u.body&&!t.parentNode.nextSibling;)t=t.parentNode;return t.parentNode===u.body?null:t.parentNode&&t.parentNode.nextSibling}_replacePhoneText(e,t,i){for(var s=e,r=this;s;){var n=this._getNext(s);if(3===s.nodeType&&s.data&&s.data.trim){var a=s.data,o=this._getPhoneInfo(a).filter(function(e){return e.phone===r._cleanPhone(t)});if(o.length){for(var c=a.substring(0,o[0].startPosition),l=0;l<o.length-1;l++)c+=i+a.substring(o[l].endPosition,o[l+1].startPosition);c+=i+a.substring(o[o.length-1].endPosition);for(var d=s.parentNode;d&&d!==u.body;){if("A"===d.tagName){d.href&&0===d.href.indexOf("tel:")&&(d.href="tel:"+r._cleanPhone(i,!0));break}d=d.parentNode}["parentElement","parentNode"].forEach(function(e){s[e]&&(s[e].insertBefore(u.createTextNode(c),s),s[e].removeChild(s))})}}s=n}}_tagType(e,t){if(t=-1<["7","8"].indexOf(t[0])?"+7"+t.toString().substr(1,11):"+"+t,e.length)for(var i,s=0;s<e.length;s++)if("A"===e[s].tagName)this._telMatch(e[s],t);else if(a=null==(i=e[s])?void 0:i.parentElement)for(var r=0;r<3;r++)if("A"===(null==(n=a)?void 0:n.tagName)){if(this._telMatch(a,t))break}else var n,a=null==(n=a)?void 0:n.parentElement}_telMatch(e,t){var i=e.getAttribute("href");return!(!i||!i.match(/^tel:/)||(e.setAttribute("href","tel:"+t),0))}_notifyGA(t,e){let i;switch(e){case 1:i="dynamic visit";break;case 2:i="static visit";break;case 3:i="default visit"}i&&t&&this.ids.ga.getTrackers().forEach(function(e){e.send("event",i,"visit",t)})}_updateCid(e){e&&(e=h.Urls.calltracking(this.id),h.httpClient.jsonp(e,h.Helpers.extend(this.ctRequestOptions,this.ids.getAll())))}_convertPhoneToE164(e){e=e.replace(/\D/gm,"");return"8"===e[0]?"7"+e.slice(1):e}}}((window,document),window.Mango=window.Mango||{}),function(i){"use strict";i.CallTracking=i.CallTracking||{},i.CallTracking.Module=class{constructor(e){var t=this.widgets={};i.Helpers.forEach(e,function(e){e.id=parseInt(e.id,10),e.id&&(t[e.id]=new i.CallTracking.Widget(e))})}start(){i.Helpers.forEach(this.widgets,function(e){e.start()})}exec(e,t){e=e?this.widgets[e]:Object.values(this.widgets)[0];if(e&&"function"==typeof e[t]){for(var i=arguments.length,s=new Array(2<i?i-2:0),r=2;r<i;r++)s[r-2]=arguments[r];return e[t](...s)}return!1}}}((window,document,window.Mango=window.Mango||{})),window,document,window.Mango=window.Mango||{},function(r){"use strict";r.EMT=r.EMT||{},r.EMT.Widget=class{constructor(e){this._params=e,this._started=!1,this.utm=new r.CallTracking.UtmProvider}start(){this._started||(this._requestSettings(),this._started=!0)}_getUtm(){return this.utm.getCurrent()}_getEmtCfg(){var e=this._params["addresses"];if(void 0!==e&&Array.isArray(e))return 0===e.length&&e.push(void 0),{cfg:{addresses:e}}}_requestSettings(){var e=this._params["id"],e=r.Urls.emt(e),t=r.Helpers.extend({uid:r.session.getUserId(),sid:r.session.getSessionId()},this._getUtm(),this._getEmtCfg());r.httpClient.get(e,t).then(e=>{this._onSettingsLoad(e.data)}).catch(console.error)}_onSettingsLoad(e){e&&0!==e.length&&this._replaceEmails(e)}_replaceEmails(e){var t,i,s,e=e.map(e=>{var{email:e,subEmail:t,substitution:i}=e;return{find:e,content:t,selector:i.classNames?i.classNames.join(", "):void 0}});e.length&&(1===e.length?({find:t,content:i,selector:s}=e[0],r.Utils.Dom.findAndReplaceContent(t,i,s,!0)):r.Utils.Dom.findAndReplaceMultiple(e,!0))}}}((window,document,window.Mango=window.Mango||{})),function(s){"use strict";s.EMT=s.EMT||{},s.EMT.Module=class{constructor(t){const i=this._widgets={};s.Helpers.forEach(t,function(e){i[t.id]=new s.EMT.Widget(e)})}start(){s.Helpers.forEach(this._widgets,function(e){e.start()})}exec(e,t){e=e?this._widgets[e]:Object.values(this._widgets)[0];if(e&&"function"==typeof e[t]){for(var i=arguments.length,s=new Array(2<i?i-2:0),r=2;r<i;r++)s[r-2]=arguments[r];return e[t](...s)}return!1}}}((window,document,window.Mango=window.Mango||{})),function(s){"use strict";s.FormTracking=s.FormTracking||{};s.FormTracking.Widget=class{constructor(e){this._id=e.id,this._initialForms=e.initialForms,this._forms={},this._waitingInterval=null}start(){this._requestSettings()}_requestSettings(){var e=this._initialForms.reduce((e,t)=>Object.assign(e,{[t.id]:s.Helpers.pick(t,["id","selector","params"])}),{});this._onSettingsLoaded(e)}_onSettingsLoaded(e){if(this._isSettingsChanged(e)){this._formsParams=e;for(const t of Object.values(this._formsParams))this._startForm(t);this._waitingInterval=setInterval(()=>{for(const e of Object.values(this._forms))e.setButton()},1e3),this._destroyOldForms()}}_isSettingsChanged(e){return!s.Helpers.deepEqual(this._formsParams,e)}_startForm(e){var t=e["id"],i=this._forms[t];i?i.setParams(e):Object.assign(this._forms,{[t]:new s.FormTracking.Form(e,e=>s.modules.getModule("calltracking").exec(this._id,"postForm",e))})}_destroyOldForms(){Object.keys(this._forms).filter(t=>!Object.keys(this._formsParams).find(e=>e===t)).map(e=>{this._forms[e].destroy(),delete this._forms[e]})}}}((window,document,window.Mango=window.Mango||{})),function(r,n,e){"use strict";e.FormTracking=e.FormTracking||{};const i={submit:"submit",click:"click"};e.FormTracking.Form=class{constructor(e,t){this.setParams(e,t),this.listener=()=>this._submit(),this.setButton(),this.styles={boldStyle:"font-weight: bold;",positiveStyle:"font-weight: bold; color: green;",negativeStyle:"font-weight: bold; color: red;",default:"font-weight: normal; color: inherit;"}}setButton(){var e=n.querySelector(this.form.selector);e?e&&this.submitBtn===e||(this.submitBtn=e,this.eventType=this._formEventType(),this.domElem=this._elemByEventType(this.eventType),this.domElem.addEventListener(this.eventType,this.listener)):this.destroy()}setParams(e,t){try{this.form=e,this.onEvent=t,this.submitted=0,this.error=null}catch(e){this._processError(e)}}invalid(){return!!this.error}report(){return`Form: ${this.form.id}, eventType: ${this.eventType}, submitted: ${this.submitted}, error: `+this.error}destroy(){this.domElem&&(this.domElem.removeEventListener(this.eventType,this.listener),this.domElem=null),this.submitBtn=null}getFormInfo(){r.console.info("%cИнформация по форме: %c"+this.form.selector,this.styles.boldStyle,this.styles.positiveStyle),this.form.params.forEach(e=>{this._checkSelector(e)})}_checkSelector(e){r.console.info("%cИнформация по селектору: %c"+e.field,this.styles.boldStyle,this.styles.positiveStyle);var t=n.querySelector(e.selector),i=!!t,t=null==t?void 0:t.form;let s=!1;i||(this._checkDynamicSelector(e)?(s=!0,r.console.info(`Селектор %c${e.field} %cне найден. %cВероятно, данный селектор является динамическим.`,this.styles.boldStyle,this.styles.negativeStyle,this.styles.boldStyle)):(s=!1,r.console.info(`Селектор %c${e.field} %cне найден.`,this.styles.boldStyle,this.styles.negativeStyle))),this.error||!t||s||!i?t||r.console.info(`Селектор %c${e.field} %cне находится %cв форме.`,this.styles.boldStyle,this.styles.negativeStyle,this.styles.default):i&&!s&&r.console.info(`Ошибок при работе с селектором %c${e.field} %cне найдено.
  2. %cЕсли селектор не отрабатывает, вероятно, проблема с обработчиком событий.`,this.styles.boldStyle,this.styles.positiveStyle,this.styles.default)}_checkDynamicSelector(e){const t=new RegExp(e.selector);return Array.from(n.querySelectorAll("*")).filter(e=>t.test(e.id)||t.test(e.className)).length}_isDOMForm(){return this.submitBtn.hasAttribute("type")&&"submit"===this.submitBtn.getAttribute("type")&&Boolean(this.submitBtn.form)}_formEventType(){if(this._isDOMForm()&&this.submitBtn.form)return i.submit;return i.click}_processError(e){this.error=e,this.destroy()}_elemByEventType(e){let t;switch(e){case i.submit:t=this.submitBtn.form;break;case i.click:t=this.submitBtn;break;default:return void this._processError("undefined event type")}return t}_formValues(){return this.form.params.reduce((e,t)=>{var{field:t,selector:i}=t,i=n.querySelector(i);return i&&i.value?Object.assign(e,{[t]:i.value}):e},{})}_submit(){var e=this._formValues();Object.keys(e).length?(this.onEvent&&this.onEvent({...e,fid:this.form.id}),this.submitted++):this.error="no fields found, form could not be processed"}}}(window,document,window.Mango=window.Mango||{}),function(t,s){"use strict";s.FormTracking=s.FormTracking||{},s.FormTracking.Module=class{constructor(e){const i=this._widgets={};s.Helpers.forEach(e,function(e){var t=e["id"];Object.assign(i,{[t]:new s.FormTracking.Widget(e)})}),t.FT=this}start(){s.Helpers.forEach(this._widgets,function(e){e.start()})}}}(window,(document,window.Mango=window.Mango||{})),function(m,g,p){"use strict";p.MessengerTracking=p.MessengerTracking||{};p.MessengerTracking.Widget=class{constructor(e){this._id=e.id,this._forms=null,this.rootNode=g.createElement("div"),this.rootNode.id="mango-messengers-"+p.Helpers.makeId(6),g.body.append(this.rootNode),this.activeTarget=null,this.activeItem=null,this.timeoutResizeId=null,this.timeoutScrollId=null,this.resizeListener=null,this.scrollListener=null,this.settingsStorageName="mgo_request_settings",this.loadFromStorage=e.loadFromStorage,this._appendStaticStyles()}start(){this._requestSettings()}_requestSettings(){var e=p.Urls.messengers(this._id),t=sessionStorage.getItem(this.settingsStorageName),t=Boolean(t)&&JSON.parse(t);this.loadFromStorage&&Boolean(null==t?void 0:t.messengers)?this._onSettingsLoaded(t.messengers):p.httpClient.jsonp(e).then(e=>{var t=sessionStorage.getItem(this.settingsStorageName),t=Boolean(t)&&JSON.parse(t);sessionStorage.setItem(this.settingsStorageName,JSON.stringify({...t,messengers:e})),this._onSettingsLoaded(e)})}_onSettingsLoaded(e){this._isSettingsChanged(e)&&(this._clearListeners(),this._forms=e,this._bindListeners(e))}_isSettingsChanged(e){var t=null===this._forms?[]:this._forms;return!p.Helpers.deepEqual(t.map(e=>{var{account:e,formName:t,message:i,selector:s,type:r}=e;return{account:e,formName:t,message:i,selector:s,type:r}}),e)}_startForm(e){var t=e["id"],t=this._forms[t];t&&t.setParams(e)}_getElementPosition(){let e=this.activeTarget;for(;e&&"body"!==e.nodeName.toLowerCase();){var t=m.getComputedStyle(e).getPropertyValue("position");if(t.match(/fixed|sticky/i))return t;e=e.parentNode}return"absolute"}_clearMessengersWindow(){this.rootNode.innerHTML="",this.activeTarget=null,this.activeItem=null}_getCoordinates(e){e=e.getBoundingClientRect();return{top:e.top+m.scrollY,right:e.right+m.scrollX,bottom:e.bottom+m.scrollY,left:e.left+m.scrollX}}_getMessengerWindowParams(){var e=this.activeTarget,t=this._getCoordinates(e),i=this._getElementPosition(),s=("fixed"===i||"sticky"===i?e.getBoundingClientRect():t).left,t=("fixed"===i||"sticky"===i?e.getBoundingClientRect():t).top,r=e.getBoundingClientRect().width,n=e.getBoundingClientRect().height,a=m.innerWidth<=740,o=m.innerWidth<=440,c=e.getBoundingClientRect().right-r/2>m.innerWidth/2;return{x:a?c&&!o?m.innerWidth-366-8:8:s>m.innerWidth-366?s-366+r:s,y:m.innerHeight-e.getBoundingClientRect().bottom<148?t-140-8:t+n+8,isMobile:a,isSmallMobile:o,formWidth:366,formHeight:140,position:i}}_updateMessengerWindowCoordinates(){var e,t,i,s,r,n;(this.activeTarget||this.activeItem)&&(e=this.rootNode.querySelector("form"))&&({x:t,y:i,isMobile:s,isSmallMobile:r,formWidth:n}=this._getMessengerWindowParams(),e.style.top=i+"px",e.style.left=t+"px",e.style.width=s?"calc(100vw - 16px)":n+"px",e.style.maxWidth=s&&r?"424px":"366px")}_appendMessengerWindow(){var e,t,i,s,r,n,a,o;(this.activeTarget||this.activeItem)&&(o=this.activeItem,{x:e,y:t,isMobile:i,isSmallMobile:s,position:r,formWidth:n,formHeight:a}=this._getMessengerWindowParams(),this.rootNode.innerHTML="",o=this._createMessengerWindow(o.type,o.account,o.message,o.formName,{x:e,y:t,position:r,formWidth:n,formHeight:a,isMobile:i,isSmallMobile:s}),this.rootNode.append(o))}_createMessengerWindow(t,e,i,s,r){const n={whatsapp:{name:"WhatsApp",color:"#25D366",link:`https://wa.me/${e}?text=`+encodeURIComponent(i)},telegram:{name:"Telegram",color:"#229ED9",link:"https://t.me/"+e}};var i=g.createElement("form"),e="sticky"===r.position?"fixed":r.position,a=r.isMobile?"calc(100vw - 16px)":r.formWidth+"px",o=r.isMobile&&r.isSmallMobile?"424px":"366px";const c=g.createElement("input");var l=g.createElement("span"),d=g.createElement("button"),u=g.createElement("p");i.style.cssText=`position: ${e}; width: ${a}; height: ${r.formHeight}px; border-color: ${n[t].color}; top:${r.y}px; left: ${r.x}px; max-width: ${o};`,l.innerHTML=`
  3. <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  4. <path d="M13.0967 2.91147C12.7811 2.59596 12.2715 2.59596 11.956 2.91147L7.99996 6.85939L4.04395 2.90338C3.72844 2.58787 3.21877 2.58787 2.90326 2.90338C2.58775 3.21889 2.58775 3.72856 2.90326 4.04407L6.85927 8.00008L2.90326 11.9561C2.58775 12.2716 2.58775 12.7813 2.90326 13.0968C3.21877 13.4123 3.72844 13.4123 4.04395 13.0968L7.99996 9.14077L11.956 13.0968C12.2715 13.4123 12.7811 13.4123 13.0967 13.0968C13.4122 12.7813 13.4122 12.2716 13.0967 11.9561L9.14065 8.00008L13.0967 4.04407C13.4041 3.73665 13.4041 3.21889 13.0967 2.91147Z" fill="#37474F"/>
  5. </svg>`,l.addEventListener("click",()=>this._clearMessengersWindow()),c.setAttribute("type","tel"),c.setAttribute("placeholder","+7xxxxxxxxxx"),c.setAttribute("pattern","[0-9+]{12,16}"),c.setAttribute("minlength",12),c.setAttribute("maxlength",16),c.setAttribute("required",!0),c.addEventListener("input",e=>{e=e.target;1===e.value.length&&"+"!==e.value&&e.value.match(/\d/)&&(e.value="+"+e.value),e.value=e.value.replace(/[^\d+]/g,""),c.validity.patternMismatch?c.setCustomValidity("Пожалуйста, введите номер телефона в международном формате: +7xxxxxxxxxx"):c.validity.valueMissing?c.setCustomValidity("Пожалуйста, заполните это поле"):c.setCustomValidity("")}),d.setAttribute("type","submit"),d.style.cssText+=`background: ${n[t].color};`,d.innerText="Связаться",u.innerText="Введите свой номер телефона, чтобы начать общение в "+n[t].name;const h=()=>{p.modules.getModule("calltracking").exec(this._id,"postForm",{number:c.value,subType:t,fid:s}),this._clearMessengersWindow(),g.removeEventListener("visibilitychange",h)};return i.addEventListener("submit",e=>{e.preventDefault(),g.addEventListener("visibilitychange",h),m.open(n[t].link),setTimeout(()=>{g.removeEventListener("visibilitychange",h)},6e3)}),i.append(c),i.append(d),i.append(u),i.append(l),i}_appendStaticStyles(){var e=g.createElement("style");e.textContent=`
  6. #${this.rootNode.id} *:not(path) {
  7. all: unset;
  8. box-sizing: border-box;
  9. }
  10. #${this.rootNode.id} form {
  11. box-sizing: border-box;
  12. z-index: 999999;
  13. font-family: Roboto, Helvetica, Arial, sans-serif;
  14. font-style: normal;
  15. font-weight: 400;
  16. line-height: 16px;
  17. gap: 10px;
  18. display: flex;
  19. flex-wrap: wrap;
  20. border-radius: 4px;
  21. background-color: #ffffff;
  22. box-shadow: 0px 3px 14px 0px rgba(55, 71, 79, 0.30);
  23. padding: 32px 24px 24px 24px;
  24. min-width: 272px;
  25. color: #37474F;
  26. border: 1px solid;
  27. font-size: 14px;
  28. }
  29. #${this.rootNode.id} span {
  30. display: block;
  31. position: absolute; top: 8px; right: 8px; cursor: pointer;
  32. }
  33. #${this.rootNode.id} input {
  34. flex: 1; padding: 12px 16px; border-radius: 4px; border: 1px solid #CFD8DC; background: #FFF; height: 40px; width: 100%;
  35. }
  36. #${this.rootNode.id} button {
  37. display: inline-flex; height: 40px; padding: 8px 16px; border-radius: 4px; border:none; margin: 0; color: white; align-items:center; justify-content: center; cursor: pointer; font-size: 14px;
  38. }
  39. #${this.rootNode.id} p {
  40. margin: 0; width: 100%; font-size: 14px; font-weight: normal; line-height: normal;
  41. }
  42. `,g.head.append(e)}_bindListeners(){this.resizeListener=()=>{clearTimeout(this.timeoutResizeId),this.timeoutResizeId=setTimeout(this._updateMessengerWindowCoordinates.bind(this),100)},this.scrollListener=()=>{"sticky"===this._getElementPosition()&&(clearTimeout(this.timeoutScrollId),this.timeoutScrollId=setTimeout(this._updateMessengerWindowCoordinates.bind(this),100))},m.addEventListener("resize",this.resizeListener),m.addEventListener("scroll",this.scrollListener);for(let t of this._forms)t.clickListener=e=>{e.preventDefault(),this.activeTarget=e.target,this.activeItem=t,this._appendMessengerWindow()},g.querySelectorAll(t.selector[0]).forEach(e=>{e.addEventListener("click",t.clickListener)})}_clearListeners(){if(this.resizeListener&&this.scrollListener&&(m.removeEventListener("resize",this.resizeListener),m.removeEventListener("scroll",this.scrollListener)),this._forms)for(let t of this._forms)g.querySelectorAll(t.selector[0]).forEach(e=>{e.removeEventListener("click",t.clickListener)})}}}(window,document,window.Mango=window.Mango||{}),function(t,s){"use strict";s.MessengerTracking=s.MessengerTracking||{},s.MessengerTracking.Module=class{constructor(e){const i=this._widgets={};s.Helpers.forEach(e,function(e){var t=e["id"];Object.assign(i,{[t]:new s.MessengerTracking.Widget(e)})}),t.FT=this}start(){s.Helpers.forEach(this._widgets,function(e){e.start()})}}}(window,(document,window.Mango=window.Mango||{})),function(a,o,i){"use strict";const r={PRODUCT_ID:"productId",PRODUCT_NAME:"productName",CATEGORY_ID:"categoryId",CATEGORY_NAME:"categoryName",BRAND:"brand",PRICE:"price",AMOUNT:"amount"},n={TRANSACTION_ID:"transactionId",ITEMS:"items"};i.EcomAnalytics=i.EcomAnalytics||{},i.EcomAnalytics.Widget=class{constructor(e){this.clientId=e.id,this.settings=e.settings,this.clientEvents=[],this.allEvents=[],this.allowedProductVariables=[],this.allowedTransactionVariables=[],a.dataLayer||(a.dataLayer=[]),this.dataLayer=a.dataLayer,this.previousDataLayer=this.getPreviousDataLayer()}getCookie(e){e=o.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));if(e)return e[2]}getPreviousDataLayer(){var e=localStorage.getItem("savedDataLayer");return e?JSON.parse(e):[]}saveCurrentDataLayer(e){localStorage.setItem("savedDataLayer",JSON.stringify(e))}async start(){try{this.modifyDataLayerPushMethod(),await this.fetchSettings(this.clientId,this.settings),this.monitorAndCompareDataLayers()}catch(e){}}monitorAndCompareDataLayers(){a.addEventListener("dataLayer.push",e=>{var e=e.detail.currentDataLayer,t=e.filter(t=>!this.previousDataLayer.some(e=>JSON.stringify(t)===JSON.stringify(e)));t.length&&(this.processData(t),this.previousDataLayer=[...this.previousDataLayer,...t],this.saveCurrentDataLayer(e))})}processData(e){e.forEach(i=>{var e,t;i instanceof Object&&("callee"in i?Array.from(i).forEach(e=>{var t;"string"==typeof e&&this.clientEvents.includes(e)&&(e===(null==(t=this.allEvents.find(e=>"transaction"===e.service_event))?void 0:t.client_event)?this.sendTransactionToServer(this.extractTransactionData(i)):this.sendDataToServer(this.extractProductData(i),e))}):"string"==typeof(e=i.event||i.callee)&&this.clientEvents.includes(e)&&(e===(null==(t=this.allEvents.find(e=>"transaction"===e.service_event))?void 0:t.client_event)?this.sendTransactionToServer(this.extractTransactionData(i)):this.sendDataToServer(this.extractProductData(i),e)))})}extractProductData(e){var t={};return this.recursiveExtract(e,t,this.allowedProductVariables),t}extractTransactionData(e){var t={};return this.recursiveExtract(e,t,this.allowedTransactionVariables),t}recursiveExtract(t,i,s){Array.isArray(t)?t.forEach(e=>this.recursiveExtract(e,i,s)):t instanceof Object&&Object.keys(t).forEach(e=>{this.checkKeyIncluding(s,e)?i[e]=t[e]:t[e]instanceof Object&&this.recursiveExtract(t[e],i,s)})}checkKeyIncluding(e,t){return e.some(e=>t.includes(e))}sendDataToServer(e,t){t={event:this.getEventName(t),timestamp:(new Date).toISOString(),data:JSON.stringify(this.getVariablesData(e)),mgoSid:this.getCookie("mgo_sid")};this.jsonpRequest(i.Urls.addEvent(this.clientId),t).then(e=>{}).catch(e=>{})}sendTransactionToServer(e){e={data:JSON.stringify(this.getVariablesData(e)),mgoSid:this.getCookie("mgo_sid")};this.jsonpRequest(i.Urls.addTransaction(this.clientId),e).then(e=>{}).catch(e=>{})}getEventName(t){return this.allEvents.filter(e=>e.client_event===t)[0].service_event}getVariablesData(i){let s={},r={};return Object.keys(i).forEach(t=>{var e=this.allVariables.find(e=>e.client_variable===t);e?i[t]&&"object"==typeof i[t]?Array.isArray(i[t])?s[e.service_variable]=i[t].map(e=>this.getVariablesData(e)):s[e.service_variable]=this.getVariablesData(i[t]):s[e.service_variable]=i[t]:r[t]=i[t]}),0<Object.keys(r).length&&(s.meta=r),s}async fetchSettings(e,t){try{const i=[],s=[];Object.entries(t.eventTypes).forEach(e=>{i.push({service_event:e[0],client_event:e[1]})}),Object.entries(t.fieldTypes).forEach(e=>{s.push({service_variable:e[0],client_variable:e[1]})}),this.allEvents=i,this.allVariables=s,this.clientEvents=this.allEvents.map(e=>e.client_event),this.allowedProductVariables=this.allVariables.filter(e=>Object.values(r).includes(e.service_variable)).map(e=>e.client_variable),this.allowedTransactionVariables=this.allVariables.filter(e=>Object.values(n).includes(e.service_variable)).map(e=>e.client_variable)}catch(e){}}jsonpRequest(r,n){return new Promise((t,e)=>{const i="jsonpCallback_"+Math.random().toString(36).substr(2),s=(a[i]=e=>{o.body.removeChild(s),delete a[i],t(e)},n.callback=i,o.createElement("script"));s.src=r+"?"+new URLSearchParams(n),s.onerror=()=>{o.body.removeChild(s),delete a[i],e(new Error("JSONP request failed"))},o.body.appendChild(s)})}modifyDataLayerPushMethod(){const t=a.dataLayer.push.bind(this.dataLayer);this.dataLayer.push=function(e){t(e),a.dispatchEvent(new CustomEvent("dataLayer.push",{detail:{changes:e,currentDataLayer:this}}))}}}}(window,document,window.Mango=window.Mango||{}),function(s){"use strict";s.EcomAnalytics=s.EcomAnalytics||{},s.EcomAnalytics.Module=class{constructor(e){const i=this._widgets={};s.Helpers.forEach(e,function(e){var t=e["id"];Object.assign(i,{[t]:new s.EcomAnalytics.Widget(e)})})}start(){s.Helpers.forEach(this._widgets,function(e){e.start()})}}}((window,document,window.Mango=window.Mango||{})),function(s,r){"use strict";var n="debug info warn error".split(" ");r.Log={enabled:!0,level:"info"},n.forEach(function(i){r.Log[i]=function(){var e,t;e=i,t=arguments,r.Log.enabled&&s.console&&n.indexOf(e)>=n.indexOf(r.Log.level)&&s.console[e].apply(s.console,t)}})}(window,(document,window.Mango=window.Mango||{})),function(n){"use strict";n.Urls={track:function(){return this.url(n.ClientConfig.calltrackingHost,"track")},times(){return this.url(n.ClientConfig.calltrackingHost,"track","times")},module:function(e){return this.url("widgets",e+".js")},umaModule(e){return this.url(n.ClientConfig.umaHost,"js",e+".js")},mcwModule(e){return this.url(n.ClientConfig.multichannelStaticHost,"widgets",e+".js")},calltracking(e){return this.url(n.ClientConfig.calltrackingHost,"calltracking",e)},settings(e){return this.url(n.ClientConfig.calltrackingHost,e,"settings")},addEvent(e){return this.url(n.ClientConfig.calltrackingHost,e,"ecom","addEvent")},addTransaction(e){return this.url(n.ClientConfig.calltrackingHost,e,"ecom","addTransaction")},calltouch(e){return this.url(n.ClientConfig.calltrackingHost,"widgetparam",e,"ctsite")},emt(e){return this.url(n.ClientConfig.emtHost,"api","emailtracking",e)},formtracking(e){return this.url(n.ClientConfig.calltrackingHost,"formtracking",e)},messengers(e){return this.url(n.ClientConfig.calltrackingHost,"messengers",e)},url:function(){for(var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:n.host,t=n.schema?n.schema+":":"",i=arguments.length,s=new Array(1<i?i-1:0),r=1;r<i;r++)s[r-1]=arguments[r];return t+`//${e}/`+s.join("/")}}}((window,document,window.Mango=window.Mango||{})),function(e){"use strict";(window.Mango=window.Mango||{}).Helpers={makeId:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:20,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let s="";for(let e=0;e<t;e++)s+=i.charAt(Math.floor(Math.random()*i.length));return s},isPortraitOrientation:function(){return e.matchMedia("(orientation: portrait)").matches},isMobileViewMode:function(){return e.matchMedia("only screen and (max-width: 414px)").matches},wait:function(s,r){return new Promise(t=>{const i=()=>{var e=r();e?t(e):(s-=100)<0?t(null):setTimeout(i,100)};setTimeout(i,100)})},debounce:function(s,r,n){let a;return function(){const e=this,t=arguments;var i=n&&!a;clearTimeout(a),a=setTimeout(()=>{a=null,n||s.apply(e,t)},r),i&&s.apply(e,t)}},safeExec:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:()=>{};try{return e()}catch(e){return t()}},isEmpty:function(e){return[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length},isObject:function(e){return e instanceof Object},isFunction:function(e){return"function"==typeof e},forEach:function(e,n){return Array.isArray(e)?e.forEach(n):e instanceof Object?Object.entries(e).forEach(function(e){for(var[e,t]=e,i=arguments.length,s=new Array(1<i?i-1:0),r=1;r<i;r++)s[r-1]=arguments[r];return n(t,e,...s)}):e},isNumber:function(e){return"number"==typeof e},bind:function(e,t){for(var i=arguments.length,s=new Array(2<i?i-2:0),r=2;r<i;r++)s[r-2]=arguments[r];return e.bind(t,...s)},extend:function(t){var i=arguments.length<=1?0:arguments.length-1;if(!(i<1||null==t))for(let e=0;e<i;e++){var s=e+1<1||arguments.length<=e+1?void 0:arguments[e+1];for(const r in s)t[r]=s[r]}return t},pick:function(i,e){return e.reduce((e,t)=>(i&&i.hasOwnProperty(t)&&(e[t]=i[t]),e),{})},deepEqual:function(e,t){if(e!==t){if(null===e||null===t||"object"!=typeof e||"object"!=typeof t)return!1;var i,s=Object.keys(e),r=Object.keys(t);if(s.length!==r.length)return!1;for(i of s)if(!r.includes(i)||!this.deepEqual(e[i],t[i]))return!1}return!0}}}(window,document),function(n,o){"use strict";var c={calltracking:{namespace:"CallTracking",filename:"mango.calltracking"},multichannel:{namespace:"MultiChannel",from:"mcwModule",filename:"mango.multichannel",dependsOn:[]},uma:{namespace:"UMA",from:"umaModule",filename:"mango-uma",dependsOn:["calltracking","popup"],passParams:["id"]},popup:{namespace:"Popup",from:"umaModule",filename:"mango-popup",dependsOn:[]},emt:{namespace:"EMT",dependsOn:["calltracking"],passParams:["id"]},formtracking:{namespace:"FormTracking",dependsOn:["calltracking"],passParams:["id"]},messengertracking:{namespace:"MessengerTracking",dependsOn:["calltracking"],passParams:["id"]},ecomanalytics:{namespace:"EcomAnalytics",dependsOn:["calltracking"],passParams:["id"]}},l={};o.Modules=class extends o.EventEmitter{constructor(){super(),this._loading=!1,this._modules={}}add(e,t){var i=c[e];return i?(this._modules[e]?this._modules[e].params.push(t):this._modules[e]=o.Helpers.extend({},i,{name:e,params:[t],instance:null}),i):null}start(e){e?this._modules[e]&&this._loadModule(this._modules[e]):o.Helpers.isEmpty(this._modules)||o.Helpers.forEach(this._modules,this._loadModule.bind(this))}getModule(e){return this._modules[e]?this._modules[e].instance:null}getFormsInfo(e){const t=this.getModule("formtracking")._widgets[e]._forms;Object.keys(t).forEach(e=>{t[e].getFormInfo()})}_loadModule(a){if(2===l[a.name])return this._initializeModule(a);if(3<=l[a.name])return this._startModule(a);var e=!0;if(((c[a.name]||{}).dependsOn||[]).forEach(t=>{if(e=e&&4===l[t],!l[t]){var i=a.params||[];for(let e=0;e<i.length;e++){var s=i[e],r={},n=a.passParams||[];for(let e=0;e<n.length;e++)r[n[e]]=s[n[e]];this.add(t,r),this.start(t)}}}),e){if(o[a.namespace])return l[a.name]=2,this._initializeModule(a);{l[a.name]=1;var i="mango-"+a.name+"-js";let t=n.getElementById(i);if(!t){t=n.createElement("script");var s=n.getElementsByTagName("script")[0];t.charset="utf-8",t.async=!0,t.id=i;let e="module";"function"==typeof o.Urls[a.from]&&(e=a.from),t.src=o.Urls[e](a.filename),s.parentNode.insertBefore(t,s)}const r=()=>{t.removeEventListener("load",r),l[a.name]=2,this._initializeModule(a)};t.addEventListener("load",r)}}}_initializeModule(e){var t;2===l[e.name]&&(t=o[e.namespace]?o[e.namespace].Module:null)&&(this._modules[e.name].instance=new t(e.params),l[e.name]=3,this._startModule(e))}_startModule(e){this._modules[e.name].instance.start(),l[e.name]=4,this._tryToStartDependingModules(e.name);var t=Object.keys(l);for(let e=0;e<t.length;e++)if(4!==l[t[e]])return;this.emit("started")}_tryToStartDependingModules(t){for(var e=Object.keys(c),i=0;i<e.length;i++){var s=e[i],r=this._modules[s];r&&((c[s]||{}).dependsOn||[]).find(e=>e===t)&&this._loadModule(r)}}}}((window,document),window.Mango=window.Mango||{}),function(r){"use strict";const t="productId",n=["calltracking","multichannel","uma","emt"];r.Starter=class extends r.EventEmitter{constructor(){super(),this.init()}init(){r.session=new r.Common.Session,r.httpClient=new r.Common.HttpClient,r.http=r.httpClient,r.modules=new r.Modules,r.modules.once("started",()=>{this._onModulesReady()})}load(t){for(let e=0;e<n.length;e++){var i=n[e],s=t[i];s&&r.modules.add(i,s)}}_checkProductId(e){r.Helpers.isNumber(e[t])&&(r.Helpers.isNumber(r.productId)&&r.productId!==e[t]?r.Log.warn('[mango.js] Cannot set two different parameters "productId".'):r.productId=e[t])}start(){this._validate()&&r.modules.start()}_validate(){return!0}_onModulesReady(){r.isReady=!0,this.emit("started")}}}((window,document,window.Mango=window.Mango||{})),function(a){"use strict";a.Api=class{constructor(){}exec(e,t){var[e,i]=e.split(":");if("string"==typeof t&&"_"!==t[0]){e=a.modules.getModule(e);if(e&&"function"==typeof e.exec){for(var s=arguments.length,r=new Array(2<s?s-2:0),n=2;n<s;n++)r[n-2]=arguments[n];return e.exec(+i,t,...r)}}return!1}postForm(){this.exec.call(this,"calltracking","postForm",...arguments)}getNumber(){this.exec.call(this,"calltracking","getNumber",...arguments)}getNumberByRegion(){this.exec.call(this,"calltracking","getNumberByRegion",...arguments)}getNumberWithRedirect(){this.exec.call(this,"calltracking","getNumberWithRedirect",...arguments)}getExistsNumbers(){this.exec.call(this,"calltracking","getExistsNumbers",...arguments)}}}((window,document,window.Mango=window.Mango||{})),function(a,o,c){"use strict";function l(e,t){c.Helpers.forEach(e,function(e){c.Helpers.forEach(e,function(e){c.Helpers.isFunction(e)&&e.call(a,t)})})}var e;e=function(){function e(){c.api.isReady?l([arguments]):r.push(arguments)}c.Utils.Performance.mark(c.Utils.PF_METRICS.MARKS.MAIN_START);var t,i=a.MangoObject,s=a[i],r=s.q||[],n=(c.startTime=s.t,c.host=(s=s.u,(t=o.createElement("a")).href=s,t.host),c.starter=new c.Starter,c.api=new c.Api,e.__proto__=c.api,a[i]=e,setInterval(()=>{var t;c.Helpers.isEmpty(r)||(clearInterval(n),t=c.starter,c.Helpers.forEach(r,function(e){c.Helpers.forEach(e,function(e){c.Helpers.isObject(e)&&t.load(e)})}),c.starter.start())},50));c.starter.once("started",()=>{c.api.isReady=!0,l(r,e)})},"loading"!==o.readyState?e():o.addEventListener("DOMContentLoaded",e)}(window,document,window.Mango=window.Mango||{});