Get the Best IPTV Service
((l,k)=>{XF.InlineMod=XF.Element.newHandler({options:{type:null,href:null,searchTarget:null,cookieBase:"inlinemod",cookieSizeLimit:3072,toggle:"input[type=checkbox].js-inlineModToggle",toggleContainer:".js-inlineModContainer",containerClass:"is-mod-selected",actionTrigger:".js-inlineModTrigger",counter:".js-inlineModCounter",viewport:"body"},abortController:null,cookie:null,action:null,xhr:null,searchTarget:null,init(){if(this.options.type){this.options.href||console.error("No inline mod href specified"); var a=this.options.searchTarget;if("*"===a)var b=k;else a&&a.length?(b=XF.findRelativeIf(a,this.target),b||(console.error("Search target %s not found, falling back to children",a),b=this.target)):b=this.target;this.searchTarget=b;this.cookie=this.options.cookieBase+"_"+this.options.type;XF.onDelegated(b,"click",this.options.toggle,this.onToggle.bind(this));XF.onDelegated(b,"click",this.options.actionTrigger,this.onActionTrigger.bind(this));a=this.getCookieValue();this._initialLoad(a);this._updateCounter(a.length); setTimeout(()=>{XF.on(k,"xf:reinit",c=>{({element:c}=c);this.searchTarget.contains(c)&&c.querySelector(this.options.toggle)&&this.recalculateFromCookie()})},0)}else console.error("No inline mod type specified")},_initialLoad(a){var b=this.getToggles();Array.from(b).forEach(d=>{d.checked=!1});const c={};if(a.length){Array.from(b).forEach(e=>{c[e.value]=e});b=a.length;let d;for(let e=0;e{const e=d.checked,f=c[d.value]?!0:!1;e&&!f?(d.checked=!1,this.toggleContainer(d,!1)):!e&&f&&(d.checked=!0,this.toggleContainer(d,!0))})},deselect(){this.setCookieValue([]);this.recalculateFromCookie();this.hideBar()},selectAll(){let a=this.getCookieValue();Array.from(this.getToggles()).forEach(b=>{b=parseInt(b.value,10);if(!a.includes(b)){const c=this.getCookieValue(); a.push(b);if(XF.Cookie.getEncodedCookieValueSize(this.cookie,a.join(","))>this.options.cookieSizeLimit)return a=c,XF.flashMessage(XF.phrase("you_have_exceeded_maximum_number_of_selectable_items"),3E3),!1;this.setCookieValue(a)}});this.recalculateFromCookie();return a},deselectPage(){const a=this.getCookieValue(),b=[],c=[];Array.from(this.getToggles()).forEach(d=>{c.push(parseInt(d.value,10))});for(const d of a)c.includes(d)||b.push(d);this.setCookieValue(b);this.recalculateFromCookie();b.length?this.loadBar(): this.hideBar();return b},onToggle(a){a=a.target;const b=a.checked,c=this.getCookieValue(),d=this.toggleSelectedInCookie(a.value,b);d.length!==c.length?this.toggleContainer(a,b):a.checked=!1;d.length?this.loadBar():this.hideBar()},onActionTrigger(a){a.preventDefault();this.loadBar()},loadBar(a){this.loadTimeout&&clearTimeout(this.loadTimeout);this.loadTimeout=setTimeout(()=>{this.abortController&&(this.abortController.abort(),this.abortController=null);const {abortController:b}=XF.ajaxAbortable("GET", this.options.href,{type:this.options.type},c=>this._showBar(c,a));b&&(this.abortController=b)},10)},_showBar(a,b){this.abortController=null;a.html&&XF.setupHtmlInsert(a.html,(c,d,e)=>{d=!1;this.bar&&(d=!0,this.bar.remove(),this.bar=null);this._setupBar(c);this.bar=c;XF.bottomFix(c);if(XF.browser.ios){const f=XF.createElementFromString('
'),g=this.bar,h=g.querySelector(".js-inlineModAction");XF.on(f,"click",()=>h.blur());XF.on(h,"focus",()=>g.parentNode.insertBefore(f, g));XF.on(h,"blur",()=>f.remove())}d&&(c.style.transitionDuration="0s");XF.Transition.addClassTransitioned(c,"is-active");d&&setTimeout(()=>{c.style.transitionDuration=""},0);b&&b(c)})},_setupBar(a){XF.onDelegated(a,"click",'button[type="submit"]',this.submit.bind(this));XF.onDelegated(a,"click",".js-inlineModClose",this.hideBar.bind(this));XF.onDelegated(a,"click",".js-inlineModSelectAll",this.onSelectAllClick.bind(this));const b=Array.from(this.getToggles()),c=b.filter(d=>d.checked);b.length=== c.length&&(a.querySelector("input[type=checkbox].js-inlineModSelectAll").checked=!0)},onSelectAllClick(a){a.target.checked?this.selectAll().length?this.loadBar(b=>{b.querySelector("input[type=checkbox].js-inlineModSelectAll").checked=!0}):this.deselect():this.deselectPage()},submit(){if(this.bar){var a=this.bar.querySelector(".js-inlineModAction");a?(a=a.value)&&("deselect"==a?this.deselect():XF.ajax("POST",this.options.href,{type:this.options.type,action:a},b=>this._handleSubmitResponse(b),{skipDefaultSuccess:!0})): console.error("No action selector found.")}},_handleSubmitResponse(a){a.html?XF.setupHtmlInsert(a.html,(b,c)=>{b=XF.getOverlayHtml({html:b,title:c.h1||c.title});XF.showOverlay(b)}):"ok"==a.status&&a.redirect?a.message?XF.flashMessage(a.message,1E3,()=>XF.redirect(a.redirect)):XF.redirect(a.redirect):XF.alert("Unexpected response");this.hideBar()},hideBar(){this.bar&&XF.Transition.removeClassTransitioned(this.bar,"is-active",()=>{this.bar&&this.bar.remove();this.bar=null})},_updateCounter(a){const b= this.searchTarget.querySelector(this.options.actionTrigger);if(b){var c=b.querySelector(".inlineModButton");c||(c=b);c.classList.toggle("is-mod-active",0e&&(c.push(a),XF.Cookie.getEncodedCookieValueSize(this.cookie, c.join(","))>this.options.cookieSizeLimit?(c=d,f=!1,XF.flashMessage(XF.phrase("you_have_exceeded_maximum_number_of_selectable_items"),3E3)):f=!0):0<=e&&(c.splice(e,1),f=!0);return f?this.setCookieValue(c):c},getCookieValue(){var a=XF.Cookie.get(this.cookie);if(!a)return[];a=a.split(",");const b=a.length;for(let c=0;cb-c),XF.Cookie.set(this.cookie,a.join(","))):XF.Cookie.remove(this.cookie);this._updateCounter(a.length); return a}});XF.Element.register("inline-mod","XF.InlineMod")})(window,document); Flash Sale Popup