!function(t){"object"==typeof module&&module.exports?module.exports=t():window.intlTelInput=t()}((function(t){"use strict";return function(){for(var e=[["Afghanistan (‫افغانستان‬‎)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (‫الجزائر‬‎)","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua and Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain (‫البحرين‬‎)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (БоснаIndian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros (‫جزر القمر‬‎)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (‫مصر‬‎)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (‫ایران‬‎)","ir","98"],["Iraq (‫العراق‬‎)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel (‫ישראל‬‎)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (日本)","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan (‫الأردن‬‎)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (‫الكويت‬‎)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (‫لبنان‬‎)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (‫ليبيا‬‎)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (‫موريتانيا‬‎)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco (‫المغرب‬‎)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["North Macedonia (Северна Македонија)","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway (Norge)","no","47",0],["Oman (‫عُمان‬‎)","om","968"],["Pakistan (‫پاکستان‬‎)","pk","92"],["Palau","pw","680"],["Palestine (‫فلسطين‬‎)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (‫قطر‬‎)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1",18,["869"]],["Saint Lucia","lc","1",19,["758"]],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1",20,["784"]],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (‫المملكة العربية السعودية‬‎)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (‫جنوب السودان‬‎)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්‍රී ලංකාව)","lk","94"],["Sudan (‫السودان‬‎)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1,["79"]],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (‫سوريا‬‎)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1",22,["868"]],["Tunisia (‫تونس‬‎)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1",24,["340"]],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (‫الصحراء الغربية‬‎)","eh","212",1,["5288","5289"]],["Yemen (‫اليمن‬‎)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],i=0;ithis.countryCodeMaxLen&&(this.countryCodeMaxLen=i.length),this.countryCodes.hasOwnProperty(i)||(this.countryCodes[i]=[]);for(var a=0;a-1}))}else if(this.options.excludeCountries.length){var i=this.options.excludeCountries.map((function(t){return t.toLowerCase()}));this.countries=e.filter((function(t){return-1===i.indexOf(t.iso2)}))}else this.countries=e}},{key:"_translateCountriesByLocale",value:function(){for(var t=0;te.name?1:0}},{key:"_processCountryCodes",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.countryCodes={};for(var t=0;t"),this.options.showFlags&&(n+="
")),n+="".concat(o.name,""),n+="+".concat(o.dialCode,""),n+=""}this.countryList.insertAdjacentHTML("beforeend",n)}},{key:"_setInitialState",value:function(){var t=this.telInput.getAttribute("value"),e=this.telInput.value,i=!t||"+"!==t.charAt(0)||e&&"+"===e.charAt(0)?e:t,n=this._getDialCode(i),a=this._isRegionlessNanp(i),o=this.options,s=o.initialCountry,r=o.autoInsertDialCode;n&&!a?this._updateFlagFromNumber(i):"auto"!==s&&(s?this._setFlag(s.toLowerCase()):n&&a?this._setFlag("us"):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,i||this._setFlag(this.defaultCountry)),!i&&r&&(this.telInput.value="+".concat(this.selectedCountryData.dialCode))),i&&this._updateValFromNumber(i)}},{key:"_initListeners",value:function(){this._initKeyListeners(),this.options.autoInsertDialCode&&this._initBlurListeners(),this.options.allowDropdown&&this._initDropdownListeners(),this.hiddenInput&&this._initHiddenInputListener()}},{key:"_initHiddenInputListener",value:function(){var t=this;this._handleHiddenInputSubmit=function(){t.hiddenInput.value=t.getNumber()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit)}},{key:"_getClosestLabel",value:function(){for(var t=this.telInput;t&&"LABEL"!==t.tagName;)t=t.parentNode;return t}},{key:"_initDropdownListeners",value:function(){var t=this;this._handleLabelClick=function(e){t.countryList.classList.contains("iti__hide")?t.telInput.focus():e.preventDefault()};var e=this._getClosestLabel();e&&e.addEventListener("click",this._handleLabelClick),this._handleClickSelectedFlag=function(){!t.countryList.classList.contains("iti__hide")||t.telInput.disabled||t.telInput.readOnly||t._showDropdown()},this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag),this._handleFlagsContainerKeydown=function(e){t.countryList.classList.contains("iti__hide")&&-1!==["ArrowUp","Up","ArrowDown","Down"," ","Enter"].indexOf(e.key)&&(e.preventDefault(),e.stopPropagation(),t._showDropdown()),"Tab"===e.key&&t._closeDropdown()},this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown)}},{key:"_initRequests",value:function(){var t=this;this.options.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.options.utilsScript):window.addEventListener("load",(function(){window.intlTelInputGlobals.loadUtils(t.options.utilsScript)})):this.resolveUtilsScriptPromise(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.resolveAutoCountryPromise()}},{key:"_loadAutoCountry",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((function(t){window.intlTelInputGlobals.autoCountry=t.toLowerCase(),setTimeout((function(){return h("handleAutoCountry")}))}),(function(){return h("rejectAutoCountryPromise")})))}},{key:"_initKeyListeners",value:function(){var t=this;this._handleKeyupEvent=function(){t._updateFlagFromNumber(t.telInput.value)&&t._triggerCountryChange()},this.telInput.addEventListener("keyup",this._handleKeyupEvent),this._handleClipboardEvent=function(){setTimeout(t._handleKeyupEvent)},this.telInput.addEventListener("cut",this._handleClipboardEvent),this.telInput.addEventListener("paste",this._handleClipboardEvent)}},{key:"_cap",value:function(t){var e=this.telInput.getAttribute("maxlength");return e&&t.length>e?t.substr(0,e):t}},{key:"_initBlurListeners",value:function(){var t=this;this._handleSubmitOrBlurEvent=function(){t._removeEmptyDialCode()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent)}},{key:"_removeEmptyDialCode",value:function(){if("+"===this.telInput.value.charAt(0)){var t=this._getNumeric(this.telInput.value);t&&this.selectedCountryData.dialCode!==t||(this.telInput.value="")}}},{key:"_getNumeric",value:function(t){return t.replace(/\D/g,"")}},{key:"_trigger",value:function(t){var e=document.createEvent("Event");e.initEvent(t,!0,!0),this.telInput.dispatchEvent(e)}},{key:"_showDropdown",value:function(){this.countryList.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._setDropdownPosition(),this.activeItem&&(this._highlightListItem(this.activeItem,!1),this._scrollTo(this.activeItem,!0)),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}},{key:"_toggleClass",value:function(t,e,i){i&&!t.classList.contains(e)?t.classList.add(e):!i&&t.classList.contains(e)&&t.classList.remove(e)}},{key:"_setDropdownPosition",value:function(){var t=this;if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.isMobile){var e=this.telInput.getBoundingClientRect(),i=window.pageYOffset||document.documentElement.scrollTop,n=e.top+i,a=this.countryList.offsetHeight,o=n+this.telInput.offsetHeight+ai;if(this._toggleClass(this.countryList,"iti__country-list--dropup",!o&&s),this.options.dropdownContainer){var r=!o&&s?0:this.telInput.offsetHeight;this.dropdown.style.top="".concat(n+r,"px"),this.dropdown.style.left="".concat(e.left+document.body.scrollLeft,"px"),this._handleWindowScroll=function(){return t._closeDropdown()},window.addEventListener("scroll",this._handleWindowScroll)}}}},{key:"_getClosestListItem",value:function(t){for(var e=t;e&&e!==this.countryList&&!e.classList.contains("iti__country");)e=e.parentNode;return e===this.countryList?null:e}},{key:"_bindDropdownListeners",value:function(){var t=this;this._handleMouseoverCountryList=function(e){var i=t._getClosestListItem(e.target);i&&t._highlightListItem(i,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=function(e){var i=t._getClosestListItem(e.target);i&&t._selectListItem(i)},this.countryList.addEventListener("click",this._handleClickCountryList);var e=!0;this._handleClickOffToClose=function(){e||t._closeDropdown(),e=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);var i="",n=null;this._handleKeydownOnDropdown=function(e){e.preventDefault(),"ArrowUp"===e.key||"Up"===e.key||"ArrowDown"===e.key||"Down"===e.key?t._handleUpDownKey(e.key):"Enter"===e.key?t._handleEnterKey():"Escape"===e.key?t._closeDropdown():/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)&&(n&&clearTimeout(n),i+=e.key.toLowerCase(),t._searchForCountry(i),n=setTimeout((function(){i=""}),1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown)}},{key:"_handleUpDownKey",value:function(t){var e="ArrowUp"===t||"Up"===t?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;e&&(e.classList.contains("iti__divider")&&(e="ArrowUp"===t||"Up"===t?e.previousElementSibling:e.nextElementSibling),this._highlightListItem(e,!0))}},{key:"_handleEnterKey",value:function(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}},{key:"_searchForCountry",value:function(t){for(var e=0;es){e&&(d+=c);var h=a-r;i.scrollTop=d-h}}},{key:"_updateDialCode",value:function(t){var e,i=this.telInput.value,n="+".concat(t);if("+"===i.charAt(0)){var a=this._getDialCode(i);e=a?i.replace(a,n):n,this.telInput.value=e}else this.options.autoInsertDialCode&&(e=i?n+i:n,this.telInput.value=e)}},{key:"_getDialCode",value:function(t,e){var i="";if("+"===t.charAt(0))for(var n="",a=0;a30&&o.shift()}},g=function(e,n,a=!1,o=""){if(i){var s=0,r=0;try{s=navigator.maxTouchPoints,r=navigator.webdriver}catch(t){}try{p("click] ["+e+" "+n),t.ajax({url:i+"pp/clk",type:"POST",dataType:"json",timeout:3e3,data:{pId:u.pId,sId:u.step,uId:l.uId,csrf:l.csrf,type:e,name:n,mp:s,wd:r},success:function(t){p("click submitted");var i=JSON.parse(JSON.stringify(t));i&&i.ok?a&&(p("CLICKED"),d.clicked=(new Date).getTime(),k()):p("click submit empty response"),o.length>0&&(p("click redirecting to ["+o+"]"),window.location.href=o),"close"===e&&(p("clean local vars"),u={},d={},y())},error:function(){p("click submit failed"),o.length>0&&(p("click redirecting to ["+o+"]"),window.location.href=o)}})}catch(t){}}},f=function(){p("form init"),t(".ascl-modal .ascl-content form").on("submit",(function(e){if(e.preventDefault(),a=!0,o=t(".ascl-modal .ascl-content form :input"),r=0,t.each(o,(function(e,i){var n=t(i).prop("placeholder")??"";n.length||(n=t(i).prop("name"));var o=t(i).prop("type"),s=t(i).prop("required"),l=t(i).val(),u=t(i).parent(),d="";if(u.siblings(".error").remove(),s||l.length>0){switch(o){case"email":d="Please, enter a valid email address",/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)&&(d="",r++);break;case"tel":d="Please, enter a phone number in international format";var c=window.intlTelInputGlobals.getInstance(i);0===c.getValidationError()&&c.isPossibleNumber()&&(d="",r++);break;case"number":d="Please, enter a valid number",(l=l.replace(/[\+\(\)\ \-\/]/gi,"")).length>0&&parseInt(l)+""===l&&(d="",r++);break;case"date":d="Please, enter a valid date in YYYY-MM-DD format",new RegExp("\\d{4}-\\d{2}-\\d{2}").test(l)&&(d="",r++);break;case"text":case"password":case"url":d="Please, enter "+n,l.length>=3&&(d="",r++);break;default:s?(d="Please, enter "+n,l.length>0&&(d="",r++)):p("Input ["+n+"] not checked")}d.length&&(a=!1,u.after('
'+d+"
"),p("form check error: "+d))}})),o.length&&0===r&&a&&(a=!1),p("form check: "+a),a){p("form submit"),t('.ascl-modal .ascl-content form button[type="submit"]').prop("disabled",!0);var n=t(".ascl-modal .ascl-content form").serializeArray();t('.ascl-modal .ascl-content form input[type="tel"]').each((function(e,i){var a=window.intlTelInputGlobals.getInstance(i);if(0===a.getValidationError()&&a.isPossibleNumber()){var o=t(i).prop("name");for(let t=0;t'),n=t('
'),a=t('
'),o=t('');i.hide(),n.append(a),i.append(n),t("body").append(i),o.on("click",(function(t,e=null){t.preventDefault(),null===e?(p("modal closed by user"),p("CANCELLED"),d.cancelled=(new Date).getTime(),k()):p("modal closed by form submission"),i.remove()})),a.html(e),n.append(o),i.show(),p("SHOWED"),d.showed=(new Date).getTime(),k()}(u.steps[u.step].html),f(),a&&g("show","",!1)}},y=function(){if(S())return C();if(c&&!(c.length<1)){var e,i=[],n=[];return t.each(c,(function(t,e){var a=b(e);a>0&&(e.sdelay=a,"f"===e.type&&i.push(e),"p"===e.type&&n.push(e))})),i.length&&i.sort(((t,e)=>t.sdelay-e.sdelay)),n.length&&n.sort(((t,e)=>t.sdelay-e.sdelay)),i.length&&(!n.length||i[0].sdelay0&&("p"===e.type&&f.clicked>0||"f"===e.type&&f.submitted>0)?(p("conditions nsg "+e.pId),!1):(f.showed<1&&e.delay>0&&(h=f.inited+e.delay-g),f.showed>0&&e.delay>0&&(h=Math.max(f.inited,f.showed,f.finished)+e.delay-g),(f.cancelled>0||e.nsg<1&&("p"===e.type&&f.clicked>0||"f"===e.type&&f.submitted>0))&&e.adelay>0&&(h=Math.max(f.showed,f.cancelled,f.clicked,f.submitted)+e.adelay-g),(h=Math.max(500,h))>=2147483647&&(h=20736e5),h)},C=function(){p("config requesting"),t.ajax({url:i+"pp/init",type:"POST",dataType:"json",timeout:2e3,data:{p:n,u:document.URL,uId:l.uId},success:function(t){p("config loaded"),t&&t.uId&&t.uId.length?(l=t,c=t.popups?t.popups:[],delete l.popups,L()):t&&t.gdelay&&(l.gdelay=t.gdelay,c=[],delete l.popups,L()),T(),y()},error:function(){l.gdelay=0,T()}})},_=function(t,e=""){var i="";try{var n=localStorage.getItem(r+t);if(n&&n.length)return i=JSON.parse(n),""!==e?i[e]:i}catch(n){for(var a=document.cookie?document.cookie.split("; "):[],o=0;o').appendTo("head"),(r=_("config"))?(r.gdelay&&!l.gdelay&&(l.gdelay=parseInt(r.gdelay)),r.uId&&!l.uId&&r.uId.length&&(l.uId=r.uId),r.device&&!l.device&&r.device.length&&(l.device=r.device),r.country&&!l.country&&r.country.length&&(l.country=r.country),r.direction&&!l.direction&&r.direction.length&&(l.direction=r.direction),r.csrf&&!l.csrf&&r.csrf.length&&(l.csrf=r.csrf),r.glast&&r.glast>l.glast&&(l.glast=parseInt(r.glast)),p("global config loaded from storage")):p("no global session in storage"),function(){var t=_("data");t?(c=t,p("data loaded from storage")):p("no data in storage")}(),y())},open:function(t){if(!c||c.length<1||!c.hasOwnProperty(t))return!1;if(h.length){for(let t=0;t