/*! jQuery v2.2.1 | (c) jQuery Foundation | jquery.org/license */ !function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){var n=[],i=e.document,r=n.slice,a=n.concat,o=n.push,s=n.indexOf,l={},c=l.toString,u=l.hasOwnProperty,d={},p="2.2.1",h=function(e,t){return new h.fn.init(e,t)},f=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,m=/^-ms-/,v=/-([\da-z])/gi,g=function(e,t){return t.toUpperCase()};function y(e){var t=!!e&&"length"in e&&e.length,n=h.type(e);return"function"!==n&&!h.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}h.fn=h.prototype={jquery:p,constructor:h,selector:"",length:0,toArray:function(){return r.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:r.call(this)},pushStack:function(e){var t=h.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e){return h.each(this,e)},map:function(e){return this.pushStack(h.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:o,sort:n.sort,splice:n.splice},h.extend=h.fn.extend=function(){var e,t,n,i,r,a,o=arguments[0]||{},s=1,l=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[s]||{},s++),"object"==typeof o||h.isFunction(o)||(o={}),s===l&&(o=this,s--);l>s;s++)if(null!=(e=arguments[s]))for(t in e)n=o[t],o!==(i=e[t])&&(c&&i&&(h.isPlainObject(i)||(r=h.isArray(i)))?(r?(r=!1,a=n&&h.isArray(n)?n:[]):a=n&&h.isPlainObject(n)?n:{},o[t]=h.extend(c,a,i)):void 0!==i&&(o[t]=i));return o},h.extend({expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===h.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=e&&e.toString();return!h.isArray(e)&&t-parseFloat(t)+1>=0},isPlainObject:function(e){return"object"===h.type(e)&&!e.nodeType&&!h.isWindow(e)&&!(e.constructor&&!u.call(e.constructor.prototype,"isPrototypeOf"))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;(e=h.trim(e))&&(1===e.indexOf("use strict")?((t=i.createElement("script")).text=e,i.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(m,"ms-").replace(v,g)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,i=0;if(y(e))for(n=e.length;n>i&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},trim:function(e){return null==e?"":(e+"").replace(f,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(y(Object(e))?h.merge(n,"string"==typeof e?[e]:e):o.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:s.call(t,e,n)},merge:function(e,t){for(var n=+t.length,i=0,r=e.length;n>i;i++)e[r++]=t[i];return e.length=r,e},grep:function(e,t,n){for(var i=[],r=0,a=e.length,o=!n;a>r;r++)!t(e[r],r)!==o&&i.push(e[r]);return i},map:function(e,t,n){var i,r,o=0,s=[];if(y(e))for(i=e.length;i>o;o++)null!=(r=t(e[o],o,n))&&s.push(r);else for(o in e)null!=(r=t(e[o],o,n))&&s.push(r);return a.apply([],s)},guid:1,proxy:function(e,t){var n,i,a;return"string"==typeof t&&(n=e[t],t=e,e=n),h.isFunction(e)?(i=r.call(arguments,2),(a=function(){return e.apply(t||this,i.concat(r.call(arguments)))}).guid=e.guid=e.guid||h.guid++,a):void 0},now:Date.now,support:d}),"function"==typeof Symbol&&(h.fn[Symbol.iterator]=n[Symbol.iterator]),h.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){l["[object "+t+"]"]=t.toLowerCase()}));var b=function(e){var t,n,i,r,a,o,s,l,c,u,d,p,h,f,m,v,g,y,b,w="sizzle"+1*new Date,$=e.document,C=0,x=0,S=ae(),k=ae(),T=ae(),E=function(e,t){return e===t&&(d=!0),0},D=1<<31,A={}.hasOwnProperty,P=[],M=P.pop,_=P.push,L=P.push,O=P.slice,I=function(e,t){for(var n=0,i=e.length;i>n;n++)if(e[n]===t)return n;return-1},N="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",j="\\["+F+"*("+R+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+F+"*\\]",U=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+j+")*)|.*)\\)|)",z=new RegExp(F+"+","g"),q=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),B=new RegExp("^"+F+"*,"+F+"*"),H=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),V=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),W=new RegExp(U),X=new RegExp("^"+R+"$"),G={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+U),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+N+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,ee=/'|\\/g,te=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),ne=function(e,t,n){var i="0x"+t-65536;return i!=i||n?t:0>i?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},ie=function(){p()};try{L.apply(P=O.call($.childNodes),$.childNodes),P[$.childNodes.length].nodeType}catch(e){L={apply:P.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function re(e,t,i,r){var a,s,c,u,d,f,g,y,C=t&&t.ownerDocument,x=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==x&&9!==x&&11!==x)return i;if(!r&&((t?t.ownerDocument||t:$)!==h&&p(t),t=t||h,m)){if(11!==x&&(f=Z.exec(e)))if(a=f[1]){if(9===x){if(!(c=t.getElementById(a)))return i;if(c.id===a)return i.push(c),i}else if(C&&(c=C.getElementById(a))&&b(t,c)&&c.id===a)return i.push(c),i}else{if(f[2])return L.apply(i,t.getElementsByTagName(e)),i;if((a=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(i,t.getElementsByClassName(a)),i}if(n.qsa&&!T[e+" "]&&(!v||!v.test(e))){if(1!==x)C=t,y=e;else if("object"!==t.nodeName.toLowerCase()){for((u=t.getAttribute("id"))?u=u.replace(ee,"\\$&"):t.setAttribute("id",u=w),s=(g=o(e)).length,d=X.test(u)?"#"+u:"[id='"+u+"']";s--;)g[s]=d+" "+me(g[s]);y=g.join(","),C=Q.test(e)&&he(t.parentNode)||t}if(y)try{return L.apply(i,C.querySelectorAll(y)),i}catch(e){}finally{u===w&&t.removeAttribute("id")}}}return l(e.replace(q,"$1"),t,i,r)}function ae(){var e=[];return function t(n,r){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function oe(e){return e[w]=!0,e}function se(e){var t=h.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){for(var n=e.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=t}function ce(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ue(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function de(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pe(e){return oe((function(t){return t=+t,oe((function(n,i){for(var r,a=e([],n.length,t),o=a.length;o--;)n[r=a[o]]&&(n[r]=!(i[r]=n[r]))}))}))}function he(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=re.support={},a=re.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=re.setDocument=function(e){var t,r,o=e?e.ownerDocument||e:$;return o!==h&&9===o.nodeType&&o.documentElement?(f=(h=o).documentElement,m=!a(h),(r=h.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",ie,!1):r.attachEvent&&r.attachEvent("onunload",ie)),n.attributes=se((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=se((function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=J.test(h.getElementsByClassName),n.getById=se((function(e){return f.appendChild(e).id=w,!h.getElementsByName||!h.getElementsByName(w).length})),n.getById?(i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}},i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[r++];)1===n.nodeType&&i.push(n);return i}return a},i.find.CLASS=n.getElementsByClassName&&function(e,t){return void 0!==t.getElementsByClassName&&m?t.getElementsByClassName(e):void 0},g=[],v=[],(n.qsa=J.test(h.querySelectorAll))&&(se((function(e){f.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+F+"*(?:value|"+N+")"),e.querySelectorAll("[id~="+w+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||v.push(".#.+[+~]")})),se((function(e){var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+F+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")}))),(n.matchesSelector=J.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&se((function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),g.push("!=",U)})),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),t=J.test(f.compareDocumentPosition),b=t||J.test(f.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},E=t?function(e,t){if(e===t)return d=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e===h||e.ownerDocument===$&&b($,e)?-1:t===h||t.ownerDocument===$&&b($,t)?1:u?I(u,e)-I(u,t):0:4&i?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,i=0,r=e.parentNode,a=t.parentNode,o=[e],s=[t];if(!r||!a)return e===h?-1:t===h?1:r?-1:a?1:u?I(u,e)-I(u,t):0;if(r===a)return ce(e,t);for(n=e;n=n.parentNode;)o.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;o[i]===s[i];)i++;return i?ce(o[i],s[i]):o[i]===$?-1:s[i]===$?1:0},h):h},re.matches=function(e,t){return re(e,null,null,t)},re.matchesSelector=function(e,t){if((e.ownerDocument||e)!==h&&p(e),t=t.replace(V,"='$1']"),n.matchesSelector&&m&&!T[t+" "]&&(!g||!g.test(t))&&(!v||!v.test(t)))try{var i=y.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){}return re(t,h,null,[e]).length>0},re.contains=function(e,t){return(e.ownerDocument||e)!==h&&p(e),b(e,t)},re.attr=function(e,t){(e.ownerDocument||e)!==h&&p(e);var r=i.attrHandle[t.toLowerCase()],a=r&&A.call(i.attrHandle,t.toLowerCase())?r(e,t,!m):void 0;return void 0!==a?a:n.attributes||!m?e.getAttribute(t):(a=e.getAttributeNode(t))&&a.specified?a.value:null},re.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},re.uniqueSort=function(e){var t,i=[],r=0,a=0;if(d=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(E),d){for(;t=e[a++];)t===e[a]&&(r=i.push(a));for(;r--;)e.splice(i[r],1)}return u=null,e},r=re.getText=function(e){var t,n="",i=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=r(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[i++];)n+=r(t);return n},(i=re.selectors={cacheLength:50,createPseudo:oe,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||re.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&re.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&W.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=S[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&S(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(i){var r=re.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(z," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var a="nth"!==e.slice(0,3),o="last"!==e.slice(-4),s="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,p,h,f,m=a!==o?"nextSibling":"previousSibling",v=t.parentNode,g=s&&t.nodeName.toLowerCase(),y=!l&&!s,b=!1;if(v){if(a){for(;m;){for(p=t;p=p[m];)if(s?p.nodeName.toLowerCase()===g:1===p.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[o?v.firstChild:v.lastChild],o&&y){for(b=(h=(c=(u=(d=(p=v)[w]||(p[w]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===C&&c[1])&&c[2],p=h&&v.childNodes[h];p=++h&&p&&p[m]||(b=h=0)||f.pop();)if(1===p.nodeType&&++b&&p===t){u[e]=[C,h,b];break}}else if(y&&(b=h=(c=(u=(d=(p=t)[w]||(p[w]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===C&&c[1]),!1===b)for(;(p=++h&&p&&p[m]||(b=h=0)||f.pop())&&((s?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++b||(y&&((u=(d=p[w]||(p[w]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[C,b]),p!==t)););return(b-=r)===i||b%i==0&&b/i>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||re.error("unsupported pseudo: "+e);return r[w]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?oe((function(e,n){for(var i,a=r(e,t),o=a.length;o--;)e[i=I(e,a[o])]=!(n[i]=a[o])})):function(e){return r(e,0,n)}):r}},pseudos:{not:oe((function(e){var t=[],n=[],i=s(e.replace(q,"$1"));return i[w]?oe((function(e,t,n,r){for(var a,o=i(e,null,r,[]),s=e.length;s--;)(a=o[s])&&(e[s]=!(t[s]=a))})):function(e,r,a){return t[0]=e,i(t,null,a,n),t[0]=null,!n.pop()}})),has:oe((function(e){return function(t){return re(e,t).length>0}})),contains:oe((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||t.innerText||r(t)).indexOf(e)>-1}})),lang:oe((function(e){return X.test(e||"")||re.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:pe((function(){return[0]})),last:pe((function(e,t){return[t-1]})),eq:pe((function(e,t,n){return[0>n?n+t:n]})),even:pe((function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e})),odd:pe((function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e})),lt:pe((function(e,t,n){for(var i=0>n?n+t:n;--i>=0;)e.push(i);return e})),gt:pe((function(e,t,n){for(var i=0>n?n+t:n;++it;t++)i+=e[t].value;return i}function ve(e,t,n){var i=t.dir,r=n&&"parentNode"===i,a=x++;return t.first?function(t,n,a){for(;t=t[i];)if(1===t.nodeType||r)return e(t,n,a)}:function(t,n,o){var s,l,c,u=[C,a];if(o){for(;t=t[i];)if((1===t.nodeType||r)&&e(t,n,o))return!0}else for(;t=t[i];)if(1===t.nodeType||r){if((s=(l=(c=t[w]||(t[w]={}))[t.uniqueID]||(c[t.uniqueID]={}))[i])&&s[0]===C&&s[1]===a)return u[2]=s[2];if(l[i]=u,u[2]=e(t,n,o))return!0}}}function ge(e){return e.length>1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function ye(e,t,n,i,r){for(var a,o=[],s=0,l=e.length,c=null!=t;l>s;s++)(a=e[s])&&(!n||n(a,i,r))&&(o.push(a),c&&t.push(s));return o}function be(e,t,n,i,r,a){return i&&!i[w]&&(i=be(i)),r&&!r[w]&&(r=be(r,a)),oe((function(a,o,s,l){var c,u,d,p=[],h=[],f=o.length,m=a||function(e,t,n){for(var i=0,r=t.length;r>i;i++)re(e,t[i],n);return n}(t||"*",s.nodeType?[s]:s,[]),v=!e||!a&&t?m:ye(m,p,e,s,l),g=n?r||(a?e:f||i)?[]:o:v;if(n&&n(v,g,s,l),i)for(c=ye(g,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(g[h[u]]=!(v[h[u]]=d));if(a){if(r||e){if(r){for(c=[],u=g.length;u--;)(d=g[u])&&c.push(v[u]=d);r(null,g=[],c,l)}for(u=g.length;u--;)(d=g[u])&&(c=r?I(a,d):p[u])>-1&&(a[c]=!(o[c]=d))}}else g=ye(g===o?g.splice(f,g.length):g),r?r(null,o,g,l):L.apply(o,g)}))}function we(e){for(var t,n,r,a=e.length,o=i.relative[e[0].type],s=o||i.relative[" "],l=o?1:0,u=ve((function(e){return e===t}),s,!0),d=ve((function(e){return I(t,e)>-1}),s,!0),p=[function(e,n,i){var r=!o&&(i||n!==c)||((t=n).nodeType?u(e,n,i):d(e,n,i));return t=null,r}];a>l;l++)if(n=i.relative[e[l].type])p=[ve(ge(p),n)];else{if((n=i.filter[e[l].type].apply(null,e[l].matches))[w]){for(r=++l;a>r&&!i.relative[e[r].type];r++);return be(l>1&&ge(p),l>1&&me(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(q,"$1"),n,r>l&&we(e.slice(l,r)),a>r&&we(e=e.slice(r)),a>r&&me(e))}p.push(n)}return ge(p)}function $e(e,t){var n=t.length>0,r=e.length>0,a=function(a,o,s,l,u){var d,f,v,g=0,y="0",b=a&&[],w=[],$=c,x=a||r&&i.find.TAG("*",u),S=C+=null==$?1:Math.random()||.1,k=x.length;for(u&&(c=o===h||o||u);y!==k&&null!=(d=x[y]);y++){if(r&&d){for(f=0,o||d.ownerDocument===h||(p(d),s=!m);v=e[f++];)if(v(d,o||h,s)){l.push(d);break}u&&(C=S)}n&&((d=!v&&d)&&g--,a&&b.push(d))}if(g+=y,n&&y!==g){for(f=0;v=t[f++];)v(b,w,o,s);if(a){if(g>0)for(;y--;)b[y]||w[y]||(w[y]=M.call(l));w=ye(w)}L.apply(l,w),u&&!a&&w.length>0&&g+t.length>1&&re.uniqueSort(l)}return u&&(C=S,c=$),b};return n?oe(a):a}return fe.prototype=i.filters=i.pseudos,i.setFilters=new fe,o=re.tokenize=function(e,t){var n,r,a,o,s,l,c,u=k[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=i.preFilter;s;){for(o in(!n||(r=B.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(a=[])),n=!1,(r=H.exec(s))&&(n=r.shift(),a.push({value:n,type:r[0].replace(q," ")}),s=s.slice(n.length)),i.filter)!(r=G[o].exec(s))||c[o]&&!(r=c[o](r))||(n=r.shift(),a.push({value:n,type:o,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?re.error(e):k(e,l).slice(0)},s=re.compile=function(e,t){var n,i=[],r=[],a=T[e+" "];if(!a){for(t||(t=o(e)),n=t.length;n--;)(a=we(t[n]))[w]?i.push(a):r.push(a);(a=T(e,$e(r,i))).selector=e}return a},l=re.select=function(e,t,r,a){var l,c,u,d,p,h="function"==typeof e&&e,f=!a&&o(e=h.selector||e);if(r=r||[],1===f.length){if((c=f[0]=f[0].slice(0)).length>2&&"ID"===(u=c[0]).type&&n.getById&&9===t.nodeType&&m&&i.relative[c[1].type]){if(!(t=(i.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return r;h&&(t=t.parentNode),e=e.slice(c.shift().value.length)}for(l=G.needsContext.test(e)?0:c.length;l--&&(u=c[l],!i.relative[d=u.type]);)if((p=i.find[d])&&(a=p(u.matches[0].replace(te,ne),Q.test(c[0].type)&&he(t.parentNode)||t))){if(c.splice(l,1),!(e=a.length&&me(c)))return L.apply(r,a),r;break}}return(h||s(e,f))(a,t,!m,r,!t||Q.test(e)&&he(t.parentNode)||t),r},n.sortStable=w.split("").sort(E).join("")===w,n.detectDuplicates=!!d,p(),n.sortDetached=se((function(e){return 1&e.compareDocumentPosition(h.createElement("div"))})),se((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||le("type|href|height|width",(function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&se((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||le("value",(function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue})),se((function(e){return null==e.getAttribute("disabled")}))||le(N,(function(e,t,n){var i;return n?void 0:!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null})),re}(e);h.find=b,h.expr=b.selectors,h.expr[":"]=h.expr.pseudos,h.uniqueSort=h.unique=b.uniqueSort,h.text=b.getText,h.isXMLDoc=b.isXML,h.contains=b.contains;var w=function(e,t,n){for(var i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&h(e).is(n))break;i.push(e)}return i},$=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},C=h.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,S=/^.[^:#\[\.,]*$/;function k(e,t,n){if(h.isFunction(t))return h.grep(e,(function(e,i){return!!t.call(e,i,e)!==n}));if(t.nodeType)return h.grep(e,(function(e){return e===t!==n}));if("string"==typeof t){if(S.test(t))return h.filter(t,e,n);t=h.filter(t,e)}return h.grep(e,(function(e){return s.call(t,e)>-1!==n}))}h.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?h.find.matchesSelector(i,e)?[i]:[]:h.find.matches(e,h.grep(t,(function(e){return 1===e.nodeType})))},h.fn.extend({find:function(e){var t,n=this.length,i=[],r=this;if("string"!=typeof e)return this.pushStack(h(e).filter((function(){for(t=0;n>t;t++)if(h.contains(r[t],this))return!0})));for(t=0;n>t;t++)h.find(e,r[t],i);return(i=this.pushStack(n>1?h.unique(i):i)).selector=this.selector?this.selector+" "+e:e,i},filter:function(e){return this.pushStack(k(this,e||[],!1))},not:function(e){return this.pushStack(k(this,e||[],!0))},is:function(e){return!!k(this,"string"==typeof e&&C.test(e)?h(e):e||[],!1).length}});var T,E=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(h.fn.init=function(e,t,n){var r,a;if(!e)return this;if(n=n||T,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:E.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof h?t[0]:t,h.merge(this,h.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:i,!0)),x.test(r[1])&&h.isPlainObject(t))for(r in t)h.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(a=i.getElementById(r[2]))&&a.parentNode&&(this.length=1,this[0]=a),this.context=i,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):h.isFunction(e)?void 0!==n.ready?n.ready(e):e(h):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),h.makeArray(e,this))}).prototype=h.fn,T=h(i);var D=/^(?:parents|prev(?:Until|All))/,A={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}h.fn.extend({has:function(e){var t=h(e,this),n=t.length;return this.filter((function(){for(var e=0;n>e;e++)if(h.contains(this,t[e]))return!0}))},closest:function(e,t){for(var n,i=0,r=this.length,a=[],o=C.test(e)||"string"!=typeof e?h(e,t||this.context):0;r>i;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&h.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?h.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?s.call(h(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(h.uniqueSort(h.merge(this.get(),h(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),h.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return w(e,"parentNode")},parentsUntil:function(e,t,n){return w(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return w(e,"nextSibling")},prevAll:function(e){return w(e,"previousSibling")},nextUntil:function(e,t,n){return w(e,"nextSibling",n)},prevUntil:function(e,t,n){return w(e,"previousSibling",n)},siblings:function(e){return $((e.parentNode||{}).firstChild,e)},children:function(e){return $(e.firstChild)},contents:function(e){return e.contentDocument||h.merge([],e.childNodes)}},(function(e,t){h.fn[e]=function(n,i){var r=h.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=h.filter(i,r)),this.length>1&&(A[e]||h.uniqueSort(r),D.test(e)&&r.reverse()),this.pushStack(r)}}));var M,_=/\S+/g;function L(){i.removeEventListener("DOMContentLoaded",L),e.removeEventListener("load",L),h.ready()}h.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return h.each(e.match(_)||[],(function(e,n){t[n]=!0})),t}(e):h.extend({},e);var t,n,i,r,a=[],o=[],s=-1,l=function(){for(r=e.once,i=t=!0;o.length;s=-1)for(n=o.shift();++s-1;)a.splice(n,1),s>=n&&s--})),this},has:function(e){return e?h.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return r=o=[],a=n="",this},disabled:function(){return!a},lock:function(){return r=o=[],n||(a=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],o.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},h.extend({Deferred:function(e){var t=[["resolve","done",h.Callbacks("once memory"),"resolved"],["reject","fail",h.Callbacks("once memory"),"rejected"],["notify","progress",h.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var e=arguments;return h.Deferred((function(n){h.each(t,(function(t,a){var o=h.isFunction(e[t])&&e[t];r[a[1]]((function(){var e=o&&o.apply(this,arguments);e&&h.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[a[0]+"With"](this===i?n.promise():this,o?[e]:arguments)}))})),e=null})).promise()},promise:function(e){return null!=e?h.extend(e,i):i}},r={};return i.pipe=i.then,h.each(t,(function(e,a){var o=a[2],s=a[3];i[a[1]]=o.add,s&&o.add((function(){n=s}),t[1^e][2].disable,t[2][2].lock),r[a[0]]=function(){return r[a[0]+"With"](this===r?i:this,arguments),this},r[a[0]+"With"]=o.fireWith})),i.promise(r),e&&e.call(r,r),r},when:function(e){var t,n,i,a=0,o=r.call(arguments),s=o.length,l=1!==s||e&&h.isFunction(e.promise)?s:0,c=1===l?e:h.Deferred(),u=function(e,n,i){return function(a){n[e]=this,i[e]=arguments.length>1?r.call(arguments):a,i===t?c.notifyWith(n,i):--l||c.resolveWith(n,i)}};if(s>1)for(t=new Array(s),n=new Array(s),i=new Array(s);s>a;a++)o[a]&&h.isFunction(o[a].promise)?o[a].promise().progress(u(a,n,t)).done(u(a,i,o)).fail(c.reject):--l;return l||c.resolveWith(i,o),c.promise()}}),h.fn.ready=function(e){return h.ready.promise().done(e),this},h.extend({isReady:!1,readyWait:1,holdReady:function(e){e?h.readyWait++:h.ready(!0)},ready:function(e){(!0===e?--h.readyWait:h.isReady)||(h.isReady=!0,!0!==e&&--h.readyWait>0||(M.resolveWith(i,[h]),h.fn.triggerHandler&&(h(i).triggerHandler("ready"),h(i).off("ready"))))}}),h.ready.promise=function(t){return M||(M=h.Deferred(),"complete"===i.readyState||"loading"!==i.readyState&&!i.documentElement.doScroll?e.setTimeout(h.ready):(i.addEventListener("DOMContentLoaded",L),e.addEventListener("load",L))),M.promise(t)},h.ready.promise();var O=function(e,t,n,i,r,a,o){var s=0,l=e.length,c=null==n;if("object"===h.type(n))for(s in r=!0,n)O(e,t,s,n[s],!0,a,o);else if(void 0!==i&&(r=!0,h.isFunction(i)||(o=!0),c&&(o?(t.call(e,i),t=null):(c=t,t=function(e,t,n){return c.call(h(e),n)})),t))for(;l>s;s++)t(e[s],n,o?i:i.call(e[s],s,t(e[s],n)));return r?e:c?t.call(e):l?t(e[0],n):a},I=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function N(){this.expando=h.expando+N.uid++}N.uid=1,N.prototype={register:function(e,t){var n=t||{};return e.nodeType?e[this.expando]=n:Object.defineProperty(e,this.expando,{value:n,writable:!0,configurable:!0}),e[this.expando]},cache:function(e){if(!I(e))return{};var t=e[this.expando];return t||(t={},I(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var i,r=this.cache(e);if("string"==typeof t)r[t]=n;else for(i in t)r[i]=t[i];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][t]},access:function(e,t,n){var i;return void 0===t||t&&"string"==typeof t&&void 0===n?void 0!==(i=this.get(e,t))?i:this.get(e,h.camelCase(t)):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,i,r,a=e[this.expando];if(void 0!==a){if(void 0===t)this.register(e);else{h.isArray(t)?i=t.concat(t.map(h.camelCase)):(r=h.camelCase(t),t in a?i=[t,r]:i=(i=r)in a?[i]:i.match(_)||[]),n=i.length;for(;n--;)delete a[i[n]]}(void 0===t||h.isEmptyObject(a))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!h.isEmptyObject(t)}};var F=new N,R=new N,j=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,U=/[A-Z]/g;function z(e,t,n){var i;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(U,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:j.test(n)?h.parseJSON(n):n)}catch(e){}R.set(e,t,n)}else n=void 0;return n}h.extend({hasData:function(e){return R.hasData(e)||F.hasData(e)},data:function(e,t,n){return R.access(e,t,n)},removeData:function(e,t){R.remove(e,t)},_data:function(e,t,n){return F.access(e,t,n)},_removeData:function(e,t){F.remove(e,t)}}),h.fn.extend({data:function(e,t){var n,i,r,a=this[0],o=a&&a.attributes;if(void 0===e){if(this.length&&(r=R.get(a),1===a.nodeType&&!F.get(a,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&(0===(i=o[n].name).indexOf("data-")&&(i=h.camelCase(i.slice(5)),z(a,i,r[i])));F.set(a,"hasDataAttrs",!0)}return r}return"object"==typeof e?this.each((function(){R.set(this,e)})):O(this,(function(t){var n,i;if(a&&void 0===t){if(void 0!==(n=R.get(a,e)||R.get(a,e.replace(U,"-$&").toLowerCase())))return n;if(i=h.camelCase(e),void 0!==(n=R.get(a,i)))return n;if(void 0!==(n=z(a,i,void 0)))return n}else i=h.camelCase(e),this.each((function(){var n=R.get(this,i);R.set(this,i,t),e.indexOf("-")>-1&&void 0!==n&&R.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){R.remove(this,e)}))}}),h.extend({queue:function(e,t,n){var i;return e?(t=(t||"fx")+"queue",i=F.get(e,t),n&&(!i||h.isArray(n)?i=F.access(e,t,h.makeArray(n)):i.push(n)),i||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=h.queue(e,t),i=n.length,r=n.shift(),a=h._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete a.stop,r.call(e,(function(){h.dequeue(e,t)}),a)),!i&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return F.get(e,n)||F.access(e,n,{empty:h.Callbacks("once memory").add((function(){F.remove(e,[t+"queue",n])}))})}}),h.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length",""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function J(e,t){var n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&h.nodeName(e,t)?h.merge([e],n):n}function Z(e,t){for(var n=0,i=e.length;i>n;n++)F.set(e[n],"globalEval",!t||F.get(t[n],"globalEval"))}K.optgroup=K.option,K.tbody=K.tfoot=K.colgroup=K.caption=K.thead,K.th=K.td;var Q=/<|&#?\w+;/;function ee(e,t,n,i,r){for(var a,o,s,l,c,u,d=t.createDocumentFragment(),p=[],f=0,m=e.length;m>f;f++)if((a=e[f])||0===a)if("object"===h.type(a))h.merge(p,a.nodeType?[a]:a);else if(Q.test(a)){for(o=o||d.appendChild(t.createElement("div")),s=(G.exec(a)||["",""])[1].toLowerCase(),l=K[s]||K._default,o.innerHTML=l[1]+h.htmlPrefilter(a)+l[2],u=l[0];u--;)o=o.lastChild;h.merge(p,o.childNodes),(o=d.firstChild).textContent=""}else p.push(t.createTextNode(a));for(d.textContent="",f=0;a=p[f++];)if(i&&h.inArray(a,i)>-1)r&&r.push(a);else if(c=h.contains(a.ownerDocument,a),o=J(d.appendChild(a),"script"),c&&Z(o),n)for(u=0;a=o[u++];)Y.test(a.type||"")&&n.push(a);return d}!function(){var e=i.createDocumentFragment().appendChild(i.createElement("div")),t=i.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),d.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",d.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var te=/^key/,ne=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ie=/^([^.]*)(?:\.(.+)|)/;function re(){return!0}function ae(){return!1}function oe(){try{return i.activeElement}catch(e){}}function se(e,t,n,i,r,a){var o,s;if("object"==typeof t){for(s in"string"!=typeof n&&(i=i||n,n=void 0),t)se(e,s,n,i,t[s],a);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=ae;else if(!r)return e;return 1===a&&(o=r,(r=function(e){return h().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=h.guid++)),e.each((function(){h.event.add(this,t,r,i,n)}))}h.event={global:{},add:function(e,t,n,i,r){var a,o,s,l,c,u,d,p,f,m,v,g=F.get(e);if(g)for(n.handler&&(n=(a=n).handler,r=a.selector),n.guid||(n.guid=h.guid++),(l=g.events)||(l=g.events={}),(o=g.handle)||(o=g.handle=function(t){return void 0!==h&&h.event.triggered!==t.type?h.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(_)||[""]).length;c--;)f=v=(s=ie.exec(t[c])||[])[1],m=(s[2]||"").split(".").sort(),f&&(d=h.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=h.event.special[f]||{},u=h.extend({type:f,origType:v,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&h.expr.match.needsContext.test(r),namespace:m.join(".")},a),(p=l[f])||((p=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,i,m,o)||e.addEventListener&&e.addEventListener(f,o)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,u):p.push(u),h.event.global[f]=!0)},remove:function(e,t,n,i,r){var a,o,s,l,c,u,d,p,f,m,v,g=F.hasData(e)&&F.get(e);if(g&&(l=g.events)){for(c=(t=(t||"").match(_)||[""]).length;c--;)if(f=v=(s=ie.exec(t[c])||[])[1],m=(s[2]||"").split(".").sort(),f){for(d=h.event.special[f]||{},p=l[f=(i?d.delegateType:d.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=p.length;a--;)u=p[a],!r&&v!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(p.splice(a,1),u.selector&&p.delegateCount--,d.remove&&d.remove.call(e,u));o&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,g.handle)||h.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)h.event.remove(e,f+t[c],n,i,!0);h.isEmptyObject(l)&&F.remove(e,"handle events")}},dispatch:function(e){e=h.event.fix(e);var t,n,i,a,o,s=[],l=r.call(arguments),c=(F.get(this,"events")||{})[e.type]||[],u=h.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,e)){for(s=h.event.handlers.call(this,e,c),t=0;(a=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=a.elem,n=0;(o=a.handlers[n++])&&!e.isImmediatePropagationStopped();)(!e.rnamespace||e.rnamespace.test(o.namespace))&&(e.handleObj=o,e.data=o.data,void 0!==(i=((h.event.special[o.origType]||{}).handle||o.handler).apply(a.elem,l))&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,r,a,o=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],n=0;s>n;n++)void 0===i[r=(a=t[n]).selector+" "]&&(i[r]=a.needsContext?h(r,this).index(l)>-1:h.find(r,this,null,[l]).length),i[r]&&i.push(a);i.length&&o.push({elem:l,handlers:i})}return s]*)\/>/gi,ce=/\s*$/g;function he(e,t){return h.nodeName(e,"table")&&h.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function fe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function me(e){var t=de.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function ve(e,t){var n,i,r,a,o,s,l,c;if(1===t.nodeType){if(F.hasData(e)&&(a=F.access(e),o=F.set(t,a),c=a.events))for(r in delete o.handle,o.events={},c)for(n=0,i=c[r].length;i>n;n++)h.event.add(t,r,c[r][n]);R.hasData(e)&&(s=R.access(e),l=h.extend({},s),R.set(t,l))}}function ge(e,t){var n=t.nodeName.toLowerCase();"input"===n&&X.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function ye(e,t,n,i){t=a.apply([],t);var r,o,s,l,c,u,p=0,f=e.length,m=f-1,v=t[0],g=h.isFunction(v);if(g||f>1&&"string"==typeof v&&!d.checkClone&&ue.test(v))return e.each((function(r){var a=e.eq(r);g&&(t[0]=v.call(this,r,a.html())),ye(a,t,n,i)}));if(f&&(o=(r=ee(t,e[0].ownerDocument,!1,e,i)).firstChild,1===r.childNodes.length&&(r=o),o||i)){for(l=(s=h.map(J(r,"script"),fe)).length;f>p;p++)c=r,p!==m&&(c=h.clone(c,!0,!0),l&&h.merge(s,J(c,"script"))),n.call(e[p],c,p);if(l)for(u=s[s.length-1].ownerDocument,h.map(s,me),p=0;l>p;p++)c=s[p],Y.test(c.type||"")&&!F.access(c,"globalEval")&&h.contains(u,c)&&(c.src?h._evalUrl&&h._evalUrl(c.src):h.globalEval(c.textContent.replace(pe,"")))}return e}function be(e,t,n){for(var i,r=t?h.filter(t,e):e,a=0;null!=(i=r[a]);a++)n||1!==i.nodeType||h.cleanData(J(i)),i.parentNode&&(n&&h.contains(i.ownerDocument,i)&&Z(J(i,"script")),i.parentNode.removeChild(i));return e}h.extend({htmlPrefilter:function(e){return e.replace(le,"<$1>")},clone:function(e,t,n){var i,r,a,o,s=e.cloneNode(!0),l=h.contains(e.ownerDocument,e);if(!(d.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||h.isXMLDoc(e)))for(o=J(s),i=0,r=(a=J(e)).length;r>i;i++)ge(a[i],o[i]);if(t)if(n)for(a=a||J(e),o=o||J(s),i=0,r=a.length;r>i;i++)ve(a[i],o[i]);else ve(e,s);return(o=J(s,"script")).length>0&&Z(o,!l&&J(e,"script")),s},cleanData:function(e){for(var t,n,i,r=h.event.special,a=0;void 0!==(n=e[a]);a++)if(I(n)){if(t=n[F.expando]){if(t.events)for(i in t.events)r[i]?h.event.remove(n,i):h.removeEvent(n,i,t.handle);n[F.expando]=void 0}n[R.expando]&&(n[R.expando]=void 0)}}}),h.fn.extend({domManip:ye,detach:function(e){return be(this,e,!0)},remove:function(e){return be(this,e)},text:function(e){return O(this,(function(e){return void 0===e?h.text(this):this.empty().each((function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return ye(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||he(this,e).appendChild(e)}))},prepend:function(){return ye(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=he(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return ye(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return ye(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(h.cleanData(J(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return h.clone(this,e,t)}))},html:function(e){return O(this,(function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ce.test(e)&&!K[(G.exec(e)||["",""])[1].toLowerCase()]){e=h.htmlPrefilter(e);try{for(;i>n;n++)1===(t=this[n]||{}).nodeType&&(h.cleanData(J(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return ye(this,arguments,(function(t){var n=this.parentNode;h.inArray(this,e)<0&&(h.cleanData(J(this)),n&&n.replaceChild(t,this))}),e)}}),h.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){h.fn[e]=function(e){for(var n,i=[],r=h(e),a=r.length-1,s=0;a>=s;s++)n=s===a?this:this.clone(!0),h(r[s])[t](n),o.apply(i,n.get());return this.pushStack(i)}}));var we,$e={HTML:"block",BODY:"block"};function Ce(e,t){var n=h(t.createElement(e)).appendTo(t.body),i=h.css(n[0],"display");return n.detach(),i}function xe(e){var t=i,n=$e[e];return n||("none"!==(n=Ce(e,t))&&n||((t=(we=(we||h("`,u.open("videoModal")},close(){this.playerCode="",u.close("videoModal")},displayUnsafe(){return o.trustAsHtml(this.playerCode)}},deliveries:{isCheck:new URLSearchParams(window.location.search).has("check"),isSendStatistic:!1,self:{searchBoxValue:"",isSelectDeliveryPoint:!1,numberOfSelectedItems:0,isStopAddingDeliveryPoints:!1,numberOfDeliveryPoints:10,numberOfPointsAdded:11,isShowButtonForRecipientData:!1,addressPanelOnMap:{isOpenCollapse:!1,collapseBtnText:t("Подробнее")},init(e){"ru"===p.mainDetectedCountry.cntr&&(D.deliveries.view.availableCountries=["ru","by"]),k(e.cscTypes),D.deliveries.view.cscList=e.cscList,D.deliveries.view.currentCity=p.mainDetectedCity,D.deliveries.view.currentCountryCode=p.mainDetectedCountry.cntr,D.deliveries.view.isShowDeliveryPeriodFromCsc=p.mainDetectedCountry.isShowDeliveryPeriodFromCsc,D.deliveries.view.filteredData=D.deliveries.filterPickpoint(D.deliveries.view.cscList,D.deliveries.view.cscTypes),D.deliveries.view.endOfList=D.deliveries.calcBaseEndOfList(D.deliveries.view.additionalItemsCount,D.deliveries.view.filteredData.length),D.deliveries.view.paginatedData=D.deliveries.view.filteredData.slice(0,D.deliveries.view.endOfList),D.deliveries.view.orderStoragePeriodDaysInCsc=p.mainDetectedCountry.orderStoragePeriodDaysInCsc,D.deliveries.view.cscTypes.forEach((e=>e.disabled=!1)),this.numberOfSelectedItems=D.deliveries.view.cscTypes.filter((e=>!0===e.on)).length,c.host().slice(0,2).includes("ru")?(u.open("deliverySelfNewModal"),u.readyStateModal.promise.then((()=>{document.querySelector(".self-points-list").addEventListener("scroll",D.deliveries.scrollPoints),D.deliveries.activatePickpointsMap()}))):(u.open("deliverySelfModal"),u.readyStateModal.promise.then((()=>{D.deliveries.selectDelivery(e.cscList[0],"deliverySelfModal",!0),document.querySelector(".self-points-list").addEventListener("scroll",D.deliveries.scrollPoints)}))),"undefined"!=typeof dataLayer&&D.deliveries.isSendStatistic&&dataLayer.push({event:"user saw Pickup delivery popup"})},closeNew(){document.querySelector(".modal_delivery-self-new").scrollTo(0,0),u.close("deliverySelfModal"),this.isScroll=!0,D.deliveries.isSearch=!0,this.isSelectDeliveryPoint=!1,this.isShowButtonForRecipientData=!1,this.numberOfSelectedItems=0,D.deliveries.self.isStopAddingDeliveryPoints=!1,D.deliveries.self.numberOfDeliveryPoints=10,D.deliveries.self.numberOfPointsAdded=10,D.deliveries.self.addressPanelOnMap.isOpenCollapse=!1,D.deliveries.self.addressPanelOnMap.collapseBtnText=t("Подробнее"),D.deliveries.view.activeItem={deliveryData:void 0}},close(){u.close("deliverySelfModal"),document.querySelector(".self-points-list").removeEventListener("scroll",D.deliveries.scrollPoints),this.isScroll=!0,D.deliveries.isSearch=!0},setDelivery(e,n){"undefined"!=typeof dataLayer&&D.deliveries.isSendStatistic&&dataLayer.push({event:"user click butt Done at pickup popup"}),D.deliveries.setDelivery(e,n),this.isScroll=!0,D.deliveries.isSearch=!0,this.isSelectDeliveryPoint=!1,this.isShowButtonForRecipientData=!1,this.numberOfSelectedItems=0,D.deliveries.self.isStopAddingDeliveryPoints=!1,D.deliveries.self.numberOfDeliveryPoints=10,D.deliveries.self.numberOfPointsAdded=10,D.deliveries.self.addressPanelOnMap.isOpenCollapse=!1,D.deliveries.self.addressPanelOnMap.collapseBtnText=t("Подробнее"),D.deliveries.view.activeItem={deliveryData:void 0},c.host().slice(0,2).includes("ru")&&(localStorage.setItem("redirectAfterCompleteTheForm",1),r((()=>{const e=new Event("click");document.querySelector(".total-cart-block__row .btn.btn_blue.btn_block.btn_XL").dispatchEvent(e)})))},isScroll:!0,scroll(){"undefined"!=typeof dataLayer&&D.deliveries.isSendStatistic&&this.isScroll&&(this.isScroll=!1,dataLayer.push({event:"user scroll pickup point list"}))},cityClick(){"undefined"!=typeof dataLayer&&D.deliveries.isSendStatistic&&dataLayer.push({event:"user tried change pickup point city"})},toggleCollapse(){$(".delivery-dropdown").stop(1,1).slideToggle()},toggleAddressCollapse(e,t){if($(".address-panel").eq(e).find(".address-panel__collapse").stop(1,1).slideToggle(),$(".address-panel").eq(e).find(".pickpoint-price-directive").hasClass("_hide"))$(".address-panel").eq(e).find(".pickpoint-price-directive").removeClass("_hide"),$(".address-panel").eq(e).find(".pickpoint-price-directive").show(),$(".address-panel").eq(e).find(".address-panel__btn").text($(".address-panel").eq(e).find(".address-panel__btn").data("text-show"));else{"undefined"!==dataLayer&&dataLayer.push({event:"user clck btn More about PVZ"}),$(".address-panel").eq(e).find(".pickpoint-price-directive").addClass("_hide"),$(".address-panel").eq(e).find(".pickpoint-price-directive").hide(),$(".address-panel").eq(e).find(".address-panel__btn").text($(".address-panel").eq(e).find(".address-panel__btn").data("text-hide"));const t=document.querySelector(".self-points-list").querySelectorAll(".address-panel")[e].getBoundingClientRect().top,n=document.querySelector(".modal_delivery-self-new").scrollTop;document.querySelector(".modal_delivery-self-new").scrollTo({top:t+n-document.querySelector(".modal_delivery-self-new .modal-body__filter").offsetHeight,behavior:"smooth"})}D.deliveries.getPickpointPrice(t,(()=>{c.host().slice(0,2).includes("ru")&&Object.keys(t).length>1&&t.isActive()&&D.deliveries.self.showButtonForRecipientData()}))},toggleAddressCollapseInMapSnippet(){if(D.deliveries.self.addressPanelOnMap.isOpenCollapse=!D.deliveries.self.addressPanelOnMap.isOpenCollapse,D.deliveries.self.addressPanelOnMap.collapseBtnText=D.deliveries.self.addressPanelOnMap.isOpenCollapse?t("Свернуть описание"):t("Подробнее"),$(".address-panel_for-map").find(".address-panel__collapse").stop(1,1).slideToggle(),D.deliveries.self.addressPanelOnMap.isOpenCollapse){"undefined"!==dataLayer&&dataLayer.push({event:"user clck btn More about PVZ"}),document.querySelector(".self-points-map .address-panel__collapse").classList.contains("address-panel__collapse_open")||document.querySelector(".self-points-map .address-panel__collapse").classList.add("address-panel__collapse_open");const e=document.querySelector(".self-points-map").querySelector(".address-panel").getBoundingClientRect().top,t=document.querySelector(".modal_delivery-self-new").scrollTop;document.querySelector(".modal_delivery-self-new").scrollTo({top:e+t-document.querySelector(".modal_delivery-self-new .modal-body__filter").offsetHeight,behavior:"smooth"})}else document.querySelector(".self-points-map .address-panel__collapse").classList.contains("address-panel__collapse_open")&&document.querySelector(".self-points-map .address-panel__collapse").classList.remove("address-panel__collapse_open");D.deliveries.getPickpointPrice(D.deliveries.view.activeItem,(()=>{c.host().slice(0,2).includes("ru")&&Object.keys(D.deliveries.view.activeItem).length>1&&D.deliveries.view.activeItem.isActive()&&D.deliveries.self.showButtonForRecipientData()}))},showButtonForRecipientData(){if(D.deliveries.self.isSelectDeliveryPoint=!0,!document.querySelectorAll(".modal_delivery-self-new").length)return!1;r((()=>{const e=document.querySelector(".delivery-address__form").getBoundingClientRect().top,t=document.querySelector(".modal_delivery-self-new").offsetHeight,n=document.querySelector(".modal_delivery-self-new").scrollTop;D.deliveries.self.isShowButtonForRecipientData=n+t<=n+e}),100)},scrollToForm(){"undefined"!=typeof dataLayer&&dataLayer.push({event:"user clck btn Next delivery data"}),D.deliveries.self.isStopAddingDeliveryPoints=!0;const e=document.querySelector(".modal_delivery-self-new .delivery-address__form").getBoundingClientRect().top,t=document.querySelector(".modal_delivery-self-new").scrollTop;document.querySelector(".modal_delivery-self-new").scrollTo({top:e+t-document.querySelector(".modal_delivery-self-new .modal-body__filter").offsetHeight,behavior:"smooth"})},mouseEnter(){"undefined"!=typeof dataLayer&&dataLayer.push({event:"user clck Info pickup point city"})},searchOnMap(e){h.searchOnDeliveryMap(e)},searchOnMapKeypress(e,t){13===e.which&&t&&h.searchOnDeliveryMap(t)},canDeliverCompletely(e){if(!e.deliveryData)return;const{cscTypes:t}=D.deliveries.view;return t.find((t=>t.type===e.deliveryData.type)).fullAvailability}},courier:{active:!1,isSelectAddress:!1,isSelectMethod:!1,init(e){"ru"===p.mainDetectedCountry.cntr&&(D.deliveries.view.availableCountries=["ru","by"]),this.active=!0,D.deliveries.view.addressList.length&&!e||D.deliveries.getAddressList(e),D.deliveries.view.isLocationCountry=D.deliveries.view.isEmailRequired=p.isLocationCountry,D.deliveries.view.currentCity=p.mainDetectedCity,D.deliveries.view.currentCountryCode=p.mainDetectedCountry.cntr,D.deliveries.view.isShowDeliveryPeriodFromCsc=p.mainDetectedCountry.isShowDeliveryPeriodFromCsc,c.host().slice(0,2).includes("ru")?u.open("deliveryCourierNewModal"):u.open("deliveryCourierModal"),D.deliveries.view.isOpenedCourierModal=!0},close(e){this.active=!1,"de"!=p.mainDetectedCountry&&!p.mainDetectedCountry.europeCode&&D.deliveries.deliveryDone([e])||(D.deliveries.view.selectedDelivery={},D.deliveries.view.selectedAddress={},c.host().slice(0,2).includes("ru")&&(this.isSelectAddress=!1,this.isSelectMethod=!1)),u.close("deliveryCourierModal"),m.hide(),D.deliveries.view.isOpenedCourierModal=!1},setDelivery(e){if("undefined"!=typeof dataLayer&&D.deliveries.isSendStatistic){let e=0;null!==D.deliveries.view.selectedDelivery.period&&(e=parseInt(D.deliveries.view.selectedDelivery.period.match(/\d+/))),dataLayer.push({event:c.host().slice(0,2).includes("ru")?"user clk btn Done at courier popup":"user click butt Done at courier popup",event_params:{courier_method:D.deliveries.view.selectedDelivery.type,delivery_day:e}})}const t=()=>{D.deliveries.setDelivery(e),c.host().slice(0,2).includes("ru")&&(localStorage.setItem("redirectAfterCompleteTheForm",1),r((()=>{const e=new Event("click");document.querySelector(".total-cart-block__row .btn.btn_blue.btn_block.btn_XL").dispatchEvent(e)})))},{selectedDelivery:n}=D.deliveries.view;if(!n.fullAvailability&&D.deliveries.isCheck){const e=x.open("os-modal-delivery-warning",{bemModifier:"os-modal-delivery-warning",closeOnBackdropClick:!1,context:{callback:()=>{e.close(),t()},cartTotal:f.cart.sum,close:()=>e.close(),deliveryAddressId:D.deliveries.view.selectedAddress.id,deliveryType:n.type}})}else t()}},view:{allCscTypeCanDelivery:!1,allCscTypeCanNotDelivery:!1,hasSelectedNotFullAvailabilityType:!1,availableCountries:[],search:"",showMap:!1,isBubbleOpen:!1,cscList:[],addressList:[],couriersList:[],cscTypes:[],showUserComment:!1,userComment:"",showAddressWarning:!1,changeDeliveryCountryWarning:"",receiver:{nameFirst:"",nameSecond:"",nameThird:"",phone:"",email:""},activeItem:{deliveryData:void 0},selectedDelivery:{},selectedAddress:{},formInvalid:!1,addressProgress:!1,courierProgress:!1,currentCity:null,orderStoragePeriodDaysInCsc:null,isShowDeliveryPeriodFromCsc:!0,isLocationCountry:!1,isEmailRequired:!1,filteredData:[],paginatedData:[],endOfList:10,additionalItemsCount:10,clearCart:!1,isOpenedCourierModal:!1,addressValidation:{countries:["bg","by","cz","de","kg","kz","mn","pl","ru","ua","uz"],patterns:{cyrillicAndLatin:'^((?=[" "A-z0-9Ѐ-ӿÜüÖöÄäẞ\\d]{1})([" "A-z0-9Ѐ-ӿÜüÖöÄäẞ\\d\\_\\-\\.,/+*!@#№$%^&\'";:<>=?`~]+))$',onlyLatin:"^((?=[A-Za-z¿-ɏ¡ªº₫\\d]{1})([s -¿-ɏ¡ªº₫№]+))$"}}},getData(e,t){let n=createUrl({self:"shopen_app_ajax_get_csc_list",post:"shopen_app_ajax_delivery_get_user_addresses",selfPick:"shopen_app_ajax_get_selfpicks_list",courier:"shopen_app_ajax_get_couriers_list"}[e]);d.getData(n,"",(e=>{"function"==typeof t&&t(e.data),u.progress=!1}))},getAddressList(e){const n=createUrl("shopen_app_ajax_delivery_get_user_addresses");this.view.addressProgress=!0,d.getData(n,"",(n=>{if(D.deliveries.view.isOpenedCourierModal){if(u.progress=!1,n.data.length){angular.forEach(n.data,(t=>{t.addressName=t.street?t.street+" "+(t.housing||""):s("textcut")(t.address,50),(t.id==e||t.isChecked||t.isMain)&&(this.view.selectedAddress=t,c.host().slice(0,2).includes("ru")&&(this.courier.isSelectAddress=!0)),t.isActive=()=>t.id===this.view.selectedAddress.id})),p.isLocationCountry&&this.view.selectedAddress.countryCode!=a.get("countryDeliveryCode")&&m.show("warning",[t("Внимание, при смене страны доставки Ваша корзина будет очищена")],"cart"),(!this.view.addressValidation.countries.includes(p.mainDetectedCountry.cntr)&&!p.mainDetectedCountry.europeCode||this.validateAddress(this.view.selectedAddress.address))&&this.getDeliveryTypes(this.view.selectedAddress.id);let i=n.data;const{cntr:r}=p.mainDetectedCountry;"ru"===r&&(i=i.filter((e=>/^[\u0400-\u04FF0-9.,/\-'\\"`№#\s]+$/.test(e.street)))),this.view.addressList=i}"undefined"!=typeof dataLayer&&D.deliveries.isSendStatistic&&dataLayer.push({event:"user saw Courier delivery popup",event_params:{courier_delivery_address:this.view.addressList.length?"Saved address":"No one address"}}),this.view.addressProgress=!1}}),(()=>{this.view.addressProgress=!1}))},changeTab(){this.view.showMap=!this.view.showMap,this.view.isBubbleOpen=!1,"undefined"!=typeof dataLayer&&D.deliveries.isSendStatistic&&this.view.showMap&&dataLayer.push({event:"user click butt Map at pickup popup"}),this.view.showMap?r((()=>{c.host().slice(0,2).includes("ru")?(this.view.activeItem={deliveryData:void 0},D.deliveries.self.searchOnMap(D.deliveries.self.searchBoxValue),D.deliveries.self.isStopAddingDeliveryPoints=!0):this.activatePickpointsMap()}),100):c.host().slice(0,2).includes("ru")&&r((()=>{this.closeInfoBubble(),D.deliveries.setSearchValue(D.deliveries.self.searchBoxValue),D.deliveries.self.addressPanelOnMap.isOpenCollapse&&(document.querySelector(".self-points-map .address-panel__collapse").classList.remove("address-panel__collapse_open"),D.deliveries.self.addressPanelOnMap.isOpenCollapse=!1,D.deliveries.self.addressPanelOnMap.collapseBtnText=t("Подробнее"),$(".address-panel_for-map").find(".address-panel__collapse").stop(1,1).slideToggle()),D.deliveries.self.isStopAddingDeliveryPoints=!1}),100)},calcBaseEndOfList:(e,t)=>e{t.type==e.type&&(t.on=e.on)})),c.host().slice(0,2).includes("ru")&&(D.deliveries.self.numberOfSelectedItems=D.deliveries.view.cscTypes.filter((e=>!0===e.on)).length,D.deliveries.view.hasSelectedNotFullAvailabilityType=D.deliveries.view.cscTypes.some((e=>e.on&&!e.fullAvailability)),1===D.deliveries.self.numberOfSelectedItems?D.deliveries.view.cscTypes.filter((e=>!0===e.on))[0].disabled=!0:D.deliveries.self.numberOfSelectedItems>1&&1===D.deliveries.view.cscTypes.filter((e=>!0===e.disabled)).length&&(D.deliveries.view.cscTypes.filter((e=>!0===e.disabled))[0].disabled=!1)),this.view.search?this.setSearchValue(this.view.search):(this.view.filteredData=this.filterPickpoint(this.view.cscList,this.view.cscTypes),this.view.endOfList=this.calcBaseEndOfList(this.view.additionalItemsCount,this.view.filteredData.length),this.view.paginatedData=this.view.filteredData.slice(0,this.view.endOfList),D.deliveries.self.numberOfDeliveryPoints=D.deliveries.view.filteredData.length>=D.deliveries.self.numberOfPointsAdded+10?10:D.deliveries.view.filteredData.length-D.deliveries.self.numberOfPointsAdded,D.deliveries.self.numberOfPointsAdded=this.view.paginatedData.length,D.deliveries.self.isStopAddingDeliveryPoints=!1)},filterPickpoint(e,t){let n=e.filter((e=>t.some((t=>e.type==t.type&&t.on))));return s("pickupPointsModalSelfFilter")(n,t)},renderNextPoints(){if(c.host().slice(0,2).includes("ru"))D.deliveries.self.numberOfDeliveryPoints=D.deliveries.view.filteredData.length>=D.deliveries.self.numberOfPointsAdded+10?10:D.deliveries.view.filteredData.length-D.deliveries.self.numberOfPointsAdded,D.deliveries.view.filteredData.slice(D.deliveries.self.numberOfPointsAdded,D.deliveries.self.numberOfPointsAdded+D.deliveries.self.numberOfDeliveryPoints).map((e=>{D.deliveries.view.paginatedData.push(e)})),D.deliveries.self.numberOfPointsAdded+=D.deliveries.self.numberOfDeliveryPoints,D.deliveries.self.isStopAddingDeliveryPoints=!1;else{let e=D.deliveries.view.endOfList;D.deliveries.view.endOfList+=D.deliveries.view.additionalItemsCount,D.deliveries.view.endOfList>D.deliveries.view.filteredData.length&&(D.deliveries.view.endOfList=D.deliveries.view.filteredData.length),D.deliveries.view.filteredData.slice(e,D.deliveries.view.endOfList).map((e=>{D.deliveries.view.paginatedData.push(e)}))}},scrollPoints(){document.querySelector(".self-points-list").scrollTop>=document.querySelector(".self-points-list").scrollHeight-2*document.querySelector(".self-points-list").offsetHeight&&document.getElementById("loadMoreButton").click()},activatePickpointsMap(){let e=s("pickpointsFilterDelivery")(this.view.cscList,this.view.cscTypes);e.forEach((e=>e.canDeliverCompletely=!D.deliveries.isCheck||D.deliveries.self.canDeliverCompletely(e))),h.initMultipleMarkersMap("self-points-common-map",e,this.mapMarkersCallback,"","",10)},mapMarkersCallback(e){let t=D.deliveries.view.cscList.find((t=>t.number==e.number));t&&(D.deliveries.view.activeItem=t,D.deliveries.view.isBubbleOpen=!0,i.$apply())},updateMap(e){(e=e||s("pickpointsFilterDelivery")(this.view.cscList,this.view.cscTypes)).forEach((e=>e.canDeliverCompletely=!D.deliveries.isCheck||D.deliveries.self.canDeliverCompletely(e))),h.displayMarkers(e,h.map,this.mapMarkersCallback,10,!1)},pickPointClick(e){this.view.activeItem={deliveryData:void 0},e.active?e.active=!1:h.initLocalMap(e,"self-points-common-map").then((t=>{e.active=t}))},getPickpointPrice(e,t){if(e.price&&e.price.value||e.progress||e.inactive)return;e.progress=!0;let n=createUrl("shopen_app_ajax_cart_self_pickup_calculate",{deliveryPointNumber:e.number});d.getData(n,"",(n=>{e.price=n.data.price,e.period=n.data.period,e.progress=!1,"function"==typeof t&&t()}),(()=>{c.host().slice(0,2).includes("ru")&&(e.progress=!1,e.inactive=!0,D.deliveries.view.selectedDelivery={})}),(()=>{c.host().slice(0,2).includes("ru")&&(e.progress=!1,e.inactive=!0,D.deliveries.view.selectedDelivery={})}))},isSearch:!0,setSearchValue(e){if("undefined"!=typeof dataLayer&&D.deliveries.isSendStatistic&&this.isSearch&&(this.isSearch=!1,dataLayer.push({event:"user use search console at pickup popup"})),this.view.search=e,this.view.filteredData=this.filterPickpoint(this.view.cscList,this.view.cscTypes),this.view.filteredData=s("filter")(this.view.filteredData,this.view.search),this.view.endOfList=this.calcBaseEndOfList(this.view.additionalItemsCount,this.view.filteredData.length),this.view.paginatedData=this.view.filteredData.slice(0,this.view.endOfList),c.host().slice(0,2).includes("ru")&&(D.deliveries.self.numberOfDeliveryPoints=D.deliveries.view.filteredData.length>=D.deliveries.self.numberOfPointsAdded+10?10:D.deliveries.view.filteredData.length-D.deliveries.self.numberOfPointsAdded,D.deliveries.self.numberOfPointsAdded=this.view.paginatedData.length,D.deliveries.self.isStopAddingDeliveryPoints=!1),this.view.showMap){let e=s("filter")(this.view.cscList,this.view.search);this.updateMap(e)}},toggleComment(){c.host().slice(0,2).includes("ru")&&$(".delivery-address__user-comment").stop(1,1).slideToggle(),this.view.showUserComment=!this.view.showUserComment},moreDetails(e){this.view.activeItem=e},closeAddressWarning(){this.view.showAddressWarning=!1},createSubwayLineColor(e){angular.forEach(e,(e=>{e.subway.line={color:"#"+e.subway.color}}))},selectDelivery(e,t,n,i){if(e.inactive)return!1;"undefined"!=typeof dataLayer&&D.deliveries.isSendStatistic&&dataLayer.push({event:"user click butt Select pickup point",event_params:{select_point_at:D.deliveries.view.showMap?"Карта":"Список"}}),"undefined"!=typeof dataLayer&&c.host().slice(0,2).includes("ru")&&dataLayer.push({event:"user click butt Select pickup point"}),this.view.selectedDelivery=e,c.host().slice(0,2).includes("ru")&&(this.courier.isSelectMethod=!0),n&&(i&&i.stopPropagation(),c.host().slice(0,2).includes("ru")&&Object.keys(e).length>0&&e.price&&e.price.value&&D.deliveries.self.showButtonForRecipientData(),this.getPickpointPrice(e,(()=>{c.host().slice(0,2).includes("ru")&&Object.keys(e).length>0&&D.deliveries.self.showButtonForRecipientData()})),this.view.selectedAddress.cityName=e.cityName,this.view.selectedAddress.address=e.address,this.view.selectedDelivery.displayValue=e.addressName)},addressClick(e){if(m.hide(),p.isLocationCountry&&this.view.selectedAddress.countryCode!=e.countryCode&&(/de/i.test(p.mainDetectedCountry.cntr)&&!e.isEuMember||p.mainDetectedCountry.europeCode&&"uk"==e.cntr)){let n=e.isEurope?t("При отправке в страны, не входящие в ЕС, Клиенту необходимо предварительно самостоятельно выяснить условия прохождении груза на таможне страны-получателя.")+" ":"";const i="kr"!==e.countryCode?t("Пожалуйста, предварительно свяжитесь с таможенной службой вашей страны, чтобы убедиться, что все заказываемые вами товары разрешены для ввоза, а также требуются ли дополнительные разрешения или лицензии. Обратите внимание, что максимально допустимая сумма покупки ограничена ~limit~ евро. Это связано с таможенным и налоговым законодательством страны поставки.",{limit:e.orderValueLimit}):t("Пожалуйста, предварительно свяжитесь с таможенной службой вашей страны, чтобы убедиться, что все заказываемые вами товары разрешены для ввоза, а также требуются ли дополнительные разрешения или лицензии. Обратите внимание, что максимально допустимая сумма покупки ограничена ~limit~ евро. Максимальное количество заказанных товаров не более 6 штук. Это связано с таможенным и налоговым законодательством страны поставки.",{limit:e.orderValueLimit});D.notification.message=n+i,u.open("notificationModal")}p.isLocationCountry&&e.countryCode!=a.get("countryDeliveryCode")&&m.show("warning",[t("Внимание, при смене страны доставки Ваша корзина будет очищена")],"cart"),this.view.showAddressWarning=!1,this.view.selectedAddress=e,this.view.selectedDelivery=[],S([]),c.host().slice(0,2).includes("ru")&&(this.courier.isSelectAddress=!0,this.courier.isSelectMethod=!1),(!this.view.addressValidation.countries.includes(p.mainDetectedCountry.cntr)&&!p.mainDetectedCountry.europeCode||this.validateAddress(e.address))&&this.getDeliveryTypes(e.id)},validateAddress(e){let n;n=["cz","de","pl"].includes(p.mainDetectedCountry.cntr)||p.mainDetectedCountry.europeCode?this.view.addressValidation.patterns.onlyLatin:this.view.addressValidation.patterns.cyrillicAndLatin;let i=new RegExp(n).test(e);return i||m.show("warning",[t("Некорректные символы. Создайте новый адрес.")],"cart"),i},deleteAddress(e,t){e.stopPropagation(),e.preventDefault(),t.progress=!0;let n=createUrl("shopen_app_ajax_address_delete",{addressId:t.id});d.postData(n,"","",(e=>{angular.forEach(this.view.addressList,((e,n)=>{e.id==t.id&&this.view.addressList.splice(n,1)})),S([]),this.view.selectedAddress="",this.view.selectedDelivery="",c.host().slice(0,2).includes("ru")&&(this.courier.isSelectAddress=!1,this.courier.isSelectMethod=!1),t.progress=!1}))},openEditAddressModal(e){if(D.editAddress.addressID=e.id,D.editAddress.field.country.optionsList=D.newAddress.field.country.optionsList,D.editAddress.field.country.value=p.availableCountries[e.countryCode],D.editAddress.field.street.value=e.street,D.editAddress.field.house.value=e.housing,D.editAddress.field.entry.value=e.entry,D.editAddress.field.corps.value=e.building,D.editAddress.field.structure.value=e.structure,D.editAddress.field.apartment.value=e.apartment,D.editAddress.field.zip.value=e.zip,D.editAddress.field.userComment.value=e.userComment,D.editAddress.field.city.value={},D.editAddress.field.city.value.name=e.cityName,D.editAddress.field.city.value.id=e.cityId,D.editAddress.field.city.optionsList=[p.mainDetectedCity],D.editAddress.field.isAddressMain=e.isMain,D.editAddress.field.floor.value=e.floor,D.editAddress.field.province.type)e.block=e.cityName.split(",")[0],e.province=e.districtName,e.district=e.regionName,D.editAddress.getTerritorialUnit("province","102","getProvinces"),D.editAddress.getDistrictOptions("province",e,e.districtCode),D.editAddress.getDistrictOptions("district",e,e.regionCode),D.editAddress.getDistrictOptions("subDistrict",e);else if("select"==D.editAddress.field.district.type)switch(p.mainDetectedCountry.cntr){case"pl":D.editAddress.field.city.value={},D.editAddress.field.city.value.name=e.cityName.split(",")[0],D.editAddress.field.city.value.id=e.cityId,D.editAddress.field.district.value={},D.editAddress.field.district.value.name=e.district,D.editAddress.field.district.value.id=e.districtCode,D.editAddress.field.subDistrict.value={},D.editAddress.field.subDistrict.value.name=e.cityName.split(",")[1],D.editAddress.field.subDistrict.value.id=e.regionCode,D.editAddress.getTerritorialUnit("district","23","getProvinces"),D.editAddress.getTerritorialUnit("subDistrict",e.districtCode,"getRegions"),D.editAddress.getTerritorialUnit("city",e.regionCode,"getCities");break;default:D.editAddress.getTerritorialUnit("district",e.cityId,"getDistricts"),D.editAddress.getDistrictOptions("district",e),D.editAddress.getDistrictOptions("subDistrict",e)}"string"==D.editAddress.field.district.type&&(D.editAddress.field.district.value=e.district),"string"==D.editAddress.field.subDistrict.type&&(D.editAddress.field.subDistrict.value=e.block),D.editAddress.field.roadType.value=p.roadTypes[0],D.editAddress.field.roadType.optionsList=p.roadTypes,D.editAddress.field.zip.isDisabled=D.editAddress.isAutozipEnable(),u.open("deliveryEditAddressModal")},getDeliveryTypes(e){if(!e)return;this.view.selectedAddress.cityId==p.mainDetectedCity.id||p.mainDetectedCountry.isLocationCountry||(this.view.showAddressWarning=!0),this.view.courierProgress=!0;let t=createUrl("shopen_app_ajax_delivery_get_delivery_types",{addressId:e});d.getData(t,"",(e=>{if(!D.deliveries.view.isOpenedCourierModal)return;const t=s("couriersListCartModalFilter")(e.data.deliveryTypes);t.length>0&&(this.view.selectedDelivery=t[0],c.host().slice(0,2).includes("ru")&&(this.courier.isSelectMethod=!0)),angular.forEach(t,(e=>{e.isActive=()=>e.type===this.view.selectedDelivery.type})),S(t),this.view.courierProgress=!1}),(()=>{S([]),this.view.courierProgress=!1}))},needShowDeliveryList(){return this.view.selectedAddress.id&&!this.view.courierProgress},needShowDeliveryHint(){return!(this.view.selectedAddress.id&&this.view.couriersList.length||this.view.courierProgress)},deliveryDone(e=[]){if(!e)return!1;let t=e.length>0;e.forEach((function(e){if(!e)return t=e,!1}));let n=!d.isEmptyObj(this.view.selectedAddress),i=!d.isEmptyObj(this.view.selectedDelivery);return n&&i&&t},setDelivery(e=[],t){this.view.formInvalid=!1,this.deliveryDone(e)?t?(this.view.showMap=!1,u.close("deliverySelfModal")):(p.isLocationCountry&&a.get("countryDeliveryCode")!=this.view.selectedAddress.countryCode&&(this.view.clearCart=!0,p.changeCountryDelivery(p.availableCountries[this.view.selectedAddress.countryCode])),this.courier.active=!1,u.close("deliveryCourierModal")):this.view.formInvalid=!0},openNewAddressModal(){if("undefined"!=typeof dataLayer&&D.deliveries.isSendStatistic&&dataLayer.push({event:c.host().slice(0,2).includes("ru")?"user clk btn Create adr courier popup":"user click butt Create adr courier popup"}),D.newAddress.field.country.value=p.mainDetectedCountry.isLocationCountry?p.availableCountries[p.countryDelivery.cntr]:p.availableCountries[p.mainDetectedCity.country.cntr],"select"===D.newAddress.field.city.type&&"pl"!=p.mainDetectedCountry.cntr&&(D.newAddress.field.city.value=p.mainDetectedCity),D.newAddress.field.province.type)D.newAddress.getTerritorialUnit("province","102","getProvinces");else if("select"==D.newAddress.field.district.type)switch(p.mainDetectedCountry.cntr){case"pl":D.newAddress.getTerritorialUnit("district","23","getProvinces"),D.newAddress.field.city.afterSubdistrictSelectionLoading=!0;break;default:D.newAddress.getTerritorialUnit("district",p.mainDetectedCity.id,"getDistricts")}D.newAddress.field.roadType.value=p.roadTypes[0],D.newAddress.field.roadType.optionsList=p.roadTypes,D.newAddress.field.zip.isDisabled=D.newAddress.isAutozipEnable();const e=p.mainDetectedCountry.europeCode||p.mainDetectedCountry.bbCode||p.mainDetectedCountry.cntr,{cntr:t}=p.mainDetectedCountry;switch(["am","bg","by","kg","kz","mn","ua","uz"].includes(t)?D.newAddress.field.street.validateAs="cyrillicAndLatin":"ru"===t&&(D.newAddress.field.street.validateAs="onlyCyrillic"),e){case"bb":case"de":case"eu":u.open("deliveryNewAddressModalDe");break;case"bg":u.open("deliveryNewAddressModalBg");break;case"th":u.open("deliveryNewAddressModalTh");break;case"tr":D.newTurkishAddress.fields.country.value=p.mainDetectedCountry.isLocationCountry?p.availableCountries[p.countryDelivery.cntr]:p.availableCountries[p.mainDetectedCity.country.cntr],D.newTurkishAddress.fields.roadType=p.roadTypes[0],D.newTurkishAddress.currLang=p.mainLanguage.localeCode,u.open("deliveryNewAddressModalTr");break;default:u.open("deliveryNewAddressModal")}},clearForms(){this.view.selectedDelivery="",this.view.active="",this.view.showUserComment=!1,this.view.userComment="",this.view.showMap=!1,this.courier.active=!1},close(e){this.clearForms(),e&&u.close(e)},closeInfoBubble(){this.view.activeItem={deliveryData:void 0},this.view.isBubbleOpen=!1,c.host().slice(0,2).includes("ru")&&$(".self-points-map__collapse").hasClass("self-points-map__collapse_is-open")&&($(".self-points-map__collapse").removeClass("self-points-map__collapse_is-open"),$(".self-points-map__collapse").stop(1,1).slideToggle())},onPointClick(){const[e]=arguments;if(!D.deliveries.isCheck||D.deliveries.self.canDeliverCompletely(e))return void D.deliveries.selectDelivery.apply(D.deliveries,arguments);E({callback:(e,t)=>{const{pickupDeliveryTypes:n}=t;T(n),D.deliveries.selectDelivery.apply(D.deliveries,arguments),e.close()},deliveryPointId:e.number,deliveryType:e.deliveryData.type})},onCourierClick(){const[e]=arguments;if(!D.deliveries.isCheck||e.fullAvailability)return void D.deliveries.selectDelivery.apply(D.deliveries,arguments);E({callback:(e,t)=>{const{courierDeliveryTypes:n,pickupDeliveryTypes:i}=t;T(i);const{couriersList:r}=D.deliveries.view,a=new Map,{deliveryTypes:o}=n;o.forEach((e=>{a.set(e.type,e.fullAvailability)})),r.forEach((e=>{e.fullAvailability=a.get(e.type)})),S(r),D.deliveries.selectDelivery.apply(D.deliveries,arguments),e.close()},deliveryAddressId:D.deliveries.view.selectedAddress.id,deliveryType:e.type})},onPartialDeliveryTitleClick(){E({callback:(e,t)=>{const{pickupDeliveryTypes:n}=t;T(n),e.close()}})},onCscTypeClick(e){if(e.fullAvailability)return;E({callback:(e,t)=>{const{pickupDeliveryTypes:n}=t;T(n),e.close()},deliveryTypes:[e.type]})}},newTurkishAddress:{currLang:null,isFormInvalid:!1,fields:{country:{required:!0,value:""},city:{required:!0,value:"",searchValue:"",searchCount:0,optionsList:[],originalOptionsList:[],select(){D.newTurkishAddress.citySelection()},search(){D.newTurkishAddress.searchAndFiltering(this,"1","city")}},district:{isLoading:!1,required:!0,disabled:!0,value:"",searchValue:"",searchCount:0,optionsList:[],originalOptionsList:[],select(){D.newTurkishAddress.districtSelection()},search(){D.newTurkishAddress.searchAndFiltering(this,D.newTurkishAddress.fields.city.value.id,"district")}},subDistrict:{isLoading:!1,required:!0,disabled:!0,value:"",searchValue:"",searchCount:0,optionsList:[],originalOptionsList:[],select(){D.newTurkishAddress.subDistrictSelection()},search(){D.newTurkishAddress.searchAndFiltering(this,D.newTurkishAddress.fields.district.value.id,"subDistrict")}},street:{isLoading:!1,required:!0,disabled:!0,value:"",searchValue:"",searchCount:0,optionsList:[],originalOptionsList:[],search(){D.newTurkishAddress.searchAndFiltering(this,D.newTurkishAddress.fields.subDistrict.value.id||D.newTurkishAddress.fields.district.value.id||D.newTurkishAddress.fields.city.value.id,"street")}},house:"",apartment:"",houseName:"",userComment:"",isAddressMain:!1,floor:""},close(){u.close("deliveryNewAddressModalTr"),this.clearForm()},getUrl:(e,t)=>createUrl(e)+`?countryCode=tr&parentId=${t}&perPage=-1`,getData:e=>new Promise(((t,n)=>{const i=new XMLHttpRequest;i.open("GET",e),i.addEventListener("load",(()=>{i.status>=200&&i.status<400?t(i.response):n(new Error("getTurkishData: "+i.statusText))})),i.addEventListener("error",(()=>n(new Error("getTurkishData: Network error")))),i.send()})),getDataForNewAddressForm(e,n){this.getData(e).then((e=>{if("string"==typeof e){const t=JSON.parse(e);i.$apply((()=>{n.bind(this)(t)}))}}),(e=>{m.show("error",[t("Адресный сервис временно недоступен. Попробуйте завершить оформление заказа позднее. Cообщите нам об ошибке: destek@sibvaleo.com")]),console.error(e)})).catch((e=>{m.show("error",[t("Адресный сервис временно недоступен. Попробуйте завершить оформление заказа позднее. Cообщите нам об ошибке: destek@sibvaleo.com")]),console.error(e)}))},searchAndFiltering(e,t,n){if(0===e.searchValue.normalize("NFKD").replace(/[^\w\s.-_\/]/g,"").length)return D.newTurkishAddress.fields[n].optionsList=D.newTurkishAddress.fields[n].originalOptionsList,!1;e.optionsList=e.originalOptionsList.filter((t=>t.name.normalize("NFKD").replace(/[^\w\s.-_\/]/g,"").toLowerCase().startsWith(e.searchValue.normalize("NFKD").replace(/[^\w\s.-_\/]/g,"").toLowerCase())))},setOptions(e,t){this.fields[e].optionsList=JSON.parse(t).data,this.fields[e].originalOptionsList=JSON.parse(t).data},stepToNextStandardLevel(e,t,n,i){this.fields[e].value.next_geo_level.id===t&&(this.setOptions(n,i),this.fields[n].disabled=!1,this.fields[n].isLoading=!1)},citySelection(){this.fields.district.isLoading="district"===this.fields.city.value.next_geo_level.id,this.fields.street.isLoading="street"===this.fields.city.value.next_geo_level.id,this.fields.district.optionsList=[],this.fields.subDistrict.optionsList=[],this.fields.street.optionsList=[],this.fields.district.searchValue="",this.fields.subDistrict.searchValue="",this.fields.street.searchValue="",this.fields.district.value="",this.fields.subDistrict.value="",this.fields.street.value="",this.fields.district.disabled=!0,this.fields.subDistrict.disabled=!0,this.fields.street.disabled=!0,this.getDataForNewAddressForm(this.getUrl("shopen_app_ajax_location_search_object",this.fields.city.value.id),(e=>{if(!JSON.parse(e.data).data.length)return m.show("error",[t("Адресный сервис временно недоступен. Попробуйте завершить оформление заказа позднее. Cообщите нам об ошибке: destek@sibvaleo.com")]),this.fields.district.isLoading=!1,this.fields.street.isLoading=!1,!1;this.stepToNextStandardLevel("city","district","district",e.data),"street"===this.fields.city.value.next_geo_level.id&&(this.setOptions("street",e.data),this.fields.street.disabled=!1,this.fields.district.required=!1,this.fields.subDistrict.required=!1,this.fields.street.isLoading=!1)}))},districtSelection(){this.fields.subDistrict.isLoading="neighborhood"===this.fields.district.value.next_geo_level.id,this.fields.street.isLoading="street"===this.fields.district.value.next_geo_level.id,this.fields.subDistrict.optionsList=[],this.fields.street.optionsList=[],this.fields.subDistrict.value="",this.fields.subDistrict.searchValue="",this.fields.street.value="",this.fields.street.searchValue="",this.fields.subDistrict.disabled=!0,this.fields.street.disabled=!0,this.getDataForNewAddressForm(this.getUrl("shopen_app_ajax_location_search_object",this.fields.district.value.id),(e=>{if(!JSON.parse(e.data).data.length)return m.show("error",[t("Адресный сервис временно недоступен. Попробуйте завершить оформление заказа позднее. Cообщите нам об ошибке: destek@sibvaleo.com")]),this.fields.subDistrict.isLoading=!1,this.fields.street.isLoading=!1,!1;this.stepToNextStandardLevel("district","neighborhood","subDistrict",e.data),"street"===this.fields.district.value.next_geo_level.id&&(this.setOptions("street",e.data),this.fields.street.disabled=!1,this.fields.subDistrict.required=!1,this.fields.street.isLoading=!1)}))},subDistrictSelection(){this.fields.street.isLoading=!0,this.fields.street.optionsList=[],this.fields.street.value="",this.fields.street.searchValue="",this.fields.street.disabled=!0,this.getDataForNewAddressForm(this.getUrl("shopen_app_ajax_location_search_object",this.fields.subDistrict.value.id),(e=>{if(!JSON.parse(e.data).data.length)return m.show("error",[t("Адресный сервис временно недоступен. Попробуйте завершить оформление заказа позднее. Cообщите нам об ошибке: destek@sibvaleo.com")]),this.fields.street.isLoading=!1,!1;this.stepToNextStandardLevel("subDistrict","street","street",e.data)}))},clearForm(){Object.keys(this.fields).forEach((e=>"isAddressMain"===e?(this.fields[e]=!1,!1):"house"===e||"apartment"===e||"houseName"===e||"userComment"===e?(this.fields[e]="",!1):(this.fields[e].required=!0,this.fields[e].disabled=!0,this.fields[e].value="",this.fields[e].searchValue="",void("city"===e?this.fields[e].optionsList=this.fields[e].originalOptionsList:(this.fields[e].optionsList=[],this.fields[e].originalOptionsList=[])))))},sendData(e){if(this.isFormInvalid=e,e)return;const t=createUrl("shopen_app_ajax_delivery_user_addresses_add");u.inProgress=!0;let n={countryISO:this.fields.country.value.cntr,city:this.fields.city.value.external_ids.oracle,district:this.fields.district.value.name,subDistrict:this.fields.subDistrict.value.name,subDistrict_id:this.fields.subDistrict.value.id,street:this.fields.street.value.name,street_id:this.fields.street.value.id,house:this.fields.house,apartment:this.fields.apartment,houseName:this.fields.houseName,userComment:this.fields.userComment,makeDefaultAddress:this.fields.isAddressMain,floor:this.fields.floor};p.noRoads||(n.roadType=this.fields.roadType),d.postData(t,n,"",(e=>{D.deliveries.getAddressList(e.data.id),u.inProgress=!1,u.close("deliveryNewAddressModalTr"),this.clearForm()}))}},newAddress:{isFormInvalid:!1,field:{country:{value:"",optionsList:null,isProgress:!1,isRequired:!0},city:{value:"",optionsList:null,isProgress:!1,afterSubdistrictSelectionLoading:!1},province:{value:"",optionsList:null,isProgress:!1},district:{forceLabel:"",value:"",optionsList:null,isProgress:!1},subDistrict:{forceLabel:"",value:"",optionsList:null,isProgress:!1},microDistrict:{forceLabel:"",value:""},roadType:{value:{}},street:{value:"",validateAs:"onlyLatin"},house:{value:""},entry:{value:""},corps:{value:""},structure:{value:""},apartment:{value:""},floor:{value:""},zip:{value:"",isDisabled:!0},userComment:{value:""},isAddressMain:!1},changeCountry(e){if(this.clearForm(),p.mainDetectedCountry.europeCode&&p.redirectToOtherShop&&e&&e.value&&"cz"==e.value.cntr)return D.notificationShopRedirect.openShopRedirectModal(e.value.cntr),void(D.newAddress.field.country.value=p.availableCountries[p.mainDetectedCity.country.cntr]);if(/de/i.test(p.mainDetectedCountry.cntr)||"uk"===D.newAddress.field.country.value.cntr||(D.notification.message=t("Пожалуйста, предварительно свяжитесь с таможенной службой вашей страны, чтобы убедиться, что все заказываемые вами товары разрешены для ввоза, а также требуются ли дополнительные разрешения или лицензии."),u.open("notificationModal")),/de/i.test(p.mainDetectedCountry.cntr)&&!D.newAddress.field.country.value.isEuMember||p.mainDetectedCountry.europeCode&&"uk"==D.newAddress.field.country.value.cntr){let e=D.newAddress.field.country.value.isEurope?t("При отправке в страны, не входящие в ЕС, Клиенту необходимо предварительно самостоятельно выяснить условия прохождении груза на таможне страны-получателя.")+" ":"";const n="kr"!==D.newAddress.field.country.value.cntr?t("Пожалуйста, предварительно свяжитесь с таможенной службой вашей страны, чтобы убедиться, что все заказываемые вами товары разрешены для ввоза, а также требуются ли дополнительные разрешения или лицензии. Обратите внимание, что максимально допустимая сумма покупки ограничена ~limit~ евро. Это связано с таможенным и налоговым законодательством страны поставки.",{limit:D.newAddress.field.country.value.orderValueLimit}):t("Пожалуйста, предварительно свяжитесь с таможенной службой вашей страны, чтобы убедиться, что все заказываемые вами товары разрешены для ввоза, а также требуются ли дополнительные разрешения или лицензии. Обратите внимание, что максимально допустимая сумма покупки ограничена ~limit~ евро. Максимальное количество заказанных товаров не более 6 штук. Это связано с таможенным и налоговым законодательством страны поставки.",{limit:D.newAddress.field.country.value.orderValueLimit});D.notification.message=e+n,u.open("notificationModal")}},changeCity(){"select"==this.field.district.type&&"select"==this.field.subDistrict.type&&"pl"!==p.mainDetectedCountry.cntr&&(this.field.district.value="",this.field.district.optionsList=[],this.field.subDistrict.value="",this.field.subDistrict.optionsList=[],(this.field.province.value.id||this.field.city.value.id&&"vn"==p.mainDetectedCountry.cntr)&&this.getTerritorialUnit("district",this.field.province.value.id||this.field.city.value.id,"getDistricts"))},changeDistrict(){if(this.field.subDistrict.value="",this.field.subDistrict.optionsList=[],this.field.district.value&&this.field.district.value.id)switch(p.mainDetectedCountry.cntr){case"vn":this.getTerritorialUnit("subDistrict",this.field.district.value.id,"getSubDistricts");break;case"pl":this.field.city.value="",this.field.city.optionsList=[],this.getTerritorialUnit("subDistrict",this.field.district.value.id,"getRegions")}},changeSubDistrict(){switch(p.mainDetectedCountry.cntr){case"pl":this.field.city.value="",this.field.city.optionsList=[],this.getTerritorialUnit("city",this.field.subDistrict.value.id,"getCities")}},getTerritorialUnit(e,t,n){if(!t)return;let i={action:n,unitId:t};this.field[e].isProgress=!0,p.getTerritorialUnits(i).then((t=>{this.field[e].isProgress=!1,this.field[e].optionsList=t.data}),(t=>{this.field[e].isProgress=!1}))},sendData(e){if("undefined"!=typeof dataLayer&&D.deliveries.isSendStatistic&&dataLayer.push({event:"user click btn Done at courier popup",event_params:{delivery_to:this.field.city.value.name||this.field.city.value}}),this.isFormInvalid=e,e)return;const t=createUrl("shopen_app_ajax_delivery_user_addresses_add");u.inProgress=!0;let n={countryISO:this.field.country.value.cntr,city:this.field.province.value.id||this.field.city.value.id||this.field.city.value,district:this.field.district.value.id||this.field.district.value,subDistrict:this.field.subDistrict.value.id||this.field.subDistrict.value,microDistrict:this.field.microDistrict.value.id||this.field.microDistrict.value,zip:this.field.zip.value,street:this.field.street.value,house:this.field.house.value,entry:this.field.entry.value,corps:this.field.corps.value,structure:this.field.structure.value,apartment:this.field.apartment.value,floor:this.field.floor.value,userComment:this.field.userComment.value,makeDefaultAddress:this.field.isAddressMain};p.noRoads||(n.roadType=this.field.roadType.value),d.postData(t,n,"",(e=>{D.deliveries.getAddressList(e.data.id),u.inProgress=!1,u.close("deliveryNewAddressModal"),this.clearForm()}))},resetZip(){this.field.zip.isDisabled=!1},detectZip(){if(!this.isAutozipEnable())return;let e;this.field.province.type?e=[this.field.country.value.name,this.field.province.value.name||"",this.field.district.value.name||"",this.field.subDistrict.value.name||"",this.field.street.value,this.field.house.value]:(e=[this.field.country.value.name,this.field.city.value.name,this.field.street.value,this.field.house.value],p.noRoads||e.splice(2,0,this.field.roadType.value.name)),h.detectZip(e).then((e=>{this.field.zip.isNotFound="not found"==e,this.field.zip.value="not found"==e?"":e}))},isAutozipEnable(){return"string"!=this.field.city.type&&(!!p.mainDetectedCountry&&p.mainDetectedCountry.isAutoZipEnabled)},clearForm(){for(let e in this.field)switch(e){case"city":"pl"!=this.field.country.value.cntr&&this.field.country.value.cntr==p.mainDetectedCity.country.cntr&&"select"==this.field[e].type&&(this.field[e].value=p.mainDetectedCity)}this.field.isAddressMain=!1}},editAddress:{isFormInvalid:!1,addressID:null,field:{country:{value:"",optionsList:null,isProgress:!1,isRequired:!0},city:{value:"",optionsList:null,isProgress:!1},province:{value:"",optionsList:null,isProgress:!1},district:{value:"",optionsList:null,isProgress:!1},subDistrict:{value:"",optionsList:null,isProgress:!1},microDistrict:{value:""},roadType:{value:{}},street:{value:""},house:{value:""},entry:{value:""},corps:{value:""},structure:{value:""},apartment:{value:""},floor:{value:""},zip:{value:"",isDisabled:!0},userComment:{value:""},isAddressMain:!1},changeCountry(){this.clearForm()},changeCity(){"select"==this.field.district.type&&"select"==this.field.subDistrict.type&&"pl"!==p.mainDetectedCountry.cntr&&"select"==this.field.district.type&&"select"==this.field.subDistrict.type&&(this.field.district.value="",this.field.district.optionsList=[],this.field.subDistrict.value="",this.field.subDistrict.optionsList=[],(this.field.province.value.id||this.field.city.value.id)&&this.getTerritorialUnit("district",this.field.province.value.id||this.field.city.value.id,"getDistricts"))},changeDistrict(){if(this.field.subDistrict.value="",this.field.subDistrict.optionsList=[],this.field.district.value&&this.field.district.value.id)switch(p.mainDetectedCountry.cntr){case"vn":this.getTerritorialUnit("subDistrict",this.field.district.value.id,"getSubDistricts");break;case"pl":this.field.city.value="",this.field.city.optionsList=[],this.getTerritorialUnit("subDistrict",this.field.district.value.id,"getRegions")}},changeSubDistrict(){switch(p.mainDetectedCountry.cntr){case"pl":this.field.city.value="",this.field.city.optionsList=[],this.getTerritorialUnit("city",this.field.subDistrict.value.id,"getCities")}},getTerritorialUnit(e,t,n){if(!t)return;let i={action:n,unitId:t};this.field[e].isProgress=!0,p.getTerritorialUnits(i).then((t=>{this.field[e].isProgress=!1,this.field[e].optionsList=t.data}),(t=>{this.field[e].isProgress=!1}))},sendData(e){if(this.isFormInvalid=e,e)return;const t=createUrl("shopen_app_ajax_delivery_user_addresses_edit");u.inProgress=!0;let n={addressID:this.addressID,countryISO:this.field.country.value.cntr,city:this.field.province.value.id||this.field.city.value.id,name:this.field.province.value.name||this.field.city.value.name,district:this.field.district.value.name||this.field.district.value,subDistrict:this.field.subDistrict.value.name||this.field.subDistrict.value,microDistrict:this.field.microDistrict.value.id||this.field.microDistrict.value,zip:this.field.zip.value,street:this.field.street.value,house:this.field.house.value,entry:this.field.entry.value,corps:this.field.corps.value,structure:this.field.structure.value,apartment:this.field.apartment.value,floor:this.field.floor.value,userComment:this.field.userComment.value,makeDefaultAddress:this.field.isAddressMain,cityVN:this.field.subDistrict.value.id,token:null};p.noRoads||(n.roadType=this.field.roadType.value),d.postData(t,n,"",(e=>{D.deliveries.getAddressList(e.data.id),u.inProgress=!1,u.close("deliveryEditAddressModal"),this.clearForm()}))},resetZip(){this.field.zip.isDisabled=!1},detectZip(){if(!this.isAutozipEnable())return;let e;this.field.province.type?e=[this.field.country.value.name,this.field.province.value.name||"",this.field.district.value.name||"",this.field.subDistrict.value.name||"",this.field.street.value,this.field.house.value]:(e=[this.field.country.value.name,this.field.city.value.name,this.field.street.value,this.field.house.value],p.noRoads||e.splice(2,0,this.field.roadType.value.name)),h.detectZip(e).then((e=>{this.field.zip.isNotFound="not found"==e,this.field.zip.value="not found"==e?"":e}))},isAutozipEnable(){return"string"!=this.field.city.type&&(!!p.mainDetectedCountry&&p.mainDetectedCountry.isAutoZipEnabled)},clearForm(){for(let e in this.field)switch(e){case"country":case"roadType":break;case"city":this.field.country.value.cntr==p.mainDetectedCity.country.cntr&&"select"==this.field[e].type&&(this.field[e].value=p.mainDetectedCity)}this.field.isAddressMain=!1},getDistrictOptions(e,t,n=-1){D.editAddress.field[e]=Object.assign({},D.editAddress.field[e]),D.editAddress.field[e]=new Proxy(D.editAddress.field[e],{set:(i,r,a)=>(i[r]=a,"optionsList"==r&&Array.isArray(a)&&a.forEach((i=>{(-1!==n&&i.id==n||i.name===t["subDistrict"==e?"block":e])&&(D.editAddress.field[e].value=i,"district"===e&&D.editAddress.changeDistrict(),"province"===e&&D.editAddress.changeCity())})),!0)})}},referalLink:{links:{pc:"",c:"",currentPage:"",wc:"",show_wc:C.getParam("is_show_wellness_community_link")},mentor:{name:"",contract:null},showHint:!1,showMessage:!1,showNewImplementation:!1,showOneClickRegistration:!1,isIOS:navigator.userAgent.match(/ipad|ipod|iphone/i),open(){this.showNewImplementation=["az","ru","by","md","kz","kg","uz","ua","tr"].includes(p.mainDetectedCountry.cntr)&&"ru"==p.mainLanguage.localeCode,u.open("referalModal"),this.setMentor(),this.showNewImplementation||r((()=>{let e=document.querySelector(".modal_referal-link .os-input__control");e&&(e.focus(),e.selectionStart=0,e.selectionEnd=999)}),300)},copy(){document.querySelector(".modal_referal-link .os-input__control").select();try{document.execCommand("copy")&&(this.showMessage=!0)}catch(e){this.showHint=!0}},close(){this.showMessage=!1,this.showHint=!1,u.close("referalModal")},changeMentor(){this.mentor.name=this.mentor.contract=""},getMentorByContract(){u.inProgress=!0,v.validation.mentor(this.mentor.contract,(e=>{this.setMentor(e.data),u.inProgress=!1}),(()=>{this.setMentor(),u.inProgress=!1}))},setMentor({name:e=f.user.name,contract:t=f.user.contract}={}){this.mentor.name=e,this.mentor.contract=t,this.setRefLinks(t)},setRefLinks(e){this.links.pc=`${location.origin}${createUrl("shopen_app_user_registration")}PRIVILEGED_CLIENT/?referral=${e}`,this.links.c=`${location.origin}${createUrl("shopen_app_user_registration")}CONSULTANT/?referral=${e}`;let t="",n=window.location.href.split("?")[0];void 0!==a.get("countryDeliveryCode")&&(t="&delivery="+a.get("countryDeliveryCode")),this.links.currentPage=n+"?referral="+e+t,this.links.wc="https://wellnessmarathon.siberianhealth.com/hls?referral="+e}},outofstockOrder:{currentProduct:null,open(e){this.currentProduct=e,u.open("outofstockOrderModal")},sendData(){u.inProgress=!0;const e=createUrl("shopen_app_ajax_order_outofstock_product");let n={contract:f.user.contract,productSku:this.currentProduct};d.postData(e,n,"cart",(e=>{u.inProgress=!1,u.close("outofstockOrderModal"),m.show("standingSuccess",[t("Ваш запрос принят. Мы свяжемся с вами в ближайшее время.")],"cart")}),(()=>{u.inProgress=!1,u.close("outofstockOrderModal"),m.show("error",[t("Что-то пошло не так. Пожалуйста, повторите попытку.")],"server")}))}},overlimitCertificate:{confirmOverlimit(){},refuseOverlimit(){},closeOverlimitModal(){u.close("overlimitCertificateModal")},setModalFunctions(e,t,n){"function"==typeof e&&(D.overlimitCertificate.confirmOverlimit=e),"function"==typeof t&&(D.overlimitCertificate.refuseOverlimit=t),"function"==typeof n&&(D.overlimitCertificate.closeOverlimitModal=n)}},actionsWithProduct:{actionsCount:0,actionsList:null,currentProduct:null,defferedAddToCart:null,open(e,t){this.currentProduct=e,this.defferedAddToCart=t;const n=createUrl("shopen_app_ajax_actions_get_kits_by_product",{productSku:e.sku});d.getData(n,"",(e=>{this.actionsCount=Object.keys(e.data).length,this.actionsList=e.data,u.open("actionsWithProductModal")}))},close(){u.close("actionsWithProductModal")}},mergeCart:{packages:[],open(e){this.packages=e.cartData.packages,u.open("mergeCartModal",700)},unionCarts(e){u.inProgress=!0,f.unionCarts(e).then((e=>{u.close("mergeCartModal")})).finally((()=>{this.packages=[],u.inProgress=!1}))}},notificationShopRedirect:{title:t("Корзина будет очищена"),message:t("При смене страны корзина будет очищена, вы уверены?"),countrySubdomainForRedirect:null,deliveryCountryCode:null,openShopRedirectModal(e,t=null){this.countrySubdomainForRedirect=e,this.deliveryCountryCode=t,u.open("notificationShopRedirectModal")},redirectToShop(){const e=window.location.hostname.split(".");e.splice(0,1,this.countrySubdomainForRedirect);let t=`${window.location.protocol}//${e.join(".")}/${p.mainLanguage.localeCode}/`;this.deliveryCountryCode&&(t=`${t}?delivery=${this.deliveryCountryCode}`),window.location.href=t}},track24Widget:{open(){u.open("track24WidgetModal")}},posylkaNetTracking:{open(){u.open("posylkaNetTrackingModal")}},ozonTracking:{open(){u.open("ozonTrackingModal")}},homeCourierexeTracking:{open(){u.open("homeCourierexeTrackingModal")}},mentorSelectNotification:{data:null,isConsultant:!1,open(e){this.data=e,this.isConsultant=1==e.contractType,u.open("mentorSelectNotificationModal")},close(){this.data=null,u.close("mentorSelectNotificationModal"),w.scrollTo(".os-reg-form__mentor-row"),"undefined"!=typeof dataLayer&&this.isConsultant&&dataLayer.push({event:"user go back chosen BP"})},sendData(){let e=this.isConsultant;"undefined"!=typeof dataLayer&&e&&dataLayer.push({event:"user chosen BP after Sing up",event_params:{partner_method:"Auto",partner_ID:"0"}});let t=l.googleRecaptchaV3,n=this.data;grecaptcha.ready((function(){grecaptcha.execute(t,{action:"submit"}).then((function(t){n.token=t,u.inProgress=!0;const i=createUrl("shopen_app_ajax_validate_user_registration_data");d.postData(i,n,"",(t=>{t.data.phoneValidationRequired?(u.inProgress=!1,v.confirm.contract=t.data.contract,v.confirm.promoMentorSale=n.promoMentorSale,x.open("os-sms-verification"),g.registrationAction("phone",e)):d.createAndSubmitForm(t.data),u.close("mentorSelectNotificationModal"),u.inProgress=!1}))}))}))}},sidePopupConsultantProducts:{name:"",products:[],kits:[],addProductsFromConsultantCart(){if(this.products.length>0||this.kits.length>0){const e=createUrl("shopen_app_share_cart_link_add"),n=new XMLHttpRequest,a={items:[],kits:[]};this.products.length>0&&this.products.forEach((e=>{e.stock>0&&a.items.push({sku:e.sku,count:e.availableCount})})),this.kits.forEach(((e,t)=>{if(0===e.availableKitCount||!e.isActive)return!1;const n=JSON.parse(JSON.stringify(e));a.kits.push(n),e.count>e.availableKitCount&&(a.kits[t].count=e.availableKitCount),a.kits[t].items.forEach((t=>{t.count=t.count/e.count}))})),n.open("POST",e),n.addEventListener("load",(()=>{n.status>=200&&n.status<400?(m.show("success",[t("Товар успешно добавлен в корзину")]),i.$apply(),u.close("consultantHasntProducts"),r((()=>{window.location.href=`${window.location.origin}/${window.location.pathname.slice(1,3)}/shop/cart/`}),1500)):(m.show("error",[n.statusText]),console.error("addProductsFromConsultantCart: Request failed: "+n.statusText))})),n.addEventListener("error",(()=>{console.error("addProductsFromConsultantCart: Network error")})),n.send(JSON.stringify(a))}},removeProductOrKit(e,t){const n=e.findIndex((e=>e.sku===t));-1!==n&&e.splice(n,1),0===this.products.length&&0===this.kits.length&&u.close("consultantProducts")}},newClub500Bonus:{progress:!1,count:1,activeTab:"stepChoice0",prevTab:"",reinitAction:0,headerSliderOptions:{roundLengths:!0,spaceBetween:20,touchEventsTarget:"wrapper",slidesPerView:4,breakpoints:{991:{slidesPerView:1}}},productSliderOptions:{roundLengths:!0,spaceBetween:20,touchEventsTarget:"wrapper",simulateTouch:!1,slidesPerView:4,freeMode:!1,scrollbar:{el:".js-prod-actions-slider__scrollbar",hide:!1,draggable:!0},navigation:{prevEl:".js-prod-actions-slider__left",nextEl:".js-prod-actions-slider__right"},breakpoints:{991:{slidesPerView:1,freeMode:!1}}},currentTabNumber:1,steps:[],done:0,item:{id:"",name:"",imageURL:"",count:1,progress:!1,isPresentsAdded:!1,selectedGift:{},items:[],totalSum:{sum:0,oldSum:0,pointsSum:0}},openModal(){this.reinitAction++,this.calculate(),u.open("new500Bonuses")},closeModal(){this.clear(),u.close("new500Bonuses")},clear(){f.cart.actions.Club1000.length>0&&angular.forEach(f.cart.actions.Club1000[0].choice,(e=>{e.done=0,angular.forEach(e.products,(e=>{e.selected=!1,e.count=0}))})),this.item.count=1,this.item.items=[],this.item.selectedGift={},this.item.isPresentsAdded=!1,this.prevTab="",this.activeTab="stepChoice0",this.steps=[]},calculate(){this.item.id=f.cart.actions.Club1000[0].id,this.item.name=t(f.cart.actions.Club1000[0].name),this.item.imageURL=f.cart.actions.Club1000[0].imageURL&&/\.svg/gi.test(f.cart.actions.Club1000[0].imageURL)?"":f.cart.actions.Club1000[0].imageURL,!this.item.isPresentsAdded&&f.cart.actions.Club1000[0].presents&&(this.item.items=[].concat(f.cart.actions.Club1000[0].presents),this.item.isPresentsAdded=!0),f.cart.actions.Club1000[0].choice&&f.cart.actions.Club1000[0].choice.forEach(((e,t)=>{this.steps.push("stepChoice"+t)})),this.steps.push("stepTotal","stepComplete")},isCurrent(e){return e==this.activeTab},checkCondition(e){let t="stepCartCondition"==e?f.cart.actions.Club1000[0].cartConditions:f.cart.actions.Club1000[0].choice[e],n=!1;return n=f.cart.actions.Club1000[0].isRepeatable?t.done>=t.count:t.done>=t.count&&0===f.cart.actions.Club1000[0].countInCart,n},goTo(e){let t=this.steps.findIndex((t=>t==e)),n=this.steps[t-1];/choice|condition/i.test(n)&&!this.checkCondition(/choice/i.test(n)?n.slice(-1):"stepCartCondition")||("stepTotal"==e&&(this.item.items.forEach((e=>{e.price.current=e.newPrice&&+e.newPrice.value?+e.newPrice.value:+e.price.value,e.price.old=e.newPrice&&+e.newPrice.value?+e.price.value:0})),this.getActionPrice()),this.currentTabNumber=t+1,this.prevTab=this.activeTab,this.activeTab=e,this.reinitAction++)},goToNext(){let e=this.steps[this.steps.findIndex((e=>e==this.activeTab))+1];e&&this.goTo(e)},getActionPrice(){let e=this.item,t=createUrl("shopen_app_ajax_actions_get_kit_information"),n={actionID:e.id,actionName:e.name,items:e.items,count:e.count};e.progress=!0,d.postData(t,n,"",(t=>{e.totalSum.sum=t.data.kitTotalSum.value,e.totalSum.pointsSum=t.data.kitTotalPoints,e.progress=!1}),(()=>{e.progress=!1}))},getProductStatus(e,t){return t.selected?"selected":this.checkCondition(e)&&!t.selected||t.missing||t.noSale&&!p.mainDetectedCity.isSelfDeliveryAvailable?"disabled":void 0},addToCart(){let t=e.defer();if(this.progress)t.reject();else{let e=createUrl("shopen_app_ajax_cart_add_kit"),n=f.selectedPack.contract,i={actionID:this.item.id,actionName:this.item.name,items:this.item.items,packageContract:n||null,count:this.item.count};this.progress=!0,d.postData(e,i,"cart",(e=>{let n=this.item.totalSum.sum;g.addActionToCart(f.cart.actions.Club1000[0],n,this.item.count,p.mainDetectedCountry.currency.externalIso),f.prepareCart(e.data.cartData),this.clear(),this.progress=!1,t.resolve(e),this.closeModal()}),(()=>{f.getUserData().then((()=>{this.progress=!1,this.clear(),this.closeModal()})),t.resolve()}),(()=>{this.progress=!1,this.clear(),this.closeModal(),t.resolve()}))}return t.promise}}};return c.host().slice(0,2).includes("ru")&&(document.querySelector(".modal").addEventListener("scroll",(function(){if(!this.classList.contains("modal_delivery-self-new"))return!1;document.querySelectorAll(".modal-body__filter").length>0&&(document.querySelector(".modal-body__filter").getBoundingClientRect().top<=0&&!document.querySelector(".modal-body__filter").classList.contains("modal-body__filter_is-fixed")?document.querySelector(".modal-body__filter").classList.add("modal-body__filter_is-fixed"):document.querySelector(".modal-body__filter").getBoundingClientRect().top>0&&document.querySelector(".modal-body__filter").classList.contains("modal-body__filter_is-fixed")&&document.querySelector(".modal-body__filter").classList.remove("modal-body__filter_is-fixed"));const e=document.querySelector(".modal_delivery-self-new").scrollTop,t=document.querySelector(".modal_delivery-self-new").offsetHeight,n=document.querySelector(".delivery-address__form").getBoundingClientRect().top;if(!D.deliveries.self.isShowButtonForRecipientData&&e+t<=e+n&&i.$apply((()=>{D.deliveries.self.isShowButtonForRecipientData=!0})),D.deliveries.self.isShowButtonForRecipientData&&e+t>e+n&&i.$apply((()=>{D.deliveries.self.isShowButtonForRecipientData=!1})),D.deliveries.view.filteredData.length===D.deliveries.self.numberOfPointsAdded||D.deliveries.view.filteredData.length<=10||D.deliveries.self.isStopAddingDeliveryPoints)return!1;const r=document.querySelector(".self-points-list").querySelectorAll(".address-panel")[D.deliveries.self.numberOfPointsAdded-3].getBoundingClientRect().top;e+document.querySelector(".modal_delivery-self-new").offsetHeight>=r+e&&(D.deliveries.self.isStopAddingDeliveryPoints=!0,D.deliveries.self.numberOfDeliveryPoints=D.deliveries.view.filteredData.length>=D.deliveries.self.numberOfPointsAdded+10?10:D.deliveries.view.filteredData.length-D.deliveries.self.numberOfPointsAdded,i.$apply((()=>{D.deliveries.view.filteredData.slice(D.deliveries.self.numberOfPointsAdded,D.deliveries.self.numberOfPointsAdded+D.deliveries.self.numberOfDeliveryPoints).map((e=>{D.deliveries.view.paginatedData.push(e)}))})),D.deliveries.self.numberOfPointsAdded+=D.deliveries.self.numberOfDeliveryPoints,D.deliveries.self.isStopAddingDeliveryPoints=!1)})),window.addEventListener("resize",(function(){if(!document.querySelector(".modal_delivery-self-new"))return!1;const e=document.querySelector(".modal_delivery-self-new").scrollTop,t=document.querySelector(".modal_delivery-self-new").offsetHeight,n=document.querySelector(".delivery-address__form").getBoundingClientRect().top;!D.deliveries.self.isShowButtonForRecipientData&&e+t<=e+n&&i.$apply((()=>{D.deliveries.self.isShowButtonForRecipientData=!0})),D.deliveries.self.isShowButtonForRecipientData&&e+t>e+n&&i.$apply((()=>{D.deliveries.self.isShowButtonForRecipientData=!1}))}))),D}]),frontApp.factory("notificationService",["$rootScope","$timeout",function(e,n){return{showNotification:!1,activeResult:"",userMessage:"",noResponseMessage:[t("Сервер не отвечает. Попробуйте позднее")],activeType:"",types:["cart","security","server","product"],events:{getNotification(){e.$broadcast("getNotification")},listenGetNotification(t){e.$on("getNotification",t)}},show(e,t,i){t.length&&n((()=>{this.activeResult=e,this.activeType=i,this.userMessage=t,this.showNotification=!0,"success"==this.activeResult&&n((()=>{this.hide()}),2e3)}))},hide(e){void 0!==e&&e.preventDefault(),this.showNotification=!1,this.activeResult="",this.activeType="",this.userMessage=""}}}]),frontApp.factory("paymentService",[function(){return{kgSendPaymentData:(e,t)=>new Promise(((n,i)=>{const r=new XMLHttpRequest;r.open("POST",e),r.addEventListener("load",(()=>{r.status>=200&&r.status<400?n(r.response):(n(r.response),i(new Error("kgSendPaymentData: Request failed: "+r.statusText)))})),r.addEventListener("error",(()=>i(new Error("kgSendPaymentData: Network error")))),r.send(t)})),kgPaymentConfirmation:(e,t,n)=>"POST"===n?new Promise(((n,i)=>{const r=new XMLHttpRequest;r.open("POST",e),r.addEventListener("load",(()=>{r.status>=200&&r.status<400?n(r.response):(n(r.response),console.log("kgPaymentConfirmation: Request failed: "+r.statusText))})),r.addEventListener("error",(()=>i(new Error("kgPaymentConfirmation: Network error")))),r.setRequestHeader("Content-type","application/json; charset=utf-8"),r.send(t)})):"GET"===n?new Promise(((t,n)=>{const i=new XMLHttpRequest;i.open("GET",e),i.addEventListener("load",(()=>{i.status>=200&&i.status<400?t(i.response):(t(i.response),console.log("kgPaymentConfirmation: Request failed: "+i.statusText))})),i.addEventListener("error",(()=>n(new Error("kgPaymentConfirmation: Network error")))),i.send()})):void 0}}]),frontApp.factory("preloader",(function(){return{displayPreloader:!1,showPreloader(){this.displayPreloader=!0},hidePreloader(){this.displayPreloader=!1}}})),frontApp.factory("registrationService",["$timeout","$interval","$cookies","$location","httpService","geoService","modalService","notificationService","preloader","userService","$window","eCommerceService",function($timeout,$interval,$cookies,$location,httpService,geoService,modalService,notificationService,preloader,userService,$window,eCommerceService){const registration={csrf_token:""};function prepareMentors(e){if(["ru","ua","by","kz","uz","kg","pl","de","rs","cz","bg","az","md"].find((e=>e===geoService.mainDetectedCountry.cntr))){const t="ru"===geoService.mainDetectedCountry.cntr?{VK:"vk",OKID:"ok"}:{FACEID:"fb",INSTNAME:"instagram",VK:"vk",OKID:"ok"};e.forEach((e=>{e.social=[],Object.keys(t).forEach((n=>{const i=e.contacts.find((e=>e.type===n));i&&i.value&&e.social.push({type:t[n],href:i.value})}))}))}return e}return registration.existingContract={card:{number:"",code:""},progress:!1,validate(e,t,n){this.progress=!0;let i={number:e.number,secret:e.code},r=createUrl("shopen_app_ajax_security_check_card",i);httpService.postData(r,"","",(e=>{e.data&&e.data.fullName&&(registration.mentor.selectedMentor=e.data,registration.mentor.setByUser=!1,registration.mentor.search="",registration.mentor.setBySearch=!1,registration.mentor.forceMentor=!0),this.progress=!1,"function"==typeof t&&t()}),(()=>{this.progress=!1,"function"==typeof n&&n()}),(()=>{this.progress=!1,"function"==typeof n&&n()}))}},registration.mentor={selectedMentor:{},mentorList:[],forceMentor:!1,cardMentor:!1,userLink:!1,setByUser:!1,setBySearch:!1,search:"",progress:!1,requireSelect:!1,isConsultantText:!1,openModal(){this.requireSelect=!0,modalService.open("mentorModal")},clearPromocodeMentor(){this.forceMentor&&!this.userLink&&(this.selectedMentor={},this.forceMentor=!1,this.getCookieMentor())},getList(e,t,n,i){let r={countryCode:e||geoService.mainDetectedCountry.cntr,cityCode:t||geoService.mainDetectedCity.id};n&&(r.sex=n),i&&(r.birthdate=i);let a=createUrl("shopen_app_ajax_security_get_mentor_list",r);this.progress=!0,httpService.getData(a,"",(e=>{this.mentorList=prepareMentors(e.data),this.progress=!1}))},selectMentor(e){let t=/CONSULTANT/gi.test($location.absUrl());"undefined"!=typeof dataLayer&&t&&dataLayer.push({event:"user slct BP at list"}),this.selectedMentor=e,this.setByUser=!0,this.search="",this.setBySearch=!1,modalService.close("mentorModal")},resetMentorSearch(){this.selectedMentor={},this.search="",this.setBySearch=!1},getCookieMentor(){let e=$cookies.get("mentorContract"),t=$cookies.get("mentorFullName");e||t||!$cookies.get("setCyberMentor")||(e="6885245",t="Siberian Wellness Cybersport"),e&&t&&(this.selectedMentor.contract=e,this.selectedMentor.fullName=t.replace(/\+/g," "),this.forceMentor=!0,this.userLink=!0)}},registration.validation={email(e,t,n){let i=createUrl("shopen_app_ajax_security_email_check"),r={email:e};this.check(i,r,t,n)},phone(e,t,n){let i=createUrl("shopen_app_ajax_security_phone_check");this.check(i,e,t,n)},mentor(e,t,n){notificationService.hide();let i=createUrl("shopen_app_ajax_security_mentor_check_by_contract",{contract:e});const r={isConsultantText:registration.mentor.isConsultantText};httpService.postData(i,r,"",(e=>{let n=/CONSULTANT/gi.test($location.absUrl());"undefined"!=typeof dataLayer&&n&&dataLayer.push({event:"user slct BP by using reg num"}),registration.mentor.selectedMentor=e.data,registration.mentor.setByUser=!1,registration.mentor.setBySearch=!0,t(e)}),(e=>{registration.mentor.setBySearch=!1,n(e)}),(()=>{registration.mentor.setBySearch=!1,n()}))},promocode(e,t,n){notificationService.hide();let i=createUrl("shopen_app_ajax_security_refcode_check",{promoMentorSale:e});httpService.postData(i,"","",(function(e){registration.mentor.selectedMentor=e.data,registration.mentor.forceMentor=!0,registration.mentor.userLink=!1,t(e)}),(function(e){registration.mentor.forceMentor=!1,n(e)}),(function(){registration.mentor.forceMentor=!1,n()}))},check(e,t,n,i){notificationService.hide(),httpService.updatePromise().then((()=>{t._csrf_token=registration.csrf_token,httpService.postData(e,t,"",(e=>{n(e)}),(e=>{i(e)}),(()=>{i()}))}))}},registration.confirm={contract:"",confirmationCode:"",promoMentorSale:"",phoneCountryIsoCode:"",sendData(e,n,i){if(!this.confirmationCode)return void notificationService.show("error",[t("Введите код подтверждения")]);"undefined"!=typeof dataLayer&&i&&dataLayer.push({event:"user success entr reg code"}),n&&eCommerceService.buttonClickEvent("cart2","verify_phone");let r=createUrl("shopen_app_ajax_security_phone_verify"),a={contract:this.contract,code:this.confirmationCode};this.promoMentorSale&&(a.promoMentorSale=this.promoMentorSale),registration.existingContract.card.number&&(a.oldContract=registration.existingContract.card.number);return httpService.postData(r,a,"",(t=>{if("2.0"===$cookies.get("Exp01")&&"не авторизован"===$cookies.get("status_exp")){let e=new Date;const t=$cookies.get("mentorContract")?"привели":"самостоятельный";((e,t,n)=>{$cookies.put(e,n,{expires:t,path:"/"})})("status_exp",new Date(e.setMonth(e.getMonth()+2)),t)}e?eCommerceService.registrationAction("payment",e,(()=>{httpService.createAndSubmitForm(t.data)})):n?userService.getUserData().then((e=>{eCommerceService.logIn(!1,"registration",!0)})):httpService.createAndSubmitForm(t.data)}))},resendSmsCode(e){let t=createUrl("shopen_app_ajax_security_change_registration_phone_and_resend_validation_code"),n={contract:this.contract};return e&&eCommerceService.buttonClickEvent("cart2","change_phone"),httpService.postData(t,n,"")}},registration.social={fb:{login(e){httpService.isEmptyObj(FB)||new Promise(((e,t)=>{FB.login((n=>{if(n.authResponse){let t=["id","first_name","last_name","gender","picture","email","birthday"];FB.api("/me?fields="+t.join(","),(t=>{e(t)}))}else t(n)}),{scope:"public_profile, email, user_birthday, user_gender"})})).then((t=>{e.email=t.email,e.secondName=t.last_name,e.firstName=t.first_name,t.gender&&(e.sex="женский"==t.gender?"W":"M"),t.birthday&&2==t.birthday.match(/\//g).length&&(e.birthDate=t.birthday.replace(/(\d+)\/(\d+)\/(\d+)/,"$2.$1.$3")),e.sn={snAlias:"facebook",userID:t.id}}))}}},registration.getCscList=function(e,t){let n=createUrl("shopen_app.api.v1.get-csc.bycity",{cityId:e}),i=[];httpService.getData(n,"",(function(e){i=e.data,angular.forEach(i,(e=>{e.cscInfo=`${e.contract}\n${e.address}`})),"function"==typeof t&&t(i)}),(function(){}))},registration.getCscListByCountry=function(e,t){let n=createUrl("shopen_app.api.v1.get-csc.bycountry",{countryCode:e}),i=[];httpService.getData(n,"",(function(e){i=e.data,angular.forEach(i,(e=>{e.cscInfo=`${e.contract}\n${e.address}`})),"function"==typeof t&&t(i)}),(function(){}))},registration.refferalSmsCodeAuth={code:"",phone:"",countryIso:"",canResend:!1,canRepeatPhone:!1,newPhone:"",timer:{seconds:180,promise:""},isReferralRegistration:!0,isErrorSmsCode:!1,applyData(e,t){this.phone=e,this.countryIso=t,this.canResend=!1,$interval.cancel(this.timer.promise),registration.timer.start(this.timer,180,(()=>{this.canResend=!0}))},sendData(){preloader.showPreloader();let e={code:this.code,phone:this.phone,countryIso:this.countryIso,isReferralRegistration:this.isReferralRegistration},t=createUrl("shopen_app_ajax_security_code_verify_to_auth");httpService.postData(t,e,"",(e=>{preloader.hidePreloader(),e.data.redirect&&(preloader.showPreloader(),this.isErrorSmsCode=!1,$timeout((()=>{$window.location.href=e.data.redirect}),1e3))}),(()=>{preloader.hidePreloader(),this.isErrorSmsCode=!0}))},resendSmsCode(invalid){if(invalid)return;preloader.showPreloader(),this.canResend=!1,registration.timer.start(this.timer,180,(()=>{this.canResend=!0}));let data={phone:this.phone},url=createUrl("shopen_app_ajax_security_change_registration_phone_and_resend_validation_code");if(this.newPhone){data.phone=httpService.clearPhone(this.newPhone),this.phone=this.newPhone,geoService.getLocation();let location=eval("("+$cookies.get("location")+")");data.countryIso=location.countryCode}httpService.postData(url,data,"",(e=>{preloader.hidePreloader(),this.newPhone="",this.canResend=!1,this.canRepeatPhone=!1,registration.timer.stop(this.timer),registration.timer.start(this.timer,180,(()=>{this.canResend=!0}))}),(()=>{preloader.hidePreloader()}),(()=>{preloader.hidePreloader()}))},changePhone(e,t){e.preventDefault(),this.canRepeatPhone=!0,this.canResend=!0,this.isErrorSmsCode=!1,registration.timer.stop(this.timer),t&&eCommerceService.buttonClickEvent(t,"change_phone")}},registration.smsCodeAuth={code:"",phone:"",countryIso:"",isQuickPurchase:!1,inProgress:!1,canResend:!1,timer:{seconds:180,promise:""},applyData(e,t){this.phone=e,this.countryIso=t,this.canResend=!1,$interval.cancel(this.timer.promise),registration.timer.start(this.timer,180,(()=>{this.canResend=!0}))},sendData(){this.inProgress=!0;const e={code:this.code,phone:this.phone,countryIso:this.countryIso,isQuickPurchase:this.isQuickPurchase},t=createUrl("shopen_app_ajax_security_code_verify_to_auth");httpService.postData(t,e,"",(e=>{this.inProgress=!1,modalService.close("smsCodeAuth"),e.data.redirect&&(preloader.showPreloader(),$timeout((()=>{$window.location.href=e.data.redirect}),1e3))}),(()=>{this.inProgress=!1}))},resendSmsCode(){this.inProgress=!0,this.canResend=!1,registration.timer.start(this.timer,180,(()=>{this.canResend=!0}));let e={phone:this.phone},t=createUrl("shopen_app_ajax_security_resend_code");httpService.postData(t,e,"",(e=>{this.inProgress=!1}),(()=>{this.inProgress=!1}))}},registration.timer={start(e,t,n){e.seconds=t,e.promise=$interval((()=>{e.seconds--,e.seconds<=0&&($interval.cancel(e.promise),"function"==typeof n&&n())}),1e3)},stop(e){$interval.cancel(e.promise)},splitSeconds(e){let t=e.toString();return e<100&&(t=e>9?"0"+e:"00"+e),{number1:t[0],number2:t[1],number3:t[2]}}},registration}]),frontApp.factory("retailrocketService",["geoService",function(e){function t(e,t){-1===t.indexOf(+e)&&t.push(+e)}return{addProductEvent(t){try{rrApi.addToBasket(t.optionSku||t.sku,{stockId:e.mainDetectedCity.id})}catch(e){}},sendEmail(t){(window.rrApiOnReady=window.rrApiOnReady||[]).push((function(){rrApi.setEmail(t.email,{stockId:e.mainDetectedCity.id,name:t.name,birthday:t.birthday,age:t.age,userType:t.userType,phone:t.phone})}))},initRetailRocketBlocks(e){let n=document.querySelectorAll("[data-rrblockinit]");if(!n.length)return;let i=decodeURI(document.cookie.replace(/(?:(?:^|.*;\s*)location\s*\=\s*([^;]*).*$)|^.*$/,"$1")).split('"')[7],r=function(e){let n=[];return angular.forEach(e.packages,(e=>{angular.forEach(e.items,(e=>{t(e.sku,n)})),angular.forEach(e.kits,(e=>{angular.forEach(e.items,(e=>{t(e.sku,n)}))}))})),n.join(",")}(e),a=!!window.location.pathname.includes("catalog/product/")&&window.location.pathname.split("/")[5];n.forEach((e=>{r&&(e.dataset.products=r),e.dataset.stockId=i,a&&(e.dataset.productId=a),e.dataset.retailrocketMarkupBlock=e.dataset.rrblockinit}));try{retailrocket.markup.render()}catch(e){}}}}]),frontApp.service("reviewsService",["httpService",function(e){function t(e,t){let n;return n=e<=5?new Array(e).fill(1).map(((e,t)=>t+1)):t<4?Array.of(1,2,3,4,5,"..."):t>=e-1?Array.of(1,"...",e-2,e-1,e):Array.of(1,"...",t-1,t,t+1,"..."),n}this.list=[],this.progress=!1,this.reviewText="",this.sendReview=function(t){this.progress=!0;let n=createUrl("shopen_app_ajax_product_feedback_send"),i={product:{sku:t},text:this.reviewText};e.postData(n,i,"",(()=>{this.reviewText="",this.progress=!1}),(()=>{this.progress=!1}))},this.getReviews=function(e){this.list=e,this.pagination.pagesCount=Math.ceil(e.length/3),this.pagination.pagesCount>1&&(this.pagination.pages=t(this.pagination.pagesCount,this.pagination.currentPage))},this.pagination={pagesCount:0,pages:null,currentPage:1,shift:0,setPage(e){this.isNumber(e)&&(this.currentPage=e,this.shift=3*(e-1),this.pages=t(this.pagesCount,this.currentPage))},setPrevPage(){this.setPage(this.currentPage-1)},setNextPage(){this.setPage(this.currentPage+1)},isNumber:e=>Number.isInteger(e)}}]),frontApp.factory("userService",["$window","$timeout","$cookies","$q","httpService","modalService","certificatesService","headerInformerService","mainConfigurationService","eCommerceService","geoService","retailrocketService",function(e,t,n,i,r,a,o,s,l,c,u,d){const p={user:{},cart:{},oldCart:null,isUserAuthorized:!1,isProgress:!0,selectedPack:{},redirectUrl:"",menu:{},getDateForStatusExpCookie(e){let t=new Date;return new Date(t.setMonth(t.getMonth()+e))},getStatusForStatusExpCookie(e){switch(e){case"не авторизован":return"не авторизован";case"c":return"БП";case"pc":return"ПК";case"e":return"сотрудник";case"n":return"NO_CASHBACK";case"m":return"MY_MARKET"}},setCookieStatusExp(e,t){n.put("status_exp",e,{expires:t,path:"/"})},getUserData(){this.isProgress=!0;const e=createUrl("shopen_app_ajax_security_auth_check"),t=i.defer();return r.getData(e,"security",(e=>{if(this.isUserAuthorized=!!e.data.userData.contract,this.prepareUser(e.data),this.prepareCart(e.data.cartData),this.isProgress=!1,t.resolve(this.isUserAuthorized),"2.0"===n.get("Exp01")&&!n.get("status_exp")){const e=(()=>this.isUserAuthorized&&p.user.role?this.getStatusForStatusExpCookie(p.user.role):this.getStatusForStatusExpCookie("не авторизован"))();this.setCookieStatusExp(e,this.getDateForStatusExpCookie(2))}"2.0"===n.get("Exp01")&&"undefined"!=typeof ym&&"function"==typeof ym&&("не авторизован"!==n.get("status_exp")||this.isUserAuthorized?n.get("status_exp")&&this.isUserAuthorized&&ym(21951292,"userParams",{status:n.get("status_exp"),UserID:e.data.userData.contract}):ym(21951292,"userParams",{status:"не авторизован"}),ym(21951292,"params",{Exp01:n.get("Exp01")}))}),(e=>{this.isProgress=!1,t.resolve(!1)})),t.promise},checkShoppingCart(){this.isProgress=!0;const e=createUrl("shopen_app_ajax_update_prices"),t=i.defer();return r.getData(e,"security",(e=>{this.isProgress=!1,t.resolve(this.isUserAuthorized)})),t.promise},login(t,a){const o=createUrl("shopen_app_login_check"),s={_username:t,_password:a},l=i.defer();if("de"!==u.mainDetectedCountry.cntr){let e=new Date;e.setMonth(e.getMonth()+120),document.cookie="loginAgreement=true; expires="+e.toUTCString()+"; path=/"}return localStorage.ga_client_id&&(s._gaID=JSON.parse(localStorage.ga_client_id).clientId),r.postData(o,s,"security",(t=>{if(this.isUserAuthorized=!0,this.prepareUser(t.data),this.prepareCart(t.data.cartData),"2.0"===n.get("Exp01")&&"не авторизован"===n.get("status_exp")){const e=(()=>this.isUserAuthorized&&p.user.role?this.getStatusForStatusExpCookie(p.user.role):this.getStatusForStatusExpCookie("не авторизован"))();this.setCookieStatusExp(e,this.getDateForStatusExpCookie(2))}"undefined"==typeof ga||ga.devEnv||(userId=t.data.userData.contract,userRole=t.data.userData.role,userRef=n.get("mentorContract")||"","undefined"!=typeof userRole&&userRole.length>0&&"undefined"!==dataLayer&&dataLayer.push({userRole:userRole})),c.logIn("c"==this.user.role),t.data.hasCart?(this.oldCart=t.data.cartData.packages,this.redirectUrl=t.data.redirect):t.data.redirect&&(e.location.href=t.data.redirect),l.resolve(t.data)}),(()=>{l.reject()})),l.promise},logout(){"undefined"!=typeof dataLayer&&dataLayer.push({event:"user clk Exit account"});const n=createUrl("opensite_app_ajax_security_logout");r.postData(n,"","security",(n=>{this.isUserAuthorized=!1,n.data.redirect&&t((()=>{e.location.href=n.data.redirect}),100)}))},prepareCart(e,t=this.user){e.certificatedPackages&&e.certificatedPackages.length&&o.prepareCertificatePackages(e,t.certificates),function(e,t){const i=n.get("selectedPack");angular.forEach(e,(e=>{e.isCertificate=!!e.isCertificate,e.isOwner=e.contract==t,e.avatar&&!e.isCertificate&&(e.style={backgroundImage:`url(${e.avatar})`}),e.contract==t&&(p.selectedPack=e),!i||i!=e.contract&&i!=e.certificateNum||(p.selectedPack=e)}))}(e.packages,t.contract),e.actions&&Object.values(e.actions).forEach((e=>{var t;e.length&&(t=e,Object.defineProperty(t,"swiperOptions",{value:{autoHeight:!1,roundLengths:!0,spaceBetween:8,touchEventsTarget:"wrapper",slidesPerView:3,freeMode:!1,navigation:{nextEl:".actions-special-offer__swiper-btn._right",prevEl:".actions-special-offer__swiper-btn._left"},breakpoints:{600:{slidesPerView:2},450:{slidesPerView:1}}},writable:!0}))})),Object.assign(this.cart,e)},prepareUser(e){if(e.userData.name&&"de"!==u.mainDetectedCountry.cntr){let e=new Date;e.setMonth(e.getMonth()+120),document.cookie="loginAgreement=true; expires="+e.toUTCString()+"; path=/"}"M"!=e.userData.contract.charAt(0)&&"e"!=e.userData.role||(l.packagesEnabled=!1),e.userData.bonuses&&(e.userData.bonuses.sum=e.userData.bonuses.b25+e.userData.bonuses.bz+e.userData.bonuses.elacc+e.userData.bonuses.roz19),e.userData.certificates&&e.userData.certificates.length&&o.prepareCertificates(e.userData.certificates,e.cartData.certificatedPackages),s.types.registerPay.deferred.resolve(e.userData.isRegisterPaid?null:"registerPay"),Object.assign(this.user,e.userData)},unionCarts(t){if(!t)return;const n=createUrl("shopen_app_ajax_cart_merge_carts",{userAction:t}),a=i.defer();return r.postData(n,"","cart",(e=>{this.prepareCart(e.data.cartData),a.resolve()}),(()=>{a.reject()})),this.redirectUrl&&(e.location.href=this.redirectUrl),a.promise},getRegistrationPaymentLink(){const e=createUrl("shopen_app_ajax_security_get_redirect_data_for_payment");this.getRegistrationPaymentLink.isProgress=!0,r.postData(e,"","",(e=>{r.createAndSubmitForm(e.data)}))},formSubscribe:{isSent:!1,isProgress:!1,email:"",sendData(){const e={email:this.email};d.sendEmail(e);const t=createUrl("ajax_opensite_subscribe"),n={email:this.email};this.isProgress=!0,r.postData(t,n,"",(e=>{this.isProgress=!1,this.isSent=!0}))}}};return p}]),frontApp.directive("actionCounterButton",(function(){const e={selectedOne:t("Выбрать 1"),selectedMany:t("Выбрано"),selectedUnits:t("шт."),selectedCancel:t("Отменить выбор")};return{restrict:"E",require:"ngModel",replace:!0,templateUrl:TEMPLATE_URL+"/os-action-counter-button.html",scope:{ngModel:"=",cart:"=",counter:"=",max:"="},link(t,n,i){function r(){t.ngModel.count=1,t.cart.push(t.ngModel),t.ngModel.selected=!0,t.counter++}t.ngModel.count=0,t.stopSelection=!1,t.hideButtons=!1,t.singleChoice=1==t.max,t.labels=e,t.$watch("counter",(e=>{e==t.max?(t.stopSelection=!0,t.ngModel.selected||(t.hideButtons=!0)):(t.stopSelection=!1,t.hideButtons=!1)})),t.addItem=()=>{t.ngModel.selected||r()},t.reset=()=>{let e=t.cart.findIndex((e=>e.sku==t.ngModel.sku));t.cart.splice(e,1),t.ngModel.selected=!1,t.counter-=t.ngModel.count,t.ngModel.count=0},t.change=e=>{if(e&&!t.stopSelection){if(!t.ngModel.selected)return void r();t.ngModel.count++,t.counter++}else!e&&t.ngModel.count>1&&(t.ngModel.count--,t.counter--)}}}})),frontApp.directive("addToCart",["$q","userService","cartService","geoService","modals","eCommerceService","mainConfigurationService","actionsService","modalService",function(e,n,i,r,a,o,s,l,c){const u={toCart:t("В корзину"),amount:t("шт."),wantToOrder:t("Хочу заказать!"),outOfStock:t("Нет в наличии"),subscribeToProduct:t("Узнать о поступлении"),whereBuy:t("Найти где купить")},d=s.createUrl("shopen_app_opensite_geo"),p=(e,t)=>{t?++e.count:e.count>1&&--e.count},h=(e,t,r)=>{t?(++e.countInCart,++n.cart.amount,++n.selectedPack.items.find((t=>t.sku===e.sku)).count,i.editCart(n.cart),null!==r&&void 0!==typeof ym&&"undefined"!=typeof ym&&"function"==typeof ym&&ym(21951292,"reachGoal",r)):e.countInCart>1&&(--e.countInCart,--n.cart.amount,--n.selectedPack.items.find((t=>t.sku===e.sku)).count,i.editCart(n.cart))};return addProductToCart=(e,t)=>{i.addToCart(e,(()=>{if(null!==t&&void 0!==typeof ym&&"undefined"!=typeof ym&&"function"==typeof ym)for(let n=0;n{let e=JSON.parse(localStorage.getItem("cartActionPopup")),t=Array.isArray(e)?e:[],n=l.fullList,i=[];for(let e=0;et===n[e].id))&&l.hasMarginedActions&&n[e].cartConditions.done&&n[e].cartConditions.count&&n[e].cartConditions.done>=n[e].cartConditions.count&&0===n[e].countInCart&&(i.push(n[e]),t.push(n[e].id))}localStorage.setItem("cartActionPopup",JSON.stringify(t)),i.sort(((e,t)=>e.cartConditions.count-t.cartConditions.count)),l.marginedActionsList=i,l.setCurrentAction(i[i.length-1]),c.open("addToCartActionModal")}))}),(()=>{e.progress=!1}))},getCountInCart=e=>{const t=n.selectedPack;let i;return"object"==typeof t&&void 0!==t.items&&(i=t.items.filter((t=>t.sku===e.sku)),!!i.length&&i[0].count)},{restrict:"E",replace:!0,scope:{product:"=",disabled:"=",useProductSubscribtion:"=",ymtype:"="},templateUrl:TEMPLATE_URL+"/os-addtocart-button.html",link(e,t){e.text=u,e.linkToGeoPage=d,e.isCartLoaded=!1,e.isDemandForbidden=!1,e.product.count=1,e.product.countInCart,e.changeCount=p,e.changeCountInCart=h,e.addToCart=()=>{e.product.progress=!0,e.product.gaLabel&&o.buttonClickEvent(...e.product.gaLabel),o.addProductToCart(e.product),addProductToCart(e.product,e.ymtype),e.product.isUsedInAction&&!i.getCartProducts().some((t=>t.sku===e.product.sku))&&a.actionsWithProduct.open(e.product)},e.subscribeProduct=()=>{catalogBlock=document.querySelector(".os-catalog"),rrMarkupBlock=document.createElement("div"),rrMarkupBlock.setAttribute("data-retailrocket-markup-block","622f661a97a52511cc3ca94a"),rrMarkupBlock.setAttribute("data-stock-id",r.mainDetectedCity.id),rrMarkupBlock.setAttribute("data-product-id",e.product.sku);let t=document.querySelector('[data-retailrocket-markup-block="622f661a97a52511cc3ca94a"]');t?t.replaceWith(rrMarkupBlock):catalogBlock.appendChild(rrMarkupBlock);try{retailrocket.markup.render()}catch(e){console.log(e)}},e.openOutOfStockModal=e=>{a.outofstockOrder.open(e.sku)},e.$watch((()=>n.isProgress),(t=>{t||(e.isCartLoaded=!0)})),e.$watch((()=>n.selectedPack),(()=>{e.product.countInCart=getCountInCart(e.product)}));let s=e.$watch((()=>r.mainDetectedCountry.isDemandForbidden),(t=>{void 0!==t&&(e.isDemandForbidden=t,s())}))}}}]),frontApp.directive("checkPickpointPrice",["modals",function(e){const n={getPrice:t("узнать цену"),newGetPrice:t("Узнать стоимость")};return{restrict:"E",replace:!0,template:'
\n \n
\n
',scope:{csc:"=",isNew:"="},link(t,i,r){t.labels=n,t.show=()=>!t.csc.price&&!t.csc.progress,t.getPrice=()=>{e.deliveries.getPickpointPrice(t.csc,(()=>{t.isNew&&("undefined"!==dataLayer&&dataLayer.push({event:"user clck btn find out the cost pickup"}),t.csc.isActive()&&e.deliveries.self.showButtonForRecipientData(),e.deliveries.activatePickpointsMap())}))}}}}]),frontApp.directive("checkRecaptcha",["$timeout",function(e){return{restrict:"E",replace:!0,scope:{ngModel:"=",sitekey:"@"},template:'
',link(t,n,i){"undefined"!=typeof grecaptcha&&(grecaptcha.render("askQuestion-re",{sitekey:t.sitekey}),window.reCaptchaFilled=()=>{e((()=>{let e=grecaptcha.getResponse();e&&(t.ngModel=e)}))},window.reCaptchaExpired=()=>{e((()=>{t.ngModel=""}))})}}}]),frontApp.directive("ecProduct",["eCommerceService",function(e){return{restrict:"A",scope:{ecProduct:"=",position:"=",list:"@"},link(t,n,i){if("IntersectionObserver"in window){new IntersectionObserver(((n,i)=>{n.forEach((n=>{const{isIntersecting:r}=n;r&&(e.catalogProductsViewByProduct(t.ecProduct,t.position,t.list),i=i.disconnect())}))}),{root:null,rootMargin:"0px 0px 0px 0px",threshold:.5}).observe(n[0])}i.ngClick||(n.on("click",(function(n){if(n.target.classList.contains("product-baloon")||n.target.classList.contains("products-catalog__badge"))return;void 0!==typeof ym&&"undefined"!=typeof ym&&"function"==typeof ym&&ym(21951292,"reachGoal","open_product_from_listing");let i=t.position||t.staticPosition;e.productClick(t.ecProduct,i,t.list)})),n.on("click","a",(function(e){e.preventDefault()})))}}}]),frontApp.directive("existingContractCard",["geoService","registrationService","notificationService","eCommerceService",function(e,n,i,r){const a={question:t("У вас есть незарегистрированная карта?"),cancelText:t("Отмена"),cardNumberText:t("Номер карты:"),cardCodeText:t("Штрихкод:"),requireText:t("Это поле обязательно для заполнения"),noteText:t("Если ранее вы приобрели Регистрационный комплект Консультанта, введите номер карты и секретный код в соответствующие поля. В этом случае оплата за регистрацию сниматься не будет."),chinaText:t("Введите номер карты и секретный код в соответствующие поля"),sevenDigitCardNote:t("Если номер вашей карты состоит из семи цифр, то для регистрации необходимо ввести номер карты и пароль.")};return{restrict:"E",require:["^form"],scope:{ngModel:"=",formName:"@",formValidFlag:"=",pagename:"@"},templateUrl:TEMPLATE_URL+"/os-existingcontract.html",link(t,o,s,l){let c={number:"",code:""},u=l[0];function d(e){u.oldContract.$setValidity("uniqueValue",e),u.oldContractCode.$setValidity("uniqueValue",e)}t.texts=a,t.showOldContractFields=!1,t.currentCountry=e.mainDetectedCountry,t.showContractCardDescription=/CONSULTANT/gi.test(window.location),t.insertCard=()=>{t.showOldContractFields=!0,t.pagename&&r.buttonClickEvent(t.pagename,"UnregisteredCard")},t.cancelCard=e=>{t.showOldContractFields=!1,t.ngModel.number="",t.ngModel.code="",n.mentor.forceCard=!1,n.mentor.getCookieMentor()},t.saveOnFocus=()=>{c.number=t.ngModel.number,c.code=t.ngModel.code},t.tryValidate=()=>{t.ngModel.number&&t.ngModel.code&&(t.ngModel.number===c.number&&t.ngModel.code===c.code||(i.hide(),n.existingContract.validate(t.ngModel,(()=>{d(!0)}),(()=>{d(!1)}))))},t.fieldError=e=>t.formValidFlag&&!u[e].$valid,t.hideCard=()=>n.mentor.forceMentor&&!n.mentor.userLink,t.$watch("ngModel",(function(e,i){!e.number&&i.number?(t.ngModel.code="",d(!0),n.mentor.getCookieMentor()):!e.code&&i.code&&e.number&&(u.oldContract.$setValidity("uniqueValue",!1),n.mentor.getCookieMentor())}),!0),t.$watch("geoService.mainDetectedCountry",(e=>{e&&"cn"==e.cntr&&(t.noteText=t.chinaText)}))}}}]),frontApp.directive("focusIf",["$timeout",function(e){return{scope:{focusIf:"=",focusDelay:"@"},link(t,n,i){t.focusDelay||(t.focusDelay=100),t.$watch("focusIf",(i=>{i&&e((()=>{n[0].focus()}),t.focusDelay)}))}}}]),frontApp.directive("getDomData",(function(){return{restrict:"A",scope:{getDomData:"=",catalogBrand:"=",categoryId:"="},link(e,t,n){n.brand&&(e.catalogBrand=n.brand),n.categoryid&&(e.categoryId=n.categoryid),e.getDomData=JSON.parse(n.value),t[0].value=""}}})),frontApp.directive("getValue",(function(){return{restrict:"A",scope:{getValue:"=",to:"="},link(e,t,n){e.$watch("getValue",(t=>{t&&(e.to=t)}))}}})),frontApp.directive("onlyNumbers",(function(){return{require:"ngModel",link(e,t,n,i){i.$parsers.push((function(e){let t=(e+="").replace(/[^0-9]/g,""),r=e.search("\\."),a=r>-1?e.slice(r+1):0,o=parseFloat(t);return n.float&&(t=e.replace(/[^0-9\.]/g,""),o=parseFloat(t).toFixed(2)),o%1!=0&&a.length>2&&(t=o.toFixed(2)),t!==e&&(i.$setViewValue(t),i.$render()),t}))}}})),frontApp.directive("osAccordion",(function(){return{restrict:"A",link(e,t,n){const i=new MutationObserver((function(e){e.forEach((function(e){const n=e.target;n.open&&t[0].querySelectorAll("details[open]").forEach((e=>{e!==n&&(e.open=!1)}))}))})),r={attributeFilter:["open"]};t[0].querySelectorAll("details").forEach((e=>i.observe(e,r)))}}})),frontApp.directive("osBurger",(function(){return{replace:!0,scope:{target:"@"},template:'',link(e,t,n){let i=document.querySelector(e.target),r=!0;e.toggle=()=>{i.classList.toggle("active"),t[0].classList.toggle("active"),r=!r}}}})),frontApp.directive("osCheck",(function(){return{restrict:"E",require:"ngModel",replace:!0,transclude:!0,scope:{ngModel:"=",value:"=",label:"@",required:"=",disabled:"=",name:"@",cb:"&",bemModifier:"@"},template:'
[}label{]
',link(e,t,n,i){e.bemModifier&&t.addClass("os-switch-container_"+e.bemModifier),e.click=function(){if(e.disabled)return!1;e.ngModel=e.ngModel==e.value?"":e.value,"function"==typeof e.cb&&e.cb()},e.isActive=()=>e.ngModel==e.value,e.notValid=()=>e.required&&!e.ngModel}}})),frontApp.directive("osDatePicker",["$document","$timeout","$locale","notificationService","domManipulations","geoService",function(e,n,i,r,a,o){return{restrict:"E",require:"?ngModel",replace:!0,scope:{ngModel:"=",name:"@",required:"=",disabled:"=",locale:"@",blur:"&",placeholder:"@",placeholderInside:"=",tabnumber:"@"},templateUrl:TEMPLATE_URL+"/os-date-picker.html",link(e,s,l,c){let u={currentDate:new Date,startYear:1930,lastYear:(new Date).getFullYear(),yearsList:[],monthList:[],daysList:[],week:[],selectedDate:{year:"",month:"",day:"",weekDay:""},init(){this.createYears(),this.createMonths(),this.createWeekDays(),this.getDates(this.currentDate.getMonth(),this.currentDate.getFullYear()),this.selectDate(this.monthList[0],"month")},createYears(){for(var e=this.lastYear;e>=this.startYear;e--)this.yearsList.push({number:e,active:e==this.lastYear});this.selectedDate.year=this.yearsList[0]},createMonths(){for(var e=1;e<=12;e++)this.monthList.push({number:e,textNumber:e<10?"0"+e:e,title:i.DATETIME_FORMATS.MONTH[e-1]});this.selectedDate.month=this.monthList[this.currentDate.getMonth()]},createWeekDays(){let e=i.DATETIME_FORMATS.SHORTDAY;e.push(e.shift());for(var t=0;t{e.disabled||(e.open=!0)},e.lostFocus=()=>{e.open=!1},e.selectDate=t=>{u.selectDate(t,"day",(t=>{e.ngModel=`${t.day.textNumber}.${t.month.textNumber}.${t.year.number}`,e.fill=!0,e.open=!1,e.checkAge(e.ngModel)})),e.lostFocus(),e.tabnumber&&a.focusNexFormElement(e.tabnumber,s)},e.checkAge=t=>{const n=t.replace(/(\d+).(\d+).(\d+)/,"$3-$2-$1T00:00:00.000Z");let i=new Date(n),a=!1;const o=u.currentDate.getFullYear(),s=i.getFullYear(),l=u.currentDate.getMonth(),d=i.getMonth();if(o-18{t&&(e.fill=!0)})),e.$watch((()=>o.mainDetectedCountry),(n=>{n&&d.indexOf(o.mainDetectedCountry.cntr)>-1&&"ru"===o.mainLanguage.localeCode&&e.ageWarningLabel.push(t("Если вам менее 18 лет, ознакомьтесь с условиями регистрации в Компании (п. 1.1 Стандартов сотрудничества с Компанией)."))})),s.on("focus",(function(t){n((()=>{e.open=!0}),1)})),s.on("blur",(function(t){n((()=>{e.open||e.lostFocus()}),1)})),s.on("keydown",(function(t){9==t.keyCode&&e.open&&n((()=>{e.lostFocus()}),1)}))}}}]),frontApp.directive("osIncdec",(function(){return{restrict:"E",replace:!0,scope:{ngModel:"=",disabled:"=",max:"=",validationFn:"&"},templateUrl:TEMPLATE_URL+"/os-incdec.html",link(e,t,n){let i=e.max||999;function r(t,n){return"function"==typeof e.validationFn&&e.validationFn({newValue:t,currentValue:n})}e.change=t=>{e.disabled||!t&&e.isDisabledDecrease()||t&&e.isDisabledIncrease()||r(t?+e.ngModel+1:+e.ngModel-1,e.ngModel)||(t?e.ngModel++:e.ngModel--)},e.isDisabledDecrease=()=>+e.ngModel<=1||e.disabled,e.isDisabledIncrease=()=>+e.ngModel>=i||e.disabled,e.watchModelChangeFn=t=>{if(!angular.isDefined(t))return+e.ngModel;0===(t=+(t+"").replace(/[^0-9]/g,""))&&(t=1),t>i&&(t=i),r(t,+e.ngModel)||(e.ngModel=t)},e.$watch("max",(e=>{i=e||999}))}}})),frontApp.directive("osInput",["$rootScope","$timeout","registrationService","notificationService","geoService",function(e,n,i,r,a){function o(e){e.selectionStart=0,e.selectionEnd=999,e.select()}const s={text:{valueMissing:t("Обязательное поле!"),patternMismatch:t("Проверьте правильность введенных данных"),customError:t("Проверьте правильность введенных данных")},email:{valueMissing:t("Обязательное поле!"),patternMismatch:t("Проверьте правильность введенной почты"),customError:t("Такой E-mail уже зарегистрирован в системе")},password:{valueMissing:t("Обязательное поле!")},number:{valueMissing:t("Обязательное поле!"),patternMismatch:t("Проверьте правильность введенных данных"),customError:t("Проверьте правильность введенных данных")},thPassportNumber:{valueMissing:t("Обязательное поле!"),patternMismatch:t("Номер удостоверения личности должен содержать 13 цифр")},onlyNumber:{patternMismatch:t("Разрешены только цифры")},onlyLatin:{patternMismatch:t("Разрешены только буквы латинского алфавита")},cyrillicAndLatin:{patternMismatch:t("Разрешены только кириллица и латинские буквы")},forIndex:{patternMismatch:t("Разрешены только цифры")},onlyCyrillic:{patternMismatch:t("Только русские буквы, числа и символы")}},l={email:/^([\w\.-]{0,30}@([\w][\w-]+)\.[\w]{2,})|([а-я\d\._-]{0,30}@([а-я\d][а-я\d.-]+)\.[а-я]{2,})$/i,thPassportNumber:"^[0-9]{13}$",forIndex:'^[\\d\\-A-Z" "]*$',cyrillicAndLatin:'^((?=[A-zЀ-ӿ԰-֏ÜüÖöÄäẞ\\d]{1})([" "A-zЀ-ӿ԰-֏ÜüÖöÄäẞ\\d\\_\\-\\.,/+*!@#№$%^&\'";:<>=?`~()]+))$',onlyLatin:"^((?=[A-Za-z¿-ɏ¡ªº₫\\d]{1})([s -¿-ɏ¡ªº₫№]+))$",onlyNumber:"^[0-9]+$",onlyCyrillic:"^[Ѐ-ӿ0-9.,/\\-'\\\\\"`№#\\s]+$"},c=["bb","am","bg","by","cz","de","kg","kz","mn","pl","ru","th","ua","uz","tr"],u=IMAGES_PATH+"/sprites/svg/sprite.symbol.svg#info";return{restrict:"E",require:"ngModel",replace:!0,transclude:!0,scope:{ngModel:"=",name:"@",type:"@",step:"@",placeholder:"@",tabnumber:"@",required:"=",disabled:"=",readonly:"=",selectByFocus:"=",serverValidation:"@",tooltipInfo:"@info",customBlur:"&",onEmpty:"&",customValidation:"@"},templateUrl:TEMPLATE_URL+"/os-input.html",link(e,d,p,h,f){const m=d[0].querySelector("input");let v="";function g(t){void 0!==t&&y(t);for(let t in m.validity)m.validity[t]&&s[e.type]&&s[e.type][t]&&(e.errorMessage=s[e.type][t]);(c.includes(a.mainDetectedCountry.cntr)||a.mainDetectedCountry.europeCode)&&e.customValidation&&b()}function y(e){m.setCustomValidity(0==e?"uniqueValue":""),h.$setValidity("uniqueValue",e),h.$render()}function b(){let t=new RegExp(l[e.customValidation]).test(e.ngModel);t?e.errorMessage="":(m.validity.custom=!0,m.validity.valid=!1,e.errorMessage=s[e.customValidation].patternMismatch),h.$setValidity("customValidation",t),h.$render()}e.requiredLabel=t("Обязательное поле!"),e.errorMessage="",e.spriteIconInfo=u,e.iconInfo={path:u,needShow:!1},f((function(t){e.iconInfo.needShow=t.length>1||t[0]&&t[0].innerText})),e.type=e.type||"text",e.pattern=l[e.type]||".+",e.onFocus=()=>{if(e.errorMessage="",e.requiredLabel="",e.selectByFocus){o(m);try{document.execCommand("copy"),r.show("success",[t("Ваша ссылка скопирована в буфер обмена")])}catch(e){}}},e.onBlur=()=>{if(p.customBlur&&e.customBlur(),e.ngModel)if("maxlength"in h.$error){const n=d.attr("ng-maxlength");e.errorMessage=t("Не более ~maxlength~ символов",{maxlength:n})}else"email"==e.customValidation&&e.serverValidation&&(g(),e.errorMessage)||(e.serverValidation&&v!==e.ngModel&&m.validity.valid?(e.inProgress=!0,v=e.ngModel,i.validation[e.serverValidation](e.ngModel,(()=>{e.inProgress=!1,g(!0)}),(()=>{e.inProgress=!1,g(!1)}))):g());else e.required&&(e.errorMessage=t("Обязательное поле!"))},e.onKeypress=t=>{13===t.which&&(t.preventDefault(),e.onBlur())},e.$watch("ngModel",((t,n)=>{y(null),(c.includes(a.mainDetectedCountry.cntr)||a.mainDetectedCountry.europeCode)&&e.customValidation&&t&&t==n&&b(),n&&!t&&"function"==typeof e.onEmpty&&(v="",e.onEmpty())})),e.$watch("disabled",(e=>{!1===e&&n((()=>{m.focus(),o(m)}),100)}))}}}]),frontApp.directive("osLazyLoad",(function(){return{restrict:"A",link(e,t,n){if("IntersectionObserver"in window){new IntersectionObserver(((e,t)=>{e.forEach((e=>{const{isIntersecting:r,target:a}=e;r&&(i(a,n.osLazyLoad),t=t.disconnect())}))}),{root:null,rootMargin:"0px 0px 0px 0px"}).observe(t[0])}else i(t[0],n.osLazyLoad);let i=(e,t)=>{"picture"==t?([...e.querySelectorAll("source")].forEach((e=>{e.hasAttribute("data-srcset")&&(e.srcset=e.dataset.srcset)})),[...e.querySelectorAll("img")].forEach((e=>{e.hasAttribute("data-src")&&(e.src=e.dataset.src),e.hasAttribute("data-srcset")&&(e.srcset=e.dataset.srcset)}))):[...e.querySelectorAll("img")].forEach((e=>{e.hasAttribute("ng-data-src")&&(e.src=e.getAttribute("ng-data-src"))}))}}}}));const TEMPLATE='
\n
\n
';function OsModalController(e,t,n){if(!t.id)return void console.error(this.constructor.name+": modal must have an id.");const i=this,r={bemModifier:null,closeOnBackdropClick:!0};"boolean"==typeof i.closeOnBackdropClick&&(r.closeOnBackdropClick=i.closeOnBackdropClick),"bemModifier"in i&&(r.bemModifier=i.bemModifier),i.$onDestroy=function(){n.unregister(t.id),a.remove()},i.close=c,i.context=null,i.modifiers=[],i.opened=!1;const a=e[0];document.body.append(a),a.addEventListener("click",(function(e){!e.target.closest(".os-modal__body")&&r.closeOnBackdropClick&&c()}));const o={id:t.id,open:function(e){l(e),a.style.display="block",i.opened=!0,n.addToStack(t.id)},close:c,setConfig:l};function s(){"string"==typeof r.bemModifier&&(i.modifiers=["os-modal_"+r.bemModifier])}function l(e){if("object"!=typeof e)return;const{context:t,...n}=e;i.context=t,Object.assign(r,n),s()}function c(){a.removeAttribute("style"),i.opened=!1,n.removeFromStack(t.id)}n.register(o),s()}function OsModalDeliveryWarningController(e,t){e.addClass("os-modal-delivery-warning");const n=this;n.$onInit=function(){Object.assign(n,n.osModal.context),e.addClass("os-progress"),function(){let e;e=n.deliveryType?createUrl("shopen_app_ajax_cart_get_absent_products"):createUrl("shopen_app_ajax_cart_get_absent_products_by_self_pickups");return t.postData(e,{deliveryAddressId:n.deliveryAddressId,deliveryPointId:n.deliveryPointId,deliveryType:n.deliveryType,deliveryTypes:n.deliveryTypes})}().then((e=>{if(!e.success||!e.data.kits.length&&!e.data.products.length)return;e.data.kits.length?n.currency=e.data.kits[0].price.currency:e.data.products.length&&(n.currency=e.data.products[0].price.currency);let t=0;t=e.data.products.reduce(((e,t)=>{let n=t.price.value;return t.newPrice&&(n=t.newPrice.value),e+n*t.overLimit}),0),t=e.data.kits.reduce(((e,t)=>e+t.price.value*t.count),t),n.kits=e.data.kits,n.products=e.data.products,n.total=t,dataLayer.push({event:"user saw Out of stock message",event_params:{order_price:n.cartTotal,Out_sum:n.total,order_currency:n.currency.externalIso}})})).finally((()=>e.removeClass("os-progress")))},n.callback=()=>{},n.cartTotal=0,n.changeDeliveryMethod=function(){dataLayer.push({event:"user clck change delivery Out of stock"}),n.close()},n.close=()=>{},n.currency=null,n.deliveryAddressId=null,n.deliveryPointId=null,n.deliveryType=null,n.deliveryTypes=null,n.kits=[],n.products=[],n.removeProducts=function(){e.addClass("os-progress"),function(){let e;e=n.deliveryType?createUrl("shopen_app_ajax_cart_remove_absent_products"):createUrl("shopen_app_ajax_cart_remove_absent_products_by_self_pickups");return t.postData(e,{deliveryAddressId:n.deliveryAddressId,deliveryPointId:n.deliveryPointId,deliveryType:n.deliveryType,deliveryTypes:n.deliveryTypes})}().then((e=>{e.success&&(n.callback(e.data),dataLayer.push({event:"user click btn Delete products",event_params:{order_price:n.cartTotal,Out_sum:n.total,order_currency:n.currency.externalIso}}))})).finally((()=>e.removeClass("os-progress")))},n.total=0}frontApp.component("osModal",{controller:OsModalController,bindings:{bemModifier:"@",closeOnBackdropClick:"<"},template:TEMPLATE,transclude:!0}),OsModalController.$inject=["$element","$attrs","_ModalService"],frontApp.component("osModalDeliveryWarning",{controller:OsModalDeliveryWarningController,templateUrl:TEMPLATE_URL+"/os-modal-delivery-warning.html",require:{osModal:"^osModal"}}),OsModalDeliveryWarningController.$inject=["$element","httpService"];const DEFAULT_MIN_LENGTH=5,DEFAULT_MAX_LENGTH=11;function OsPhoneDirective(e,n,i,r){const a={uniqueValue:t("Проверьте правильность введенного телефона"),minlength:t("Проверьте правильность введенного телефона"),required:t("Обязательное поле!")},o=["+7","+380"],s=new Map([["ru",[/^(7|8(?=9))/,/^(7|8)/,10]],["by",[null,/^(0|80|375)/,9]],["uz",[null,/^998/,null]]]);return{link:function(l,c,u,d){const p=c[0].querySelector(".os-input__control"),h=c[0].querySelector(".os-phone__select-search-input");let f=!1;function m(e){let t=Object.values(e);return Array.isArray(l.availableCountries)&&l.availableCountries.length>0&&(t=t.filter((e=>l.availableCountries.includes(e.cntr)))),t}function v(e){const t=l.countries.find((t=>t.cntr===e));if(!t){const{cntr:t}=i.mainDetectedCity.country;return t===e?l.countries[0]:v(t)}return t}function g(){let e={cntr:"",phoneCode:""};return l.countries.length?(e=v(i.mainDetectedCity.country.cntr),l.phone&&(o.includes(l.phone.code)?e=v(l.countryCode):(t=l.phone.code,e=l.countries.find((e=>e.phoneCode===t))||l.countries[0]),l.phone.code!==e.phoneCode&&(f=!0)),e):e;var t}function y(e){d.$setValidity("uniqueValue",e)}function b(e){void 0!==e&&y(e);for(const e in d.$error)l.errorMessage=a[e]}function w(){n.smsCodeAuth.applyData(d.$viewValue,l.selectedCountry.cntr),r.open("smsCodeAuthModal")}function $(e){l.isProgress=!1,b(!0),e.data.smsAuth&&w()}function C(e){l.isProgress=!1,b(!1),e.data.smsAuth&&w()}l.countries=m(i.phoneCodes),l.errorMessage="",l.isProgress=!l.countries.length,l.isSelectOpened=!1,l.placeholderSearch=t("поиск"),l.placeholderTel="00000000000",l.selectedCountry=g(),l.spriteIconInfo=IMAGES_PATH+"/sprites/svg/sprite.symbol.svg#info";const x=function(){let e="";return function(){if(l.serverValidation&&p.value&&d.$viewValue!==e&&d.$valid){l.isProgress=!0,e=d.$viewValue;const t={phone:d.$viewValue,countryIso:l.selectedCountry.cntr};n.validation.phone(t,$,C)}else b()}}();function S(){x()}function k(e,t=!1){const{cntr:n}=l.selectedCountry;e=e.replace(/[^0-9]/g,"");let i=DEFAULT_MAX_LENGTH;if(s.has(n)){const[r,a,o]=s.get(n);t?e=e.replace(a,""):r&&(e=e.replace(r,"")),o&&(i=o)}else{let{phoneCode:t}=l.selectedCountry;t=t.replace("+","");const n=new RegExp("^"+t);e=e.replace(n,"")}return e.slice(0,i)}const T=function(){let e="";return function(t){y(null);const n=k(t.target.value);if(t.target.value!==n){const e=t.target.selectionStart;t.target.value=n,t.target.selectionStart=t.target.selectionEnd=e}e=n,d.$setViewValue(l.selectedCountry.phoneCode+" "+n)}}();function E(){const{value:e}=p;return e.length>0}p.addEventListener("input",T),p.addEventListener("paste",(function(e){e.preventDefault();const t=k(e.clipboardData.getData("text/plain"),!0);e.target.value=t,d.$setViewValue(l.selectedCountry.phoneCode+" "+t)})),d.$render=function(){p.value=k(d.$viewValue,!0)},d.$formatters.push((function(e){let t=e;return l.phone&&(f?f=!1:t=l.phone.number),"string"!=typeof t?"":l.selectedCountry.phoneCode+" "+k(t,!0)})),d.$validators.minlength=function(){const{value:e}=p,{cntr:t}=l.selectedCountry;if(s.has(t)){const[,,n]=s.get(t);if(n)return e.length===n}return e.length>DEFAULT_MIN_LENGTH},l.$evalAsync((()=>{d.$validators.required&&(d.$validators.required=E)})),l.toggleSelect=function(){l.isSelectOpened=!l.isSelectOpened,l.isSelectOpened&&e((()=>h.focus()),100)},l.selectCountry=function(e){l.selectedCountry=e,n.confirm.phoneCountryIsoCode=e.cntr,l.isSelectOpened=!1,p.focus()},l.isSelectedCountry=function(e){if(l.selectedCountry)return l.selectedCountry.cntr===e.cntr},l.onFocus=function(){l.errorMessage="",l.requiredLabel=""},l.onBlur=S,l.onKeyup=function(e){"Enter"===e.key&&(e.preventDefault(),S())},l.$watch((()=>i.phoneCodes),(function(e,t){e!==t&&(l.countries=m(e),l.selectedCountry=g(),l.isProgress=!1)}),!0),l.$watch("selectedCountry",(function(e,t){e.cntr!==t.cntr&&(d.$setViewValue(e.phoneCode),d.$render())}))},replace:!0,require:"ngModel",restrict:"E",scope:{availableCountries:"=",countryCode:"=country",name:"@",ngModel:"<",notUniqueFlag:"=",phone:"=",placeholder:"@",serverValidation:"=",tabnumber:"@",tooltipInfo:"@info"},templateUrl:TEMPLATE_URL+"/os-phone.html"}}OsPhoneDirective.$inject=["$timeout","registrationService","geoService","modalService"],frontApp.directive("osPhone",OsPhoneDirective),frontApp.directive("osRadio",(function(){return{restrict:"E",require:"ngModel",replace:!0,scope:{ngModel:"=",value:"="},template:'
',link(e,t,n){e.click=()=>{e.ngModel=e.value},e.isActive=()=>e.ngModel==e.value}}})),frontApp.directive("osScroll",(function(){return{restrict:"A",link(e,t,n){t.bind("scroll",(()=>{e.$eval(n.osScroll)}))}}})),frontApp.directive("osSelect",["$document","$timeout","$filter","$window","httpService","geoService","domManipulations","countryConfiguratorService",function(e,n,i,r,a,o,s,l){return{restrict:"E",replace:!0,scope:{ngModel:"=",options:"=",changeCb:"&",modelView:"@",optionView:"@",name:"@",placeholder:"@",tabnumber:"@",required:"=",disabled:"=",search:"=",autocomplete:"=",autocompleteList:"=",country:"=",city:"=",district:"="},templateUrl:TEMPLATE_URL+"/os-select.html",link(r,c,u,d){let p,h="";function f(e){r.isProgress=!0;let t=r.country?r.country.cntr:o.mainDetectedCountry.cntr;const n=l.getParam("ui_select_city_format",!1,!1);o.getCities(t,e).then((t=>{p=t.map((e=>(e.name=l.format(n,e),e))),r.optionsList=p.length>1?i("filter")(p,{name:e}):p,r.isProgress=!1}))}function m(e){c.find(e.target).length>0||r.$apply(r.isOpen=!1)}r.isOpen=!1,r.isProgress=!1,r.searchString="",r.optionsList=[],r.requiredLabel=t("Обязательное поле!"),r.searchPlaceholder=t("Введите название"),a.isEmptyObj(r.options)&&(r.options=[]),a.isEmptyObj(r.ngModel)&&void 0===u.stopPreselect&&(r.ngModel=r.options[0]),r.modelView=r.modelView||"name",r.optionView=r.optionView||"name",r.toggleDropDown=()=>{r.disabled||(r.isOpen=!r.isOpen,r.isOpen&&n((()=>{c[0].querySelector(".os-select__search-input").focus()}),100))},r.select=e=>{r.ngModel=e,r.isOpen=!1,r.changeCb&&"function"==typeof r.changeCb&&n((()=>{r.changeCb()}),1)},r.onKeydown=e=>{9===e.keyCode&&(e.preventDefault(),r.isOpen=!1,s.focusNexFormElement(r.tabnumber,$(c))),13===e.keyCode&&r.searchString.length&&void 0===r.autocompleteList&&r.$apply((function(){f(r.searchString)}))},r.isActive=e=>{if(!a.isEmptyObj(r.ngModel))return e[r.optionView]==r.ngModel[r.optionView]},r.stopBubble=e=>{e.stopPropagation()},r.autocomplete&&(r.$watch("searchString",(e=>{void 0===r.autocompleteList?function(e){if(!e||e.toLowerCase().substring(0,3)===h)return void(r.optionsList=e?i("filter")(p,{name:e}):p);h=e.toLowerCase().substring(0,3),e.length>=2?f(e):n((()=>{r.optionsList=i("filter")(p,{name:e})}),200)}(e):function(e){r.optionsList=e?i("filter")(r.autocompleteList,{name:e}):r.autocompleteList}(e)})),r.$watch("autocompleteList",(e=>{r.searchString="",r.optionsList=e}))),e.on("click",m),c.on("$destroy",(function(){e.off("click",m)}))}}}]),frontApp.directive("osSelectLocation",["$filter","$timeout","$window","geoService","userService","mainConfigurationService","modalService","modals","countryConfiguratorService",function(e,n,i,r,a,o,s,l,c){const u=c.getParam("ui_select_location_format",!1,!1),d=(t("На сайт Белоруссии"),{title:{city:t("Город доставки"),country:t("Страна доставки")},placeholder:{city:t("Введите название города"),country:t("Введите название страны")},change:t("Изменить"),ndsNote:t("Цены указываются с учетом НДС, установленного законодательством страны доставки"),confirm:{city:t("Это мой город"),country:t("Выбрать")},anotherSiteLink:{city:t("Перейти на сайт"),country:t("Интернет-магазин")},anotherSiteMessage:{city:t("Ассортимент, акции и условия доставки для разных городов могут отличаться"),country:""},emptySearch:t("Ничего не найдено"),chooseCountry:t("Выберите страну из списка"),declinations:{at:t("Австрии"),au:t("Австралии"),be:t("Бельгии"),bg:t("Болгарии"),ch:t("Швейцарии"),cs:t("Канарских островов"),cy:t("Южного кипра"),cz:t("Чехии"),de:t("Германии"),dk:t("Дании"),ee:t("Эстонии"),es:t("Испании"),fi:t("Финляндии"),fr:t("Франции"),gr:t("Греции"),hk:t("Гонконга"),hr:t("Хорватии"),hu:t("Венгрии"),id:t("Индонезии"),ie:t("Ирландии"),in:t("Индии"),is:t("Исландии"),it:t("Италии"),jp:t("Японии"),kr:t("Южной кореи"),lt:t("Литвы"),lu:t("Люксембурга"),lv:t("Латвии"),ma:t("Марокко"),mt:t("Мальты"),nl:t("Нидерланд"),no:t("Норвегии"),ph:t("Филиппин"),pl:t("Польши"),pt:t("Португалии"),ro:t("Румынии"),se:t("Швеции"),si:t("Словении"),sk:t("Словакии"),uk:t("Великобритании"),us:t("США")},czShop:t("Чехия")});return{restrict:"E",replace:!0,templateUrl:TEMPLATE_URL+"/os-select-location.html",link(p,h,f){let m="",v=[],g=[],y=h[0].querySelector(".os-select-location__search-input");if(p.imagesPath=o.imagesPath,p.texts=d,p.locationSelected={},p.locationsList=[],p.isSearchMode=!1,p.isNdsNote=!1,p.isSearchInProgress=!1,p.searchString="",p.isPreselected=!1,p.isAnotherSite=!1,p.anotherSiteLink="",p.isReloading=!1,p.locationType=r.isLocationCountry?"country":"city",p.isCountryEqualStockDelivery=!1,p.openSearch=()=>{p.isSearchMode=!0,p.isPreselected=!1,p.locationsList=g,n((()=>{y.focus()}),100)},p.displayLocation=e=>Object.keys(e).length?c.format(u,e):"",p.preselectLocation=e=>{w(e),p.isSearchMode=!1,p.isPreselected=!0,p.isCountryEqualStockDelivery=r.mainDetectedCountry.cntr===p.locationSelected.cntr,$(),r.redirectToOtherShop&&(r.mainDetectedCountry.europeCode&&"cz"==e.cntr&&l.notificationShopRedirect.openShopRedirectModal(e.cntr),r.mainDetectedCountry.bbCode&&"bg"==e.cntr&&l.notificationShopRedirect.openShopRedirectModal("bg",e.cntr),"bg"==r.mainDetectedCountry.cntr&&"bg"!=e.cntr&&l.notificationShopRedirect.openShopRedirectModal("bb",e.cntr))},p.confirmLocation=()=>{r.isLocationCountry?r.changeCountryDelivery(p.locationSelected,(()=>{if(p.isReloading=!0,void 0===p.locationSelected||p.locationSelected.isEuMember||p.locationSelected.cntr===r.mainDetectedCountry.cntr)a.checkShoppingCart().then((()=>i.open(C("delivery"),"_self"))),i.open(C("delivery"),"_self");else{const e=t("При отправке в страны, не входящие в ЕС, Клиенту необходимо предварительно самостоятельно выяснить условия прохождении груза на таможне страны-получателя.")+" ",n="kr"!==p.locationSelected.cntr?t("Пожалуйста, предварительно свяжитесь с таможенной службой вашей страны, чтобы убедиться, что все заказываемые вами товары разрешены для ввоза, а также требуются ли дополнительные разрешения или лицензии. Обратите внимание, что максимально допустимая сумма покупки ограничена ~limit~ евро. Это связано с таможенным и налоговым законодательством страны поставки.",{limit:p.locationSelected.orderValueLimit||""}):t("Пожалуйста, предварительно свяжитесь с таможенной службой вашей страны, чтобы убедиться, что все заказываемые вами товары разрешены для ввоза, а также требуются ли дополнительные разрешения или лицензии. Обратите внимание, что максимально допустимая сумма покупки ограничена ~limit~ евро. Максимальное количество заказанных товаров не более 6 штук. Это связано с таможенным и налоговым законодательством страны поставки.",{limit:p.locationSelected.orderValueLimit||""});l.notification.message=(p.locationSelected.isEurope&&!p.locationSelected.isEuMember?e:"")+n,s.open("notificationModal",null,!0)}})):r.notifyServer(p.locationSelected,(()=>{p.isReloading=!0,i.open(C("delivery"),"_self")})),p.reset()},p.clearSearch=()=>{$(),n((()=>{y.focus()}),100)},p.reset=()=>{p.isSearchMode=!1,p.isPreselected=!1,$()},p.$watch("searchString",(t=>{p.searchString=t.replace("ё","е").replace("Ё","Е");var n;(t=t.toLowerCase()).length>=2?r.isLocationCountry?function(t){if(g.length)return void(p.locationsList=g);p.isSearchInProgress=!0,p.locationsList=[];let n=r.mainDetectedCountry.europeCode?r.mainDetectedCountry.europeCode:r.mainDetectedCountry.cntr;r.getDeliveryCountries(n,t).then((t=>{t=Object.values(t),p.locationsList=t.length>1?e("filter")(t,{name:p.searchString}):t}),(()=>{})).finally((()=>{p.isSearchInProgress=!1}))}(t):(n=t,p.isSearchInProgress=!0,p.locationsList=[],r.getCities(r.mainDetectedCountry.cntr,n,!1).then((t=>{p.locationsList=t.length>1?e("filter")(t,{name:p.searchString}):t}),(()=>{})).finally((()=>{p.isSearchInProgress=!1}))):p.locationsList=e("filter")("object"==typeof p.locationsList?Object.values(p.locationsList):p.locationsList,{name:t})})),p.$watch("geoService.mainDetectedCountry.cntr",(e=>{"de"===e&&(d.title.country=t("Выбранная страна доставки (указывается НДС страны доставки)"))})),p.$watch("isSearchMode",(e=>{"de"===r.mainDetectedCountry.cntr&&(p.isNdsNote=!!e)})),p.$on("selectLocation:Open",((e,t)=>{b(e,t)})),!l.locationAndLang.isSelectLocationHandlerSetup&&r.mainDetectedCountry.cntr){l.locationAndLang.isSelectLocationHandlerSetup=!0;b(event,{})}function b(e,t){p.locationType=r.isLocationCountry?"country":"city",p.isCountryEqualStockDelivery=r.mainDetectedCountry.cntr===p.locationSelected.cntr,t.selectLocationIsSearchMode&&(p.isSearchMode=t.selectLocationIsSearchMode),w(r.isLocationCountry?r.countryDelivery:r.mainDetectedCity),r.isLocationCountry?function(){if(g.length)return void(p.locationsList=g);p.isSearchInProgress=!0;let e=r.mainDetectedCountry.europeCode||r.mainDetectedCountry.bbCode||r.mainDetectedCountry.cntr;r.getDeliveryCountries(e).then((e=>{p.locationsList=g=e})).finally((()=>{p.isSearchInProgress=!1}))}():function(){if(g.length)return void(p.locationsList=g);p.isSearchInProgress=!0,r.getCities(r.mainDetectedCountry.cntr,"").then((e=>{p.locationsList=g=e})).finally((()=>{p.isSearchInProgress=!1}))}()}function w(e){p.locationSelected=e,function(e){if("city"===p.locationType)return;if("rs"===r.mainDetectedCountry.cntr)return;let t="country"===p.locationType?e.cntr:e.country.cntr;if(p.isAnotherSite=r.mainDetectedCountry.cntr!==t&&e.redirectUrl.toString().length>0&&!["hu","sk","ro","gr"].includes(t),p.isAnotherSite){let n=["bg","pl"].includes(t)?"/bc/index/":"/";p.anotherSiteLink=e.redirectUrl+r.mainLanguage.localeCode+n}}(e)}function $(){p.searchString="",p.locationsList=g.length?g:[],m="",v=[]}function C(e){let t=document.location.href,n=t.split("?");if(n.length>=2){let i=n.shift(),r=n.join("?"),a=encodeURIComponent(e)+"=",o=r.split(/[&;]/g);for(let e=o.length;e-- >0;)-1!==o[e].lastIndexOf(a,0)&&o.splice(e,1),t=i+"?"+o.join("&");window.history.pushState("",document.title,t)}return t}p.$on("selectLocation:Close",(()=>{p.reset(),p.$apply()})),p.$on("$destroy",(()=>{p.isSearchMode=!1}))}}}]),frontApp.directive("osSelectWithSearch",["$timeout",function(e){return{restrict:"E",replace:!0,scope:{ngModel:"=",options:"=",selectCb:"&",searchCb:"&",searchString:"=",modelView:"@",optionView:"@",name:"@",placeholder:"@",tabnumber:"@",required:"=",disabled:"="},templateUrl:TEMPLATE_URL+"/os-select-with-search.html",link(n,i,r){n.isOpen=!1,n.isProgress=!1,n.searchString="",n.requiredLabel=t("Обязательное поле!"),n.searchPlaceholder=t("Введите название"),n.toggleDropDown=()=>{n.isOpen=!n.isOpen},n.search=()=>{n.selectCb&&"function"==typeof n.selectCb&&e((()=>{n.searchCb()}),1)},n.select=t=>{n.ngModel=t,n.isOpen=!1,n.selectCb&&"function"==typeof n.selectCb&&e((()=>{n.selectCb()}),1)}}}}]),frontApp.component("osSmsHelp",{templateUrl:TEMPLATE_URL+"/os-sms-help.html",require:{osModal:"^osModal"}});const COUNT_SECONDS=180;function OsSmsVerificationController(e,t,n,i){const r=this;r.$onDestroy=function(){s&&n.cancel(s)},e.close=()=>i.open("os-sms-warning"),e.code=new Array(5).fill(""),e.errors=[],e.exit=()=>r.osModal.close(),e.loading=!1,e.onKeydown=p,e.onKeyup=h,e.onMousedown=d,e.openHelp=()=>i.open("os-sms-help"),e.resend=function(){r.onGetNewCode().then((e=>{e.success&&v()}))},e.time="",e.timeForResend=COUNT_SECONDS,e.$watch("code",(function(t,n){if(t==n)return;if(i=t,i.every((e=>""!=e))){e.loading=!0;const n=t.join("");r.onCheckCode({code:n}).then((t=>{t.success?r.osModal.close():e.errors=t.message})).finally((()=>e.loading=!1))}else e.errors=[];var i}),!0);const a=t[0],o=a.querySelector(".os-sms-verification__code");o.addEventListener("mousedown",d),o.addEventListener("keydown",p),o.addEventListener("keyup",h);let s,l=!1;function c(){const t=e.code.findIndex((e=>""===e));return-1===t?null:t}function u(){const e=c();if(null!=e){a.querySelector(`[data-symbol-index="${e}"]`).focus()}}function d(t){const{symbolIndex:n}=t.target.dataset;n&&(t.preventDefault(),null!=c()?u():function(){const t=e.code.length-1;a.querySelector(`[data-symbol-index="${t}"]`).focus()}())}function p(e){if(e.key>="0"&&e.key<="9")l=!0;else if("Backspace"!==e.key)e.preventDefault();else{if(e.target.value.length)return;let{symbolIndex:t}=e.target.dataset;if(--t>=0){a.querySelector(`[data-symbol-index="${t}"]`).focus()}}}function h(){l&&(u(),l=!1)}function f(e){return e>9?e:"0"+e}function m(e){const t=Math.floor(e/60),n=e-60*t;return f(t)+":"+f(n)}function v(){e.timeForResend=COUNT_SECONDS,e.time=m(e.timeForResend),s=n((()=>{e.time=m(--e.timeForResend)}),1e3,COUNT_SECONDS)}v()}function OsSnippetProductNotAvailableController(e){e.addClass("os-snippet-product-not-available");const t=this;t.priceValue=0,t.priceLogo="",t.$onInit=function(){t.product.newPrice?(t.priceValue=t.product.newPrice.value,t.priceLogo=t.product.newPrice.currency.logo):(t.priceValue=t.product.price.value,t.priceLogo=t.product.price.currency.logo)}}OsSmsVerificationController.$inject=["$scope","$element","$interval","_ModalService"],frontApp.component("osSmsVerification",{templateUrl:TEMPLATE_URL+"/os-sms-verification.html",controller:OsSmsVerificationController,bindings:{onCheckCode:"&",onGetNewCode:"&",phone:"@"},require:{osModal:"^osModal"}}),frontApp.component("osSmsWarning",{templateUrl:TEMPLATE_URL+"/os-sms-warning.html",bindings:{onExit:"&"},require:{osModal:"^osModal"}}),frontApp.component("osSnippetProductNotAvailable",{bindings:{product:"<"},controller:OsSnippetProductNotAvailableController,templateUrl:TEMPLATE_URL+"/os-snippet-product-not-available.html"}),OsSnippetProductNotAvailableController.$inject=["$element"],frontApp.directive("osSvgNoImage",(function(){return{restrict:"E",replace:!0,transclude:!0,templateNamespace:"svg",templateUrl:TEMPLATE_URL+"/os-svg-no-image.html"}})),frontApp.directive("osTabs",["$timeout",function(e){return{restrict:"A",link(t,n,i){let r;function a(e){e.preventDefault(),e.stopPropagation(),n.find("a").removeClass("active"),$(r.children).removeClass("active"),o(this)}function o(e){e&&(e.classList.add("active"),r.querySelector(e.dataset.target||e.hash).classList.add("active"))}e((()=>{let e=n[0].querySelector("a");r=document.querySelector(e.dataset.target||e.hash).closest(i.osTabs),o(e)}),10),n.on("click","a",a),n.on("$destroy",(function(){n.off("click","a",a)}))}}}]),frontApp.directive("osTextArea",(function(){return{restrict:"E",replace:!0,scope:{ngModel:"=",name:"@",required:"=",disabled:"=",placeholder:"@",tabnumber:"@"},templateUrl:TEMPLATE_URL+"/os-textarea.html",link(e,n,i){e.requiredLabel=t("Обязательное поле!")}}})),frontApp.directive("osToggle",(function(){return{restrict:"A",link(e,t,n){let i,r=!1;const a=t[0],o=a.parentElement.querySelector(n.osToggle),s=void 0!==n.outsideClose,l=(t=!r,i={})=>{a.classList.toggle("_active",t),o.classList.toggle("_open",t),r=t,t&&o.focus(),n.osToggleName&&e.$broadcast(`${n.osToggleName}:${t?"Open":"Close"}`,i)};a.addEventListener("click",(()=>{l()})),n.osToggleName&&e.$on(`dropdown${n.osToggleName}:Open`,((e,t)=>{l(!0,t)})),s&&(o.addEventListener("blur",(()=>{i=setTimeout((()=>{l(!1)}),100)}),!0),o.addEventListener("focusin",(()=>{clearTimeout(i)})))}}})),frontApp.directive("osWalletNumber",["$rootScope","$timeout","registrationService","notificationService","geoService",function(e,t,n,i,r){return{restrict:"E",require:"ngModel",replace:!0,transclude:!0,scope:{ngModel:"=",name:"@",type:"@",code:"@",mask:"@",separatorsymbol:"@",maxlength:"@",min:"@",tabindex:"@",afterSuccessEntering:"&",isLoading:"=",isError:"=",disabled:"=",isKeyPress:"=",readonly:"="},templateUrl:TEMPLATE_URL+"/os-wallet-number.html",link(e,t,n,i,r){t[0].querySelector("input");e.errorMessage="",e.isError=!1,e.disabled=!1,e.isLoading=!1,e.isKeyPress=!0,e.type=e.type||"text",e.isAddGapBefore=!1,void 0===e.separatorsymbol||"space"===e.separatorsymbol?e.separator=void 0===e.separatorsymbol?"":" ":e.separator=e.separatorsymbol,e.onFocus=()=>{e.isError=!1},e.onKeyDown=t=>{if(t.keyCode<48&&e.isKeyPress||t.keyCode>57&&e.isKeyPress||!e.isKeyPress||e.isLoading||e.disabled)return t.preventDefault(),8===t.keyCode&&e.isKeyPress&&(e.ngModel=e.ngModel.substring(0,e.ngModel.length-1),e.isAddGapBefore=e.mask[e.ngModel.length]===e.separator),!1;e.isAddGapBefore&&(e.ngModel+=e.separator,e.isAddGapBefore=!1),e.isKeyPress&&e.mask[e.ngModel.length+1]===e.separator&&(e.isKeyPress=!1)},e.$watch("ngModel",(t=>{e.isKeyPress||+e.min==+t.length||(e.ngModel+=e.separator,e.isKeyPress=!0),void 0!==typeof e.ngModel&&+e.min==+t.length&&n.afterSuccessEntering&&e.afterSuccessEntering()}))}}}]),frontApp.directive("outsideClick",["$document",function(e){return{link(t,n,i){let r=e=>{n.find(e.target).length>0||t.$apply(i.outsideClick)};e.on("click",r),n.on("$destroy",(function(){e.off("click",r)}))}}}]),frontApp.directive("plainTextSelect",["$document","$timeout","httpService",function(e,t,n){return{restrict:"E",replace:!0,scope:{ngModel:"=",options:"=",modelView:"@",optionView:"@",label:"@"},templateUrl:TEMPLATE_URL+"/os-plain-select.html",link(e,t,i){e.open=!1,n.isEmptyObj(e.options)&&(e.options=[]),e.toggle=()=>{e.open=!e.open},e.select=t=>{e.ngModel=t},e.isActive=t=>{if(!n.isEmptyObj(e.ngModel))return t[e.optionView]==e.ngModel[e.optionView]},e.$watch("options",(t=>{t&&n.isEmptyObj(e.ngModel)&&(e.ngModel=t[0])}),!0)}}}]),frontApp.directive("regSmsCode",["$timeout",function(e){return{restrict:"E",replace:!0,template:(e,t)=>'
 
',scope:{ngModel:"="},link(t,n,i,r){t.codeChars=new Array(+i.codeLength||6).fill(""),e((()=>{n[0].querySelectorAll("input").forEach((e=>{e.addEventListener("focus",(e=>{e.target.select()}))})),n[0].addEventListener("keydown",(e=>{if(8===e.keyCode&&""===e.target.value){if("0"===e.target.dataset.index)return;t.codeChars[e.target.dataset.index-1]="",t.$apply(),e.target.previousElementSibling.focus()}})),n[0].addEventListener("keyup",(e=>{e.target.value.length>=e.target.maxLength&&e.target.nextElementSibling&&e.target.nextElementSibling.focus()})),n[0].addEventListener("paste",(e=>{e.preventDefault();let n,r=e.clipboardData||window.clipboardData||e.originalEvent.clipboardData;if(r){try{n=r.getData("text/plain")}catch(e){}if(n&&(n=void 0!==i.digitsCode?n.replace(/[^0-9]/gim,""):n.replace(/[^0-9a-z]/gim,""),n.length)){for(let e=0;e!e))?"":n.join(""))}),!0)}}}]),frontApp.directive("saldo",["catalogService","geoService",function(e,n){const i={missing:t("Нет в наличии"),archive:t("Продукт снят с производства"),onlySelfdelivery:t("Только самовывоз"),notAvailableForSale:t("БАД. Недоступен для продажи on-line")};return{restrict:"E",replace:!0,template:'
\n [}labelText{]\n
',scope:{product:"="},link(e){e.labelText="",e.product.isArchived?e.labelText=i.archive:e.product.missing?e.labelText=i.missing:e.product.noSale&&(e.labelText=n.mainDetectedCity.isSelfDeliveryAvailable?i.onlySelfdelivery:i.notAvailableForSale)}}}]),frontApp.directive("scrollable",["$timeout",function(e){return{restrict:"A",link(t,n,i){let r;"PerfectScrollbar"in window&&(r=new PerfectScrollbar(n[0],{wheelSpeed:i.scrollSpeed||1,wheelPropagation:null==i.scrollPropagation||i.scrollPropagation,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0})),n.on("mouseover",(function(e){e.stopPropagation(),e.preventDefault(),r&&r.update()})),$(".modal").on("show.bs.modal",(function(){e((()=>{r&&r.update()}),200)})),t.$watch(i.scrollableUpdate,(t=>{t&&e((()=>{r&&r.update()}),100)}))}}}]),frontApp.directive("sexField",(function(){const e={male:t("Мужской"),female:t("Женский")};return{restrict:"E",replace:!0,template:'
\n \n \n
',scope:{ngModel:"="},link(t,n,i){t.labels=e,t.isFemail=()=>"W"==t.ngModel,t.click=()=>{t.ngModel="M"==t.ngModel?"W":"M"}}}})),frontApp.directive("osSharebuttons",["userService",function(e){const n={product:".os-product-card__gallery-img",post:".os-blog-person__photo-img"};return{restrict:"E",replace:!0,scope:{socials:"@",page:"@"},templateUrl:TEMPLATE_URL+"/os-share-buttons.html",link(i,r,a,o){let s=i.socials.replace(/[\'\[\]\"\s\t\r\n]/g,"").split(","),l=encodeURIComponent(window.location.href||""),c=encodeURIComponent(document.title||""),u=encodeURIComponent(document.querySelector('meta[name="description"]').content||""),d=document.querySelector('meta[property="og:image"]')&&document.querySelector('meta[property="og:image"]').content||document.querySelector(n[i.page])&&document.querySelector(n[i.page]).src||"",p=encodeURIComponent(d)||"",h=l;const f={telegram:{class:"_telegram",href:"https://telegram.me/share/url",onClick:m},vk:{class:"_vkontakte",href:/mac os/gi.test(window.navigator.appVersion)?"http://vk.com/share.php?url="+l:`http://vk.com/share.php?url=${l}&title=${c}&description=${u}&image=${p}&noparse=true`,onClick:m},ok:{class:"_ok",href:`https://connect.ok.ru/offer?url=${l}&title=${c}&imageUrl=${p}`,onClick:m},facebook:{class:"_facebook",href:"https://www.facebook.com/sharer/sharer.php?u="+l,onClick:m},twitter:{class:"_twitter",href:`https://twitter.com/share?url=${l}&text=${c}`,onClick:m},print:{class:"_print",href:"",onClick:function(e){e.preventDefault(),window.print()}},pinterest:{class:"_pinterest",href:`http://pinterest.com/pin/create/button/?url=${l}&media=${p}&description=${c}`,onClick:m},mailru:{class:"_mailru",href:"http://connect.mail.ru/share?share_url="+l,onClick:m},tumblr:{class:"_tumblr",href:`https://www.tumblr.com/widgets/share/tool?canonicalUrl=${l}&posttype=link&title=${c}\n &caption=${u}&content=${l}`,onClick:m},copy:{class:"_copy",href:h,onClick:function(e){e.preventDefault();var t,n=$(e.target),r=n.parents(".share-buttons").find(".share-buttons__copy-inp"),a=n.find(".os-popover._bubble");!function(e){var t;e.focus(),e.setSelectionRange(0,e.value.length);try{t=document.execCommand("copy")}catch(e){t=!1}return t}(r.get(0))?i.manualCopyMode=!0:(clearTimeout(t),a.addClass("active"),t=setTimeout((function(){a.removeClass("active")}),3e3))},innerHtml:`${t("Ссылка скопирована")}`},whatsapp:{class:"_whatsapp",href:"whatsapp://send?text=",onClick:v},sms:{class:"_sms",href:/mac os/gi.test(window.navigator.appVersion)?"sms:&body=":"sms:?body=",onClick:v},email:{class:"_email",href:"mailto:?body=",onClick:v},fbmess:{class:"_fb-mess",href:"fb-messenger://share/?link=",onClick:v},qzone:{class:"_qzone",href:"http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+l,onClick:m},xing:{class:"_xing",href:"https://www.xing.com/app/user?op=share&url="+l,onClick:m},renren:{class:"_renren",href:`http://share.renren.com/share/buttonshare.do?link=${l}&title=${c}`,onClick:m},weibo:{class:"_weibo",href:`http://service.weibo.com/share/share.php?url=${l}&appkey=&title=${c}&pic=${p}&ralateUid=`,onClick:m}};function m(e){e.preventDefault();const t=i.refLink?i.refLink:"",n=encodeURIComponent(window.location.href+t||"");var r=-1!==e.target.className.indexOf("_telegram")?e.target.href+`?url=${n}&text=${c}`:e.target.href+i.refLink,a=document.documentElement,o=window.open(r,"shareWindow","scrollbars=1,height="+Math.min(500,screen.availHeight)+",width="+Math.min(640,screen.availWidth)+",left="+Math.max(0,(a.clientWidth-640)/2+window.screenX)+",top="+Math.max(0,(a.clientHeight-500)/2+window.screenY));o.screenY>=screen.availHeight-o.outerHeight&&o.moveTo(o.screenX,screen.availHeight-o.outerHeight),o.screenX>=screen.availWidth-o.outerWidth&&o.moveTo(screen.availWidth-o.outerWidth,o.screenY)}function v(e,t){e.preventDefault(),t&&t.href&&(window.location.href=t.href+l+i.refLink)}i.targetSocials=s.map((e=>f[e]||null)),i.copytext=window.location.href,i.manualCopyMode=!1,i.refLink="",i.$watch((()=>e.isUserAuthorized),(t=>{t&&(i.refLink="?referral="+e.user.contract,i.copytext=i.copytext+i.refLink)}))}}}]),frontApp.directive("stopBubble",(function(){return{link(e,t,n){t.on("click",(function(e){e.stopPropagation()}))}}})),frontApp.directive("swiperSlider",["$timeout",function(e){return{restrict:"A",scope:{swiperInit:"=",swiperOptions:"=swiperSlider",swiperGoto:"=",afterInitCb:"=",listenClick:"@",listenCb:"="},link(t,n,i){let r;t.$watch("swiperInit",(i=>{i&&n.length&&e((()=>{r=new Swiper(n,t.swiperOptions),"function"==typeof t.afterInitCb&&t.afterInitCb(n,r)}),100)})),null!=t.swiperGoto&&t.$watch("swiperGoto",(e=>{r&&e&&r.slideTo(e-1)})),t.listenClick&&n.on("click",t.listenClick,(function(e){"function"==typeof t.listenCb&&t.listenCb($(this),e)}))}}}]),frontApp.filter("couriersListCartMainFilter",(function(){return function(e){let t=[],n=[],i=0;e.length&&e.sort((function(e,t){return e.freeConditions.sumForFreeCourier-t.freeConditions.sumForFreeCourier}));let r=[...e];return[...r].forEach((function(e,a){e.type.toLowerCase().includes("russian_post")&&(n.push(...r.splice(a-i,1)),i++),e.type.toLowerCase().includes("express_delivery")&&e.isFree&&(t=r.splice(a-i,1),i++)})),[...t,...r,...n]}})),frontApp.filter("couriersListCartModalFilter",(function(){return function(e){let t=[],n=[],i=0,r=[...e];return[...r].forEach((function(e,a){e.type.toLowerCase().includes("russian_post")&&(n.push(...r.splice(a-i,1)),i++),e.type.toLowerCase().includes("express_delivery")&&0==e.price.value&&(t=r.splice(a-i,1),i++)})),[...t,...r,...n]}})),frontApp.filter("currentPackFilter",["$filter",function(e){return function(t,n){return t.length?n.isCertificate?e("filter")(t,{certificateNum:n.certificateNum}):e("filter")(t,{contract:"!"+n.contract}):t}}]),frontApp.filter("money",["$filter","$sce","geoService","userService","$window",function(e,n,i,r,a){return function(e,a,o,s){if(void 0===e||null==e)return;if(0==e&&s)return t("бесплатно");let l=o||i.mainDetectedCountry.currency&&i.mainDetectedCountry.currency.decimals||r.cart.currency&&r.cart.currency.decimals||2;e%1==0&&(l=0);let c=(e,t)=>parseFloat(e).toFixed(t);if("points"==(a=a||(i.mainDetectedCountry.currency?i.mainDetectedCountry.currency:r.cart.currency)))return c(e,l);if(-2==o||(e=c(e,l)),("vn"==i.mainDetectedCountry.cntr||r.cart.currency&&"VND"==r.cart.currency.externalIso)&&(e=new Intl.NumberFormat("de").format(e),"noCurrency"==a))return e;let u=a?``:"",d=e;return a&&a.logo&&(u=``,d=`${e}`),n.trustAsHtml(a&&a.isPrefixed?u+d:d+u)}}]),frontApp.filter("pickpointsFilter",(function(){return function(e,t,n){var i=[];return e.length?angular.forEach(e,(function(e){var n=[];angular.forEach(t,(function(t){e.type==t&&n.push(e)})),n.length&&i.push(e)})):i=e,i}})),frontApp.filter("pickpointsFilterDelivery",(function(){return function(e,t,n){var i=[];return e.length?angular.forEach(e,(function(e){var n=[];angular.forEach(t,(function(t){e.type==t.type&&t.on&&n.push(e)})),n.length&&i.push(e)})):i=e,i}})),frontApp.filter("pickpointsSortByCscTypes",(function(){return function(e){let t=["dpd","privatecsc","corporatecsc"];return e.length&&e.sort((function(e,n){return t.indexOf(e.type.toLowerCase())>t.indexOf(n.type.toLowerCase())?-1:1})),e}})),frontApp.filter("pickupPointsModalSelfFilter",(function(){return function(e,t){const n=t.map((function(e){return e.type}));return e.sort((function(e,t){return n.indexOf(e.type)-n.indexOf(t.type)})),e}})),frontApp.filter("textcut",["$filter",function(e){return function(t,n){if(t){var i=t;return t.length>n&&(i=e("limitTo")(t,n)+"..."),i}}}]),frontApp.filter("trustThisUrl",["$sce",function(e){return e.trustAsResourceUrl}]);