!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.public=o():e.public=o()}(self,(function(){return window.lazyLoadOptions={elements_selector:".lazy"},{}}));var _mtm=window._mtm=window._mtm||[];_mtm.push({'mtm.startTime':(new Date().getTime()),'event':'mtm.Start'});var d=document,g=d.createElement('script'),s=d.getElementsByTagName('script')[0];g.async=!0;g.src='https://vlOIcXUv.addictivetips.com/js/container_vlOIcXUv.js';s.parentNode.insertBefore(g,s);(function(e,t,o,n,p,r,i){e.visitorGlobalObjectAlias=n;e[e.visitorGlobalObjectAlias]=e[e.visitorGlobalObjectAlias]||function(){(e[e.visitorGlobalObjectAlias].q=e[e.visitorGlobalObjectAlias].q||[]).push(arguments)};e[e.visitorGlobalObjectAlias].l=(new Date).getTime();r=t.createElement("script");r.src=o;r.async=!0;i=t.getElementsByTagName("script")[0];i.parentNode.insertBefore(r,i)})(window,document,"https://diffuser-cdn.app-us1.com/diffuser/diffuser.js","vgo");vgo('setAccount','225600763');vgo('setTrackByDefault',!0);vgo('process');const ADTCustomElements=document.querySelectorAll('.sidebar .custom-html-widget');ADTCustomElements.forEach((ADTCustomElement)=>{ADTCustomElement.className='custom-html-widget-2'});(function(){var fixed_widgets=["toc-widget-8","text-464276952"];for(var index=0;index<fixed_widgets.length;index ++){var widget=document.getElementById(fixed_widgets[index]);widget.className+=' floating'}})();window.REQUIRED_CODE_ERROR_MESSAGE='Please choose a country code';window.LOCALE='en';window.EMAIL_INVALID_MESSAGE=window.SMS_INVALID_MESSAGE="The email address entered is invalid, please check the formatting (e.g., email@domain.com).";window.REQUIRED_ERROR_MESSAGE="This field is required ";window.GENERIC_INVALID_MESSAGE="The email address entered is invalid, please check the formatting (e.g., email@domain.com).";window.translation={common:{selectedList:'{quantity} list selected',selectedLists:'{quantity} lists selected'}};var AUTOHIDE=Boolean(0);var addtips={"current_language":{"id":0,"slug":"en"},"recent_posts_cache_file_uri":"https:\/\/www.addictivetips.com\/app\/uploads\/addtips-recent-posts.json","ajaxurl":"https:\/\/www.addictivetips.com\/wp\/wp-admin\/admin-ajax.php","affiliate_links_w_post_slug":["https:\/\/www.addictivetips.com\/go\/cyberghost-super-deal\/","https:\/\/addictivetips.com\/go\/cyberghost-super-deal\/","https:\/\/www.addictivetips.com\/go\/beenverified\/","https:\/\/addictivetips.com\/go\/beenverified\/","https:\/\/www.addictivetips.com\/go\/truthfinder\/","https:\/\/addictivetips.com\/go\/truthfinder\/","https:\/\/www.addictivetips.com\/go\/instant-checkmate\/","https:\/\/addictivetips.com\/go\/instant-checkmate\/","https:\/\/www.addictivetips.com\/go\/nordvpn-sconto\/","https:\/\/addictivetips.com\/go\/nordvpn-sconto\/","https:\/\/www.addictivetips.com\/go\/cyberghost-sconto\/","https:\/\/addictivetips.com\/go\/cyberghost-sconto\/","https:\/\/www.addictivetips.com\/go\/nordvpn-netflix\/","https:\/\/addictivetips.com\/go\/nordvpn-netflix\/","https:\/\/www.addictivetips.com\/go\/cyberghost-netflix-deal\/","http:\/\/www.addictivetips.com\/go\/cyberghost-netflix-deal\/","https:\/\/www.addictivetips.com\/go\/cyberghost-descuento\/","https:\/\/addictivetips.com\/go\/cyberghost-descuento\/","https:\/\/www.addictivetips.com\/go\/nordvpn-descuento\/","https:\/\/addictivetips.com\/go\/nordvpn-descuento\/","https:\/\/www.addictivetips.com\/go\/vyprvpn-discounts\/","https:\/\/addictivetips.com\/go\/vyprvpn-discounts\/","https:\/\/www.addictivetips.com\/go\/nordvpn-discount\/","https:\/\/addictivetips.com\/go\/nordvpn-discount\/","https:\/\/www.addictivetips.com\/go\/vyprvpn-discount\/","https:\/\/addictivetips.com\/go\/vyprvpn-discount\/","https:\/\/www.addictivetips.com\/go\/nordvpn-rabais\/","https:\/\/addictivetips.com\/go\/nordvpn-rabais\/","https:\/\/www.addictivetips.com\/go\/expressvpn-oferta\/","https:\/\/addictivetips.com\/go\/expressvpn-oferta\/","https:\/\/www.addictivetips.com\/go\/nordvpn-oferta\/","https:\/\/addictivetips.com\/go\/nordvpn-oferta\/","https:\/\/www.addictivetips.com\/go\/expressvpn-firestick\/","https:\/\/addictivetips.com\/go\/expressvpn-firestick\/"],"post-slug":"avoid-common-scams"};!function(){"use strict";var t={171:function(t,e,i){var s,n=class{constructor(t){this.element=t,this.element||(this.element=document.querySelectorAll(".sidebar-section")),0!==this.element.length&&this.element.forEach((t=>{this.checkForSidebarTOC(t),this.setSideBarTOC(t)})),this.element=document.querySelectorAll("#toc_container, .toc_widget"),0!==this.element.length&&this.element.forEach((t=>{this.checkForParentLists(t),this.addToggle(t)}))}checkForSidebarTOC(t){this.toc_widget_list=t.querySelector(".toc_widget_list"),this.toc_section_title=t.querySelector(".section-title")}setSideBarTOC(t){null!=this.toc_widget_list&&(t.classList.add("toc_container"),t.setAttribute("id","toc_container"),this.toc_widget_list.classList.add("toc_list"),null!=this.toc_section_title&&(this.toc_section_title.classList.add("toc_title"),this.toc_section_title.setAttribute("id","toc_title")))}checkForParentLists(t){let e=t.querySelectorAll("ul > li");0!=e.length&&(e.forEach((t=>{let e=document.createElement("span");t.prepend(e)})),t.querySelectorAll("li > ul").forEach((t=>{t.parentElement.classList.add("arrow")})))}addToggle(t){t.querySelectorAll(".arrow > span").forEach((t=>{t.addEventListener("click",(function(e){t.classList.toggle("open")}))}))}};t=i.hmd(t),new n,"undefined"!=typeof jQuery&&(function(){var t,e;t=jQuery||window.jQuery,e=t(window),t.fn.stick_in_parent=function(i){var s,n,a,o,l,r,d,c,u,p,h;for(null==i&&(i={}),h=i.sticky_class,l=i.inner_scrolling,p=i.recalc_every,u=i.parent,c=i.offset_top,d=i.spacer,n=i.bottoming,null==c&&(c=0),null==u&&(u=void 0),null==l&&(l=!0),null==h&&(h="is_stuck"),s=t(document),null==n&&(n=!0),a=function(i,a,o,r,f,g,m,v){var _,w,y,b,k,x,L,C,N,E,A,S;if(!i.data("sticky_kit")){if(i.data("sticky_kit",!0),k=s.height(),L=i.parent(),null!=u&&(L=L.closest(u)),!L.length)throw"failed to find stick parent";if(_=y=!1,(A=null!=d?d&&i.closest(d):t("<div />"))&&A.css("position",i.css("position")),C=function(){var t,e,n;if(!v&&(k=s.height(),t=parseInt(L.css("border-top-width"),10),e=parseInt(L.css("padding-top"),10),a=parseInt(L.css("padding-bottom"),10),o=L.offset().top+t+e,r=L.height(),y&&(_=y=!1,null==d&&(i.insertAfter(A),A.detach()),i.css({position:"",top:"",width:"",bottom:""}).removeClass(h),n=!0),f=i.offset().top-(parseInt(i.css("margin-top"),10)||0)-c,g=i.outerHeight(!0),m=i.css("float"),A&&A.css({width:i.outerWidth(!0),height:g,display:i.css("display"),"vertical-align":i.css("vertical-align"),float:m}),n))return S()},C(),g!==r)return b=void 0,x=c,E=p,S=function(){var t,u,w,N;if(!v&&(w=!1,null!=E&&(0>=--E&&(E=p,C(),w=!0)),w||s.height()===k||C(),w=e.scrollTop(),null!=b&&(u=w-b),b=w,y?(n&&(N=w+g+x>r+o,_&&!N&&(_=!1,i.css({position:"fixed",bottom:"",top:x}).trigger("sticky_kit:unbottom"))),w<f&&(y=!1,x=c,null==d&&("left"!==m&&"right"!==m||i.insertAfter(A),A.detach()),t={position:"",width:"",top:""},i.css(t).removeClass(h).trigger("sticky_kit:unstick")),l&&(t=e.height(),g+c>t&&!_&&(x-=u,x=Math.max(t-g,x),x=Math.min(c,x),y&&i.css({top:x+"px"})))):w>f&&(y=!0,(t={position:"fixed",top:x}).width="border-box"===i.css("box-sizing")?i.outerWidth()+"px":i.width()+"px",i.css(t).addClass(h),null==d&&(i.after(A),"left"!==m&&"right"!==m||A.append(i)),i.trigger("sticky_kit:stick")),y&&n&&(null==N&&(N=w+g+x>r+o),!_&&N)))return _=!0,"static"===L.css("position")&&L.css({position:"relative"}),i.css({position:"absolute",bottom:a,top:"auto"}).trigger("sticky_kit:bottom")},N=function(){return C(),S()},w=function(){if(v=!0,e.off("touchmove",S),e.off("scroll",S),e.off("resize",N),t(document.body).off("sticky_kit:recalc",N),i.off("sticky_kit:detach",w),i.removeData("sticky_kit"),i.css({position:"",bottom:"",top:"",width:""}),L.position("position",""),y)return null==d&&("left"!==m&&"right"!==m||i.insertAfter(A),A.remove()),i.removeClass(h)},e.on("touchmove",S),e.on("scroll",S),e.on("resize",N),t(document.body).on("sticky_kit:recalc",N),i.on("sticky_kit:detach",w),setTimeout(S,0)}},o=0,r=this.length;o<r;o++)i=this[o],a(t(i));return this}}.call(void 0),s=function(t){var e="flex-pulldown",i={init:function(s){return s=t.extend({showNum:!0,sp:!0,breakwidth:420},s),i.settings={state:!1,class:{wrap:"flex-pulldown",menu:"flex-pulldown-menu",more:"flex-pulldown-more",list:"flex-menu-li",hideli:"menu-hidden",visible:"flex-pulldown-more-visible",addul:"flex-pulldown-add-menu"}},this.each((function(){var n=this,a=t(this);a.data(e),s=t.extend({},s),a.data(e,{options:s}),i.setup.call(n),i.flexevent.call(n),t(window).on("resize",(function(){i.flexevent.call(n)}))}))},setup:function(){var s=t(this),n=s.data(e).options;s.addClass(i.settings.class.wrap),s.find("."+i.settings.class.menu).find("> li").not("."+i.settings.class.more).addClass(i.settings.class.list);var a=s.find("."+i.settings.class.list);i.listNum=a.length;var o=0;i.bp=[];for(var l=0;l<i.listNum;l++)o+=a.eq(l).outerWidth(!0),i.bp.push(o);i.more=s.find("."+i.settings.class.more),i.toggle.call(this),n.showNum&&i.showNum.call(this);var r=s.find("."+i.settings.class.more).height();t("."+i.settings.class.addul).css({top:r})},flexevent:function(){var s=this,n=t(this),a=n.data(e).options,o=n.width(),l=0;n.children().each((function(t){l+=n.children().not("."+i.settings.class.menu).eq(t).outerWidth(!0),t++}));for(var r=o-l-10,d=0,c=0;c<i.listNum;c++)d+=n.find("."+i.settings.class.list).not("."+i.settings.class.hideli).eq(c).outerWidth(!0);n.find("."+i.settings.class.more).hasClass(i.settings.class.visible)&&(d+=n.find("."+i.settings.class.more).outerWidth(!0));var u=t.grep(i.bp,(function(t,e){return r>t})),p=n.find("."+i.settings.class.list).not("."+i.settings.class.hideli).length;i.addpulldown.call(s,u,r,d),i.removepulldown.call(s,p,r),n.find("."+i.settings.class.hideli).get(0)&&n.find("."+i.settings.class.more).addClass(i.settings.class.visible),a.showNum&&i.countNum.call(s)},addpulldown:function(s,n,a){var o=t(this),l=o.data(e).options,r=t(window).width(),d=o.find("."+i.settings.class.list),c=o.find("."+i.settings.class.addul);l.sp&&r<=l.breakwidth?(d.prependTo("."+i.settings.class.addul),c.find("> li").addClass(i.settings.class.hideli),o.find("."+i.settings.class.more).addClass(i.settings.class.visible)):a>n&&(d.slice(s.length-1).prependTo(c),o.find("."+i.settings.class.addul).find("> li").addClass(i.settings.class.hideli))},removepulldown:function(s,n){var a=t(this),o=a.data(e).options,l=t(window).width(),r=a.find("."+i.settings.class.more);(!o.sp||o.sp&&l>o.breakwidth)&&(n>=i.bp[s+1]&&i.listNum-2>s?a.find("."+i.settings.class.addul).find("> li").first().removeClass(i.settings.class.hideli).insertBefore(r):n>=i.bp[i.listNum-1]&&(a.find("."+i.settings.class.addul).find("> li").removeClass(i.settings.class.hideli).insertBefore(r),a.find("."+i.settings.class.more).removeClass(i.settings.class.visible)))},toggle:function(){var s=this,n=t(this);n.data(e).options,i.more.on("click",(function(){n.find("."+i.settings.class.addul).hasClass("show")?i.close.call(s):i.open.call(s)}))},open:function(){var e=t(this);e.find("."+i.settings.class.addul).addClass("show"),e.find("."+i.settings.class.more).addClass("open")},close:function(){var e=t(this);e.find("."+i.settings.class.addul).removeClass("show"),e.find("."+i.settings.class.more).removeClass("open")},showNum:function(){var e=t(this);i.$MenuNum=t('<span class="menu-num"></span>'),e.find("."+i.settings.class.more).append(i.$MenuNum),e.find(".menu-num").css({display:"none"})},countNum:function(){var e=t(this);e.find("."+i.settings.class.hideli).get(0)&&(e.find(".menu-num").css({display:"block"}),i.$MenuNum.text(e.find("."+i.settings.class.hideli).length))}};t.fn.fxpulldown=function(e){return i[e]?i[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void t.error("Method "+e+" does not exist on jQuery.tooltip"):i.init.apply(this,arguments)}},"function"==typeof define&&i.amdO?define(["jquery"],s):"object"==typeof exports?t.exports=s(i(311)):s(jQuery));var a,o={};"undefined"!=typeof jQuery&&(a=jQuery,o.GENERAL=function(){var t=this;return t.DAY_IN_MILLISECONDS=864e5,t.get_cookie=function(t){t+="=";for(var e=decodeURIComponent(document.cookie).split(";"),i=0;i<e.length;i++){for(var s=e[i];" "==s.charAt(0);)s=s.substring(1);if(0==s.indexOf(t))return s.substring(t.length,s.length)}return""},t.set_cookie=function(e,i,s){var n=new Date;n.setTime(n.getTime()+s*t.DAY_IN_MILLISECONDS);var a="expires="+n.toUTCString();document.cookie=e+"="+i+";"+a+";path=/"},t},o.Main=function(){var t=a(".addtips_popup_box"),e=90,i="",s="addtips_popup__",n=function(){a.post(addtips.ajaxurl+"?action=addtips_popup__get_user_ip_address",{},(function(e){if(void 0!==e&&""!==e){var i=a(".addtips_user_ip_address",t);a("em",i).text(e),i.show(),s=e,a.get("https://extreme-ip-lookup.com/json/"+s,{},(function(e){if(void 0!==e.isp&&""!==e.isp){var i=a(".addtips_user_isp",t);a("em",i).text(e.isp),i.show(),a(".addtips_vpn_status_warning",t).show()}}),"json")}var s}),"json")};this.init=function(){if([...document.body.querySelectorAll(".menu-item-has-children")].forEach((t=>t.addEventListener("click",(e=>(t=>{t.classList.contains("openchildmenu")?t.classList.remove("openchildmenu"):([...t.parentElement.children].forEach((t=>t.classList.remove("openchildmenu"))),t.classList.add("openchildmenu"))})(t))))),a(window).on("scroll",(function(t){t.preventDefault(),a(this).scrollTop()>300?a(".back-to-top").css("display","flex").fadeIn():a(".back-to-top").fadeOut()})),a(".back-to-top").on("click",(function(t){t.preventDefault(),a("html,body").animate({scrollTop:a("body").offset().top},500,(function(){a(".back-to-top").fadeOut()}))})),a(".subheader").css("overflow","visible"),1===a("nav.category-nav .flex-pulldown-more").length&&a("nav.category-nav .flex-pulldown-more").append('<ul class="flex-pulldown-add-menu"></ul>'),a("nav.category-nav").fxpulldown({showNum:!0}),a(".hamburger").on("click",(function(){return a(".hamburger").toggleClass("is-active"),a("body").toggleClass("is-mobile"),!1})),a(".sticky").stick_in_parent(),1===t.length&&(i=t.data("popup-id"),e=t.data("num-days-hide"),setTimeout((function(){var a,l;a=!1,l=parseInt(o.GENERAL().get_cookie(s+i)),1===t.closest(".addtips_popup_box__preview").length?a=!0:l?((new Date).getTime()-l)/o.GENERAL().DAY_IN_MILLISECONDS>=e&&(a=!0,o.GENERAL().set_cookie(s+i,"",-e)):a=!0,a&&(setTimeout((function(){t.addClass("fade-in"),n()}),5e3),t.on("click",".close",(function(n){n.preventDefault(),0===t.closest(".addtips_popup_box__preview").length&&o.GENERAL().set_cookie(s+i,(new Date).getTime(),e),t.removeClass("fade-in")})))}),1e3)),void 0!==addtips.affiliate_links_w_post_slug&&addtips.affiliate_links_w_post_slug.length>0){for(var l=[],r=0;r<addtips.affiliate_links_w_post_slug.length;r++)l.push('a[href*="'+addtips.affiliate_links_w_post_slug[r]+'"]');l=l.join(),a("body").on("click",l,(function(t){if(window.location.pathname.length>1&&-1===a(this).attr("href").indexOf(window.location.host+"/go/nordvpn-discount")){var e=window.location.pathname.match(/([^\/]*)\/*?$/),i=a(this).attr("href");i=(i=i+"/d/"+e[1]).replace("//d","/d"),a(this).attr("href",i)}}))}a("body.single.at-is-mobile").on("click touchend",".languagepicker a",(function(t){a(this).closest(".languagepicker").hasClass("toggled-visible")||(t.preventDefault(),t.stopPropagation(),a(this).closest(".languagepicker").addClass("toggled-visible"))})),a("body.single.at-is-mobile").on("click touchend",(function(t){a(".languagepicker a").is(t.target)||0!=a(".languagepicker a").has(t.target).length||a(".languagepicker").removeClass("toggled-visible")}))}},o.Handle_Recent_Posts=function(){this.init=function(){a.ajax({url:addtips.recent_posts_cache_file_uri,async:!0,cache:!1,dataType:"json",success:function(t){var e=a(".addtips-recent-posts"),i=0;void 0!==addtips.current_language&&(i=addtips.current_language.id);var s="",n=a(".container .main-content .post");1===n.length&&(s=n.data("post-id")),a.each(e,(function(e){var n=a(this),o=n.data("id"),l=n.data("language"),r=n.data("num-posts");if(l===i&&"undefined"!=t[o])if(n.hasClass("json")){0==a(".sidebar.author_pg_sidebar").length&&n.parent().css("display","block");var d=a(t[o]);s&&1==d.find(".post-thumb[data-post-id="+s+"]").length?d.find(".post-thumb[data-post-id="+s+"]").remove():d.find(".post-thumb").lengh>r&&d.find(".post-thumb").last().remove(),n.replaceWith(d)}else n.removeClass("hidden")}))}})}},o.Popular_Posts=function(){var t,e,i,s=null,n=function(){a(".popular-posts").each((function(){(t=a(this)).closest(".sidebar-section").addClass("hidden"),e=t.data("period"),t.data("num-posts"),i=t.data("list-type"),a.isPlainObject(s)&&void 0!==s[e]&&0!==s[e].length?function(e){for(var s in e){var n=e[s].permalink,a=e[s].title,o=e[s].post_thumb,l=(e[s].author.name,e[s].author.url,"full-width-images"==i?"post-small":"post-thumb"),r="";void 0!==e[s].category&&(r='<a href="'+e[s].category.url+'" title="'+e[s].category.name+'" class="category-title-link"><h4 class="category-title">'+e[s].category.name+"</h4></a>");var d='<article class="post '+l+'"><div class="featured-image"><a href="'+n+'" class="featured-image-link" title="'+a+'"><img src="'+o+'" alt="'+a+'" loading="lazy" /></a></div><div class="post-header"><header class="header">'+r+'<a href="'+n+'" title="'+a+'" class="title-link"><h2 class="title">'+a+"</h2></a></header></div></article>";t.append(d)}t.closest(".section-popular").removeClass("hidden")}(s[e]):t.closest(".sidebar-section").remove()})),a(window).trigger("addtips_content_loaded_async")};this.init=function(){void 0!==addtips.current_language&&0!==addtips.current_language.id||function(){if(null===s){var t="/toplytics.json?ver="+Math.floor((new Date).getTime()/1e3);a.ajax({url:t,dataType:"json",complete:function(t){void 0!==t.responseJSON&&(s=t.responseJSON),n()}})}else n()}()}},o.Handle_Affiliate_Links=function(){this.init=function(){a("a").filter('[href*="'+window.location.host+'/go/"]').attr("target","_blank"),encodeURIComponent(window.location.pathname.substr(1)),a("body").hasClass("single")&&a("a").filter('[href*="'+window.location.host+'/go/expressvpn-discounts/"]').each((function(){if(-1===a(this).attr("href").indexOf(window.location.host+"/go/nordvpn-discount")){var t=null,e=!0;if(1===a(this).closest("h1, h2, h3, h4, h5, h6").length?t="title":1===a(this).closest(".vpndeal").length?t="deal":1===a(this).closest(".post-content").length&&(t="content",e=!1),null!==t){var i=a(this).attr("href");i=function(t,e,i,s){var n="d/";if(-1!==t.indexOf("/d/")){var a=t.match(/\/d\/[^\/]+\/?/)[0];t=t.replace(a,""),a=a.replace("/d/","").replace("/","").split("+"),(s||void 0===a[e])&&(a[e]=i),n+=a.join("+")}else{for(var o=0;o<e;o++)n+="+";n+=i}return"/"!==t.slice(-1)&&(t+="/"),t+(n+"/")}(i,0,t,e),a(this).attr("href",i)}}}))}},o.Article_Summary_CTA=function(){const t=a(".article_summary_cta .button");this.init=function(){t.each((function(){a(this).on("click",(function(){a(this).hasClass("open")?(a(this).closest(".article_summary_cta").find(".article_summary_cta__content").hide(),a(this).removeClass("open")):(a(this).closest(".article_summary_cta").find(".article_summary_cta__content").slideDown(),a(this).addClass("open"))}))}))}},o.Handle_Repeating_Sidebar_Widget=function(){var t=null,e=null,i=null;this.init=function(s,n){e=a("."+s),t=n,i=a(".repeating-widget-wrapper",e).children(".repeating-widget").clone(),a(".repeating-widget-wrapper",e).attr("data-widget-loaded","yes"),a(window).load((function(){var s,n=e.height(),o=a(window).height(),l=s=e.height()>2*o?2*o:e.height();for(a(".repeating-widget-wrapper",e).height(s);l<n;)e.append('<div class="'+t+'"></div>'),l+=s=n>l+2*o?2*o:n-l,a(".repeating-widget-wrapper",e).last().height(s);a(window).on("scroll",(function(){a(".repeating-widget-wrapper:not([data-widget-loaded])",e).each((function(){"function"==typeof a(this)[0].getBoundingClientRect&&a(this)[0].getBoundingClientRect().top<=o+20&&a(this).append(i.clone()).attr("data-widget-loaded","yes")}))}))}))}},(new o.Main).init(),a(document).on("ready",(function(){(new o.Handle_Recent_Posts).init(),a(".popular-posts").length>0&&(new o.Popular_Posts).init(),(new o.Handle_Affiliate_Links).init(),0!==a(".article_summary_cta").length&&(new o.Article_Summary_CTA).init();const t=window.outerWidth;t>320&&t<426&&(a("main.container").css("padding-right","20px !important"),a("main.container").css("padding-left","20px !important")),a(".video_container .img_cover")&&a(".video_container .img_cover .play_icon").on("click",(function(t){a(".video_container .img_cover .play_icon").fadeOut(600),a(".video_container .img_cover img").fadeOut(600),a("#video_yt_play")[0].src+="?autoplay=1&origin=https://addictivetips.com",t.preventDefault()})),a("main.vpn-methodology")&&a("main.vpn-methodology").attr("style","padding-left:0px !important;padding-right:0px !important"),a("#single-post").length>0&&document.querySelectorAll("#single-post img").forEach((function(t){t.classList.contains("aligncenter")?t.parentNode.parentNode.classList.add("aligncenter-img"):t.classList.contains("alignleft")?t.parentNode.parentNode.classList.add("alignleft-img"):t.classList.contains("alignright")&&t.parentNode.parentNode.classList.add("alignright-img")}))})),1===a(".sidebar .sidebar-inner.repeating-widget-wrapper").length&&(new o.Handle_Repeating_Sidebar_Widget).init("sidebar","sidebar-inner repeating-widget-wrapper")),o.Handle_Affiliate_Links_Nojquery=function(){var t=function(t){var e=t.href;if("/"!==e.substr(-1)&&(e+="/"),-1===e.indexOf("/d/"))e+="d/+"+addtips["post-slug"];else{var i=e.split("/d/");i[1]=i[1].replace("/","");var s=i[1].split("+");0==s.length?(s.push(""),s.push(addtips["post-slug"])):1==s.length?s.push(addtips["post-slug"]):void 0!==s[1]&&s[1]==addtips["post-slug"]||s.splice(1,0,addtips["post-slug"]),i[1]=s.join("+")+"/",e=i[0]+"/d/"+i[1]}t.href=e};this.init=function(){if("undefined"!=typeof addtips&&""!==addtips["post-slug"])for(var e=document.getElementsByTagName("a"),i=0;i<e.length;i++)-1!=e[i].href.indexOf("/go/nordvpn-discount")&&(e[i].addEventListener("click",(function(e){t(e.currentTarget)})),e[i].addEventListener("touchend",(function(e){t(e.currentTarget)})))}},(new o.Handle_Affiliate_Links_Nojquery).init();let l=document.querySelectorAll(".accordion-item");0!==l.length&&(l[0].classList.toggle("active"),l.forEach((t=>{t.addEventListener("click",(()=>{t.classList.toggle("active")}))})));let r,d=document.querySelectorAll(".rating_numb .toggle"),c=document.querySelectorAll(".rating_numb .tooltip");0!==d.length&&d.forEach((t=>{t.addEventListener("click",(()=>{t.classList.contains("active")||null!=r?t.classList.contains("active")||null==r?t.classList.contains("active")&&null!=r&&(t.classList.remove("active"),c[r-1].style.display="none",r=null):(c[r-1].style.display="none",d[r-1].classList.remove("active"),t.classList.add("active"),r=t.classList[1],c[r-1].style.display="block"):(t.classList.add("active"),r=t.classList[1],c[r-1].style.display="block")}))}))},311:function(t){t.exports=jQuery}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var a=e[s]={id:s,loaded:!1,exports:{}};return t[s](a,a.exports,i),a.loaded=!0,a.exports}i.amdO={},i.hmd=function(t){return(t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t};i(171)}();!function(e){function t(t){for(var i,o,r=t[0],s=t[1],a=0,u=[];a<r.length;a++)o=r[a],n[o]&&u.push(n[o][0]),n[o]=0;for(i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i]);for(c&&c(t);u.length;)u.shift()()}var i={},n={https:0};function o(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],i=n[e];if(0!==i)if(i)t.push(i[2]);else{var r=new Promise(function(t,o){i=n[e]=[t,o]});t.push(i[2]=r);var s,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+"modules/"+({}[e]||e)+".bundle.js"}(e),s=function(t){a.onerror=a.onload=null,clearTimeout(c);var i=n[e];if(0!==i){if(i){var o=t&&("load"===t.type?"missing":t.type),r=t&&t.target&&t.target.src,s=new Error("Loading chunk "+e+" failed.\n("+o+": "+r+")");s.type=o,s.request=r,i[1](s)}n[e]=void 0}};var c=setTimeout(function(){s({type:"timeout",target:a})},12e4);a.onerror=a.onload=s,document.head.appendChild(a)}return Promise.all(t)},o.m=e,o.c=i,o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(i,n,function(t){return e[t]}.bind(null,n));return i},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="https://cdn.gravitec.net/",o.oe=function(e){throw console.error(e),e};var r=window.gravitecWebpackJsonp=window.gravitecWebpackJsonp||[],s=r.push.bind(r);r.push=t,r=r.slice();for(var a=0;a<r.length;a++)t(r[a]);var c=s;o(o.s=1)}({"./node_modules/@firebase/util/dist/index.esm2017.js":function(e,t,i){"use strict";(function(e,n){i.d(t,"a",function(){return p}),i.d(t,"b",function(){return y}),i.d(t,"c",function(){return v}),i.d(t,"d",function(){return m}),i.d(t,"e",function(){return a}),i.d(t,"f",function(){return S}),i.d(t,"g",function(){return d}),i.d(t,"h",function(){return T}),i.d(t,"i",function(){return h}),i.d(t,"j",function(){return g}),i.d(t,"k",function(){return f}),i.d(t,"l",function(){return b});const o=function(e){const t=[];let i=0;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);o<128?t[i++]=o:o<2048?(t[i++]=o>>6|192,t[i++]=63&o|128):55296==(64512&o)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),t[i++]=o>>18|240,t[i++]=o>>12&63|128,t[i++]=o>>6&63|128,t[i++]=63&o|128):(t[i++]=o>>12|224,t[i++]=o>>6&63|128,t[i++]=63&o|128)}return t},r={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const i=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let t=0;t<e.length;t+=3){const o=e[t],r=t+1<e.length,s=r?e[t+1]:0,a=t+2<e.length,c=a?e[t+2]:0,u=o>>2,l=(3&o)<<4|s>>4;let d=(15&s)<<2|c>>6,p=63&c;a||(p=64,r||(d=64)),n.push(i[u],i[l],i[d],i[p])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(o(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let i=0,n=0;for(;i<e.length;){const o=e[i++];if(o<128)t[n++]=String.fromCharCode(o);else if(o>191&&o<224){const r=e[i++];t[n++]=String.fromCharCode((31&o)<<6|63&r)}else if(o>239&&o<365){const r=((7&o)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536;t[n++]=String.fromCharCode(55296+(r>>10)),t[n++]=String.fromCharCode(56320+(1023&r))}else{const r=e[i++],s=e[i++];t[n++]=String.fromCharCode((15&o)<<12|(63&r)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const i=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let t=0;t<e.length;){const o=i[e.charAt(t++)],r=t<e.length?i[e.charAt(t)]:0,a=++t<e.length?i[e.charAt(t)]:64,c=++t<e.length?i[e.charAt(t)]:64;if(++t,null==o||null==r||null==a||null==c)throw new s;const u=o<<2|r>>4;if(n.push(u),64!==a){const e=r<<4&240|a>>2;if(n.push(e),64!==c){const e=a<<6&192|c;n.push(e)}}}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class s extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const a=function(e){return function(e){const t=o(e);return r.encodeByteArray(t,!0)}(e).replace(/\./g,"")},c=function(e){try{return r.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};const u=()=>(function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("Unable to locate global object.")})().__FIREBASE_DEFAULTS__,l=()=>{try{return u()||(()=>{if(void 0===n||void 0===n.env)return;const e=n.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&c(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},d=()=>{var e;return null===(e=l())||void 0===e?void 0:e.config};class p{constructor(){this.reject=(()=>{}),this.resolve=(()=>{}),this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,i)=>{t?this.reject(t):this.resolve(i),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,i))}}}function h(){return"undefined"!=typeof window||f()}function f(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function g(){try{return"object"==typeof indexedDB}catch(e){return!1}}function b(){return new Promise((e,t)=>{try{let i=!0;const n="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(n);o.onsuccess=(()=>{o.result.close(),i||self.indexedDB.deleteDatabase(n),e(!0)}),o.onupgradeneeded=(()=>{i=!1}),o.onerror=(()=>{var e;t((null===(e=o.error)||void 0===e?void 0:e.message)||"")})}catch(e){t(e)}})}function m(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)}const w="FirebaseError";class v extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name=w,Object.setPrototypeOf(this,v.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,y.prototype.create)}}class y{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){const i=t[0]||{},n=`${this.service}/${e}`,o=this.errors[e],r=o?function(e,t){return e.replace(k,(e,i)=>{const n=t[i];return null!=n?String(n):`<${i}?>`})}(o,i):"Error",s=`${this.serviceName}: ${r} (${n}).`;return new v(n,s,i)}}const k=/\{\$([^}]+)}/g;function S(e,t){if(e===t)return!0;const i=Object.keys(e),n=Object.keys(t);for(const o of i){if(!n.includes(o))return!1;const i=e[o],r=t[o];if(_(i)&&_(r)){if(!S(i,r))return!1}else if(i!==r)return!1}for(const e of n)if(!i.includes(e))return!1;return!0}function _(e){return null!==e&&"object"==typeof e}function T(e){return e&&e._delegate?e._delegate:e}}).call(this,i("./node_modules/webpack/buildin/global.js"),i("./node_modules/process/browser.js"))},"./node_modules/idb/build/index.js":function(e,t,i){"use strict";const n=(e,t)=>t.some(t=>e instanceof t);let o,r;const s=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,l=new WeakMap;let d={get(e,t,i){if(e instanceof IDBTransaction){if("done"===t)return a.get(e);if("objectStoreNames"===t)return e.objectStoreNames||c.get(e);if("store"===t)return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return f(e[t])},set:(e,t,i)=>(e[t]=i,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(r||(r=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(g(this),t),f(s.get(this))}:function(...t){return f(e.apply(g(this),t))}:function(t,...i){const n=e.call(g(this),t,...i);return c.set(n,t.sort?t.sort():[t]),f(n)}}function h(e){return"function"==typeof e?p(e):(e instanceof IDBTransaction&&function(e){if(a.has(e))return;const t=new Promise((t,i)=>{const n=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",r),e.removeEventListener("abort",r)},o=()=>{t(),n()},r=()=>{i(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",o),e.addEventListener("error",r),e.addEventListener("abort",r)});a.set(e,t)}(e),n(e,o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,d):e)}function f(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,i)=>{const n=()=>{e.removeEventListener("success",o),e.removeEventListener("error",r)},o=()=>{t(f(e.result)),n()},r=()=>{i(e.error),n()};e.addEventListener("success",o),e.addEventListener("error",r)});return t.then(t=>{t instanceof IDBCursor&&s.set(t,e)}).catch(()=>{}),l.set(t,e),t}(e);if(u.has(e))return u.get(e);const t=h(e);return t!==e&&(u.set(e,t),l.set(t,e)),t}const g=e=>l.get(e);function b(e,t,{blocked:i,upgrade:n,blocking:o,terminated:r}={}){const s=indexedDB.open(e,t),a=f(s);return n&&s.addEventListener("upgradeneeded",e=>{n(f(s.result),e.oldVersion,e.newVersion,f(s.transaction),e)}),i&&s.addEventListener("blocked",e=>i(e.oldVersion,e.newVersion,e)),a.then(e=>{r&&e.addEventListener("close",()=>r()),o&&e.addEventListener("versionchange",e=>o(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}function m(e,{blocked:t}={}){const i=indexedDB.deleteDatabase(e);return t&&i.addEventListener("blocked",e=>t(e.oldVersion,e)),f(i).then(()=>void 0)}i.d(t,"a",function(){return m}),i.d(t,"b",function(){return b});const w=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],y=new Map;function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(y.get(t))return y.get(t);const i=t.replace(/FromIndex$/,""),n=t!==i,o=v.includes(i);if(!(i in(n?IDBIndex:IDBObjectStore).prototype)||!o&&!w.includes(i))return;const r=async function(e,...t){const r=this.transaction(e,o?"readwrite":"readonly");let s=r.store;return n&&(s=s.index(t.shift())),(await Promise.all([s[i](...t),o&&r.done]))[0]};return y.set(t,r),r}d=(e=>({...e,get:(t,i,n)=>k(t,i)||e.get(t,i,n),has:(t,i)=>!!k(t,i)||e.has(t,i)}))(d)},"./node_modules/process/browser.js":function(e,t){var i,n,o=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(i===setTimeout)return setTimeout(e,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(e){i=r}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var c,u=[],l=!1,d=-1;function p(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!l){var e=a(p);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];u.push(new f(e,t)),1!==u.length||l||a(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},"./node_modules/webpack/buildin/global.js":function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},"./src/sdk-template/client/base.client.ts":function(e,t,i){"use strict";var n=i("./src/sdk-template/enums.ts"),o=i("./src/sdk-template/utils/index.ts"),r=i("./src/sdk-template/utils/logger.ts"),s=i("./src/sdk-template/client/browser-subscription-managers/browser-subscription-manager.ts"),a=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};i.d(t,"a",function(){return u});var c=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};class u{constructor(e,t,i,n){this._db=t,this._api=i,this._modules=n,this._Notification=window.Notification,this._autoRegister=!0,this._mode=null,this._commandsPermittedWithoutInit=[{module:this,commands:["init","getSubscription","getSubscriptionData","afterSubscription","subscriptionResult","isSubscribed","testMethod","subscribe"]}],this._subscriptionPromise=new Promise(e=>{this._subscriptionResolve=e}),this.config=e}_checkSubscriptionOwn(e){return Promise.resolve(!0)}_unsubscribeForeign(){return Promise.resolve(!1)}init(e={}){return this._initPromise||(this._initPromise=this._init(e),this._initPromise.then(()=>{this._onInit()}).catch(()=>{})),this._initPromise}_init(e={}){return c(this,void 0,void 0,function*(){const t=e.onInit||(()=>{});try{yield this._checkSupport()}catch(e){throw"Notifications API is not supported"===e.message||e.message==="You must use this SDK only for "+this.config.app.siteUrl?r.a.warn(e.message):r.a.error(e.message),e.permission&&t(!0),e}if(this._setMode(this._detectMode()),this._subscriptionManager.getSubscription().then(e=>{switch(e.permission){case n.c.granted:if(!e.subscription)break;this._subscriptionResolve(e);break;case n.c.denied:this._subscriptionResolve(e)}}),!this._subscriptionManager.isNotificationPermitted())throw t(!1,!0),r.a.info("notifications are blocked"),new Error("notifications are blocked");return!1===e.autoRegister&&(this._autoRegister=!1),new Promise(e=>{const i=()=>{t(),e()};"loading"!==document.readyState?i():window.addEventListener("DOMContentLoaded",i)})})}_onInit(){return c(this,void 0,void 0,function*(){if(this._autoRegister&&this.config.app.subscriptionAllowed){(yield this.registerUserForPush(void 0,{ignoreBlockedCookie:!1})).permission===n.c.granted&&this.config.taggingRules&&this.config.taggingRules.map(e=>{document.location.href.includes(e.categoryPattern)&&(window.localStorage.setItem(e.categoryPattern,(Number(window.localStorage.getItem(`${e.categoryPattern}`))+1).toString()),Number(window.localStorage.getItem(e.categoryPattern))===e.clicksAmount&&(this.push(["addTag",e.tagName]),window.localStorage.removeItem(e.categoryPattern)))})}})}getSubscriptionData(e){this._getSubscription().then(t=>{e(t)}).catch(t=>{e({permission:t,subscription:null})})}getSubscription(e){this.getSubscriptionData(t=>{e(t.subscription||null)})}subscribe(e){console.log(e),window.addEventListener("ready-to-ask-permission-event",t=>c(this,void 0,void 0,function*(){if("CUSTOM"===t.detail.type){(yield e())?window.dispatchEvent(new CustomEvent("grv-permission-event")):window.dispatchEvent(new CustomEvent("grv-block-event"))}}))}subscriptionResult(e){this._subscriptionPromise.then(t=>{e(t)})}afterSubscription(e){this.subscriptionResult(t=>{t.newSubscription&&e(t.subscription||null)})}isSubscribed(e){return this._getSubscription().then(t=>{const i=Boolean(t.subscription);return e(i),i})}isSubMatchIdb(e){return c(this,void 0,void 0,function*(){return r.a.log("Matching subscriptions with idb..."),(yield this._subscriptionManager.checkSubscriptionState(e)).state===s.b.not_changed})}isSubNeedsToBeUpdatedInDb(e){return c(this,void 0,void 0,function*(){return r.a.log("Matching subscriptions with idb..."),(yield this._subscriptionManager.checkSubscriptionState(e)).state===s.b.updated})}isSubExistOnServer(e){return c(this,void 0,void 0,function*(){return yield this._checkSubscriptionOwn(e)})}saveSubscriptionInDb(e){return c(this,void 0,void 0,function*(){try{r.a.debug("saving subscription to db..."),yield this._subscriptionManager.saveSubscription(e),r.a.debug("saved subscription to db")}catch(t){r.a.warn(`Gravitec: couldn't store subscription to db (${e.regID})`)}})}updateSubscription(e){return c(this,void 0,void 0,function*(){const t=yield this._subscriptionManager.checkSubscriptionState(e);yield this._updateSubscription(t.storedSubscription,e).then(()=>c(this,void 0,void 0,function*(){r.a.debug(`subscription updated: ${e.regID}`),this.saveSubscriptionInDb(e)}))})}insertSubscription(e){return c(this,void 0,void 0,function*(){yield this._sendSubscription(e).then(()=>c(this,void 0,void 0,function*(){r.a.debug(`subscription sent: ${e.regID}`),yield this.saveSubscriptionInDb(e)}))})}isPushSubCreatedWithValidVapid(){return c(this,void 0,void 0,function*(){return yield function(e){return a(this,void 0,void 0,function*(){try{const t=yield navigator.serviceWorker.ready,i=(yield t.pushManager.getSubscription()).options.applicationServerKey,n=new Uint8Array(i),o=String.fromCharCode.apply(null,n),s=window.btoa(o).replace(/\=/g,"").replace(/\+/g,"-").replace(/\//g,"_")===e;return r.a.log("Vapid validation done"),s}catch(e){return!1}})}(this.config.app.applicationServerKey)})}isFcmStandartMigrationEnabled(){var e,t;return null===(t=null===(e=this.config.app)||void 0===e?void 0:e.firebaseConfig)||void 0===t?void 0:t.updateLegacySubscriptionToNewFcmStandardEnabled}registerUserForPush(e=(()=>{}),t={ignoreBlockedCookie:!0}){var i;return c(this,void 0,void 0,function*(){r.a.debug("registering user for web push");let s=yield this._subscriptionManager.getSubscription(),a=s.subscription;if(t&&delete t.brandingEnabled,!t||void 0!==t.ignoreBlockedCookie&&!0!==t.ignoreBlockedCookie||Object(o.o)("gravitecOptInBlocked"),a)if(yield this.isPushSubCreatedWithValidVapid())if(yield this.isSubMatchIdb(a)){r.a.log("Subscription not changed");const e=yield this._subscriptionManager.getStoredSubscription();this.isFcmStandartMigrationEnabled()&&!(null===(i=e)||void 0===i?void 0:i.fcmToken)&&(yield this.resubscribeExistingSubscription(s,!0))}else try{(yield this.isSubExistOnServer(a))?(r.a.log("Subscription exist on server"),yield this.saveSubscriptionInDb(a)):(r.a.log("Subscription does not exist on server"),yield this.upsertSubscription(a))}catch(e){r.a.error(e)}else r.a.warn("current subscription is been used with foreign subscription keys. Unsubscribing..."),r.a.info("Unsubscribed from foreign subscription keys"),this.resubscribeExistingSubscription(s);else try{a=yield this._subscriptionManager.subscribe(t),s.permission=n.c.granted,s.subscription=a,s.newSubscription=!0,yield this.upsertSubscription(a)}catch(e){e.permission?s.permission=e.permission:r.a.error(e)}return s.subscription=a,this._subscriptionResolve(s),e(s),s})}resubscribeExistingSubscription(e,t=!1){return c(this,void 0,void 0,function*(){if(yield this._unsubscribeForeign()){e.permission=n.c.granted,e.newSubscription=!0;try{const i=yield this._subscriptionManager.subscribe(void 0,t);yield this.upsertSubscription(i),e.subscription=i,r.a.info("Resubscribed with new subscription keys")}catch(t){t.permission?e.permission=t.permission:r.a.error(t)}}})}upsertSubscription(e){return c(this,void 0,void 0,function*(){this._mode!==n.a.safari&&((yield this.isSubNeedsToBeUpdatedInDb(e))?yield this.updateSubscription(e):yield this.insertSubscription(e))})}_getSubscription(){return this._subscriptionManager.getSubscription()}_processSubscriptionIfChanged(e){return c(this,void 0,void 0,function*(){if(this._mode===n.a.safari)return!0;const t=yield this._subscriptionManager.checkSubscriptionState(e);r.a.debug(`subscription state: ${t.state}`);let i=Promise.resolve();switch(t.state){case s.b.not_changed:return!1;case s.b.updated:i=this._updateSubscription(t.storedSubscription,e).then(()=>{r.a.debug(`subscription updated: ${e.regID}`)});break;case s.b.new:i=this._sendSubscription(e).then(()=>{r.a.debug(`subscription sent: ${e.regID}`)})}try{return yield i,!0}catch(e){return!1}})}_updateSubscription(e,t){return this._api.updateSubscription(e,t).then(i=>{if(i&&i.error)throw new Error(`couldn't update subscriber (old subscription - ${e.regID}, new subscription - ${t.regID}) - ${i.message}`);return i})}_sendSubscription(e){return this._api.subscribe(e).then(t=>{if(!t||!t.error)return t;throw new Error(`couldn't store subscriber (${e.regID}) - ${t.message}`)})}_checkSupport(){return c(this,void 0,void 0,function*(){if(!(document.baseURI||window.location&&window.location.href||"").includes(this.config.app.siteUrl))throw new Error("You must use this SDK only for "+this.config.app.siteUrl);if(window.navigator.userAgent.indexOf("MSIE ")>0)throw new Error("IE doesn't support Web Push");if(Object(o.b)()){if(!this.config.app.applePushId)throw new Error("Safari project ID not provided. Unable to use Safari subscription");return!0}if(!this._Notification)throw new Error("Notifications API is not supported");if(!Object(o.l)())throw new Error("Push messaging isn't supported");if(yield Object(o.k)())throw new Error("Web push not supported in incognito mode");return!0})}_detectMode(){return Object(o.b)()?n.a.safari:n.a.chrome}_setMode(e){this._mode=e,this._initModeSpecifics()}push(e){return c(this,void 0,void 0,function*(){let t,i=e[0];if(i.includes(".")?[t,i]=i.split("."):["addTag","addTags","setTags","removeTag","removeAllTags","setAlias","getTags"].includes(i)&&(t="segmentation"),t&&!this._modules[t])return void r.a.error(`Gravitec: No module ${t}`);const n=t?this._modules[t]:this;if(!(i in n&&n[i]instanceof Function))return void r.a.error(`Gravitec: No command ${i} ${t?` in ${t}module`:""}`);if(n!==this||"init"!==i){const e=this._commandsPermittedWithoutInit.some(e=>e.module===n&&e.commands.includes(i));try{yield this.init()}catch(t){if(!e)return}}if("segmentation"===t){const t=yield this._getSubscription();if(!t.subscription)return void r.a.log(`No subscription found to execute '${i}' on segmentation module`);let n=["removeAllTags","getTags","getAlias"].includes(i)?1:2;e.splice(n,0,t.subscription.regID)}const o=n[i].apply(n,e.slice(1));o&&"object"==typeof o&&"catch"in o&&o.catch(()=>{})})}processPushes(e){e.forEach(e=>this.push(e))}}},"./src/sdk-template/client/browser-subscription-managers/browser-subscription-manager.ts":function(e,t,i){"use strict";i.d(t,"b",function(){return n}),i.d(t,"a",function(){return s});var n,o=i("./src/sdk-template/utils/database.ts"),r=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};!function(e){e.updated="updated",e.new="new",e.not_changed="not changed"}(n||(n={}));class s{constructor(e,t,i){this.config=e,this._db=t,this._Notification=i}getSubscription(e=!1){return r(this,void 0,void 0,function*(){return yield this._getSubscription(e)})}subscribe(e,t=!1){return this._subscribe(e,t)}saveSubscription(e){return r(this,void 0,void 0,function*(){return yield this._db.put(o.a.ids,{type:"SubscriptionId",value:e}),e})}_retrieveSubscription(){return r(this,void 0,void 0,function*(){try{const e=yield this._db.get(o.a.ids,"SubscriptionId");return e&&e.value}catch(e){return null}})}getStoredSubscription(){return r(this,void 0,void 0,function*(){return yield this._retrieveSubscription()})}checkSubscriptionState(e){return r(this,void 0,void 0,function*(){const t=yield this._retrieveSubscription();return t?t.regID===e.regID?{state:n.not_changed}:{state:n.updated,storedSubscription:t}:{state:n.new}})}}},"./src/sdk-template/client/browser-subscription-managers/chrome-like-subscription-manager.ts":function(e,t,i){"use strict";var n=i("./src/sdk-template/enums.ts"),o=i("./src/sdk-template/exceptions/subscribe.exception.ts"),r=i("./src/sdk-template/utils/index.ts"),s=i("./src/sdk-template/client/browser-subscription-managers/browser-subscription-manager.ts"),a=i("./src/sdk-template/utils/logger.ts"),c=i("./src/sdk-template/utils/database.ts"),u=i("./node_modules/@firebase/util/dist/index.esm2017.js");class l{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const d="[DEFAULT]";class p{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new u.a;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&e.resolve(i)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const i=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),n=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(i)&&!this.shouldAutoInitialize()){if(n)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:i})}catch(e){if(n)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:d})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:i});t.resolve(e)}catch(e){}}}}clearInstance(e=d){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=d){return this.instances.has(e)}getOptions(e=d){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const n=this.getOrInitializeService({instanceIdentifier:i,options:t});for(const[e,t]of this.instancesDeferred.entries()){i===this.normalizeInstanceIdentifier(e)&&t.resolve(n)}return n}onInit(e,t){var i;const n=this.normalizeInstanceIdentifier(t),o=null!==(i=this.onInitCallbacks.get(n))&&void 0!==i?i:new Set;o.add(e),this.onInitCallbacks.set(n,o);const r=this.instances.get(n);return r&&e(r,n),()=>{o.delete(e)}}invokeOnInitCallbacks(e,t){const i=this.onInitCallbacks.get(t);if(i)for(const n of i)try{n(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:(n=e,n===d?void 0:n),options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch(e){}var n;return i||null}normalizeInstanceIdentifier(e=d){return this.component?this.component.multipleInstances?e:d:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class h{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new p(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const f=[];var g;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(g||(g={}));const b={debug:g.DEBUG,verbose:g.VERBOSE,info:g.INFO,warn:g.WARN,error:g.ERROR,silent:g.SILENT},m=g.INFO,w={[g.DEBUG]:"log",[g.VERBOSE]:"log",[g.INFO]:"info",[g.WARN]:"warn",[g.ERROR]:"error"},v=(e,t,...i)=>{if(t<e.logLevel)return;const n=(new Date).toISOString(),o=w[t];if(!o)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[o](`[${n}]  ${e.name}:`,...i)};var y=i("./node_modules/idb/build/index.js");class k{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(" ")}}const S="@firebase/app",_="0.10.6",T=new class{constructor(e){this.name=e,this._logLevel=m,this._logHandler=v,this._userLogHandler=null,f.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in g))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?b[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,g.DEBUG,...e),this._logHandler(this,g.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,g.VERBOSE,...e),this._logHandler(this,g.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,g.INFO,...e),this._logHandler(this,g.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,g.WARN,...e),this._logHandler(this,g.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,g.ERROR,...e),this._logHandler(this,g.ERROR,...e)}}("@firebase/app"),I="[DEFAULT]",x={[S]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","@firebase/vertexai-preview":"fire-vertex","fire-js":"fire-js",firebase:"fire-js-all"},E=new Map,C=new Map,A=new Map;function O(e,t){try{e.container.addComponent(t)}catch(i){T.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,i)}}function P(e){const t=e.name;if(A.has(t))return T.debug(`There were multiple attempts to register component ${t}.`),!1;A.set(t,e);for(const t of E.values())O(t,e);for(const t of C.values())O(t,e);return!0}function j(e,t){const i=e.container.getProvider("heartbeat").getImmediate({optional:!0});return i&&i.triggerHeartbeat(),e.container.getProvider(t)}const N={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},B=new u.b("app","Firebase",N);class D{constructor(e,t,i){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new l("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw B.create("app-deleted",{appName:this._name})}}function W(e,t={}){let i=e;if("object"!=typeof t){t={name:t}}const n=Object.assign({name:I,automaticDataCollectionEnabled:!1},t),o=n.name;if("string"!=typeof o||!o)throw B.create("bad-app-name",{appName:String(o)});if(i||(i=Object(u.g)()),!i)throw B.create("no-options");const r=E.get(o);if(r){if(Object(u.f)(i,r.options)&&Object(u.f)(n,r.config))return r;throw B.create("duplicate-app",{appName:o})}const s=new h(o);for(const e of A.values())s.addComponent(e);const a=new D(i,n,s);return E.set(o,a),a}function H(e=I){const t=E.get(e);if(!t&&e===I&&Object(u.g)())return W();if(!t)throw B.create("no-app",{appName:e});return t}function M(e,t,i){var n;let o=null!==(n=x[e])&&void 0!==n?n:e;i&&(o+=`-${i}`);const r=o.match(/\s|\//),s=t.match(/\s|\//);if(r||s){const e=[`Unable to register library "${o}" with version "${t}":`];return r&&e.push(`library name "${o}" contains illegal characters (whitespace or "/")`),r&&s&&e.push("and"),s&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void T.warn(e.join(" "))}P(new l(`${o}-version`,()=>({library:o,version:t}),"VERSION"))}const $="firebase-heartbeat-database",R=1,L="firebase-heartbeat-store";let z=null;function F(){return z||(z=Object(y.b)($,R,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(L)}catch(e){console.warn(e)}}}}).catch(e=>{throw B.create("idb-open",{originalErrorMessage:e.message})})),z}async function K(e,t){try{const i=(await F()).transaction(L,"readwrite"),n=i.objectStore(L);await n.put(t,U(e)),await i.done}catch(e){if(e instanceof u.c)T.warn(e.message);else{const t=B.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});T.warn(t.message)}}}function U(e){return`${e.name}!${e.options.appId}`}const q=1024,V=2592e6;class G{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Y(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){var e,t;const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),n=J();if((null!=(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||(this._heartbeatsCache=await this._heartbeatsCachePromise,null!=(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))&&this._heartbeatsCache.lastSentHeartbeatDate!==n&&!this._heartbeatsCache.heartbeats.some(e=>e.date===n))return this._heartbeatsCache.heartbeats.push({date:n,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=V}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=J(),{heartbeatsToSend:i,unsentEntries:n}=function(e,t=q){const i=[];let n=e.slice();for(const o of e){const e=i.find(e=>e.agent===o.agent);if(e){if(e.dates.push(o.date),X(i)>t){e.dates.pop();break}}else if(i.push({agent:o.agent,dates:[o.date]}),X(i)>t){i.pop();break}n=n.slice(1)}return{heartbeatsToSend:i,unsentEntries:n}}(this._heartbeatsCache.heartbeats),o=Object(u.e)(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=t,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}}function J(){return(new Date).toISOString().substring(0,10)}class Y{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!Object(u.j)()&&Object(u.l)().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await F()).transaction(L),i=await t.objectStore(L).get(U(e));return await t.done,i}catch(e){if(e instanceof u.c)T.warn(e.message);else{const t=B.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});T.warn(t.message)}}}(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return K(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return K(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}}}function X(e){return Object(u.e)(JSON.stringify({version:2,heartbeats:e})).length}var Z;Z="",P(new l("platform-logger",e=>new k(e),"PRIVATE")),P(new l("heartbeat",e=>new G(e),"PRIVATE")),M(S,_,Z),M(S,_,"esm2017"),M("fire-js","");M("firebase","10.12.3","app");const Q=1e4,ee="w:0.6.8",te="FIS_v2",ie="https://firebaseinstallations.googleapis.com/v1",ne=36e5,oe={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},re=new u.b("installations","Installations",oe);function se(e){return e instanceof u.c&&e.code.includes("request-failed")}function ae({projectId:e}){return`${ie}/projects/${e}/installations`}function ce(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function ue(e,t){const i=(await t.json()).error;return re.create("request-failed",{requestName:e,serverCode:i.code,serverMessage:i.message,serverStatus:i.status})}function le({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function de(e,{refreshToken:t}){const i=le(e);return i.append("Authorization",function(e){return`${te} ${e}`}(t)),i}async function pe(e){const t=await e();return t.status>=500&&t.status<600?e():t}function he(e){return new Promise(t=>{setTimeout(t,e)})}const fe=/^[cdef][\w-]{21}$/,ge="";function be(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){return(t=e,btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22);var t}(e);return fe.test(t)?t:ge}catch(e){return ge}}function me(e){return`${e.appName}!${e.appId}`}const we=new Map;function ve(e,t){const i=me(e);ye(i,t),function(e,t){const i=Se();i&&i.postMessage({key:e,fid:t});_e()}(i,t)}function ye(e,t){const i=we.get(e);if(i)for(const e of i)e(t)}let ke=null;function Se(){return!ke&&"BroadcastChannel"in self&&((ke=new BroadcastChannel("[Firebase] FID Change")).onmessage=(e=>{ye(e.data.key,e.data.fid)})),ke}function _e(){0===we.size&&ke&&(ke.close(),ke=null)}const Te="firebase-installations-database",Ie=1,xe="firebase-installations-store";let Ee=null;function Ce(){return Ee||(Ee=Object(y.b)(Te,Ie,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(xe)}}})),Ee}async function Ae(e,t){const i=me(e),n=(await Ce()).transaction(xe,"readwrite"),o=n.objectStore(xe),r=await o.get(i);return await o.put(t,i),await n.done,r&&r.fid===t.fid||ve(e,t.fid),t}async function Oe(e){const t=me(e),i=(await Ce()).transaction(xe,"readwrite");await i.objectStore(xe).delete(t),await i.done}async function Pe(e,t){const i=me(e),n=(await Ce()).transaction(xe,"readwrite"),o=n.objectStore(xe),r=await o.get(i),s=t(r);return void 0===s?await o.delete(i):await o.put(s,i),await n.done,!s||r&&r.fid===s.fid||ve(e,s.fid),s}async function je(e){let t;const i=await Pe(e.appConfig,i=>{const n=function(e){return De(e||{fid:be(),registrationStatus:0})}(i),o=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){const e=Promise.reject(re.create("app-offline"));return{installationEntry:t,registrationPromise:e}}const i={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=async function(e,t){try{const i=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:i}){const n=ae(e),o=le(e),r=t.getImmediate({optional:!0});if(r){const e=await r.getHeartbeatsHeader();e&&o.append("x-firebase-client",e)}const s={fid:i,authVersion:te,appId:e.appId,sdkVersion:ee},a={method:"POST",headers:o,body:JSON.stringify(s)},c=await pe(()=>fetch(n,a));if(c.ok){const e=await c.json();return{fid:e.fid||i,registrationStatus:2,refreshToken:e.refreshToken,authToken:ce(e.authToken)}}throw await ue("Create Installation",c)}(e,t);return Ae(e.appConfig,i)}catch(i){throw se(i)&&409===i.customData.serverCode?await Oe(e.appConfig):await Ae(e.appConfig,{fid:t.fid,registrationStatus:0}),i}}(e,i);return{installationEntry:i,registrationPromise:n}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:Ne(e)}:{installationEntry:t}}(e,n);return t=o.registrationPromise,o.installationEntry});return i.fid===ge?{installationEntry:await t}:{installationEntry:i,registrationPromise:t}}async function Ne(e){let t=await Be(e.appConfig);for(;1===t.registrationStatus;)await he(100),t=await Be(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:i}=await je(e);return i||t}return t}function Be(e){return Pe(e,e=>{if(!e)throw re.create("installation-not-found");return De(e)})}function De(e){return 1===(t=e).registrationStatus&&t.registrationTime+Q<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function We({appConfig:e,heartbeatServiceProvider:t},i){const n=function(e,{fid:t}){return`${ae(e)}/${t}/authTokens:generate`}(e,i),o=de(e,i),r=t.getImmediate({optional:!0});if(r){const e=await r.getHeartbeatsHeader();e&&o.append("x-firebase-client",e)}const s={installation:{sdkVersion:ee,appId:e.appId}},a={method:"POST",headers:o,body:JSON.stringify(s)},c=await pe(()=>fetch(n,a));if(c.ok){return ce(await c.json())}throw await ue("Generate Auth Token",c)}async function He(e,t=!1){let i;const n=await Pe(e.appConfig,n=>{if(!$e(n))throw re.create("not-registered");const o=n.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+ne}(e)}(o))return n;if(1===o.requestStatus)return i=async function(e,t){let i=await Me(e.appConfig);for(;1===i.authToken.requestStatus;)await he(100),i=await Me(e.appConfig);const n=i.authToken;return 0===n.requestStatus?He(e,t):n}(e,t),n;{if(!navigator.onLine)throw re.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(n);return i=async function(e,t){try{const i=await We(e,t),n=Object.assign(Object.assign({},t),{authToken:i});return await Ae(e.appConfig,n),i}catch(i){if(!se(i)||401!==i.customData.serverCode&&404!==i.customData.serverCode){const i=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await Ae(e.appConfig,i)}else await Oe(e.appConfig);throw i}}(e,t),t}});return i?await i:n.authToken}function Me(e){return Pe(e,e=>{if(!$e(e))throw re.create("not-registered");return function(e){return 1===e.requestStatus&&e.requestTime+Q<Date.now()}(e.authToken)?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}function $e(e){return void 0!==e&&2===e.registrationStatus}async function Re(e,t=!1){const i=e;return await async function(e){const{registrationPromise:t}=await je(e);t&&await t}(i),(await He(i,t)).token}function Le(e){return re.create("missing-app-config-values",{valueName:e})}const ze="installations",Fe="installations-internal",Ke=e=>{const t=j(e.getProvider("app").getImmediate(),ze).getImmediate();return{getId:()=>(async function(e){const t=e,{installationEntry:i,registrationPromise:n}=await je(t);return n?n.catch(console.error):He(t).catch(console.error),i.fid})(t),getToken:e=>Re(t,e)}};P(new l(ze,e=>{const t=e.getProvider("app").getImmediate();return{app:t,appConfig:function(e){if(!e||!e.options)throw Le("App Configuration");if(!e.name)throw Le("App Name");const t=["projectId","apiKey","appId"];for(const i of t)if(!e.options[i])throw Le(i);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),heartbeatServiceProvider:j(t,"heartbeat"),_delete:()=>Promise.resolve()}},"PUBLIC")),P(new l(Fe,Ke,"PRIVATE")),M("@firebase/installations","0.6.8"),M("@firebase/installations","0.6.8","esm2017");const Ue="/firebase-messaging-sw.js",qe="/firebase-cloud-messaging-push-scope",Ve="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",Ge="https://fcmregistrations.googleapis.com/v1",Je="google.c.a.c_id",Ye="google.c.a.c_l",Xe="google.c.a.ts",Ze="google.c.a.e";var Qe,et;function tt(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function it(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=atob(t),n=new Uint8Array(i.length);for(let e=0;e<i.length;++e)n[e]=i.charCodeAt(e);return n}!function(e){e[e.DATA_MESSAGE=1]="DATA_MESSAGE",e[e.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"}(Qe||(Qe={})),function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"}(et||(et={}));const nt="fcm_token_details_db",ot=5,rt="fcm_token_object_Store";const st="firebase-messaging-database",at=1,ct="firebase-messaging-store";let ut=null;function lt(){return ut||(ut=Object(y.b)(st,at,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(ct)}}})),ut}async function dt(e){const t=ht(e),i=await lt(),n=await i.transaction(ct).objectStore(ct).get(t);if(n)return n;{const t=await async function(e){if("databases"in indexedDB&&!(await indexedDB.databases()).map(e=>e.name).includes(nt))return null;let t=null;return(await Object(y.b)(nt,ot,{upgrade:async(i,n,o,r)=>{var s;if(n<2)return;if(!i.objectStoreNames.contains(rt))return;const a=r.objectStore(rt),c=await a.index("fcmSenderId").get(e);if(await a.clear(),c)if(2===n){const e=c;if(!e.auth||!e.p256dh||!e.endpoint)return;t={token:e.fcmToken,createTime:null!==(s=e.createTime)&&void 0!==s?s:Date.now(),subscriptionOptions:{auth:e.auth,p256dh:e.p256dh,endpoint:e.endpoint,swScope:e.swScope,vapidKey:"string"==typeof e.vapidKey?e.vapidKey:tt(e.vapidKey)}}}else if(3===n){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:tt(e.auth),p256dh:tt(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:tt(e.vapidKey)}}}else if(4===n){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:tt(e.auth),p256dh:tt(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:tt(e.vapidKey)}}}}})).close(),await Object(y.a)(nt),await Object(y.a)("fcm_vapid_details_db"),await Object(y.a)("undefined"),function(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return"number"==typeof e.createTime&&e.createTime>0&&"string"==typeof e.token&&e.token.length>0&&"string"==typeof t.auth&&t.auth.length>0&&"string"==typeof t.p256dh&&t.p256dh.length>0&&"string"==typeof t.endpoint&&t.endpoint.length>0&&"string"==typeof t.swScope&&t.swScope.length>0&&"string"==typeof t.vapidKey&&t.vapidKey.length>0}(t)?t:null}(e.appConfig.senderId);if(t)return await pt(e,t),t}}async function pt(e,t){const i=ht(e),n=(await lt()).transaction(ct,"readwrite");return await n.objectStore(ct).put(t,i),await n.done,t}function ht({appConfig:e}){return e.appId}const ft={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invalid-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."},gt=new u.b("messaging","Messaging",ft);async function bt(e,t){const i={method:"DELETE",headers:await wt(e)};try{const n=await fetch(`${mt(e.appConfig)}/${t}`,i),o=await n.json();if(o.error){const e=o.error.message;throw gt.create("token-unsubscribe-failed",{errorInfo:e})}}catch(e){throw gt.create("token-unsubscribe-failed",{errorInfo:null==e?void 0:e.toString()})}}function mt({projectId:e}){return`${Ge}/projects/${e}/registrations`}async function wt({appConfig:e,installations:t}){const i=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${i}`})}function vt({p256dh:e,auth:t,endpoint:i,vapidKey:n}){const o={web:{endpoint:i,auth:t,p256dh:e}};return n!==Ve&&(o.web.applicationPubKey=n),o}const yt=6048e5;async function kt(e){const t=await async function(e,t){const i=await e.pushManager.getSubscription();if(i)return i;return e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:it(t)})}(e.swRegistration,e.vapidKey),i={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:tt(t.getKey("auth")),p256dh:tt(t.getKey("p256dh"))},n=await dt(e.firebaseDependencies);if(n){if(function(e,t){const i=t.vapidKey===e.vapidKey,n=t.endpoint===e.endpoint,o=t.auth===e.auth,r=t.p256dh===e.p256dh;return i&&n&&o&&r}(n.subscriptionOptions,i))return Date.now()>=n.createTime+yt?async function(e,t){try{const i=await async function(e,t){const i=await wt(e),n=vt(t.subscriptionOptions),o={method:"PATCH",headers:i,body:JSON.stringify(n)};let r;try{const i=await fetch(`${mt(e.appConfig)}/${t.token}`,o);r=await i.json()}catch(e){throw gt.create("token-update-failed",{errorInfo:null==e?void 0:e.toString()})}if(r.error){const e=r.error.message;throw gt.create("token-update-failed",{errorInfo:e})}if(!r.token)throw gt.create("token-update-no-token");return r.token}(e.firebaseDependencies,t),n=Object.assign(Object.assign({},t),{token:i,createTime:Date.now()});return await pt(e.firebaseDependencies,n),i}catch(e){throw e}}(e,{token:n.token,createTime:Date.now(),subscriptionOptions:i}):n.token;try{await bt(e.firebaseDependencies,n.token)}catch(e){console.warn(e)}return St(e.firebaseDependencies,i)}return St(e.firebaseDependencies,i)}async function St(e,t){const i={token:await async function(e,t){const i=await wt(e),n=vt(t),o={method:"POST",headers:i,body:JSON.stringify(n)};let r;try{const t=await fetch(mt(e.appConfig),o);r=await t.json()}catch(e){throw gt.create("token-subscribe-failed",{errorInfo:null==e?void 0:e.toString()})}if(r.error){const e=r.error.message;throw gt.create("token-subscribe-failed",{errorInfo:e})}if(!r.token)throw gt.create("token-subscribe-no-token");return r.token}(e,t),createTime:Date.now(),subscriptionOptions:t};return await pt(e,i),i.token}function _t(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return function(e,t){if(!t.notification)return;e.notification={};const i=t.notification.title;i&&(e.notification.title=i);const n=t.notification.body;n&&(e.notification.body=n);const o=t.notification.image;o&&(e.notification.image=o);const r=t.notification.icon;r&&(e.notification.icon=r)}(t,e),function(e,t){if(!t.data)return;e.data=t.data}(t,e),function(e,t){var i,n,o,r,s;if(!t.fcmOptions&&!(null===(i=t.notification)||void 0===i?void 0:i.click_action))return;e.fcmOptions={};const a=null!==(o=null===(n=t.fcmOptions)||void 0===n?void 0:n.link)&&void 0!==o?o:null===(r=t.notification)||void 0===r?void 0:r.click_action;a&&(e.fcmOptions.link=a);const c=null===(s=t.fcmOptions)||void 0===s?void 0:s.analytics_label;c&&(e.fcmOptions.analyticsLabel=c)}(t,e),t}function Tt(e,t){const i=[];for(let n=0;n<e.length;n++)i.push(e.charAt(n)),n<t.length&&i.push(t.charAt(n));return i.join("")}function It(e){return gt.create("missing-app-config-values",{valueName:e})}Tt("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),Tt("AzSCbw63g1R0nCw85jG8","Iaya3yLKwmgvh7cF0q4");class xt{constructor(e,t,i){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const n=function(e){if(!e||!e.options)throw It("App Configuration Object");if(!e.name)throw It("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:i}=e;for(const e of t)if(!i[e])throw It(e);return{appName:e.name,projectId:i.projectId,apiKey:i.apiKey,appId:i.appId,senderId:i.messagingSenderId}}(e);this.firebaseDependencies={app:e,appConfig:n,installations:t,analyticsProvider:i}}_delete(){return Promise.resolve()}}async function Et(e){try{e.swRegistration=await navigator.serviceWorker.register(Ue,{scope:qe}),e.swRegistration.update().catch(()=>{})}catch(e){throw gt.create("failed-service-worker-registration",{browserErrorMessage:null==e?void 0:e.message})}}async function Ct(e,t){if(!navigator)throw gt.create("only-available-in-window");if("default"===Notification.permission&&await Notification.requestPermission(),"granted"!==Notification.permission)throw gt.create("permission-blocked");return await async function(e,t){t?e.vapidKey=t:e.vapidKey||(e.vapidKey=Ve)}(e,null==t?void 0:t.vapidKey),await async function(e,t){if(t||e.swRegistration||await Et(e),t||!e.swRegistration){if(!(t instanceof ServiceWorkerRegistration))throw gt.create("invalid-sw-registration");e.swRegistration=t}}(e,null==t?void 0:t.serviceWorkerRegistration),kt(e)}async function At(e,t,i){const n=function(e){switch(e){case et.NOTIFICATION_CLICKED:return"notification_open";case et.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}(t);(await e.firebaseDependencies.analyticsProvider.get()).logEvent(n,{message_id:i[Je],message_name:i[Ye],message_time:i[Xe],message_device_time:Math.floor(Date.now()/1e3)})}async function Ot(e,t){const i=t.data;if(!i.isFirebaseMessaging)return;e.onMessageHandler&&i.messageType===et.PUSH_RECEIVED&&("function"==typeof e.onMessageHandler?e.onMessageHandler(_t(i)):e.onMessageHandler.next(_t(i)));const n=i.data;var o;"object"==typeof(o=n)&&o&&Je in o&&"1"===n[Ze]&&await At(e,i.messageType,n)}const Pt="@firebase/messaging",jt="0.12.10",Nt=e=>{const t=e.getProvider("messaging").getImmediate();return{getToken:e=>Ct(t,e)}};function Bt(e=H()){return async function(){try{await Object(u.l)()}catch(e){return!1}return"undefined"!=typeof window&&Object(u.j)()&&Object(u.d)()&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}().then(e=>{if(!e)throw gt.create("unsupported-browser")},e=>{throw gt.create("indexed-db-unsupported")}),j(Object(u.h)(e),"messaging").getImmediate()}P(new l("messaging",e=>{const t=new xt(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",e=>Ot(t,e)),t},"PUBLIC")),P(new l("messaging-internal",Nt,"PRIVATE")),M(Pt,jt),M(Pt,jt,"esm2017");var Dt=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};class Wt{constructor(e){this.app=W(e),this.messaging=Bt(this.app)}static getInstance(e){return Wt.instance||(Wt.instance=new Wt(e)),Wt.instance}getMessaging(){return this.messaging}getToken(e){return Dt(this,void 0,void 0,function*(){const t=yield navigator.serviceWorker.ready;return async function(e,t){return Ct(e=Object(u.h)(e),t)}(this.messaging,{vapidKey:e,serviceWorkerRegistration:t})})}}i.d(t,"a",function(){return $t}),i.d(t,"b",function(){return Rt});var Ht=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};function Mt(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),n=new Uint8Array(i.length);for(let e=0;e<i.length;++e)n[e]=i.charCodeAt(e);return n}class $t extends s.a{constructor(e,t,i){super(e,t,i),this.trackingLink=`https://api.gravitec.media/api/stats/event?app_key=${this.config.app.appKey}`,this.getFcmToken=(()=>Ht(this,void 0,void 0,function*(){try{const e=yield Wt.getInstance(this.config.app.firebaseConfig);return e?yield e.getToken(this.config.app.applicationServerKey):""}catch(e){return a.a.error(`Couldn't get FCM token: ${e}`),""}})),this.nativeSubscription=(()=>new Promise(e=>{const t=new CustomEvent("subscribed",{detail:{subscribed:!0}}),i=new CustomEvent("unsubscribed",{detail:{unsubscribed:!0}});this._Notification.requestPermission(()=>{e(this._Notification.permission),this._Notification.permission===n.c.denied?(dispatchEvent(i),Kt()):this._Notification.permission===n.c.granted?(dispatchEvent(t),Kt()):this._Notification.permission===n.c.default&&Kt()}),this._Notification.permission===n.c.default&&("complete"==document.readyState?Ut(this.config):document.onreadystatechange=(()=>{"complete"==document.readyState&&Ut(this.config)}))})),this._addServiceWorker()}_addServiceWorker(){if("serviceWorker"in navigator){const e=window.navigator.serviceWorker.controller;if(e&&e.scriptURL.endsWith(`${this.config.app.swPath}?version=${this.config.app.sdkVersion}`))return;return this._db.get(c.a.ids,"sw_version").then(e=>0!==e.value?this._tryToRegisterWorkerWithVersion():this._tryToRegisterWorkerWithoutVersion()).catch(e=>this._tryToRegisterWorkerWithVersion())}throw new Error("Service workers are not supported")}_tryToRegisterWorkerWithVersion(){const e=Lt(this.config.app.appKey);return e&&(this.config.app.swPath=e),window.navigator.serviceWorker.register(`${this.config.app.swPath}?version=${this.config.app.sdkVersion}&appKey=${this.config.app.appKey}&track_inactive=${this.config.app.trackInactive}`,{scope:this.config.app.swScope}).then(()=>{this._db.put(c.a.ids,{type:"sw_version",value:this.config.app.sdkVersion}),a.a.log("service worker registered")}).catch(e=>{this._tryToRegisterWorkerWithoutVersion(),a.a.error(e)})}_tryToRegisterWorkerWithoutVersion(){return window.navigator.serviceWorker.register(`${this.config.app.swPath}`,{scope:this.config.app.swScope}).then(e=>{this._db.put(c.a.ids,{type:"sw_version",value:0}),a.a.log("service worker registered")}).catch(e=>{a.a.error(e)})}getNativeSubscription(){return Ht(this,void 0,void 0,function*(){const e=yield window.navigator.serviceWorker.ready;try{return yield e.pushManager.getSubscription()}catch(e){return a.a.error(`Error during getSubscription(): ${e}`),null}})}_getSubscription(e=!1){return Ht(this,void 0,void 0,function*(){const t=yield this.getNativeSubscription();if(!t)return{permission:this._Notification.permission};try{let i="";return e&&(i=yield this.getFcmToken()),{permission:n.c.granted,subscription:yield Object(r.n)(t,null,null,i)}}catch(e){return a.a.error(`Couldn't parse subscription: ${e}`),{permission:this._Notification.permission}}})}getSubscription(e=!1){return Ht(this,void 0,void 0,function*(){return this._getSubscription(e)})}_subscribe(e,t=!1){var i,s;return Ht(this,void 0,void 0,function*(){const a=yield window.navigator.serviceWorker.ready,c=yield this._localSubscribe(e);if(c!==n.c.granted)return Promise.reject(new o.a(c));const u=yield a.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Mt(this.config.app.applicationServerKey)});try{let e="";return((null===(s=null===(i=this.config.app)||void 0===i?void 0:i.firebaseConfig)||void 0===s?void 0:s.useNewFcmStandardSubscription)||t)&&(e=yield this.getFcmToken()),yield Object(r.n)(u,null,null,e)}catch(e){return e}})}_localSubscribe(e){return Ht(this,void 0,void 0,function*(){if(this.config.app.subDomain&&-1===navigator.userAgent.indexOf("Firefox")||-1!==navigator.userAgent.indexOf(" UCBrowser/")||"default"!==Notification.permission)return this.nativeSubscription();{const{default:t}=yield Promise.all([i.e(0),i.e(1)]).then(i.bind(null,"./src/sdk-template/client/widgets/optIn/optIn.ts")),o=new t;return Rt(this.config)&&Object(r.o)("gravitecOptInBlocked"),(yield o.requestPermission(this.config,!1,e))===n.c.deniedFromCustom?Promise.resolve(n.c.deniedFromCustom):this.nativeSubscription()}})}isNotificationPermitted(){return this._Notification.permission!==n.c.denied}getNotificationPermission(){return this._Notification.permission}isNotificationBlockedFromCustomWidget(){return!!Object(r.a)("gravitecOptInBlocked")}}const Rt=e=>{const t=Object(r.i)()?e.opt.mobileProps:e.opt.desktopProps;if(t.reengagement){let e=Number(window.localStorage.getItem("optInBlockedTime")),i=Ft(zt,e),n=Number(window.localStorage.getItem("views-counter")),o=t.reengagement.timeoutHours,r=t.reengagement.viewDepth;return!!(o&&i>=o||r&&n>=r)}return!1},Lt=e=>{const t=document.querySelector(`script[src*="${e}/client.js"]`);if(!t)return"";{const e=t.getAttribute("src");try{const t=new URL(e||"");return"wp"===t.searchParams.get("service")?t.searchParams.get("wpath"):""}catch(e){return""}}};function zt(e,t){return(t-e)/1e3/60/60}const Ft=(e,t)=>{if(!t)return null;return e(t,(new Date).getTime())},Kt=()=>{document.querySelector(".grv-unblock-label-host")&&document.body.removeChild(document.querySelector(".grv-unblock-label-host"))},Ut=e=>{if(!Object(r.i)()){const t=document.createElement("div"),i=document.createElement("div"),n=document.createElement("span");n.innerText="✕";const o=document.createElement("div");o.style.display="flex";const r=document.createElement("div"),s=document.createElement("div"),a=document.createElement("h1");a.innerText=qt().unblockWidgetTitle,a.className="unblock-text-main";const c=document.createElement("p");c.innerText=qt().unblockWidgetBody,c.className="unblock-text-secondary";const u=document.createElement("img");u.src=u.src=`${e.app.cdnUrl}/img/unblockGuide.svg`;const l=document.createElement("style");l.innerHTML="\n  .unblock-root {\n    position: fixed;\n    z-index: 2147483647;\n    background-color: #fff;\n    top: 0;\n    padding: 10px 14px 12px;\n    background: rgba(250,250,250,.94);\n    border-radius: 0 0 4px 4px;\n    border: none;\n    -webkit-box-shadow: none;\n    box-shadow: none;\n    left: 115px;\n    width: 286px;\n    max-width: 286px;\n    min-height: 94px;\n    color: #444;\n    text-align: left;\n    display: flex;\n    flex-direction: column;\n    font-weight: 400;\n    box-sizing: border-box;\n  }\n\n  span {\n    margin-top: -9px;\n    margin-right: -6px;\n    cursor: pointer;\n    height: fit-content;\n    align-self: flex-end;\n    font-size: 18px;\n  }\n\n  .unblock-text {\n    width: 190px;\n    font-family: Arial,Helvetica,'Helvetica Neue','Dejavu Sans',sans-serif;\n  }\n\n  .unblock-text-main {\n    font-size: 14px;\n    line-height: 16px;\n    color: #000!important;\n    margin-block-end: 0;\n    margin-block-start: 0;\n  }\n\n  .unblock-text-secondary {\n    font-size: 12px!important;\n    color: #484848!important;\n    line-height: 16px!important;\n    font-weight: 400;\n    margin-bottom: 0;\n  }\n  ",r.appendChild(a),r.appendChild(c),r.className="unblock-text",s.appendChild(u),t.appendChild(n),o.appendChild(r),o.appendChild(s),t.appendChild(o),t.className="unblock-root",i.className="grv-unblock-label-host",document.body.appendChild(i);const d=i.attachShadow({mode:"open"});d.appendChild(l),d.appendChild(t),n.addEventListener("click",Kt)}},qt=()=>{const e=i("./src/sdk-template/client/widgets/translations.json");return Object.assign({},e[(()=>{let e=Object(r.f)();switch(e){case n.b.russian:case n.b.ukrainian:case n.b.polish:case n.b.portuguese:case n.b.french:case n.b.german:case n.b.dutch:case n.b.vietnamese:case n.b.azerbaijani:case n.b.kazakh:case n.b.chinese:case n.b.italian:case n.b.spanish:break;default:e=n.b.english}return e})()])}},"./src/sdk-template/client/browser-subscription-managers/safari-subscription-manager.ts":function(e,t,i){"use strict";var n=i("./src/sdk-template/utils/index.ts"),o=i("./src/sdk-template/client/browser-subscription-managers/browser-subscription-manager.ts"),r=i("./src/sdk-template/enums.ts"),s=i("./src/sdk-template/exceptions/subscribe.exception.ts");var a={en:{desktopWidgetText:{wantsTo:"wants to",showNotifications:"Show notifications",allow:"Allow",block:"Block"},mobileWidgetText:{wantsTo:"wants to",showNotifications:"send you notifications",allow:"Allow",block:"Block"},slidedownWidgetText:{promptTextHeader:"This website would like to send you push notifications.",promptTextBody:"Notifications can be turned off anytime from browser settings.",allow:"Allow",block:"Don't Allow"},slidedownPromptForHttps:{promptTextHeader:"This website would like to send you push notifications.",promptTextBody:"Notifications can be turned off anytime from browser settings.",allow:"Allow",block:"Don't Allow"}},ru:{desktopWidgetText:{wantsTo:"запрашивает разрешение на:",showNotifications:"Показывать оповещения",allow:"Разрешить",block:"Блокировать"},mobileWidgetText:{wantsTo:"запрашивает разрешение",showNotifications:"показывать оповещения",allow:"Разрешить",block:"Блокировать"},slidedownWidgetText:{promptTextHeader:"Этот веб-сайт запрашивает разрешение на отправку push-уведомлений в Центре уведомлений.",promptTextBody:'Уведомлениями веб-сайтов можно управлять в разделе "Веб-сайты" настроек Safari.',allow:"Разрешить",block:"Не разрешать"},slidedownPromptForHttps:{promptTextHeader:"This website would like to send you push notifications.",promptTextBody:"Notifications can be turned off anytime from browser settings.",allow:"Allow",block:"Don't Allow"}},uk:{desktopWidgetText:{wantsTo:"хоче",showNotifications:"показувати сповіщення",allow:"Дозволити",block:"Блокувати"},mobileWidgetText:{wantsTo:"хоче",showNotifications:"показувати сповіщення",allow:"Дозволити",block:"Блокувати"},slidedownWidgetText:{promptTextHeader:"Цей веб-сайт хоче надсилати вам push-сповіщення у Центрі сповіщень.",promptTextBody:"Сповіщення для веб-сайтів можна настроїти в параметрах веб-сайтів Safari.",allow:"Дозволити",block:"Заборонити"},slidedownPromptForHttps:{promptTextHeader:"This website would like to send you push notifications.",promptTextBody:"Notifications can be turned off anytime from browser settings.",allow:"Allow",block:"Don't Allow"}},pl:{desktopWidgetText:{wantsTo:"prosi o pozwolenie na",showNotifications:"Pokazywanie powiadomień",allow:"Zezwalaj",block:"Blokuj"},mobileWidgetText:{wantsTo:"prosi o pozwolenie na",showNotifications:"Pokazywanie powiadomień",allow:"Zezwalaj",block:"Blokuj"},slidedownWidgetText:{promptTextHeader:"This website would like to send you push notifications.",promptTextBody:"Notifications can be turned off anytime from browser settings.",allow:"Allow",block:"Don't Allow"},slidedownPromptForHttps:{promptTextHeader:"This website would like to send you push notifications.",promptTextBody:"Notifications can be turned off anytime from browser settings.",allow:"Allow",block:"Don't Allow"}},es:{desktopWidgetText:{wantsTo:"quiere",showNotifications:"Mostrar notificaciones",allow:"Permitir",block:"Bloquear"},mobileWidgetText:{wantsTo:"quiere",showNotifications:"enviar notificaciones",allow:"Permitir",block:"Bloquear"},slidedownWidgetText:{promptTextHeader:"Este sitio web desea enviarle notificaciones push",promptTextBody:"Las notificaciones se pueden desactivar en cualquier momento desde la configuración del navegador.",allow:"Permitir",block:"Ahora no"},slidedownPromptForHttps:{promptTextHeader:"Este sitio web desea enviarle notificaciones push",promptTextBody:"Las notificaciones se pueden desactivar en cualquier momento desde la configuración del navegador.",allow:"¡Si, quiero!",block:"No, gracias"}},fr:{desktopWidgetText:{wantsTo:"veut",showNotifications:"Afficher les notifications",allow:"Autoriser",block:"Bloquer"},mobileWidgetText:{wantsTo:"veut",showNotifications:"vous envoyer des notifications",allow:"Autoriser",block:"Bloquer"},slidedownWidgetText:{promptTextHeader:"Ce site web souhaite vous envoyer des notifications push.",promptTextBody:"Les notifications peuvent être désactivées à tout moment dans les paramètres du navigateur.",allow:"Autoriser",block:"Ne pas autoriser"},slidedownPromptForHttps:{promptTextHeader:"Ce site web souhaite vous envoyer des notifications push.",promptTextBody:"Les notifications peuvent être désactivées à tout moment dans les paramètres du navigateur.",allow:"Autoriser",block:"Ne pas autoriser"}},de:{desktopWidgetText:{wantsTo:"möchte",showNotifications:"Benachrichtigungen anzeigen",allow:"Erlauben",block:"Blockieren"},mobileWidgetText:{wantsTo:"möchte",showNotifications:"Ihnen Benachrichtigungen senden",allow:"Erlauben",block:"Blockieren"},slidedownWidgetText:{promptTextHeader:"Diese Website möchte Ihnen Push-Benachrichtigungen senden.",promptTextBody:"Benachrichtigungen können jederzeit in den Browsereinstellungen deaktiviert werden.",allow:"Erlauben",block:"Nicht erlauben"},slidedownPromptForHttps:{promptTextHeader:"Diese Website möchte Ihnen Push-Benachrichtigungen senden.",promptTextBody:"Benachrichtigungen können jederzeit in den Browsereinstellungen deaktiviert werden.",allow:"Erlauben",block:"Nicht erlauben"}},nl:{desktopWidgetText:{wantsTo:"wil",showNotifications:"Meldingen tonen",allow:"Toestaan",block:"Blokkeer"},mobileWidgetText:{wantsTo:"wil",showNotifications:"wil u meldingen sturen",allow:"Toestaan",block:"Blokkeer"},slidedownWidgetText:{promptTextHeader:"Deze website wil u pushmeldingen sturen.",promptTextBody:"Meldingen kunnen altijd worden uitgeschakeld in de browserinstellingen.",allow:"Toestaan",block:"Niet toestaan"},slidedownPromptForHttps:{promptTextHeader:"Deze website wil u pushmeldingen sturen.",promptTextBody:"Meldingen kunnen altijd worden uitgeschakeld in de browserinstellingen.",allow:"Toestaan",block:"Niet toestaan"}},vi:{desktopWidgetText:{wantsTo:"muốn",showNotifications:"Hiển thị thông báo",allow:"Cho phép",block:"Chặn"},mobileWidgetText:{wantsTo:"muốn",showNotifications:"gửi bạn thông báo",allow:"Cho phép",block:"Chặn"},slidedownWidgetText:{promptTextHeader:"Trang web này muốn gửi bạn thông báo đẩy.",promptTextBody:"Thông báo có thể được tắt bất kỳ lúc nào từ cài đặt trình duyệt.",allow:"Cho phép",block:"Không cho phép"},slidedownPromptForHttps:{promptTextHeader:"Trang web này muốn gửi bạn thông báo đẩy.",promptTextBody:"Thông báo có thể được tắt bất kỳ lúc nào từ cài đặt trình duyệt.",allow:"Cho phép",block:"Không cho phép"}},az:{desktopWidgetText:{wantsTo:"istəyir",showNotifications:"Bildirişləri göstərin",allow:"İcazə ver",block:"Bloklamaq"},mobileWidgetText:{wantsTo:"istəyir",showNotifications:"size bildiriş göndərmək",allow:"İcazə ver",block:"Bloklamaq"},slidedownWidgetText:{promptTextHeader:"Bu veb sayt sizə bildirişləri göndərmək istəyir.",promptTextBody:"Bildirişləri hər hansısa bir vaxtda brauzer parametrlərindən söndürə bilərsiniz.",allow:"İcazə ver",block:"İcazə verməmək"},slidedownPromptForHttps:{promptTextHeader:"Bu veb sayt sizə bildirişləri göndərmək istəyir.",promptTextBody:"Bildirişləri hər hansısa bir vaxtda brauzer parametrlərindən söndürə bilərsiniz.",allow:"İcazə ver",block:"İcazə verməmək"}},kk:{desktopWidgetText:{wantsTo:"қалайды",showNotifications:"Хабарламаларды көрсету",allow:"Рұқсат беру",block:"Тоқтату"},mobileWidgetText:{wantsTo:"қалайды",showNotifications:"сізге хабарламалар жіберу",allow:"Рұқсат беру",block:"Тоқтату"},slidedownWidgetText:{promptTextHeader:"Бұл веб-бет сізге толтыру хабарламаларын жіберу керек.",promptTextBody:"Хабарламаларды браузер параметрлерінен барлық уақытта өшіре аласыз.",allow:"Рұқсат беру",block:"Рұқсат бермеу"},slidedownPromptForHttps:{promptTextHeader:"Бұл веб-бет сізге толтыру хабарламаларын жіберу керек.",promptTextBody:"Хабарламаларды браузер параметрлерінен барлық уақытта өшіре аласыз.",allow:"Рұқсат беру",block:"Рұқсат бермеу"}},it:{desktopWidgetText:{wantsTo:"vuole",showNotifications:"Mostra le notifiche",allow:"Consenti",block:"Blocca"},mobileWidgetText:{wantsTo:"vuole",showNotifications:"inviarti notifiche",allow:"Consenti",block:"Blocca"},slidedownWidgetText:{promptTextHeader:"Questo sito web vorrebbe inviarti notifiche push.",promptTextBody:"Le notifiche possono essere disattivate in qualsiasi momento dalle impostazioni del browser.",allow:"Consenti",block:"Non consentire"},slidedownPromptForHttps:{promptTextHeader:"Questo sito web vorrebbe inviarti notifiche push.",promptTextBody:"Le notifiche possono essere disattivate in qualsiasi momento dalle impostazioni del browser.",allow:"Consenti",block:"Non consentire"}},zh:{desktopWidgetText:{wantsTo:"想要",showNotifications:"显示通知",allow:"允许",block:"阻止"},mobileWidgetText:{wantsTo:"想要",showNotifications:"发送通知",allow:"允许",block:"阻止"},slidedownWidgetText:{promptTextHeader:"此网站想要向您发送推送通知。",promptTextBody:"通知可随时从浏览器设置中关闭。",allow:"允许",block:"不允许"},slidedownPromptForHttps:{promptTextHeader:"此网站想要向您发送推送通知。",promptTextBody:"通知可随时从浏览器设置中关闭。",allow:"允许",block:"不允许"}}};i.d(t,"a",function(){return u});var c=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};class u extends o.a{constructor(e,t,i){super(e,t,i),this._cookieKeys={shown:"gravitecPromptShowed",blocked:"gravitecBlocked",blockedByWidget:"dontShowPrompt"}}_getSubscription(){return c(this,void 0,void 0,function*(){const e=window.safari.pushNotification.permission(this.config.app.applePushId);return e.permission===r.c.granted?(Object(n.a)(this._cookieKeys.shown)||Object(n.p)(this._cookieKeys.shown,!0,60),{permission:r.c.granted,subscription:{regID:e.deviceToken,browser:"SAFARI"}}):e.permission===r.c.default&&Object(n.a)(this._cookieKeys.shown)?(Object(n.o)(this._cookieKeys.shown),{permission:e.permission}):{permission:e.permission}})}_subscribeAfterUserGesture(){const e=window.safari.pushNotification.permission(this.config.app.applePushId);return this._checkRemotePermission(e)}_subscribe(){return c(this,void 0,void 0,function*(){if(!Object(n.a)(this._cookieKeys.shown)&&this.isNotificationPermitted()){const{default:e}=yield Promise.all([i.e(0),i.e(1)]).then(i.bind(null,"./src/sdk-template/client/widgets/optIn/optIn.ts"));return(new e).requestPermission(this.config).then(e=>e!==r.c.granted?(e===r.c.denied&&(Object(n.p)(this._cookieKeys.blockedByWidget,!0,7),console.log("Blocked")),Promise.reject(new s.a(e))):this._subscribeAfterUserGesture())}})}_checkRemotePermission(e){return c(this,void 0,void 0,function*(){if(e.permission===r.c.denied)throw Object(n.p)(this._cookieKeys.blockedByWidget,!0,30),new s.a(e.permission);if(e.permission===r.c.granted){Object(n.p)(this._cookieKeys.shown,!0,60);let t=Object(n.f)(),i=`${this.config.app.safariUrl}/v2/devices/${e.deviceToken}/registrations/${this.config.app.applePushId}?lang=${t}`;return fetch(i,{method:"PATCH"}),{regID:e.deviceToken,browser:"SAFARI"}}return yield new Promise((e,t)=>{window.safari.pushNotification.requestPermission(this.config.app.safariUrl,this.config.app.applePushId,{},i=>{i.permission===r.c.default?t(new Error("Recursive safari subscription...")):this._checkRemotePermission(i).then(e,t)})})})}isNotificationPermitted(){const e=window.safari.pushNotification.permission(this.config.app.applePushId);return!Object(n.a)(this._cookieKeys.blocked)&&!Object(n.a)(this._cookieKeys.blockedByWidget)&&e.permission!==r.c.denied}_getWidgetText(e){let t=Object(n.d)();switch(t){case r.b.russian:case r.b.ukrainian:case r.b.polish:case r.b.portuguese:case r.b.french:case r.b.german:case r.b.dutch:case r.b.vietnamese:case r.b.azerbaijani:case r.b.kazakh:case r.b.chinese:case r.b.italian:case r.b.spanish:break;default:t=r.b.english}const i=a[t][e];return Object.assign(Object.assign({},i),{url:"https://gravitec.net/rf/"})}}},"./src/sdk-template/client/http.client.ts":function(e,t,i){"use strict";var n=i("./src/sdk-template/enums.ts"),o=i("./src/sdk-template/client/base.client.ts"),r=i("./src/sdk-template/utils/index.ts"),s=i("./src/sdk-template/utils/database.ts"),a=i("./src/sdk-template/exceptions/subscribe.exception.ts"),c=i("./src/sdk-template/client/browser-subscription-managers/browser-subscription-manager.ts"),u=i("./src/sdk-template/client/browser-subscription-managers/chrome-like-subscription-manager.ts"),l=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};class d extends c.a{constructor(e,t,i){super(e,t,i),this._timeToCheckSubscription=5184e3,this._cookieKeys={shown:"gravitecPromptShowed",blocked:"gravitecBlocked",blockedByWidget:"dontShowPrompt"},this._poweredBy="Powered by Gravitec.net",this._subdomainFull=e.app.subDomain,this._subdomainUrl=new URL(this._subdomainFull),this._websiteDomain=window.location.hostname}_getSubscription(){return l(this,void 0,void 0,function*(){if(!this.isNotificationPermitted())return Promise.resolve({permission:n.c.denied,subscription:null});let e;const t=yield this._db.get(s.a.ids,"SubscriptionId");if(t&&(e=t.value),e){const t=Object(r.e)(),i=yield this._db.get(s.a.httpCreated,"subscribedTime");if(i&&t-i.value<this._timeToCheckSubscription)return{subscription:e,permission:n.c.granted};const o=[this._db.remove(s.a.httpCreated,"subscribedTime"),this._db.remove(s.a.ids,"SubscriptionId")];yield Promise.all(o),Object(r.o)(this._cookieKeys.shown)}return Object(r.o)(this._cookieKeys.shown),{subscription:null,permission:n.c.default}})}_subscribe(){return l(this,void 0,void 0,function*(){if(!this.isNotificationPermitted())return Promise.reject(new a.a(n.c.denied));if(!Object(r.a)(this._cookieKeys.shown)){if(this._subdomainFull){const{default:e}=yield Promise.all([i.e(0),i.e(1)]).then(i.bind(null,"./src/sdk-template/client/widgets/optIn/optIn.ts"));let t=new e;return Object(u.b)(this.config)&&Object(r.o)("gravitecOptInBlocked"),t.requestPermission(this.config,!1).then(e=>e!==n.c.granted?(e===n.c.denied&&Object(r.p)(this._cookieKeys.blockedByWidget,!0,7),Promise.reject(new a.a(e))):this._subscribeOnHttpsNewWindow())}throw"No subdomain found to subscribe"}})}isNotificationPermitted(){return!Object(r.a)(this._cookieKeys.blocked)&&!Object(r.a)(this._cookieKeys.blockedByWidget)}_subscribeOnHttpsNewWindow(){return l(this,void 0,void 0,function*(){const e=null!=window.screenLeft?window.screenLeft:screen.left,t=null!=window.screenTop?window.screenTop:screen.top,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,o=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height;Object(r.c)();let s,c,u,l;s=640,c=661,u=i/2-320+e,l=o/2-330.5+t;const d=window.open(this._subdomainFull,"_blank",`scrollbars=yes, width=640, height=661, top=${l}, left=${u}`);if(d){d.focus();const e=this._listenSubscription();d.onbeforeunload=(()=>setTimeout(()=>e.cancel()));const t=yield e.promise;if(t.permission===n.c.granted&&t.subscription)return Object(r.p)(this._cookieKeys.shown,!0,60),t.subscription;throw t.permission===n.c.denied&&Object(r.p)(this._cookieKeys.blocked,!0,30),new a.a(t.permission)}return Promise.reject("Couldn't open https window")})}saveSubscription(e){const t=Object.create(null,{saveSubscription:{get:()=>super.saveSubscription}});return l(this,void 0,void 0,function*(){return yield Promise.all([t.saveSubscription.call(this,e),this._db.put(s.a.httpCreated,{type:"subscribedTime",value:Object(r.e)()})]),e})}_listenSubscription(){let e,t;t=new Promise(t=>e=t);const i=t=>{t.origin===this._subdomainUrl.origin&&(o(),e(t.data))},o=()=>{window.removeEventListener("message",i,!1)};return window.addEventListener("message",i,!1),{promise:t,cancel:()=>{o(),e({permission:n.c.default})}}}}var p=i("./src/sdk-template/client/browser-subscription-managers/safari-subscription-manager.ts"),h=(i("./src/sdk-template/client/utils/database.ts"),i("./src/sdk-template/utils/logger.ts"));i.d(t,"a",function(){return g});var f=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};class g extends o.a{constructor(e,t,i,n){super(e,t,i,n),this._subdomainFull=new URL(e.app.subDomain),this._poweredBy=e.app.poweredBy,console.log("check subdomain:",e.app.subDomain,new URL(e.app.subDomain))}_init(e){return super._init(e)}_initModeSpecifics(){switch(this._mode){case n.a.safari:this._subscriptionManager=new p.a(this.config,this._db,this._Notification);break;case n.a.chrome:this._subscriptionManager=new d(this.config,this._db,this._Notification)}}isPushSubCreatedWithValidVapid(){return f(this,void 0,void 0,function*(){return!0})}_processSubscriptionIfChanged(e){return this._mode===n.a.safari?super._processSubscriptionIfChanged(e):(h.a.info(`subscription: ${e.regID}`),Promise.resolve(!0))}_updateCharset(e){e.toUpperCase()!==document.characterSet.toUpperCase()&&this._api.updateCharset({appKey:this.config.app.appKey,charset:document.characterSet})}}},"./src/sdk-template/client/segmentation/segmentation.ts":function(e,t,i){"use strict";i.d(t,"a",function(){return r});var n=i("./src/sdk-template/utils/logger.ts"),o=i("./src/sdk-template/utils/index.ts");class r{constructor(e){this._api=e,this._endpoints={tags:"/api/sites/followers/tags",aliases:"/api/sites/followers/aliases"}}addTag(e,t,i=o.m,r=o.m){return t?"string"!=typeof e?r({message:n.a.error("tag names argument is not a string")}):e&&e.trim()?void this._api.send(`${this._endpoints.tags}?regID=${t}`,"POST",[e]).then(()=>{n.a.debug(`tag (${e}) has been added`),i()},t=>{n.a.debug(`failed to add tag (${e})`),r(t)}):r({message:n.a.error("tag name is empty")}):r({message:n.a.error("no subscriber token to add tag")})}addTags(e,t,i=o.m,r=o.m){return t?e instanceof Array?(e=e.map(e=>e.trim()).filter(Boolean)).length?void this._api.send(`${this._endpoints.tags}?regID=${t}`,"PATCH",e).then(()=>{n.a.debug(`tags (${e.join(", ")}) have been added`),i()},t=>{n.a.debug(`failed to add tags (${e.join(", ")})`),r(t)}):r({message:n.a.error("no tags to add")}):r({message:n.a.error("tag names argument is not an array type")}):r({message:n.a.error("no subscriber token to add tags")})}setTags(e,t,i=o.m,r=o.m){return t?e instanceof Array?(e=e.map(e=>e.trim()).filter(Boolean)).length?void this._api.send(`${this._endpoints.tags}?regID=${t}`,"PUT",e).then(()=>{n.a.debug(`tags (${e.join(", ")}) have been set`),i()},t=>{n.a.debug(`failed to set tags (${e.join(", ")})`),r(t)}):r({message:n.a.error("no tags to set")}):r({message:n.a.error("tag names argument is not an array type")}):r({message:n.a.error("no subscriber token to set tags")})}removeTag(e,t,i=o.m,r=o.m){return t?"string"!=typeof e?r({message:n.a.error("tag names argument is not a string")}):e&&e.trim()?void this.removeTags([e],t,i,r):r({message:n.a.error("tag name is empty. Cannot remove")}):r({message:n.a.error("no subscriber token to remove tag")})}removeTags(e,t,i=o.m,r=o.m){return t?e instanceof Array?(e=e.map(e=>e.trim()).filter(Boolean)).length?void this._api.send(`${this._endpoints.tags}?regID=${t}`,"DELETE",e).then(()=>{n.a.debug(`tags (${e.join(", ")}) have been removed`),i()},t=>{n.a.debug(`failed to remove tags (${e.join(", ")})`),r(t)}):r({message:n.a.error("no tags to remove")}):r({message:n.a.error("tag names argument is not an array type")}):r({message:n.a.error("no subscriber token to set tags")})}removeAllTags(e,t=o.m,i=o.m){if(!e)return i({message:n.a.error("no subscriber token to remove all tags")});this._api.send(`${this._endpoints.tags}?regID=${e}`,"DELETE",[]).then(()=>{n.a.debug("tags have been removed"),t()},e=>{n.a.debug("failed to remove tags"),i(e)})}setAlias(e,t,i=o.m,r=o.m){return t?"string"!=typeof e?r({message:n.a.error("alias is not a string")}):e&&e.trim()?e.length>255?r({message:n.a.error("alias length is over 255 sumbols")}):void this._api.send(`${this._endpoints.aliases}?regID=${t}`,"POST",e).then(()=>{n.a.debug(`alias (${e}) has been added`),i()},t=>{n.a.debug(`failed to add alias (${e})`),r(t)}):r({message:n.a.error("alias is empty")}):r({message:n.a.error("no subscriber token to remove alias")})}getTags(e,t=o.m,i=o.m){this._api.send(`${this._endpoints.tags}?regID=${e}`,"GET").then(e=>{const i=e.map(e=>e.name);n.a.debug(`tags have been retrieved: ${i.join(", ")}`),t(i)}).catch(e=>{n.a.debug("failed to get tags"),i(e)})}getAlias(e,t=o.m,i=o.m){i({message:n.a.error("getAlias segmentation method is currently not available")})}}},"./src/sdk-template/client/utils/api.ts":function(e,t,i){"use strict";var n=i("./src/sdk-template/utils/logger.ts"),o=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};class r{constructor(e,t){this.version="1.2.1",this._apiUrl=e,this._appKey=t}send(e,t,i=null,r=new Headers){let s=e.split("?")[0],a=e.split("?")[1]||"";a&&(a+="&");let c=`${this._apiUrl}${s}?${a}appKey=${this._appKey}&version=${this.version}`;if(r.append("Content-Type","application/json"),null!==i&&(i=JSON.stringify(i)),"fetch"in window){const e={method:t,headers:r};return i&&(e.body=i),fetch(c.toString(),e).then(e=>o(this,void 0,void 0,function*(){if(e.status>304){const t=yield e.text();return Promise.reject(new Error(`fetch error ${t}`))}return e.json().then(e=>e&&"object"==typeof e&&"error"in e?Promise.reject(e):e).catch(()=>{})})).catch(e=>{throw console.log(e),e})}return new Promise((e,o)=>{const s=new XMLHttpRequest;s.open(t,c.toString(),!0),r.forEach((e,t)=>{s.setRequestHeader(t,e)}),s.onreadystatechange=function(){if(4==s.readyState){if(s.status>304){let e;n.a.log(`Looks like there was a problem. Status Code: ${s.status}`);try{e=JSON.parse(s.responseText)}catch(t){n.a.debug(JSON.stringify(t)),e={message:s.responseText}}return o(e)}return n.a.debug("data successfully sent"),e(JSON.parse(s.responseText))}},s.onerror=o,s.send(i||null)})}}i.d(t,"a",function(){return s});class s extends r{constructor(e,t){super(e,t)}checkOwnSubscription(e){return this.send(`/api/sites/followers/exist?regID=${e.regID}`,"get")}subscribe(e){return this.send("/api/sites/followers","post",e)}updateSubscription(e,t){return this.send("/api/sites/followers","put",{oldSubscription:e,newSubscription:t})}updateCharset(e){return this.send("/api/sites/charset","post",e)}deleteSubscription(e){return this.send("/api/sites/followers","delete",e)}}},"./src/sdk-template/client/utils/database.ts":function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i("./src/sdk-template/utils/database.ts");n.a.httpCreated="HttpCreated";class o extends n.b{constructor(){super(...arguments),this.dbName="gravitec_client_db"}onupgradeneeded(e){const t=super.onupgradeneeded(e);return t.createObjectStore(n.a.httpCreated,{keyPath:"type"}),t}}},"./src/sdk-template/client/widgets/translations.json":function(e){e.exports={en:{bubbleText:"Click to configure notifications",notificationAreBlocked:"Notifications are blocked!",tagWindowTitle:"Configure notifications",submit:"Submit",cancel:"Cancel",pushHistory:"Push History",configuration:"Configuration",emptyHistory:"Notifications history is empty",markAllAsRead:"Mark all as read",clearAll:"Clear all",optInText:"Will you allow sitename.com to send notifications?",optInAllow:"Allow",optInBlock:"No, thanks",unblockWidgetTitle:"Subscribe to our notifications!",unblockWidgetBody:"Click the bell icon to enable notifications"},es:{bubbleText:"Configura la suscripción",notificationAreBlocked:"¡Notificaciones están bloqueadas!",tagWindowTitle:"Configuración de notificaciones",submit:"Aceptar",cancel:"Cancelar",pushHistory:"Historia push",configuration:"Configuración",emptyHistory:"La historia está vacía",markAllAsRead:"Marcar todo como leído",clearAll:"Borrar todo",optInText:"¿Va a permitir a sitename.com enviar notificaciones?",optInAllow:"Permitir",optInBlock:"No, gracias",unblockWidgetTitle:"Recibe notificaciones importantes!",unblockWidgetBody:"Haga clic en el icono de la campana para activar las notificaciones"},ru:{bubbleText:"Нажмите, чтобы настроить уведомления",notificationAreBlocked:"Уведомления заблокированы!",tagWindowTitle:"Настройте уведомления",submit:"Принять",cancel:"Отменить",pushHistory:"История",configuration:"Настройки",emptyHistory:"История уведомлений пуста",markAllAsRead:"Пометить как прочитанное",clearAll:"Очистить",optInText:"Вы разрешаете sitename.com отправлять уведомления?",optInAllow:"Разрешить",optInBlock:"Нет, спасибо",unblockWidgetTitle:"Подпишитесь на наши уведомления!",unblockWidgetBody:"Нажмите на иконку колокольчика, чтобы включить уведомления"},uk:{bubbleText:"Натисніть, щоб налаштувати сповіщення",notificationAreBlocked:"Сповіщення заблоковані!",tagWindowTitle:"Налаштуйте сповіщення",submit:"Прийняти",cancel:"Відмінити",pushHistory:"Історія",configuration:"Налаштування",emptyHistory:"Історія сповіщень пуста",markAllAsRead:"Позначити як прочитане",clearAll:"Очистити",optInText:"Дозволити sitename.com відправляти сповіщення?",optInAllow:"Дозволити",optInBlock:"Ні, дякую",unblockWidgetTitle:"Отримуй важливі сповіщення від нас!",unblockWidgetBody:"Натисни на значок дзвіночка, щоб дозволити отримання повідомлень"},pl:{bubbleText:"Kliknij, aby skonfigurować subskrypcję",notificationAreBlocked:"Notifications are blocked!",tagWindowTitle:"Skonfiguruj subskrypcję",submit:"Zatwierdź",cancel:"Anulować",pushHistory:"Historia push",configuration:"Konfiguracja",emptyHistory:"Brak zapisów w historii ",markAllAsRead:"Oznacz jako przeczytane",clearAll:"Usuń wszystkie",optInText:"Czy zezwalasz sitename.com na wysyłanie powiadomień?",optInAllow:"Pozwalam",optInBlock:"Nie, dziękuję",unblockWidgetTitle:"Subskrybuj nasze powiadomienia!",unblockWidgetBody:"Kliknij ikonę dzwonka, aby włączyć powiadomienia"},pt:{bubbleText:"Clique para configurar notificações",notificationAreBlocked:"Notificações estão bloqueadas!",tagWindowTitle:"Configurar notificações",submit:"Enviar",cancel:"Cancelar",pushHistory:"Histórico de push",configuration:"Configuração",emptyHistory:"O histórico de notificações está vazio",markAllAsRead:"marcar tudo como lido",clearAll:"Limpar tudo",optInText:"Você permite que sitename.com envie notificações?",optInAllow:"Permitir",optInBlock:"Não, obrigado",unblockWidgetTitle:"Inscreva-se para receber nossas notificações!",unblockWidgetBody:"Clique no ícone de sino para habilitar notificações"},fr:{bubbleText:"Cliquez pour configurer les notifications",notificationAreBlocked:"Les notifications sont bloquées!",tagWindowTitle:"Configurer les notifications",submit:"Soumettre",cancel:"Annuler",pushHistory:"Historique des notifications",configuration:"Configuration",emptyHistory:"L'historique des notifications est vide",markAllAsRead:"Tout marquer comme lu",clearAll:"Tout effacer",subscribeToNotification:"Abonnez-vous aux notifications",optInText:"Autorisez-vous sitename.com à envoyer des notifications?",optInAllow:"Permettre",optInBlock:"Non merci",unblockWidgetTitle:"Abonnez-vous à nos notifications!",unblockWidgetBody:"Cliquez sur l'icône en forme de cloche pour activer les notifications"},de:{bubbleText:"Klicken Sie hier, um Benachrichtigungen zu konfigurieren",notificationAreBlocked:"Benachrichtigungen sind blockiert!",tagWindowTitle:"Benachrichtigungen konfigurieren",submit:"Einreichen",cancel:"Absagen",pushHistory:"Push-Verlauf",configuration:"Aufbau",emptyHistory:"Der Benachrichtigungsverlauf ist leer",markAllAsRead:"Alles als gelesen markieren",clearAll:"Alles löschen",subscribeToNotification:"Benachrichtigungen abonnieren",optInText:"Erlauben Sie sitename.com, Benachrichtigungen zu senden?",optInAllow:"Erlauben",optInBlock:"Nein Danke",unblockWidgetTitle:"Abonnieren Sie unsere Benachrichtigungen!",unblockWidgetBody:"Klicken Sie auf das Glockensymbol, um Benachrichtigungen zu aktivieren"},nl:{bubbleText:"Klik om meldingen te configureren",notificationAreBlocked:"Meldingen zijn geblokkeerd!",tagWindowTitle:"Meldingen configureren",submit:"Submit",cancel:"Annuleren",pushHistory:"Push-geschiedenis",configuration:"Configuratie",emptyHistory:"Meldingsgeschiedenis is leeg",markAllAsRead:"Markeer alles als gelezen",clearAll:"Wis alles",subscribeToNotification:"Abonneren op meldingen",optInText:"Staat u sitename.com toe om meldingen te verzenden?",optInAllow:"Toestaan",optInBlock:"Nee, bedankt",unblockWidgetTitle:"Abonneer je op onze meldingen!",unblockWidgetBody:"Klik op het belpictogram om meldingen in te schakelen"},vi:{bubbleText:"Nhấp để định cấu hình thông báo",notificationAreBlocked:"Thông báo bị chặn!",tagWindowTitle:"Định cấu hình thông báo",submit:"Gửi",cancel:"Hủy bỏ",pushHistory:"Lịch sử đẩy",configuration:"Cấu hình",emptyHistory:"Lịch sử thông báo trống",markAllAsRead:"Đánh dấu tất cả là đã đọc",clearAll:"Xóa tất cả",subscribeToNotification:"Đăng ký nhận thông báo",optInText:"Bạn có cho phép sitename.com gửi thông báo không?",optInAllow:"Cho phép",optInBlock:"Không, cảm ơn",unblockWidgetTitle:"Đăng ký nhận thông báo của chúng tôi!",unblockWidgetBody:"Nhấp vào biểu tượng chuông để bật thông báo"},az:{bubbleText:"Bildirişləri konfiqurasiya etmək üçün klikləyin",notificationAreBlocked:"Bildirişlər bloklanıb!",tagWindowTitle:"Bildirişləri konfiqurasiya edin",submit:"Göndər",cancel:"Ləğv et",pushHistory:"Push Tarix",configuration:"Konfiqurasiya",emptyHistory:"Bildirişlər tarixçəsi boşdur",markAllAsRead:"Hamısını oxunmuş kimi qeyd et",clearAll:"Hamısını sil",subscribeToNotification:"Bildirişlərə abunə olun",optInText:"Sitename.com saytına bildiriş göndərməyə icazə verirsiniz?",optInAllow:"İcazə verin",optInBlock:"Xeyr, təşəkkürlər",unblockWidgetTitle:"Bildirişlərimizə abunə olun!",unblockWidgetBody:"Bildirişləri aktivləşdirmək üçün zəng işarəsinə klikləyin"},kk:{bubbleText:"Хабарландыруларды конфигурациялау үшін басыңыз",notificationAreBlocked:"Хабарландырулар бұғатталған!",tagWindowTitle:"Хабарландыруларды конфигурациялау",submit:"Жіберу",cancel:"Болдырмау",pushHistory:"Push оқиға",configuration:"Конфигурация",emptyHistory:"Хабарландырулар тарихы бос",markAllAsRead:"Барлығын оқылған деп белгілеу",clearAll:"Барлығын өшіру",subscribeToNotification:"Хабарландыруларға жазылу",optInText:"sitename.com сайтына хабарландыру жіберуге рұқсат бересіз бе?",optInAllow:"Рұқсат ету",optInBlock:"Жоқ, рахмет",unblockWidgetTitle:"Біздің хабарландыруларымызға жазылыңыз!",unblockWidgetBody:"Хабарландыруларды қосу үшін қоңырау белгішесін басыңыз"},it:{bubbleText:"Clicca per configurare le notifiche",notificationAreBlocked:"Le notifiche sono bloccate!",tagWindowTitle:"Configura le notifiche",submit:"Invia",cancel:"Annulla",pushHistory:"Storico delle notifiche",configuration:"Configurazione",emptyHistory:"Lo storico delle notifiche è vuoto",markAllAsRead:"Segna tutto come letto",clearAll:"Cancella tutto",optInText:"Permetterai a sitename.com di inviare notifiche?",optInAllow:"Consenti",optInBlock:"No, grazie",unblockWidgetTitle:"Iscriviti alle nostre notifiche!",unblockWidgetBody:"Clicca sull'icona a campana per abilitare le notifiche"},zh:{bubbleText:"点击配置通知",notificationAreBlocked:"通知被阻止了！",tagWindowTitle:"配置通知",submit:"提交",cancel:"取消",pushHistory:"推送历史",configuration:"配置",emptyHistory:"通知历史为空",markAllAsRead:"全部标记为已读",clearAll:"清除全部",optInText:"你是否允许 sitename.com 发送通知？",optInAllow:"允许",optInBlock:"不，谢谢",unblockWidgetTitle:"订阅我们的通知！",unblockWidgetBody:"点击钟铃图标以启用通知"}}},"./src/sdk-template/enums.ts":function(e,t,i){"use strict";var n,o,r;i.d(t,"a",function(){return n}),i.d(t,"c",function(){return o}),i.d(t,"b",function(){return r}),function(e){e.chrome="CHROME",e.safari="SAFARI"}(n||(n={})),function(e){e.granted="granted",e.default="default",e.denied="denied",e.deniedFromCustom="deniedFromCustom"}(o||(o={})),function(e){e.ukrainian="uk",e.russian="ru",e.english="en",e.polish="pl",e.spanish="es",e.portuguese="pt",e.french="fr",e.german="de",e.dutch="nl",e.vietnamese="vi",e.azerbaijani="az",e.kazakh="kk",e.chinese="zh",e.italian="it"}(r||(r={}))},"./src/sdk-template/exceptions/subscribe.exception.ts":function(e,t,i){"use strict";i.d(t,"a",function(){return n});class n extends Error{constructor(e){super(`SubscribeError: permission ${e}`),this.permission=e}}},"./src/sdk-template/https.ts":function(e,t,i){"use strict";i.r(t);var n=i("./src/sdk-template/enums.ts"),o=i("./src/sdk-template/client/browser-subscription-managers/chrome-like-subscription-manager.ts"),r=i("./src/sdk-template/client/browser-subscription-managers/safari-subscription-manager.ts"),s=i("./src/sdk-template/utils/index.ts"),a=i("./src/sdk-template/client/base.client.ts"),c=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};class u extends a.a{constructor(e,t,i,n){super(e,t,i,n)}_init(e={}){return this.config.app.swScope=e.serviceWorkerScope||"/",super._init(e)}_initModeSpecifics(){switch(this._mode){case n.a.chrome:this._subscriptionManager=new o.a(this.config,this._db,this._Notification);break;case n.a.safari:this._subscriptionManager=new r.a(this.config,this._db,this._Notification)}}_checkSubscriptionOwn(e){return c(this,void 0,void 0,function*(){const{value:t}=yield this._api.checkOwnSubscription(e);return t})}_unsubscribeForeign(){return c(this,void 0,void 0,function*(){if(this._subscriptionManager instanceof o.a){const e=yield this._subscriptionManager.getNativeSubscription();return!!e&&(yield e.unsubscribe())}return!1})}_checkSupport(){const e=Object.create(null,{_checkSupport:{get:()=>super._checkSupport}});return c(this,void 0,void 0,function*(){const t=yield e._checkSupport.call(this);if(!t)return t;if(!Object(s.b)()&&!Object(s.j)())throw new Error("Notifications aren't supported.");return!0})}}var l=i("./src/sdk-template/client/segmentation/segmentation.ts"),d=i("./src/sdk-template/client/utils/database.ts"),p=i("./src/sdk-template/client/utils/api.ts"),h=i("./src/sdk-template/client/http.client.ts"),f=i("./src/sdk-template/utils/logger.ts"),g=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};function b({appKey:e,cdnUrl:t,callbacksUrl:n}){return g(this,void 0,void 0,function*(){const o=new URLSearchParams(window.location.search);if(o.get("frequency")){const r=o.get("hash"),a=o.get("frequency"),{default:c}=yield Promise.all([i.e(0),i.e(2)]).then(i.bind(null,"./src/sdk-template/client/widgets/digest/digestTemplate.ts"));(function(e,t,i,n){return g(this,void 0,void 0,function*(){let o=yield fetch(`${e}/open-api/digests?appKey=${t}&frequency=${n}&hash=${i}`);if(o.status>304){const e=yield o.text();return Promise.reject(new Error(`fetch error ${e}`))}return o.json().then(e=>e&&"object"==typeof e&&"error"in e?Promise.reject(e):null===e||0===Object.keys(e).length?Promise.reject(new Error(`Digest response: ${JSON.stringify(e)}`)):e)})})(t,e,r,a.toUpperCase()).then(e=>g(this,void 0,void 0,function*(){if(e.unique){const t=[];for(const i of e.campaigns)t.push(i.hash);let i=yield Object(s.g)();o.get("regid")&&(i=o.get("regid"));const r={id:i,link_hashes:t};try{const t=yield function(e,t,i=new Headers,n="POST"){return g(this,void 0,void 0,function*(){i.append("Content-Type","application/json");const o={method:n,headers:i};e&&(o.body=e);try{let i=null;if(!JSON.parse(e).id)return Promise.reject("hash error");if((i=yield fetch(t,o)).status>304){const e=yield i.text();return Promise.reject(new Error(`fetch error ${e}`))}return i.json().then(e=>e&&"object"==typeof e&&"error"in e?Promise.reject(e):e)}catch(e){throw e}})}(JSON.stringify(r),`${window.grvTatooineHost?window.grvTatooineHost:"https://api.gravitec.media"}/api/stats/v1/filter-viewed-page`);let i=e.campaigns.filter(e=>t.includes(e.hash)),o=e.campaigns.filter(e=>!t.includes(e.hash));if(i.length>=e.size){e.campaigns=i.slice(0,e.size),new c(e,a,n).generate()}else{e.campaigns=i.concat(o.slice(0,e.size-i.length)),new c(e,a,n).generate()}}catch(t){e.campaigns=e.campaigns.slice(0,e.size),new c(e,a,n).generate()}}else{e.campaigns=e.campaigns.slice(0,e.size),new c(e,a,n).generate()}})).catch(e=>{f.a.error(e)})}})}var m=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object(s.q)(),window._subscriptionStrategy=0;const w=window.Gravitec||window.WLPush||[];fetch("https://cdn.gravitec.net/sdk/web/configs?appKey=70e0eb2c311832e3d3a289bccca10db5").then(e=>e.status>304?Promise.reject(new Error("fetch error")):e.json()).then(e=>{e.app.isHttpToHttps=!1,e.app.sdkVersion=6,e.app.appKey="70e0eb2c311832e3d3a289bccca10db5",v(e)}).catch(e=>{console.log(e)});const v=e=>{window.GravitecConfig=e;const t=new d.a,n=new p.a(e.app.userApiUrl,e.app.appKey),r=new l.a(n);let a;a=e.app.subDomain?new h.a(e,t,n,{segmentation:r}):new u(e,t,n,{segmentation:r}),window.Gravitec=a,window.WLPush=a,b(e.app),w.some(([e],t)=>{if("init"===e)return t>0&&w.unshift(...w.splice(t,1)),!0})||window.Gravitec.push(["init"]),window.Gravitec.processPushes(w);if(["addTag","addTags","setTags","removeTag","removeTags","removeAllTags","setAlias","getTags"].forEach(e=>{window.Gravitec[e]=((...t)=>window.Gravitec.push([`segmentation.${e}`].concat(t)))}),e.app.trackUnique){const t=function e(t){if(document.body){const e=document.createElement("iframe");return e.src=t,e.style.display="none",e.className="grv-iframe",document.body.appendChild(e),e}window.requestAnimationFrame(()=>e(t))}(e.app.identifyUrl);window.addEventListener("message",e=>{"IFRAME"===e.data.type&&localStorage.setItem("wasIdentified","true")}),a.push(["subscriptionResult",i=>{i.subscription&&i.newSubscription?t.contentWindow.postMessage({type:"IDENTIFY_EVENT",regId:i.subscription.regID,appKey:e.app.appKey,siteUrl:e.app.siteUrl},e.app.identifyUrl):!i.subscription||i.newSubscription||Boolean(localStorage.getItem("wasIdentified"))||setTimeout(()=>t.contentWindow.postMessage({type:"IDENTIFY_EVENT",regId:i.subscription.regID,appKey:e.app.appKey,siteUrl:e.app.siteUrl},e.app.identifyUrl),1e3)}])}e.app.trackStat&&(e.app.tatooineUrl&&(window.grvTatooineHost=e.app.tatooineUrl),function(){m(this,void 0,void 0,function*(){let e=yield Object(s.g)();window.GravitecNetNewsConfig={appKey:"70e0eb2c311832e3d3a289bccca10db5",regId:e};var t=document.createElement("script");t.type="text/javascript",t.src="//cdn.gravitec.media/track.min.js",t.async=!0,document.getElementsByTagName("script")[0].parentNode.appendChild(t)})}()),function t(){window.GravitecNews?window.Gravitec.push(["subscriptionResult",t=>m(this,void 0,void 0,function*(){if(window.Gravitec._subscriptionManager instanceof o.a){if(e.bell.enabled&&("denied"!==Notification.permission||!Object(s.i)())&&(!Object(s.i)()||!e.opt.desktopProps.reengagement.bellHelper.enabled||e.bell.functional.includes("CONF")||e.bell.functional.includes("HISTORY"))&&!Object(s.a)("gravitecOptInBlocked")){const{default:n}=yield Promise.all([i.e(0),i.e(1),i.e(4)]).then(i.bind(null,"./src/sdk-template/client/widgets/bell/index.ts"));n.renderBellElement(n.createShadow("grv-bell-host",document.body),e.bell,e.app,e.opt,t.permission)}if("denied"===window.localStorage.permission&&"granted"===Notification.permission)try{fetch(`${window.grvTatooineHost?window.grvTatooineHost:"https://api.gravitec.media"}/api/stats/event?app_key=${e.app.appKey}&user_id=${window.GravitecNews.getUserId()}&event_type=unblock&event_source=sub`)}catch(e){}window.localStorage.setItem("permission",Notification.permission)}})]):window.requestAnimationFrame(t)}()}},"./src/sdk-template/utils/database.ts":function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return s});var n,o=i("./src/sdk-template/utils/logger.ts"),r=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};!function(e){e.ids="Ids",e.settings="Settings"}(n||(n={}));class s{constructor(){this.version=1,this.dbName="gravitec_db"}open(e=this.dbName,t=this.version){return this.db?Promise.resolve(this.db):new Promise((i,n)=>{let r;try{r=window.indexedDB.open(e,this.version)}catch(i){return void o.a.debug(`Error opening indexeddb. \nDb name: ${e}\ndb version: ${t}`)}r.onerror=n,r.onblocked=n,r.onupgradeneeded=(e=>this.onupgradeneeded(e)),r.onsuccess=(()=>{this.db=r.result,i(this.db)})})}onupgradeneeded(e){const t=e.target.result;return t.createObjectStore(n.ids,{keyPath:"type"}),t.createObjectStore(n.settings,{keyPath:"option"}),t}put(e,t){return r(this,void 0,void 0,function*(){return yield this.open(),new Promise((i,n)=>{try{const o=this.db.transaction([e],"readwrite").objectStore(e).put(t);o.onsuccess=(()=>{i()}),o.onerror=(e=>{this.logOperationError("PUT",e,!0),n(e)})}catch(e){this.logOperationError("PUT",e),n(e)}})})}count(e){return r(this,void 0,void 0,function*(){return yield this.open(),new Promise((t,i)=>{try{const n=this.db.transaction([e],"readonly").objectStore(e).count();n.onsuccess=(()=>{t(n.result)}),n.onerror=(e=>{this.logOperationError("COUNT",e,!0),i(e)})}catch(e){this.logOperationError("COUNT",e),i(e)}})})}get(e,t){return r(this,void 0,void 0,function*(){return yield this.open(),new Promise((i,n)=>{try{const o=this.db.transaction([e],"readonly").objectStore(e).get(t);o.onsuccess=(()=>{i(o.result)}),o.onerror=(e=>{this.logOperationError("GET",e,!0),n(e)})}catch(e){this.logOperationError("GET",e),n(e)}})})}remove(e,t){return r(this,void 0,void 0,function*(){return yield this.open(),new Promise((i,n)=>{try{let o;(o=t?this.db.transaction([e],"readwrite").objectStore(e).delete(t):this.db.transaction([e],"readwrite").objectStore(e).clear()).onsuccess=(()=>{i(t)}),o.onerror=(e=>{this.logOperationError("GET_ALL",e,!0),n(e)})}catch(e){this.logOperationError("GET_ALL",e),n(e)}})})}getAll(e){return r(this,void 0,void 0,function*(){return yield this.open(),new Promise((t,i)=>{try{const n={},o=this.db.transaction([e],"readonly").objectStore(e).openCursor();o.onsuccess=(()=>{const e=o.result;e?(n[e.key]=e.value,e.continue()):t(n)}),o.onerror=(e=>{this.logOperationError("GET_ALL",e,!0),i(e)})}catch(e){this.logOperationError("GET_ALL",e),i(e)}})})}logOperationError(e,t,i=!1){o.a.error(`DB${i?" transaction":""} error ${e}: ${t}`)}}},"./src/sdk-template/utils/index.ts":function(e,t,i){"use strict";i.d(t,"c",function(){return r}),i.d(t,"n",function(){return a}),i.d(t,"j",function(){return c}),i.d(t,"l",function(){return u}),i.d(t,"b",function(){return l}),i.d(t,"a",function(){return d}),i.d(t,"e",function(){return p}),i.d(t,"i",function(){return h}),i.d(t,"o",function(){return f}),i.d(t,"p",function(){return g}),i.d(t,"d",function(){return b}),i.d(t,"h",function(){return m}),i.d(t,"f",function(){return w}),i.d(t,"m",function(){return v}),i.d(t,"k",function(){return y}),i.d(t,"q",function(){return k}),i.d(t,"g",function(){return S});var n=i("./node_modules/idb/build/index.js"),o=function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})};function r(e=navigator.userAgent){return o(this,void 0,void 0,function*(){try{const{parse:t}=yield i.e(3).then(i.t.bind(null,"./node_modules/bowser/es5.js",7));switch(t(e).browser.name){case"Chrome":return"CHROME";case"Firefox":return"FIREFOX";case"Microsoft Edge":return"EDGE";case"Opera":return"OPERA";case"Safari":return"SAFARI";case"UC Browser":return"UC_BROWSER";case"Yandex Browser":return"YANDEX";case"Internet Explorer":return"IE";default:return"CHROME"}}catch(e){return function(e=navigator){var t=e.userAgent,i=t.match(/(opera|yabrowser|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i);return i?/trident/i.test(i[1])?"IE":"CHROME"===i[1].toUpperCase()&&null!==t.match(/\bOPR\/(\d+)/)?"OPERA":"CHROME"===i[1].toUpperCase()&&null!==t.match(/\bYaBrowser\/(\d+)/)?"YANDEX":"CHROME"===i[1].toUpperCase()?"CHROME":i[2]?i[1].toUpperCase():e.appName.toUpperCase():e.appName.toUpperCase()}(navigator)}})}const s=[/^https:\/\/fcm\.googleapis\.com\/fcm\/send\//,/^https:\/\/android\.googleapis\.com\/gcm\/send\//,/^https:\/\/updates\.push\.services\.mozilla\.com(?::443)?\//,/\.notify\.windows\.com\/w\/\?token\=/];function a(e,t=navigator.userAgent,i=self,n=""){return o(this,void 0,void 0,function*(){const o={regID:"",auth:void 0,p256dh:void 0,browser:null,subscriptionSpec:void 0,subscriptionStrategy:void 0,endpoint:null,lang:null,fcmToken:void 0};try{for(const t of s)t.test(e.endpoint)&&Object.assign(o,{regID:e.endpoint.split(t)[1]});const{keys:a}=e.toJSON();let c;try{c=w()}catch(e){c=null}Object.assign(o,{auth:a.auth,p256dh:a.p256dh,browser:yield r(t),subscriptionSpec:n?3:i&&i._subscriptionSpec||0,subscriptionStrategy:i&&i._subscriptionStrategy||0,endpoint:e.endpoint,lang:c,fcmToken:n||null})}catch(e){console.log(e)}return o})}function c(){return"showNotification"in(ServiceWorkerRegistration&&ServiceWorkerRegistration.prototype)}function u(){return"PushManager"in window}function l(){return"safari"in window&&"pushNotification"in window.safari}function d(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e<i.length;e++){let n=i[e];for(;" "==n.charAt(0);)n=n.substring(1);if(0==n.indexOf(t))return n.substring(t.length,n.length)}return""}function p(){return Math.round(Date.now()/1e3)}function h(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t}function f(e){g(e,null,-1)}function g(e,t,i=30){var n=new Date;n.setTime(n.getTime()+864e5*i);var o="; expires="+n.toUTCString();document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+o+"; path=/"}function b(){return window.navigator.language.substring(0,2).toLowerCase()}function m(e){let t=w(),i=e.find(e=>e.lang===t);return i?i.value:e.find(e=>"default"===e.lang).value}function w(){let e,t=document.querySelector("html").getAttribute("lang");if(t){e=t.split("-")[0]}else e=b();return e}function v(){}function y(){return new Promise(e=>{const t=()=>e(!0),i=()=>e(!1);if(window.webkitRequestFileSystem)return void window.webkitRequestFileSystem(0,0,i,t);if("MozAppearance"in document.documentElement.style){if(null===indexedDB)return t();const e=indexedDB.open("test");return e.onerror=t,void(e.onsuccess=i)}const n=navigator.userAgent.match(/Version\/([0-9\._]+).*Safari/);if(n){if(parseInt(n[1],10)<11)return(()=>{try{localStorage.length?i():(localStorage.x=1,localStorage.removeItem("x"),i())}catch(e){navigator.cookieEnabled?t():i()}})();try{return window.openDatabase(null,null,null,null),i()}catch(e){return t()}}return window.indexedDB||!window.PointerEvent&&!window.MSPointerEvent?i():t()})}const k=()=>{let e=Number(window.localStorage.getItem("views-counter"));null===e?e=1:e++,window.localStorage.setItem("views-counter",e.toString())};function S(){return o(this,void 0,void 0,function*(){let e=null;try{const t=yield navigator.serviceWorker.getRegistration();if(t){const i=yield t.pushManager.getSubscription();for(const t of s)i&&t.test(i.endpoint)&&(e=i.endpoint.split(t)[1])}}catch(t){try{e=yield _()}catch(t){e=null}}return e})}const _=()=>o(void 0,void 0,void 0,function*(){let e=null;try{const t=yield Object(n.b)("gravitec_client_db",1,{upgrade(e){e.createObjectStore("Ids",{keyPath:"type"}),e.createObjectStore("HttpCreated",{keyPath:"type"})}});if(t){const i=yield t.get("Ids","SubscriptionId");if(i&&i.value){const t=i.value.regID;t&&(e=t)}}}catch(e){}return e})},"./src/sdk-template/utils/logger.ts":function(e,t,i){"use strict";i.d(t,"a",function(){return n});class n{static log(e){return console.log("🔔",e),e}static info(e){return console.info("🔔",e),e}static warn(e){return console.warn("🔔",e),e}static error(e){return console.error("🔔",e),e}static debug(e){return console.debug("🔔",e),e}}},1:function(e,t,i){e.exports=i("./src/sdk-template/https.ts")}});!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.lazyload=t():e.lazyload=t()}(self,(function(){return e={883:function(e,t,n){var r,s,i,a,c;function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}i=function(){"use strict";var e="undefined"!=typeof window,t=e&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),n=e&&"IntersectionObserver"in window,r=e&&"classList"in document.createElement("p"),s={elements_selector:"img",container:t||e?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_poster:"poster",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,auto_unobserve:!0,callback_enter:null,callback_exit:null,callback_reveal:null,callback_loaded:null,callback_error:null,callback_finish:null,use_native:!1},i=function(e,t){var n,r=new e(t);try{n=new CustomEvent("LazyLoad::Initialized",{detail:{instance:r}})}catch(e){(n=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:r})}window.dispatchEvent(n)},a=function(e,t){return e.getAttribute("data-"+t)},c=function(e,t,n){var r="data-"+t;null!==n?e.setAttribute(r,n):e.removeAttribute(r)},l=function(e){return"true"===a(e,"was-processed")},f=function(e,t){return c(e,"ll-timeout",t)},d=function(e){return a(e,"ll-timeout")},p=function(e,t,n,r){e&&(void 0===r?void 0===n?e(t):e(t,n):e(t,n,r))},m=function(e,t){e._loadingCount+=t,0===e._elements.length&&0===e._loadingCount&&p(e._settings.callback_finish,e)},h=function(e){for(var t,n=[],r=0;t=e.children[r];r+=1)"SOURCE"===t.tagName&&n.push(t);return n},g=function(e,t,n){n&&e.setAttribute(t,n)},A=function(e,t){g(e,"sizes",a(e,t.data_sizes)),g(e,"srcset",a(e,t.data_srcset)),g(e,"src",a(e,t.data_src))},v={IMG:function(e,t){var n=e.parentNode;n&&"PICTURE"===n.tagName&&h(n).forEach((function(e){A(e,t)})),A(e,t)},IFRAME:function(e,t){g(e,"src",a(e,t.data_src))},VIDEO:function(e,t){h(e).forEach((function(e){g(e,"src",a(e,t.data_src))})),g(e,"poster",a(e,t.data_poster)),g(e,"src",a(e,t.data_src)),e.load()}},b=function(e,t){r?e.classList.add(t):e.className+=(e.className?" ":"")+t},y=function(e,t){r?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},_=function(e,t,n){e.addEventListener(t,n)},w=function(e,t,n){e.removeEventListener(t,n)},E=function(e,t,n){w(e,"load",t),w(e,"loadeddata",t),w(e,"error",n)},x=function(e,t,n){var r=n._settings,s=t?r.class_loaded:r.class_error,i=t?r.callback_loaded:r.callback_error,a=e.target;y(a,r.class_loading),b(a,s),p(i,a,n),m(n,-1)},S=["IMG","IFRAME","VIDEO"],z=function(e,t){var n=t._observer;T(e,t),n&&t._settings.auto_unobserve&&n.unobserve(e)},C=function(e){var t=d(e);t&&(clearTimeout(t),f(e,null))},T=function(e,t,n){var r=t._settings;!n&&l(e)||(S.indexOf(e.tagName)>-1&&(function(e,t){var n=function n(s){x(s,!0,t),E(e,n,r)},r=function r(s){x(s,!1,t),E(e,n,r)};!function(e,t,n){_(e,"load",t),_(e,"loadeddata",t),_(e,"error",n)}(e,n,r)}(e,t),b(e,r.class_loading)),function(e,t){var n,r,s=t._settings,i=e.tagName,c=v[i];if(c)return c(e,s),m(t,1),void(t._elements=(n=t._elements,r=e,n.filter((function(e){return e!==r}))));!function(e,t){var n=a(e,t.data_src),r=a(e,t.data_bg);n&&(e.style.backgroundImage='url("'.concat(n,'")')),r&&(e.style.backgroundImage=r)}(e,s)}(e,t),function(e){c(e,"was-processed","true")}(e),p(r.callback_reveal,e,t),p(r.callback_set,e,t))},I=function(e){return!!n&&(e._observer=new IntersectionObserver((function(t){t.forEach((function(t){return function(e){return e.isIntersecting||e.intersectionRatio>0}(t)?function(e,t,n){var r=n._settings;p(r.callback_enter,e,t,n),r.load_delay?function(e,t){var n=t._settings.load_delay,r=d(e);r||(r=setTimeout((function(){z(e,t),C(e)}),n),f(e,r))}(e,n):z(e,n)}(t.target,t,e):function(e,t,n){var r=n._settings;p(r.callback_exit,e,t,n),r.load_delay&&C(e)}(t.target,t,e)}))}),{root:(t=e._settings).container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}),!0);var t},L=["IMG","IFRAME"],R=function(e,t){return function(e){return e.filter((function(e){return!l(e)}))}((n=e||function(e){return e.container.querySelectorAll(e.elements_selector)}(t),Array.prototype.slice.call(n)));var n},k=function(t,n){var r;this._settings=function(e){return u({},s,e)}(t),this._loadingCount=0,I(this),this.update(n),r=this,e&&window.addEventListener("online",(function(e){!function(e){var t=e._settings;o(t.container.querySelectorAll("."+t.class_error)).forEach((function(e){y(e,t.class_error),function(e){c(e,"was-processed",null)}(e)})),e.update()}(r)}))};return k.prototype={update:function(e){var n,r=this,s=this._settings;this._elements=R(e,s),!t&&this._observer?(function(e){return e.use_native&&"loading"in HTMLImageElement.prototype}(s)&&((n=this)._elements.forEach((function(e){-1!==L.indexOf(e.tagName)&&(e.setAttribute("loading","lazy"),T(e,n))})),this._elements=R(e,s)),this._elements.forEach((function(e){r._observer.observe(e)}))):this.loadAll()},destroy:function(){var e=this;this._observer&&(this._elements.forEach((function(t){e._observer.unobserve(t)})),this._observer=null),this._elements=null,this._settings=null},load:function(e,t){T(e,this,t)},loadAll:function(){var e=this;this._elements.forEach((function(t){z(t,e)}))}},e&&function(e,t){if(t)if(t.length)for(var n,r=0;n=t[r];r+=1)i(e,n);else i(e,t)}(k,window.lazyLoadOptions),k},"object"===l(t)?e.exports=i():void 0===(s="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=s),a=window,c=navigator.userAgent,a.HTMLPictureElement&&/ecko/.test(c)&&c.match(/rv\:(\d+)/)&&RegExp.$1<45&&addEventListener("resize",function(){var e,t=document.createElement("source"),n=function(e){var n,r,s=e.parentNode;"PICTURE"===s.nodeName.toUpperCase()?(n=t.cloneNode(),s.insertBefore(n,s.firstElementChild),setTimeout((function(){s.removeChild(n)}))):(!e._pfLastSize||e.offsetWidth>e._pfLastSize)&&(e._pfLastSize=e.offsetWidth,r=e.sizes,e.sizes+=",100vw",setTimeout((function(){e.sizes=r})))},r=function(){var e,t=document.querySelectorAll("picture > img, img[srcset][sizes]");for(e=0;e<t.length;e++)n(t[e])},s=function(){clearTimeout(e),e=setTimeout(r,99)},i=a.matchMedia&&matchMedia("(orientation: landscape)"),c=function(){s(),i&&i.addListener&&i.addListener(s)};return t.srcset="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",/^[c|i]|d$/.test(document.readyState||"")?c():document.addEventListener("DOMContentLoaded",c),s}()),function(r,i,a){"use strict";function c(e){return" "===e||"\t"===e||"\n"===e||"\f"===e||"\r"===e}function o(e,t,n,r){var s,i,a;return"saveData"===x.algorithm?e>2.7?a=n+1:(i=(t-n)*(s=Math.pow(e-.6,1.5)),r&&(i+=.1*s),a=e+i):a=n>1?Math.sqrt(e*t):e,a>n}function u(e,t){return e.res-t.res}function l(e,t,n){var r;return!n&&t&&(n=(n=e[h.ns].sets)&&n[n.length-1]),(r=f(t,n))&&(t=h.makeUrl(t),e[h.ns].curSrc=t,e[h.ns].curCan=r,r.res||J(r,r.set.sizes)),r}function f(e,t){var n,r,s;if(e&&t)for(s=h.parseSet(t),e=h.makeUrl(e),n=0;n<s.length;n++)if(e===h.makeUrl(s[n].url)){r=s[n];break}return r}i.createElement("picture");var d,p,m,h={},g=!1,A=function(){},v=i.createElement("img"),b=v.getAttribute,y=v.setAttribute,_=v.removeAttribute,w=i.documentElement,E={},x={algorithm:""},S="data-pfsrc",z=S+"set",C=navigator.userAgent,T=/rident/.test(C)||/ecko/.test(C)&&C.match(/rv\:(\d+)/)&&RegExp.$1>35,I="currentSrc",L=/\s+\+?\d+(e\d+)?w/,R=/(\([^)]+\))?\s*(.+)/,k=r.picturefillCFG,M="font-size:100%!important;",P=!0,D={},O={},U=r.devicePixelRatio,$={px:1,in:96},B=i.createElement("a"),N=!1,j=/^[ \t\n\r\u000c]+/,G=/^[, \t\n\r\u000c]+/,W=/^[^ \t\n\r\u000c]+/,Q=/[,]+$/,F=/^\d+$/,H=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,q=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},V=function(e){var t={};return function(n){return n in t||(t[n]=e(n)),t[n]}},K=function(){var e=/^([\d\.]+)(em|vw|px)$/,t=V((function(e){return"return "+function(){for(var e=arguments,t=0,n=e[0];++t in e;)n=n.replace(e[t],e[++t]);return n}((e||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi,"")+";"}));return function(n,r){var s;if(!(n in D))if(D[n]=!1,r&&(s=n.match(e)))D[n]=s[1]*$[s[2]];else try{D[n]=new Function("e",t(n))($)}catch(e){}return D[n]}}(),J=function(e,t){return e.w?(e.cWidth=h.calcListLength(t||"100vw"),e.res=e.w/e.cWidth):e.res=e.d,e},X=function(e){if(g){var t,n,r,s=e||{};if(s.elements&&1===s.elements.nodeType&&("IMG"===s.elements.nodeName.toUpperCase()?s.elements=[s.elements]:(s.context=s.elements,s.elements=null)),r=(t=s.elements||h.qsa(s.context||i,s.reevaluate||s.reselect?h.sel:h.selShort)).length){for(h.setupRun(s),N=!0,n=0;r>n;n++)h.fillImg(t[n],s);h.teardownRun(s)}}};r.console&&console.warn,I in v||(I="src"),E["image/jpeg"]=!0,E["image/gif"]=!0,E["image/png"]=!0,E["image/svg+xml"]=i.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"),h.ns=("pf"+(new Date).getTime()).substr(0,9),h.supSrcset="srcset"in v,h.supSizes="sizes"in v,h.supPicture=!!r.HTMLPictureElement,h.supSrcset&&h.supPicture&&!h.supSizes&&function(e){v.srcset="data:,a",e.src="data:,a",h.supSrcset=v.complete===e.complete,h.supPicture=h.supSrcset&&h.supPicture}(i.createElement("img")),h.supSrcset&&!h.supSizes?function(){var e="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",t=i.createElement("img"),n=function(){2===t.width&&(h.supSizes=!0),p=h.supSrcset&&!h.supSizes,g=!0,setTimeout(X)};t.onload=n,t.onerror=n,t.setAttribute("sizes","9px"),t.srcset=e+" 1w,data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw== 9w",t.src=e}():g=!0,h.selShort="picture>img,img[srcset]",h.sel=h.selShort,h.cfg=x,h.DPR=U||1,h.u=$,h.types=E,h.setSize=A,h.makeUrl=V((function(e){return B.href=e,B.href})),h.qsa=function(e,t){return"querySelector"in e?e.querySelectorAll(t):[]},h.matchesMedia=function(){return r.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?h.matchesMedia=function(e){return!e||matchMedia(e).matches}:h.matchesMedia=h.mMQ,h.matchesMedia.apply(this,arguments)},h.mMQ=function(e){return!e||K(e)},h.calcLength=function(e){var t=K(e,!0)||!1;return 0>t&&(t=!1),t},h.supportsType=function(e){return!e||E[e]},h.parseSize=V((function(e){var t=(e||"").match(R);return{media:t&&t[1],length:t&&t[2]}})),h.parseSet=function(e){return e.cands||(e.cands=function(e,t){function n(t){var n,r=t.exec(e.substring(d));return r?(n=r[0],d+=n.length,n):void 0}function r(){var e,n,r,s,c,o,u,l,f,d=!1,m={};for(s=0;s<a.length;s++)o=(c=a[s])[c.length-1],u=c.substring(0,c.length-1),l=parseInt(u,10),f=parseFloat(u),F.test(u)&&"w"===o?((e||n)&&(d=!0),0===l?d=!0:e=l):H.test(u)&&"x"===o?((e||n||r)&&(d=!0),0>f?d=!0:n=f):F.test(u)&&"h"===o?((r||n)&&(d=!0),0===l?d=!0:r=l):d=!0;d||(m.url=i,e&&(m.w=e),n&&(m.d=n),r&&(m.h=r),r||n||e||(m.d=1),1===m.d&&(t.has1x=!0),m.set=t,p.push(m))}function s(){for(n(j),o="",u="in descriptor";;){if(l=e.charAt(d),"in descriptor"===u)if(c(l))o&&(a.push(o),o="",u="after descriptor");else{if(","===l)return d+=1,o&&a.push(o),void r();if("("===l)o+=l,u="in parens";else{if(""===l)return o&&a.push(o),void r();o+=l}}else if("in parens"===u)if(")"===l)o+=l,u="in descriptor";else{if(""===l)return a.push(o),void r();o+=l}else if("after descriptor"===u)if(c(l));else{if(""===l)return void r();u="in descriptor",d-=1}d+=1}}for(var i,a,o,u,l,f=e.length,d=0,p=[];;){if(n(G),d>=f)return p;i=n(W),a=[],","===i.slice(-1)?(i=i.replace(Q,""),r()):s()}}(e.srcset,e)),e.cands},h.getEmValue=function(){var e;if(!d&&(e=i.body)){var t=i.createElement("div"),n=w.style.cssText,r=e.style.cssText;t.style.cssText="position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",w.style.cssText=M,e.style.cssText=M,e.appendChild(t),d=t.offsetWidth,e.removeChild(t),d=parseFloat(d,10),w.style.cssText=n,e.style.cssText=r}return d||16},h.calcListLength=function(e){if(!(e in O)||x.uT){var t=h.calcLength(function(e){function t(e){return!!(u.test(e)&&parseFloat(e)>=0)||!!l.test(e)||"0"===e||"-0"===e||"+0"===e}var n,r,s,i,a,o,u=/^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,l=/^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i;for(r=function(e){function t(){s&&(i.push(s),s="")}function n(){i[0]&&(a.push(i),i=[])}for(var r,s="",i=[],a=[],o=0,u=0,l=!1;;){if(""===(r=e.charAt(u)))return t(),n(),a;if(l){if("*"===r&&"/"===e[u+1]){l=!1,u+=2,t();continue}u+=1}else{if(c(r)){if(e.charAt(u-1)&&c(e.charAt(u-1))||!s){u+=1;continue}if(0===o){t(),u+=1;continue}r=" "}else if("("===r)o+=1;else if(")"===r)o-=1;else{if(","===r){t(),n(),u+=1;continue}if("/"===r&&"*"===e.charAt(u+1)){l=!0,u+=2;continue}}s+=r,u+=1}}}(e),s=r.length,n=0;s>n;n++)if(t(a=(i=r[n])[i.length-1])){if(o=a,i.pop(),0===i.length)return o;if(i=i.join(" "),h.matchesMedia(i))return o}return"100vw"}(e));O[e]=t||$.width}return O[e]},h.setRes=function(e){var t;if(e)for(var n=0,r=(t=h.parseSet(e)).length;r>n;n++)J(t[n],e.sizes);return t},h.setRes.res=J,h.applySetCandidate=function(e,t){if(e.length){var n,r,s,i,a,c,f,d,p,m=t[h.ns],g=h.DPR;if(c=m.curSrc||t[I],(f=m.curCan||l(t,c,e[0].set))&&f.set===e[0].set&&((p=T&&!t.complete&&f.res-.1>g)||(f.cached=!0,f.res>=g&&(a=f))),!a)for(e.sort(u),a=e[(i=e.length)-1],r=0;i>r;r++)if((n=e[r]).res>=g){a=e[s=r-1]&&(p||c!==h.makeUrl(n.url))&&o(e[s].res,n.res,g,e[s].cached)?e[s]:n;break}a&&(d=h.makeUrl(a.url),m.curSrc=d,m.curCan=a,d!==c&&h.setSrc(t,a),h.setSize(t))}},h.setSrc=function(e,t){var n;e.src=t.url,"image/svg+xml"===t.set.type&&(n=e.style.width,e.style.width=e.offsetWidth+1+"px",e.offsetWidth+1&&(e.style.width=n))},h.getSet=function(e){var t,n,r,s=!1,i=e[h.ns].sets;for(t=0;t<i.length&&!s;t++)if((n=i[t]).srcset&&h.matchesMedia(n.media)&&(r=h.supportsType(n.type))){"pending"===r&&(n=r),s=n;break}return s},h.parseSets=function(e,t,n){var r,s,i,c,o=t&&"PICTURE"===t.nodeName.toUpperCase(),u=e[h.ns];(u.src===a||n.src)&&(u.src=b.call(e,"src"),u.src?y.call(e,S,u.src):_.call(e,S)),(u.srcset===a||n.srcset||!h.supSrcset||e.srcset)&&(r=b.call(e,"srcset"),u.srcset=r,c=!0),u.sets=[],o&&(u.pic=!0,function(e,t){var n,r,s,i,a=e.getElementsByTagName("source");for(n=0,r=a.length;r>n;n++)(s=a[n])[h.ns]=!0,(i=s.getAttribute("srcset"))&&t.push({srcset:i,media:s.getAttribute("media"),type:s.getAttribute("type"),sizes:s.getAttribute("sizes")})}(t,u.sets)),u.srcset?(s={srcset:u.srcset,sizes:b.call(e,"sizes")},u.sets.push(s),(i=(p||u.src)&&L.test(u.srcset||""))||!u.src||f(u.src,s)||s.has1x||(s.srcset+=", "+u.src,s.cands.push({url:u.src,d:1,set:s}))):u.src&&u.sets.push({srcset:u.src,sizes:null}),u.curCan=null,u.curSrc=a,u.supported=!(o||s&&!h.supSrcset||i&&!h.supSizes),c&&h.supSrcset&&!u.supported&&(r?(y.call(e,z,r),e.srcset=""):_.call(e,z)),u.supported&&!u.srcset&&(!u.src&&e.src||e.src!==h.makeUrl(u.src))&&(null===u.src?e.removeAttribute("src"):e.src=u.src),u.parsed=!0},h.fillImg=function(e,t){var n,r=t.reselect||t.reevaluate;e[h.ns]||(e[h.ns]={}),n=e[h.ns],(r||n.evaled!==m)&&((!n.parsed||t.reevaluate)&&h.parseSets(e,e.parentNode,t),n.supported?n.evaled=m:function(e){var t,n=h.getSet(e),r=!1;"pending"!==n&&(r=m,n&&(t=h.setRes(n),h.applySetCandidate(t,e))),e[h.ns].evaled=r}(e))},h.setupRun=function(){(!N||P||U!==r.devicePixelRatio)&&(P=!1,U=r.devicePixelRatio,D={},O={},h.DPR=U||1,$.width=Math.max(r.innerWidth||0,w.clientWidth),$.height=Math.max(r.innerHeight||0,w.clientHeight),$.vw=$.width/100,$.vh=$.height/100,m=[$.height,$.width,U].join("-"),$.em=h.getEmValue(),$.rem=$.em)},h.supPicture?(X=A,h.fillImg=A):function(){var e,t=r.attachEvent?/d$|^c/:/d$|^c|^i/,n=function(){var r=i.readyState||"";s=setTimeout(n,"loading"===r?200:999),i.body&&(h.fillImgs(),(e=e||t.test(r))&&clearTimeout(s))},s=setTimeout(n,i.body?9:99),a=w.clientHeight;q(r,"resize",function(e,t){var n,r,s=function(){var i=new Date-r;t>i?n=setTimeout(s,t-i):(n=null,e())};return function(){r=new Date,n||(n=setTimeout(s,t))}}((function(){P=Math.max(r.innerWidth||0,w.clientWidth)!==$.width||w.clientHeight!==a,a=w.clientHeight,P&&h.fillImgs()}),99)),q(i,"readystatechange",n)}(),h.picturefill=X,h.fillImgs=X,h.teardownRun=A,X._=h,r.picturefillCFG={pf:h,push:function(e){var t=e.shift();"function"==typeof h[t]?h[t].apply(h,e):(x[t]=e[0],N&&h.fillImgs({reselect:!0}))}};for(;k&&k.length;)r.picturefillCFG.push(k.shift());r.picturefill=X,"object"==typeof e.exports?e.exports=X:void 0!==(s=function(){return X}.call(t,n,t,e))&&(e.exports=s),h.supPicture||(E["image/webp"]=function(e,t){var n=new r.Image;return n.onerror=function(){E[e]=!1,X()},n.onload=function(){E[e]=1===n.width,X()},n.src=t,"pending"}("image/webp","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA=="))}(window,document)}},t={},n=function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(883),n;var e,t,n}));var tocplus={"visibility_show":"show","visibility_hide":"hide","width":"Auto"};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(t){function e(t){return t.replace(/(:|\.|\/)/g,"\\$1")}var o="1.6.0",i={},l={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},s=function(e){var o=[],i=!1,l=e.dir&&"left"===e.dir?"scrollLeft":"scrollTop";return this.each(function(){var e=t(this);return this!==document&&this!==window?!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(e[l]()>0?o.push(this):(e[l](1),i=e[l]()>0,i&&o.push(this),e[l](0))):(o.push(document.scrollingElement),!1):void 0}),o.length||this.each(function(){"BODY"===this.nodeName&&(o=[this])}),"first"===e.el&&o.length>1&&(o=[o[0]]),o};t.fn.extend({scrollable:function(t){var e=s.call(this,{dir:t});return this.pushStack(e)},firstScrollable:function(t){var e=s.call(this,{el:"first",dir:t});return this.pushStack(e)},smoothScroll:function(o,i){if(o=o||{},"options"===o)return i?this.each(function(){var e=t(this),o=t.extend(e.data("ssOpts")||{},i);t(this).data("ssOpts",o)}):this.first().data("ssOpts");var l=t.extend({},t.fn.smoothScroll.defaults,o),s=function(o){var i=this,s=t(this),n=t.extend({},l,s.data("ssOpts")||{}),c=l.exclude,a=n.excludeWithin,r=0,h=0,u=!0,d={},p=t.smoothScroll.filterPath(location.pathname),f=t.smoothScroll.filterPath(i.pathname),m=location.hostname===i.hostname||!i.hostname,g=n.scrollTarget||f===p,v=e(i.hash);if(n.scrollTarget||m&&g&&v){for(;u&&r<c.length;)s.is(e(c[r++]))&&(u=!1);for(;u&&h<a.length;)s.closest(a[h++]).length&&(u=!1)}else u=!1;u&&(n.preventDefault&&o.preventDefault(),t.extend(d,n,{scrollTarget:n.scrollTarget||v,link:i}),t.smoothScroll(d))};return null!==o.delegateSelector?this.undelegate(o.delegateSelector,"click.smoothscroll").delegate(o.delegateSelector,"click.smoothscroll",s):this.unbind("click.smoothscroll").bind("click.smoothscroll",s),this}}),t.smoothScroll=function(e,o){if("options"===e&&"object"==typeof o)return t.extend(i,o);var l,s,n,c,a,r=0,h="offset",u="scrollTop",d={},p={};"number"==typeof e?(l=t.extend({link:null},t.fn.smoothScroll.defaults,i),n=e):(l=t.extend({link:null},t.fn.smoothScroll.defaults,e||{},i),l.scrollElement&&(h="position","static"===l.scrollElement.css("position")&&l.scrollElement.css("position","relative"))),u="left"===l.direction?"scrollLeft":u,l.scrollElement?(s=l.scrollElement,/^(?:HTML|BODY)$/.test(s[0].nodeName)||(r=s[u]())):s=t("html, body").firstScrollable(l.direction),l.beforeScroll.call(s,l),n="number"==typeof e?e:o||t(l.scrollTarget)[h]()&&t(l.scrollTarget)[h]()[l.direction]||0,d[u]=n+r+l.offset,c=l.speed,"auto"===c&&(a=Math.abs(d[u]-s[u]()),c=a/l.autoCoefficient),p={duration:c,easing:l.easing,complete:function(){l.afterScroll.call(l.link,l)}},l.step&&(p.step=l.step),s.length?s.stop().animate(d,p):l.afterScroll.call(l.link,l)},t.smoothScroll.version=o,t.smoothScroll.filterPath=function(t){return t=t||"",t.replace(/^\//,"").replace(/(?:index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},t.fn.smoothScroll.defaults=l}),jQuery.cookie=function(t,e,o){if(arguments.length>1&&"[object Object]"!==String(e)){if(o=jQuery.extend({},o),(null===e||void 0===e)&&(o.expires=-1),"number"==typeof o.expires){var i=o.expires,l=o.expires=new Date;l.setDate(l.getDate()+i)}return e=String(e),document.cookie=[encodeURIComponent(t),"=",o.raw?e:encodeURIComponent(e),o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")}o=e||{};var s,n=o.raw?function(t){return t}:decodeURIComponent;return(s=new RegExp("(?:^|; )"+encodeURIComponent(t)+"=([^;]*)").exec(document.cookie))?n(s[1]):null},jQuery(document).ready(function(t){if("undefined"!=typeof tocplus){if(t.fn.shrinkTOCWidth=function(){t(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&t(this).css("width","")},1==tocplus.smooth_scroll){var e=hostname=pathname=qs=hash=null;t("body a").click(function(){if(hostname=t(this).prop("hostname"),pathname=t(this).prop("pathname"),qs=t(this).prop("search"),hash=t(this).prop("hash"),pathname.length>0&&"/"!=pathname.charAt(0)&&(pathname="/"+pathname),window.location.hostname==hostname&&window.location.pathname==pathname&&window.location.search==qs&&""!==hash){var o=hash.replace(/([ !"$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g,"\\$1");t(o).length>0?e=hash:(anchor=hash,anchor=anchor.replace("#",""),e='a[name="'+anchor+'"]',0==t(e).length&&(e="")),offset="undefined"!=typeof tocplus.smooth_scroll_offset?-1*tocplus.smooth_scroll_offset:t("#wpadminbar").length>0&&t("#wpadminbar").is(":visible")?-30:0,e&&t.smoothScroll({scrollTarget:e,offset:offset})}})}if("undefined"!=typeof tocplus.visibility_show){var o="undefined"!=typeof tocplus.visibility_hide_by_default?!0:!1;if(t.cookie)var i=t.cookie("tocplus_hidetoc")?tocplus.visibility_show:tocplus.visibility_hide;else var i=tocplus.visibility_hide;o&&(i=i==tocplus.visibility_hide?tocplus.visibility_show:tocplus.visibility_hide),t("#toc_container p.toc_title").append(' <span class="toc_toggle"><span class="toc_brackets">[</span><a href="#">'+i+'</a><span class="toc_brackets">]</span></span>'),i==tocplus.visibility_show&&(t("ul.toc_list").hide(),t("#toc_container").addClass("contracted").shrinkTOCWidth()),t("span.toc_toggle a").click(function(e){switch(e.preventDefault(),t(this).html()){case t("<div/>").html(tocplus.visibility_hide).text():t(this).html(tocplus.visibility_show),t.cookie&&(o?t.cookie("tocplus_hidetoc",null,{path:"/"}):t.cookie("tocplus_hidetoc","1",{expires:30,path:"/"})),t("ul.toc_list").hide("fast"),t("#toc_container").addClass("contracted").shrinkTOCWidth();break;case t("<div/>").html(tocplus.visibility_show).text():default:t(this).html(tocplus.visibility_hide),t.cookie&&(o?t.cookie("tocplus_hidetoc","1",{expires:30,path:"/"}):t.cookie("tocplus_hidetoc",null,{path:"/"})),t("#toc_container").css("width",tocplus.width).removeClass("contracted"),t("ul.toc_list").show("fast")}})}}});function lazyLoadThumb(e,alt,l){var t='<img data-lazy-src="https://i.ytimg.com/vi/ID/hqdefault.jpg" alt="" width="480" height="360"><noscript><img src="https://i.ytimg.com/vi/ID/hqdefault.jpg" alt="" width="480" height="360"></noscript>',a='<button class="play" aria-label="play Youtube video"></button>';if(l){t=t.replace('data-lazy-','');t=t.replace('loading="lazy"','');t=t.replace(/<noscript>.*?<\/noscript>/g,'')}t=t.replace('alt=""','alt="'+alt+'"');return t.replace("ID",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement("iframe"),t="ID?autoplay=1";t+=0===this.parentNode.dataset.query.length?"":"&"+this.parentNode.dataset.query;e.setAttribute("src",t.replace("ID",this.parentNode.dataset.src)),e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen","1"),e.setAttribute("allow","accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"),this.parentNode.parentNode.replaceChild(e,this.parentNode)}document.addEventListener("DOMContentLoaded",function(){var exclusions=[];var e,t,p,u,l,a=document.getElementsByClassName("rll-youtube-player");for(t=0;t<a.length;t++)(e=document.createElement("div")),(u='https://i.ytimg.com/vi/ID/hqdefault.jpg'),(u=u.replace('ID',a[t].dataset.id)),(l=exclusions.some(exclusion=>u.includes(exclusion))),e.setAttribute("data-id",a[t].dataset.id),e.setAttribute("data-query",a[t].dataset.query),e.setAttribute("data-src",a[t].dataset.src),(e.innerHTML=lazyLoadThumb(a[t].dataset.id,a[t].dataset.alt,l)),a[t].appendChild(e),(p=e.querySelector(".play")),(p.onclick=lazyLoadYoutubeIframe)});;(()=>{var g=class{static isNotValidScreensize(e,i){const t=window.innerWidth||document.documentElement.clientWidth,c=window.innerHeight||document.documentElement.clientHeight,n=e&&(t>i.width||c>i.height),s=!e&&(t<i.width||c<i.height);return n||s}static isPageCached(){const e=document.documentElement.nextSibling&&document.documentElement.nextSibling.data?document.documentElement.nextSibling.data:"";return e&&e.includes("Debug: cached")}static isIntersecting(e){return e.bottom>=0&&e.right>=0&&e.top<=(window.innerHeight||document.documentElement.clientHeight)&&e.left<=(window.innerWidth||document.documentElement.clientWidth)}},a=g,u=class{constructor(e,i){this.config=e,this.performanceImages=[],this.logger=i}async run(){try{const e=this._generateLcpCandidates(1/0);e&&(this._initWithFirstElementWithInfo(e),this._fillATFWithoutDuplications(e))}catch(e){this.errorCode="script_error",this.logger.logMessage("Script Error: "+e)}}_generateLcpCandidates(e){const i=document.querySelectorAll(this.config.elements);return i.length<=0?[]:Array.from(i).map(n=>{if(n.nodeName.toLowerCase()==="img"&&n.parentElement.nodeName.toLowerCase()==="picture")return null;let s;if(n.nodeName.toLowerCase()==="picture"){const o=n.querySelector("img");if(o)s=o.getBoundingClientRect();else return null}else s=n.getBoundingClientRect();return{element:n,rect:s}}).filter(n=>n!==null).filter(n=>n.rect.width>0&&n.rect.height>0&&a.isIntersecting(n.rect)).map(n=>({item:n,area:this._getElementArea(n.rect),elementInfo:this._getElementInfo(n.element)})).sort((n,s)=>s.area-n.area).slice(0,e).map(n=>({element:n.item.element,elementInfo:n.elementInfo}))}_getElementArea(e){const i=Math.min(e.width,(window.innerWidth||document.documentElement.clientWidth)-e.left),t=Math.min(e.height,(window.innerHeight||document.documentElement.clientHeight)-e.top);return i*t}_getElementInfo(e){const i=e.nodeName.toLowerCase(),t={type:"",src:"",srcset:"",sizes:"",sources:[],bg_set:[],current_src:""},c=/url\(\s*?['"]?\s*?(.+?)\s*?["']?\s*?\)/ig;if(i==="img"&&e.srcset)t.type="img-srcset",t.src=e.src,t.srcset=e.srcset,t.sizes=e.sizes,t.current_src=e.currentSrc;else if(i==="img")t.type="img",t.src=e.src,t.current_src=e.currentSrc;else if(i==="video"){t.type="img";const n=e.querySelector("source");t.src=e.poster||(n?n.src:""),t.current_src=t.src}else if(i==="svg"){const n=e.querySelector("image");n&&(t.type="img",t.src=n.getAttribute("href")||"",t.current_src=t.src)}else if(i==="picture"){t.type="picture";const n=e.querySelector("img");t.src=n?n.src:"",t.sources=Array.from(e.querySelectorAll("source")).map(s=>({srcset:s.srcset||"",media:s.media||"",type:s.type||"",sizes:s.sizes||""}))}else{const s=[window.getComputedStyle(e,null).getPropertyValue("background-image"),getComputedStyle(e,":after").getPropertyValue("background-image"),getComputedStyle(e,":before").getPropertyValue("background-image")].filter(r=>r!=="none");if(s.length===0)return null;const o=s[0];if(t.type="bg-img",o.includes("image-set(")&&(t.type="bg-img-set"),!o||o===""||o.includes("data:image"))return null;const l=[...o.matchAll(c)];t.bg_set=l.map(r=>r[1]?{src:r[1].trim()+(r[2]?" "+r[2].trim():"")}:{}),t.bg_set.every(r=>r.src==="")&&(t.bg_set=l.map(r=>r[1]?{src:r[1].trim()}:{})),t.bg_set.length>0&&(t.src=t.bg_set[0].src,t.type==="bg-img-set"&&(t.src=t.bg_set))}return t}_initWithFirstElementWithInfo(e){const i=e.find(t=>t.elementInfo!==null);if(!i){this.logger.logMessage("No LCP candidate found."),this.performanceImages=[];return}this.performanceImages=[{...i.elementInfo,label:"lcp"}]}_fillATFWithoutDuplications(e){e.forEach(({element:i,elementInfo:t})=>{this._isDuplicateImage(i)||!t||this.performanceImages.push({...t,label:"above-the-fold"})})}_isDuplicateImage(e){const i=this._getElementInfo(e);if(i===null)return!1;const t=i.type==="img"||i.type==="img-srcset"||i.type==="video",c=i.type==="bg-img"||i.type==="bg-img-set"||i.type==="picture";return(t||c)&&this.performanceImages.some(n=>n.src===i.src)}getResults(){return this.performanceImages}},d=u,h=class{constructor(e){this.enabled=e}logMessage(e){this.enabled&&console.log(e)}},m=h,p=class{constructor(e){this.config=e,this.lcpBeacon=null,this.infiniteLoopId=null,this.errorCode="",this.logger=new m(this.config.debug)}async init(){if(this.scriptTimer=new Date,!await this._isValidPreconditions()){this._finalize();return}this.infiniteLoopId=setTimeout(()=>{this._handleInfiniteLoop()},1e4);const e=await this._getGeneratedBefore();let i=!1;this.config.status.atf&&e===!1?(this.lcpBeacon=new d(this.config,this.logger),await this.lcpBeacon.run(),i=!0):this.logger.logMessage("Not running BeaconLcp because data is already available"),i?this._saveFinalResultIntoDB():(this.logger.logMessage("Not saving results into DB as no beacon features ran."),this._finalize())}async _isValidPreconditions(){const e={width:this.config.width_threshold,height:this.config.height_threshold};return a.isNotValidScreensize(this.config.is_mobile,e)?(this.logger.logMessage("Bailing out because screen size is not acceptable"),!1):!0}async _getGeneratedBefore(){if(!a.isPageCached())return!1;let e=new FormData;return e.append("action","rocket_check_beacon"),e.append("rocket_beacon_nonce",this.config.nonce),e.append("url",this.config.url),e.append("is_mobile",this.config.is_mobile),(await fetch(this.config.ajax_url,{method:"POST",credentials:"same-origin",body:e}).then(t=>t.json())).success}_saveFinalResultIntoDB(){const e={lcp:this.lcpBeacon?this.lcpBeacon.getResults():null},i=new FormData;i.append("action","rocket_beacon"),i.append("rocket_beacon_nonce",this.config.nonce),i.append("url",this.config.url),i.append("is_mobile",this.config.is_mobile),i.append("status",this._getFinalStatus()),i.append("results",JSON.stringify(e)),fetch(this.config.ajax_url,{method:"POST",credentials:"same-origin",body:i,headers:{"wpr-saas-no-intercept":!0}}).then(t=>t.json()).then(t=>{this.logger.logMessage(t)}).catch(t=>{this.logger.logMessage(t)}).finally(()=>{this._finalize()})}_getFinalStatus(){return this.errorCode!==""?this.errorCode:10<=(new Date-this.scriptTimer)/1e3?"timeout":"success"}_handleInfiniteLoop(){this._saveFinalResultIntoDB()}_finalize(){document.querySelector('[data-name="wpr-wpr-beacon"]').setAttribute("beacon-completed","true"),clearTimeout(this.infiniteLoopId)}},f=p;(e=>{if(!e)return;const i=new f(e);if(document.readyState!=="loading"){setTimeout(()=>{i.init()},e.delay);return}document.addEventListener("DOMContentLoaded",()=>{setTimeout(()=>{i.init()},e.delay)})})(window.rocket_beacon_data)})()