PageSourceSearch

https://www.livehindustan.com/lhfeed/lh/cdp/prod/sdk/echo-sdk.js

js livehindustan.com collected 2026-09-24 09:12:55 UTC 69,602 bytes, 2 lines download raw bytes

1(function(B,F){typeof exports=="object"&&typeof module<"u"?module.exports=F():typeof define=="function"&&define.amd?define(F):(B=typeof globalThis<"u"?globalThis:B||self,B["echo-sdk"]=B["echo-sdk"]||{},B["echo-sdk"].js=F())})(this,function(){"use strict";var Xo=Object.defineProperty;var Yo=(B,F,ee)=>F in B?Xo(B,F,{enumerable:!0,configurable:!0,writable:!0,value:ee}):B[F]=ee;var de=(B,F,ee)=>(Yo(B,typeof F!="symbol"?F+"":F,ee),ee);const B=e=>{const t=document.createElement("style");t.appendChild(document.createTextNode(e)),document.head.appendChild(t)},F=`*{padding:0;margin:0;list-style-type:none;outline:none;text-decoration:none}.echoSDK_topBanner a img{width:360px;height:90px;cursor:pointer}.echoSDK_inline a img{width:392px;height:55px;cursor:pointer}.echoSDK_shareBarRhs a img{width:95px;height:28px;cursor:pointer}.echoSDK_endOfArticle a img{width:392px;height:55px;cursor:pointer}.echoSDK_center_align{text-align:center}.echoSdk_signinBox_creativeUrl{width:100%;position:fixed;z-index:999;bottom:54px;left:0;line-height:0px;animation:slideUp .5s;display:flex;justify-content:center;align-items:center}.imageContainer{position:relative;display:inline-block}.echoSDK_multiPopup{position:fixed;z-index:999;bottom:54px}.echoSdk_signinBox_creativeUrl .echoSdk_closeBox,.echoSDK_multiPopup .echoSdk_closeBox{background:url(https://www.livemint.com/lm-img/cdp/prod/sdk/images/close_icon.svg) no-repeat 0 0;background-size:30px 30px;width:30px;height:30px;position:absolute;right:0;top:0}.LH_unlockSurprise{padding:16px 14px;background:linear-gradient(128.16deg,#fed5da 5.39%,#ffebc2 95.22%);border:1px solid #ffbec0;border-radius:16px;text-align:center;min-height:140px;position:relative;margin-bottom:20px}.LH_unlockSurprise h3{font-size:16px;line-height:19px;color:#0e0e0e;font-weight:800;padding-bottom:0}.LH_unlockSurprise h3 span{color:#a5091d;display:block}.LH_joined{display:flex;align-items:center;justify-content:center;margin-top:12px;min-height:24px}.LH_joined img{width:20px;height:20px;border-radius:50%;margin-right:-10px;border:1px solid #fff}.LH_joined span{margin-left:15px;font-size:12px;color:#777}.LH_revealButton{position:relative;overflow:hidden}.LH_revealButton{padding:12px 24px;width:300px;text-align:center;font-weight:500;font-size:16px;color:#fff;border:none;border-radius:8px;line-height:24px;background:linear-gradient(90deg,#c4132a 0%,#a0071b 100%);margin-top:18px;display:inline-flex;justify-content:center;box-sizing:border-box;gap:10px}.LH_revealButton:after{content:"";display:block;position:absolute;height:100%;top:0;background:rgba(255,255,255,.5);width:10px;left:30px;filter:blur(5px);-webkit-animation:shine-alt2 3s ease-in-out infinite;animation:shine-alt2 3s ease-in-out infinite}.LH_gifAnimation{display:block;margin:0 auto;width:100%;max-width:300px}.LH_gifAnimation img{width:auto;height:136px}.LH_unlockSurprise:after{position:absolute;content:"";bottom:-5px;left:0;right:0;margin:0 auto;height:5px;width:85%;background:#ffbec0;border-radius:0 0 5px 5px}.LH_exploreUser{padding:12px 9px;border-radius:8px;background:#f5f5f5}.LH_exploreUser a.LH_cursor-pointer{display:flex;color:#000;justify-content:flex-start;gap:10px;font-size:14px;line-height:17px;align-items:center}.LH_exploreUser img{width:25px}.LH_exploreUser i{display:block;height:7px;width:9px;border-style:solid;border-color:#a5091d;border-width:0px 2px 2px 0px;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg);margin-right:4px;margin-left:auto}.LH_surpriseCash h4{font-size:14px;font-weight:800;color:#0e0e0e}.LH_surpriseCash p{color:#616161;font-size:14px}.LH_offerBox{border-bottom:solid 5px #b8c7cd;background-color:#fff;border-radius:0 8px 8px 0;gap:12px;text-align:left;display:flex;justify-content:space-between;margin-top:12px;min-height:96px;position:relative}.LH_offerBox:before{content:"";position:absolute;width:8px;left:-8px;bottom:0;background-size:8.5px;height:100%}.LH_offerBrand{width:90px;background-color:#f5f5f5;flex-shrink:0;text-align:center;padding:5px 0;border-right:1px dashed #00000066}.LH_offerBrand img{max-width:80px;height:auto}.LH_offerTxt{padding:12px 0 16px;display:flex;flex-direction:column;justify-content:space-between;flex-grow:1;font-size:12px;font-weight:#e0e0e0;line-height:18px}.LH_offerTxt h5{font-weight:500;color:#0e0e0e;padding:0 10px 0 0;font-size:12px;margin:0}
1.LH_offerTxt a.LH_cursor-pointer{color:#a5091d;font-weight:500}.LH_unlockSurprise:after{position:absolute;content:"";bottom:-5px;left:0;right:0;margin:0 auto;height:5px;width:85%;background-color:#ffbec0;border-radius:0 0 5px 5px}.lh_echoSDK_gotAnimation{animation:echoSDK_gotAnimation .2s forwards 0s ease-in}.lh_echoSDK_gotPopup{border-radius:16px;padding:20px 24px 24px;font-size:16px;line-height:19px;color:#0b1c38;background:linear-gradient(128.16deg,#fed5da 5.39%,#ffebc2 95.22%);max-width:500px;margin:0 auto;position:fixed;left:16px;right:16px;z-index:21}.lh_echoSDK_handIcon{position:absolute;top:25px;right:0}.lh_echoSDK_gotPopup h3{font-size:22px;font-weight:700;line-height:24px;color:#0b1c38;margin-bottom:12px}.lh_echoSDK_gotPopup li{padding:0 0 7px;display:flex;align-items:center}.lh_echoSDK_gotPopup li img{width:19px!important;margin-right:10px}.lh_echoSDK_profile_arrow{width:190px;height:100%;background-size:contain;z-index:21;margin:30px 0;padding:0;position:fixed;left:38%;top:64%;background:url(https://images1.livehindustan.com/lh/cdp/staticImages/lh_bt_arrow.png) no-repeat}.lh_echoSDK_eg_profile_mb{background:url(https://www.hindustantimes.com/static-content/1y/ht/personalisation/bg_bottom.png) no-repeat;background-size:124px 124px;width:124px;height:124px;position:fixed;bottom:0;right:0;z-index:21}.lh_echoSDK_profile_inner{width:50px;height:50px;display:flex;flex-direction:column;justify-items:center;align-items:center;position:absolute;bottom:15px;right:15px}.lh_echoSDK_gotOverlay{background-color:#0b1c38a6;position:fixed;top:0;left:0;width:100%;height:100%;z-index:20}@keyframes echoSDK_gotAnimation{0%{bottom:0vh}to{bottom:320px}}.echoSDK_outerDiv{width:59px;height:56px}.echoSDK_mainDiv{width:59px;height:-webkit-fill-available;display:flex;justify-content:center;align-items:center;flex-direction:column;position:relative;padding-top:4px}.echoSDK_mainDiv.active:after{content:" ";position:absolute;top:0;left:50%;transform:translate(-50%);width:24px;height:4px;border-radius:0 0 8px 8px;background:linear-gradient(270deg,#73d3fe 0%,#12a2fe 100%)}.echoSDK_mainDiv a{color:#000;text-decoration:none;cursor:pointer}.echoSDK_iconName{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.echoSDK_iconName img{width:24px;height:24px;border-radius:50%}.echoSDK_iconText{color:#0b1c38;font-family:Lato;font-size:10px;font-style:normal;font-weight:500;line-height:150%}.slider-container{display:flex;overflow-x:scroll;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:auto;-ms-overflow-style:auto;margin:auto;gap:10px}.slide{scroll-snap-align:start;flex-shrink:0}.slider-container::-webkit-scrollbar{display:block;height:4px}.slider-container::-webkit-scrollbar-thumb{background:#888;border-radius:4px}.slider-container::-webkit-scrollbar-track{background:#f1f1f1}.echoSDK_styledClaimed{width:69px;height:20px;opacity:1;border-radius:48px;gap:4px;padding:2px 8px 2px 2px;background:#ffffff;border:1px solid #26770f2e;display:flex;position:absolute;top:8px;right:8px;z-index:2;align-items:center}.echoSDK_claimedIconDiv{width:16px;height:16px}.echoSDK_claimedTextDiv{width:39px;font-family:DM Sans;font-size:10px;text-align:center;vertical-align:middle}.echoSDK_carouselImage{height:99px;width:140px;border:1px solid #d7d7d7;border-radius:8px}
2`,ee={development:{API_BASE_URL:"https://cdpecho-qa.hindustantimes.com",PREVIEW_BASE_URL:"https://cdpecho-qa.hindustantimes.com",htfpCookie:"_ht_fp_dev"},production:{API_BASE_URL:"https://www.livehindustan.com/cdp",PREVIEW_BASE_URL:"https://www.livehindustan.com/preview",htfpCookie:"_ht_fp"}},qe=ee.production.API_BASE_URL,It=`${qe}/api/v4/user/benefit`,Dt=`${qe}/api/v4/benefit`,Et="https://sso.hindustantimes.com/vms/api/v1/users/benefit",Ht="https://sso.hindustantimes.com/vms/api/v1/promo/fulfillment",Rt="https://api.livehindustan.com/subscription/fetch/userinfo?usertoken=",Ot="https://sso.hindustantimes.com/vms/api/v1/users/vouchersByClientId",Ut="https://dap.livehindustan.com/ge",$t="https://www.livehindustan.com/lhfeed/lh/sso/prod/sdk/sso-sdk.js",Kt="https://www.hindustantimes.c
2om/static-content/1y/pf/prod/sdk/cir_sdk.js",Mt="https://images1.livehindustan.com/smart/sso/prod/onboarding/onboarding-sdk.js",Ge="https://images1.livehindustan.com/smart/sso/prod/vms/bottom-slider-sdk.js",ze={"SSO SDK":$t,crifSdk:Kt,"Onboarding SDK":Mt,VoucherSDK:Ge,voucherNonLoggedIn:Ge,autoLeadFormSdk:"https://images1.livehindustan.com/lh/htauto/lead-form-sdk/prod/lead-form-sdk.js",cmtLeadFormSdk:"https://images.hindustantimes.com/partnership/sdk/affiliate-lead-form-sdk.js"},Vt=e=>new Promise((t,o)=>{if(document.querySelector(`script[src="${e}"]`))return console.log(`SDK already loaded: ${e}`),t();const n=Object.assign(document.createElement("script"),{type:"text/javascript",src:e,async:!0,defer:!0,onload:()=>(console.log(`Loaded SDK: ${e}`),t()),onerror:i=>(console.error(`Failed SDK: ${e}`),o(i))});document.head.appendChild(n)}),Nt=e=>new Promise((t,o)=>{if(typeof require>"u")return o("RequireJS not available");const n=e.split("/").pop().replace(".js","");require.config({paths:{[n]:e.replace(".js","")}}),require.onError=i=>o(i),require([n],()=>(console.log(`RequireJS loaded: ${e}`),t()),i=>o(i))}),Bt=e=>Object.values(e||{}).flat().filter(Boolean).map(t=>{var o;return(t==null?void 0:t.ctaType)||((o=t==null?void 0:t.cta)==null?void 0:o.ctaType)}).filter(t=>ze[t]).map(t=>ze[t]).filter((t,o,n)=>n.indexOf(t)===o),Ft=async(e,t=!1)=>{if(!e||typeof e!="object")return console.log("Invalid response object");const o=Bt(e);console.log("SDKs to load:",o);for(const n of o){const i=t?Nt:Vt;try{await i(n)}catch(a){console.log(`Error loading ${n}:`,a)}}};class Pt{constructor(t){de(this,"data");de(this,"observers",[]);this.data=t}dispatch(t){this.data={...this.data,...t},this.observers.forEach(o=>{o(this.data)})}subscribe(t){this.observers.push(t),t(this.data)}get(t){return this.data[t]}}const b=new Pt({});function ne(e,t,o){var u,m,g,y,f,k,v,A,H,R,M,C,L,D,I,h,Z,G,J,U,K,P,j;const n=S("cdpecho_city"),i=S("echo_fp")||null,a=S("cdpecho_country"),r=(u=e[t])==null?void 0:u.creativeURL;let c=b.get("clientHints").model||"";const s=pt();let l={type:o,architecture:"SDK",campaign_name:(m=e[t])==null?void 0:m.campaign,objective:(g=e[t])==null?void 0:g.objective,property:b.get("property").toUpperCase()||"LH",platform:b.get("platform").toLowerCase()||"web",url:window.location.href,redirection_url:((y=e[t])==null?void 0:y.url2)||((f=e[t])==null?void 0:f.url),final_redirection_url:Se(((k=e[t])==null?void 0:k.url2)||((v=e[t])==null?void 0:v.url),e[t]),widget:((H=(A=e[t])==null?void 0:A.widget)==null?void 0:H.widgetFEName)||t,cohort:(R=e[t])==null?void 0:R.cohort,isLoggedin:(M=e[t])==null?void 0:M.isLoggedin,isSubscribed:(C=e[t])==null?void 0:C.isSubscribed,bucket:(L=e[t])==null?void 0:L.bucketNumber,section:b.get("section"),subsection:b.get("subsection"),campaignId:(D=e[t])==null?void 0:D.benefit_id,model:c,pageType:b.get("pageType"),bucketName:((I=e[t])==null?void 0:I.bucketName)??`Bucket ${(h=e[t])==null?void 0:h.bucketNumber}`,dealType:(Z=e[t])==null?void 0:Z.dealType,advertiser:(G=e[t])==null?void 0:G.advertiser,agency:(J=e[t])==null?void 0:J.agency,pricingType:(U=e[t])==null?void 0:U.pricingType,pricing:(K=e[t])==null?void 0:K.pricing,goal:(P=e[t])==null?void 0:P.goal,state:s==="<state>"?"":s,userSource:b.get("userSource"),enableRefresh:((j=e[t])==null?void 0:j.enableAdRefresh)==="true"?"Yes":"No"};return n&&(l.city=n),i&&(l.echo_fp=i),a&&(l.mp_country_code=a),r&&(l.creativeURL=r),Object.fromEntries(Object.entries(l).filter(([We,se])=>se!=null&&se!==""))}function re(e,t,o="all_Widgets",n,i,a=null){var l,p;const r=S("cdpecho_city"),c=S("cdpecho_country");try{var s={type:n,architecture:"SDK",event:e,cta_position:o,section:b.get("section")?b.get("section"):null,subsection:b.get("subsection")?b.get("subsection"):null,pageType:b.get("pageType")?b.get("pageType"):null,user_login_status:b.get("isLoggedin"),user_ID:S("_ht_clientid")||null,cohort_ID:t[o]?t[o].cohort:null,benefit_ID:t[o]?t[o].benefit_id:null,campaign_name:t[o].campaign||null,objective:t[o].objective,property:b.get("property").toUpperCase()||"LH",platform:b.get("platform").toLowerCase()||"web",url:window.location.href||null,redirection_url:t[o].url||null,widget:((p=(l=t[o])==null?void 0:l.widget)==null?void 0:p.widgetFEName)||o||null,isSubscribed:t[o].isSubscribed,bucket:t[o].bucketNumber,clickIdentifier:i||null,bucketName:t[o].bucketN
2ame?t[o].bucketName:`Bucket ${t[o].bucketNumber}`};r!=null&&(s.city=r),c!=null&&(s.mp_country_code=c),a!=null&&(s.refreshLevel=a)}catch(u){console.log("Error in GA4 Event: ",u)}window.dataLayer.push(s)}class jt{constructor(){de(this,"_our_document",null);de(this,"_our_node")}set document(t){this._our_document=t}get document(){const{_our_document:t}=this;return t??globalThis.document}set Node(t){this._our_node=t}get Node(){const{_our_node:t}=this;return t??globalThis.Node}useGlobalDocument(){this._our_document=null}useGlobalNode(){this._our_node=null}}const Je=new jt,Wt=["circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","line","linearGradient","marker","mask","metadata","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use","view"],qt="http://www.w3.org/2000/svg";let Qe=!1;function Gt(e){return Wt.includes(e)}function zt(e,t,...o){const{document:n,Node:i}=Je;Qe||(Qe=!0,console.warn("texsaur SVG support is experimental!"));const a=n.createElementNS(qt,e);let r;for(r of Object.keys(t)){r=r.toString();const c=t[r];a.setAttribute(r,c)}for(let c of o){if(Array.isArray(c)){a.append(...c);continue}c instanceof i?a.appendChild(c):a.append(c)}return a}function Jt(e,t,...o){const{document:n,Node:i}=Je;if(typeof e=="function")return e(t??{},o);if(Gt(e))return zt(e,t??{},...o);const a=n.createElement(e);let r=t??{},c;for(c of Object.keys(r)){const s=(p,u)=>console.warn(e,`received incorrect value type for property '${c}': expected `,typeof p,"instead of",typeof u);c=c.toString();const l=r[c];switch(c){case"style":{if(typeof l=="object")for(const[p,u]of Object.entries(l)){const m=p;typeof u=="string"&&(a.style[m]=u)}else{if(typeof l=="string")break;s("object | string",l)}continue}}if(/^on/.test(c)){typeof l=="function"?a.addEventListener(c.substring(2),r[c]):s("function",l);continue}try{const p=a;typeof p[c]>"u"?a.setAttribute(c,l):p[c]=l}catch(p){console.error(`Could not set ${c} on ${a.tagName}`,p),s(typeof a[c],l)}}for(let s of o.flat()){if(s instanceof i){a.appendChild(s);continue}if(typeof s!="string"&&(s!=null&&s[Symbol.iterator])){a.append(...s);continue}s&&a.append(s)}return a}function Qt(e,t){return t}const d=Jt;d.Fragment=Qt;async function Xe(){const e={isMobile:!1,brands:[],model:"",platform:"",platformVersion:"",uaFullVersion:""},t=navigator,o=r=>(r.match(/\b(iPad|iPhone|iPod)(?:\s+Simulator)?\b/)||[""])[0],n=r=>/\b(iPhone|iPad)\b/.test(r)?"iOS":"",i=r=>{const c=r.match(/\biPhone OS (\d+_\d+)/);return c?c[1].replace("_","."):""};function a(r){t.userAgent&&(r.model||(r.model=o(t.userAgent)),r.platform||(r.platform=n(t.userAgent)),r.platformVersion||(r.platformVersion=i(t.userAgent)))}try{if(typeof t.userAgentData<"u"){const{architecture:r,model:c,platform:s,platformVersion:l,uaFullVersion:p}=await t.userAgentData.getHighEntropyValues(["architecture","model","platform","platformVersion","uaFullVersion"]);return e.isMobile=t.userAgentData.mobile,e.brands=Xt(t.userAgentData.brands),e.architecture=r,e.model=c,e.platform=s,e.uaFullVersion=p,e.platformVersion=l,a(e),e}else return console.log("Client Hints API not supported"),a(e),e}catch(r){return console.log("Error in getUAClientHints:",r),e}}function Xt(e){return Array.isArray(e)?e:typeof e=="object"?Object.keys(e).map(t=>e[t]):[]}const Yt=async(e,t,o=null)=>{if(!e||!t){console.log("[Echo SDK] Missing required parameters for rerenderWidget: widgetType and targetElement");return}try{t.innerHTML="";const n=e,i={...Zt()};i[n]=t;let a=o;if(!a||!a[e])try{const r=await Xe();if(a=await ot(r),!a){console.log("[Echo SDK] No response from API when rerendering widget:",e);return}}catch(r){console.log("[Echo SDK] API call failed during rerender:",r);return}if(a[e]){const r={[e]:a[e]};await fe.render(i,r)}}catch(n){console.log("[Echo SDK] Error rerendering widget:",n)}};function Zt(){return["property","platform","language","isSubscribed","isLoggedin","pageType","section","subsection","contextualKeys","isPremium","isAffiliate","performanceType","userSource"].reduce((t,o)=>(t[o]=b.get(o),t),{})}const Ee=e=>e==null||e===""||typeof e=="string"&&e.trim()===""||isNaN(parseInt(e)),Ye=(e,t=!1)=>{const o=new Date;return t?(o.setHours(24,0,0,0),o.setTime(o.getTime()+24*60*60*1e3)):o.setTime(o.getTime()+e*60*60*1e3),"expires="+o.toUTCString()},Ze=(e,t)=>{let o=parseInt(S(e))||0;return o+=1,X(e,o,t),o},He=e=>{if(!e||Ee(e==null?void 0:e.benefit_id))return{currentDayClick:0,currentSessionClick:0,maxDayClicks:null,maxSessionClicks:null};const o=e.benefit_id.split("_")[0],n=Ee(e==null?void 0:e.clicksCapDay)?null:parseInt(e.clicksCapDay),i=Ee(e==null?void 0:e.clicksCapSession)?null:parseInt(e.clicksCapSession);if(!(n!==null||i!==null))return{currentDayClick:0,currentSessionClick:0,maxDayClicks:null,maxSessionClicks:null};let r=0,c=0;if(n!==null){const s=`ecd_${o}_del`,l=Ye(24,!0);r=Ze(s,l)}if(i!==null){const s=`ecs_${o}_del`,l=Ye(6);c=Ze(s,l)}return{currentDayClick:r,currentSessionClick:c,maxDayClicks:n,maxSessionClicks:i}};function Re(e){const t=e.maxDayClicks!==null&&e.currentDayClick>=e.maxDayClicks,o=e.maxSessionClicks!==null&&e.currentSessionClick>=e.maxSessionClicks;return t||o}function Oe(e,t,o,n){if(e){const i=document.getElementById(o);i&&i.parentElement&&setTimeout(()=>{Yt(t,i.parentElement,null)},n)}}function we(e,t,o,n,i=3e3){const{control_type:a}=n;setTimeout(()=>{if(a!=="customHtml"){const r=document.querySelectorAll(`#${o}`),c=r.length>0?r[r.length-1]:null;
2c&&c.addEventListener("click",s=>eo(s,e,t,o,n,i))}else to(e,t,o,n,i)},0)}function eo(e,t,o,n,i,a){const{actionType:r}=i,c=He(i),s=Re(c);r==="intervention"?(Q(t,o,"","Click",e),Ve(t,o,e)):r==="closePopupAndReload"?ie("ECHO_LH_POPUP",t,"bottompopup"):(Q(t,o,"","Click",e),Ne(t,o)),Oe(s,o,n,a)}function to(e,t,o,n,i){he(e,t),document.querySelectorAll('[id^="echosdk_click_"]').forEach(r=>{r.dataset.rerenderAdded||(r.dataset.rerenderAdded="true",r.addEventListener("click",()=>{const c=He(n),s=Re(c);Oe(s,t,o,i)},{capture:!1}))})}const oo=e=>{var m,g;const{bottompopup:t}=e;if(!t)return null;const o=(t==null?void 0:t.width)||((m=q(t))==null?void 0:m.widgetWidth)||1,n=(t==null?void 0:t.height)||((g=q(t))==null?void 0:g.widgetHeight)||1,i=window.innerWidth,a=i/(o/n),r=t.impressionTracker?JSON.parse(t.impressionTracker).filter(Boolean):[],{control_type:c,HTMLFile:s,creativeURL:l}=t,p="parentPopup",u="bottompopup";return we(e,u,p,t),c==="customHtml"&&s?d("div",{id:p}):c==="creativeImage"&&l?d("div",{class:"echoSdk_signinBox_creativeUrl",id:"echoSdk_signInPopUp"},d("div",{class:"imageContainer"},d("a",{"data-google-interstitial":"false",rel:me(e==null?void 0:e[u])},d("img",{id:p,src:l,alt:"",height:ce("height","bottompopup",e,a,i),width:ce("width","bottompopup",e,a,i)})),r&&r.length>0?d("div",{style:{position:"absolute"}},r.map((y,f)=>d("img",{key:"image"+f,src:y,alt:"",width:"1",height:"1"}))):"",d("div",{class:"echoSdk_closeBox",onclick:()=>ie("echoSdk_signInPopUp",e,u)}))):d("div",{id:p})},no=50,io=e=>{if(e==null||String(e).trim()==="")return no;const o=String(e).trim().match(/^(\d+(?:\.\d+)?)\s*%?$/);if(!o)return null;const n=Number(o[1]);return n>=0&&n<=100?n:null},ao=e=>{var t,o,n,i,a,r;return Math.max(((t=e.body)==null?void 0:t.scrollHeight)||0,((o=e.documentElement)==null?void 0:o.scrollHeight)||0,((n=e.body)==null?void 0:n.offsetHeight)||0,((i=e.documentElement)==null?void 0:i.offsetHeight)||0,((a=e.body)==null?void 0:a.clientHeight)||0,((r=e.documentElement)==null?void 0:r.clientHeight)||0)},et=(e,t,o,n,i={})=>{const a=i.windowObject||window,r=i.documentObject||document,c=i.schedule||setTimeout;let s=!1,l;const p=()=>{s||(s=!0,l&&a.removeEventListener("scroll",l),n())};if(e==="on_scroll"){const u=io(t);if(u===null){console.log("Invalid scroll percentage:",t);return}l=()=>{var k;const m=a.innerHeight,g=ao(r),y=a.pageYOffset||((k=r.documentElement)==null?void 0:k.scrollTop)||0;(g<=m?100:y/(g-m)*100)>=u&&p()},a.addEventListener("scroll",l,{passive:!0}),c(l,100);return}if(e==="add_some_delay"){const u=Number.parseInt(o,10);c(p,Number.isNaN(u)?0:Math.max(u,0)*1e3);return}p()},ro={AN:"Andaman and Nicobar Islands",AP:"Andhra Pradesh",AR:"Arunachal Pradesh",AS:"Assam",BR:"Bihar",CG:"Chhattisgarh",GA:"Goa",GJ:"Gujarat",HR:"Haryana",HP:"Himachal Pradesh",JH:"Jharkhand",KA:"Karnataka",KL:"Kerala",MP:"Madhya Pradesh",MH:"Maharashtra",MN:"Manipur",ML:"Meghalaya",MZ:"Mizoram",NL:"Nagaland",OR:"Odisha",PB:"Punjab",RJ:"Rajasthan",SK:"Sikkim",TN:"Tamil Nadu",TS:"Telangana",TR:"Tripura",UP:"Uttar Pradesh",UA:"Uttarakhand",WB:"West Bengal",CH:"Chandigarh",DN:"Dadra and Nagar Haveli",DD:"Daman and Diu",DL:"Delhi",LD:"Lakshadweep",PY:"Puducherry"},Ue="<state>",co=["hindustantimes.com","livemint.com","livehindustan.com"],so="js-2.8.0",lo="lh",po="event",te=async(e,t,o=po)=>{if(!e){console.warn("[Echo SDK] Missing eventName, skipping track call");return}const n={eventName:e,eventDetail:t,eventType:o,deviceTstamp:String(Date.now()),vTracker:so,appId:lo,userId:S("_ht_clientid")||""};try{await fetch(Ut,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){console.error("[Echo SDK] Failed to send event:",i)}},tt=async e=>{var u,m;const{control_type:t,HTMLFile:o,templateHTML:n,triggerCriteria:i,autoClose:a,delayBy:r,scrollPercentage:c}=e.bottompopup,s=document.createElement("div");document.body.appendChild(s),s.id="ECHO_LH_POPUP";const l=((m=(u=e.bottompopup)==null?void 0:u.cta)==null?void 0:m.ctaType)||"";s.style.opacity="0",s.style.visibility="hidden",s.style.transition="opacity 0.01s ease-in-out";const p=async()=>
2{if(t==="sdkOnLoad"&&(l==="crifSdk"||l==="plCrifSdk"))it(e,"bottompopup","On load");else if(t==="sdkOnLoad"&&l==="onboardingJourney"){const f=await $e();(!f.onboardingCompleted||(f==null?void 0:f.onboardingCompleted)===!1)&&nt(e,"bottompopup",s)}else if(t==="sdkOnLoad"&&l==="autoLeadFormSdk")at(e,"bottompopup","onLoad");else if(t==="sdkOnLoad"&&l==="cmtLeadFormSdk")rt(e,"bottompopup");else if(t==="googleOT")Ce();else{const f=oo(e);t==="customHtml"&&o?Y(o,s,f):t==="templates"&&n?await ue(e,n,s,f,"bottompopup"):s.append(f)}s.style.opacity="1",s.style.visibility="visible";const g=t==="sdkOnLoad"&&(l==="crifSdk"||l==="plCrifSdk")?"Triggered":"Impression";re("EchoActivity",e,"bottompopup",g),te("EchoActivity",ne(e,"bottompopup",g),"event"),xe(e,"bottompopup");const y=Number.parseInt(a);a&&!isNaN(y)&&y>0&&setTimeout(()=>{s.style.opacity="0",setTimeout(()=>s.style.visibility="hidden",500)},y*1e3)};return et(i,c,r,()=>{p().catch(g=>console.error("Bottom popup processing error:",g))}),s},uo=e=>{const t={voucherconfetti:e==null?void 0:e[0]},o={bottompopup:e==null?void 0:e[1]};Ke("voucherconfetti",1,t,o)};async function ot(e){return await new ve().get(It,e)}async function ho(e,t){return await new ve()._fetchVoucherDetails(e,t)}async function mo(e,t,o){return await new ve()._fulfillVoucherDetails(e,t,o)}async function fo(){const e=S("token"),t=S("_ht_clientid")||"";try{if(e&&!e.includes("amp-")&&t&&!t.includes("amp-")){const o=await fetch(`${Ot}`,{method:"GET",headers:{"Content-Type":"application/json",clientId:t,"X-Client":"1023"}});if(o.status===200){const{data:n}=await o.json();return n}}}catch(o){console.error("User info error",o)}}async function $e(){const e=S("token"),t=S("_ht_clientid");try{if(e&&!e.includes("amp-")&&t&&!t.includes("amp-")){const o=await fetch(`${Rt}${e}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(o.status===200)return await o.json()}}catch(o){console.error("User info error",o)}}async function Ke(e,t,o={},n={}){const i=S("_ht_clientid")||"",a=b.get("property")||"LH",r=S("token")||"";if(!i&&!r)return;let c=`https://cdpecho.hindustantimes.com/api/v4/user/benefit/poll/Vouchers?userId=${i}&appId=${a}&token=${r}`,s={"Content-Type":"application/json","X-Client":1029};new ve()._getVouchers(c,s,t,e,o,n)}class ve{constructor(){de(this,"queryParams",{ht_fp:S(ee.production.htfpCookie)||"",appId:b.get("property")||"LH",platform:b.get("platform")||"web",urlCurrent:window.location.href,isLoggedin:b.get("isLoggedin").toUpperCase()||"FALSE",isSubscribed:b.get("isSubscribed").toUpperCase()||"FALSE",contextualKey:b.get("contextualKeys")||"",language:b.get("language")||"English",pageType:b.get("pageType")?b.get("pageType"):"",isPremium:b.get("isPremium")?b.get("isPremium").toUpperCase():"FALSE",isAffiliate:b.get("isAffiliate")?b.get("isAffiliate").toUpperCase():"FALSE",performanceType:b.get("performanceType")?b.get("performanceType"):"",userSource:To(b.get("userSource"))})}async get(t,o){const n=new URLSearchParams;Object.keys(this.queryParams).forEach(s=>{n.append(s,this.queryParams[s])});const i=`${t}?${n.toString()}`,a=await fetch(i,{credentials:"include",headers:{"X-Client-Hints":JSON.stringify(o),"X-Client-Id":S("_ht_clientid")&&!S("_ht_clientid").includes("amp-")?S("_ht_clientid"):""}});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);const r=a.headers.get("Content-Length");return r&&parseInt(r)===0?(console.log("No content found in API response"),null):a.json()}async _fetchVoucherDetails(t,o){try{const n=`${Et}?campaignId=${t}`,i=await fetch(n,{method:"GET",headers:{"X-Client":"1034",Authorization:o}});if(!i.ok)throw new Error("Network response was not ok");return await i.json()}catch(n){return console.error("Error fetching the API:",n),null}}async _fulfillVoucherDetails(t,o,n){var i,a,r,c,s,l,p,u,m,g,y,f,k,v,A,H,R,M,C,L,D;try{const I=S("_ht_fp")||"",h=`${Ht}`,Z=(a=(i=t==null?void 0:t[o])==null?void 0:i.cta)==null?void 0:a.ctaType;let G;Z==="VoucherSDK"?G={campaignId:(r=t==null?void 0:t[o])==null?void 0:r.benefit_id,name:(c=t==null?void 0:t[o])==null?void 0:c.campaign,type:((s=t==null?void 0:t[o])==null?void 0:s.objective)||"Test"}:G={campaignId:(p=(l=t[o])==null?void 0:l.cta)==null?void 0:p.ctaCampaignId,name:(m=(u=t[o])==null?void 0:u.cta)==null?void 0:m.ctaVoucherName,type:(y=(g=t[o])==null?void 0:g.cta)==null?void 0:y.ctaVoucherType,value:(k=(f=t[o])==null?void 0:f.cta)==null?void 0:k.ctaValue,campaignValue:(A=(v=t[o])==null?void 0:v.cta)==null?void 0:A.ctaCampaignValue,campaignPosition:(R=(H=t[o])==null?void 0:H.cta)==null?void 0:R.ctaCampaignPosition,campaignScore:(C=(M=t[o])==null?void 0:M.cta)==null?void 0:C.ctaCampaignScore,domainId:(D=(L=t[o])==null?void 0:L.cta)==null?void 0:D.ctaDomainId,htfpId:I};const J=await fetch(h,{method:"POST",body:JSON.stringify(G),headers:{"X-Client":"1034",Authorization:n,"Content-Type":"application/json",_ht_fp:I}});if(!J.ok)throw new Error("Network response was not ok");return await J.json()}catch(I){return console.error("Error fetching the API:",I),null}}async _getVouchers(t,o,n,i,a,r={}){try{let s=await(await fetch(t,{credentials:"include",method:"GET",headers:o})).json();if(s.success&&s.data.length>0){const l=document.createElement("div");return l.id="ECHO_LH_POPUP",document.body.appendChild(l),b.dispatch({promoSdkType:"snackbar"}),xe(a,"voucherconfetti"),Me({},i,s.data[0],()=>{},l)}else n<3?setTimeout(()=>{Ke(i,n+1,a,r)},2e3):await tt(r)}catch{n<3&&setTimeout(()=>{Ke(i,n+1,a,r)},2e3)}}}const go=(e,t)=>{setTimeout(()=>{const o={element:b.get("ssoTarget")||document.getElementById("ssoSDKSignIn"),client:"LH",lhsContent:{...e[t].cta.ctaHeading?{heading:e[t].cta.ctaHeading}:{heading:""},...e[t].cta.ctaListItems?{listItems:e[t].cta.ctaListItems}:{listItems:[]}},showOnboarding:!1,...e[t].cta.ctaActionType==="Subscribe newsletter"&&{id:e[t].cta.ctaActionValue},...e[t].benefit_id&&{benefitId:e[t].benefit_id},...e[t].cohortId&&{cohortId:e[t].cohortId},...e[t].cta.ctaFunnel&&{funnel_entry:e[t].cta.ctaFunnel},...e[t].cta.ctaMessage&&{thank_you_message:e[t].cta.ctaMessage},...e[t].cta.ctaActionType==="Redirect to URL"&&{sdk_redirect_url:e[t].cta.ctaActionValue},...e[t].cta.ctaActionType==="showOnboarding"&&{showOnboarding:!0},...e[t].cta.ctaActionType&&e[t].cta.ctaActionType!="showOnboarding"&&{type:e[t].cta.ctaActionType},...e[t].cta.ctaLoginOption&&{loginOption:e[t].cta.ctaLoginOption==="all"?"":e[t].cta.ctaLoginOption},...e[t].cta.ctaShowSocialLoginFirst&&{showSocialLoginFirst:e[t].cta.ctaShowSocialLoginFirst==="true"}};window.sso.render(o)},500)},nt=(e,t,o=document.getElementById("onBoardingDiv"))=>{o&&setTimeout(()=>{var n,i,a,r;window.onboarding.render({element:o,client:"LH",funnel_entry:"article",campaignId:e[t].benefit_id,campaignName:e[t].campaign,campaignType:e[t].objective,...((i=(n=e[t])==null?void 0:n.cta)==null?void 0:i.ctaCurrentPage)&&{currentPage:(r=(a=e[t])==null?void 0:a.cta)==null?void 0:r.ctaCurrentPage}})},200)},it=(e,t,o)=>{const n="echoCrifDiv";let s=0,l=0;if(!document.getElementById(n)){const u=document.createElement("div");u.id=n,document.body.appendChild(u)}const p=setInterval(()=>{var u,m;if(window.CIR_SDK){clearInterval(p),CIR_SDK.renderPopup({rootID:n,theme:"theme-lh",flow:((m
2=(u=e[t])==null?void 0:u.cta)==null?void 0:m.ctaType)==="plCrifSdk"||e[t].control_type==="plCrifSdk"?"pl":"cs"});const g=setInterval(()=>{CIR_SDK.openCIRModal?(clearInterval(g),CIR_SDK.openCIRModal({campaign_name:e[t].campaign,bucketName:e[t].bucketName,widget:t,echo_action:o})):(l+=200,l>=2e3&&(clearInterval(g),console.log("[Echo SDK] CIR_SDK modal not available after 2 seconds")))},200)}else s+=1e3,s>=15e3&&(clearInterval(p),console.log("[Echo SDK] CIR_SDK not available after 15 seconds"))},1e3)},at=(e,t,o)=>{let n=document.getElementById("ECHO_LH_POPUP");if(!n){const l=document.createElement("div");document.body.appendChild(l),l.id="ECHO_LH_POPUP",n=l}const i=1e3,a=15e3;let r=0;const c=o+`_${t}`,s=setInterval(()=>{if(window.LeadForm&&typeof window.LeadForm.render=="function"){clearInterval(s);try{window.LeadForm.render({element:n,client:"LH",show:!0,widgetName:c,productPosition:e[t].cta.ctaProductPosition,modelSlugName:e[t].cta.ctaModelSlugName,isBottomSheet:e[t].cta.ctaIsBottomSheet,utm_source:e[t].cta.ctaSource,utm_medium:e[t].cta.ctaMedium,utm_campaign:e[t].cta.ctaCampaign})}catch(l){console.log("Error rendering LeadForm SDK:",l)}}else o==="onClick"&&(window.location.href=e[t].cta.ctaRedirectionUrl),r+=i,r>=a&&(clearInterval(s),console.log("[Echo SDK] LeadForm SDK not available after 15 seconds"))},i)},rt=(e,t)=>{let o=document.getElementById("affiliate-lead-form-sdk");o||(o=document.createElement("div"),o.id="affiliate-lead-form-sdk",document.body.appendChild(o));const n={element:o,client:"LH",campaignId:e[t].cta.ctaAffiliateCampaignId,...e[t].cta.ctaUtmSource&&{utm_source:e[t].cta.ctaUtmSource},...e[t].cta.ctaUtmMedium&&{utm_medium:e[t].cta.ctaUtmMedium}},i=e[t].cta.ctaAffiliateRedirectionUrl;try{window.affiliatePartnerLeadFormSdk&&typeof window.affiliatePartnerLeadFormSdk.render=="function"?window.affiliatePartnerLeadFormSdk.render(n):(console.log("Affiliate SDK not available, redirecting to fallback URL"),window.location.href=i)}catch(a){console.log("Error running affiliate lead form SDK:",a),window.location.href=i}},Me=(()=>{let e=!1;return async(t,o,n,i,a)=>{if(e)return;const r=a||b.get("voucherTarget");let c=n.voucherConfig||n.voucherConfigDTO,s=c.voucherCardConfig;try{e=!0,await window.bottomSlider.render({element:r,sdkType:b.get("promoSdkType")||"confettiPopup",client:"LH",modeType:(n==null?void 0:n.campaignId)||o,isOnboarding:!1,bannerImageURL:c.vendorLogo,cardColor1:(s==null?void 0:s.color1)||"#FFFFFF",cardColor2:(s==null?void 0:s.color2)||"#FFFFFF",cardTextColor:(s==null?void 0:s.textColor)||"#000000",vendorName:n.vendorName,voucherCategory:c.voucherCategory,categoryIcon:c.categoryIcon,description:c.description,validity:c.expiryDate,couponCode:n.voucherCode,availOfferLink:c.redemptionUrl,termsAndConditionsUrl:c.tnc,howToRedeemUrl:c.howToAvail,callBackFunction:()=>{e=!1,i()}})}catch(l){console.error("Error in voucher rendering:",l),e=!1,i()}}})(),Ve=async(e,t,o=null,n=null)=>{var a,r,c,s,l,p,u,m,g,y,f,k,v;if(["bottompopup","bottompopup1","bottompopup2"].includes(t)&&ie("echoSdk_signInPopUp"),((r=(a=e[t])==null?void 0:a.cta)==null?void 0:r.ctaType)==="whatsappMessage")_o(e,t);else if(((s=(c=e[t])==null?void 0:c.cta)==null?void 0:s.ctaType)==="Onboarding SDK"){const A=await $e();(!A.onboardingCompleted||(A==null?void 0:A.onboardingCompleted)===!1)&&nt(e,t)}else((p=(l=e[t])==null?void 0:l.cta)==null?void 0:p.ctaType)==="VoucherSDK"||((m=(u=e[t])==null?void 0:u.cta)==null?void 0:m.ctaType)==="voucherNonLoggedIn"?await vo(e,t,n):((y=(g=e[t])==null?void 0:g.cta)==null?void 0:y.ctaType)==="crifSdk"||((k=(f=e[t])==null?void 0:f.cta)==null?void 0:k.ctaType)==="plCrifSdk"?it(e,t,"On Click"):e[t].cta.ctaType==="autoLeadFormSdk"?at(e,t,"onClick"):e[t].cta.ctaType==="cmtLeadFormSdk"?rt(e,t):(v=e[t])!=null&&v.ctaName&&go(e,t)};function yo(e){if(e){let t=e.split("_");return t[t.length-1]}}const Q=(e,t,o="",n="Click",i=null)=>{try{let a=ne(e,t,n),r=null;if(n==="Click"){const c=o===""?i==null?void 0:i.target:yo(o);r=o===""?c==null?void 0:c.innerText:c,a.clickIdentifier=r}re("EchoActivity",e,t,n,r),te("EchoActivity",a,"event")}catch(a){console.error("Error in tracking:",a)}},ke=(e,t,o,n)=>{if(t==="on_scroll"){n(),e.style.display="none";const i=String(o||"50"),a=parseInt(i.replace("%",""),10);if(isNaN(a)){console.log("Invalid scroll percentage:",o);return}let r=!1;const c=(u,m)=>{let g=0;return function(...y){const f=Date.now();if(!(f-g<m))return g=f,u(...y)}},s=()=>{const u=window.innerHeight,m=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),g=window.pageYOffset||document.documentElement.scrollTop;return m<=u?100:g/(m-u)*100},l=()=>{if(r)return;s()>
2=a&&(r=!0,e.style.display="block",e.style.opacity="1",e.style.visibility="visible",window.removeEventListener("scroll",p))},p=c(l,100);window.addEventListener("scroll",p),setTimeout(l,100)}else n()},Se=(e,t=null,o=!1)=>{var k;if(!e)return"";const n=S("_ht_clientid")||"<clientID>",i=S("_ht_fp")||"<htfp>",a=S("cdpecho_city")||"<city>",r=o?a:encodeURIComponent(a);let c=pt(),s=c===Ue?"<state>":c;!o&&s!=="<state>"&&(s=encodeURIComponent(s));const l=window.location.href,p=o?l:encodeURIComponent(l);let u=S("name"),m;!u||u.toLowerCase()==="undefined"||u===""||u==="null"||u.toLowerCase()==="reader"?m="<name>":m=o?u:encodeURIComponent(u);const g=((k=t==null?void 0:t.benefit_id)==null?void 0:k.split("_")[0])||"<campaignId>",y=(t==null?void 0:t.campaign)||"<campaignName>",f=(t==null?void 0:t.bucketName)||"<bucketName>";return e=e.replaceAll("${city}",r).replaceAll("${state}",s).replaceAll("${htfp}",i).replaceAll("${clientID}",n).replaceAll("${url}",p).replaceAll("${user-name}",m).replaceAll("${site}","LH").replaceAll("${campaignId}",g).replaceAll("${campaignName}",y).replaceAll("${bucketName}",f),e},bo=e=>e===!0||typeof e=="string"&&e.trim().toLowerCase()==="true",Ne=(e,t)=>{const o=e[t],n=Se(o.url,o);if(bo(o.openInNewTab)){window.open(n,"_blank","noopener,noreferrer");return}setTimeout(()=>{window.location.href=n},500)},S=e=>{for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var i=o[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)==0)return i.substring(t.length,i.length)}return""},Te=()=>{let e=!1,t=!1;const o={large:"(min-width: 1024px)",small:"(max-width: 767px)"};for(let n in o)if(window.matchMedia(o[n]).matches){switch(n){case"large":t=!0;break;case"small":e=!0;break}break}return{isMobile:e,isDesktop:t}},ie=(e,t=null,o=null)=>{document.getElementById(e).style.display="none",t&&o&&Q(t,o,"","Closed")};function X(e,t,o){var n=window.location.host.split(".");n[0]="";var i=n.join(".");e&&t&&(document.cookie=e+"="+t+";SameSite=None;Secure;"+o+";path=/;domain="+i+";")}function xe(e,t){var I,h;if(!e[t])return;let o=(h=(I=e[t])==null?void 0:I.widget)==null?void 0:h.widget_id,i=e[t].benefit_id.split("_")[0],a=`cdpecho_ses_${i}_del`,r=`cdpecho_impr_${i}_del`,c=`eiw_${i}_del`,s=`eim_${i}_del`,l=`e_i_w_${o}_del`,p=`e_s_w_${o}_del`,u=e[t]&&e[t][r]?parseInt(e[t][r],10)+1:null,m=e[t]&&e[t][a]?parseInt(e[t][a],10)+1:null,g=e[t]&&e[t][c]?parseInt(e[t][c],10)+1:null,y=e[t]&&e[t][s]?parseInt(e[t][s],10)+1:null,f=e[t]&&e[t][l]?parseInt(e[t][l],10)+1:null,k=e[t]&&e[t][p]?parseInt(e[t][p],10)+1:null,v=new Date;v.setTime(v.getTime()+360*60*1e3);let A=new Date;A.setHours(24,0,0,0),A.setTime(A.getTime()+330*60*1e3);let H=new Date;H.setHours(24,0,0,0),H.setTime(H.getTime()+6*24*60*60*1e3+330*60*1e3);let R=new Date;R.setHours(24,0,0,0),R.setTime(R.getTime()+29*24*60*60*1e3+330*60*1e3);let M="expires="+A.toUTCString(),C="expires="+v.toUTCString(),L="expires="+H.toUTCString(),D="expires="+R.toUTCString();u&&X(r,u,M),m&&X(a,m,C),g&&X(c,g,L),y&&X(s,y,D),f&&X(l,f,M),k&&X(p,k,C)}function pe(e,t,o,n=null){try{const i=new IntersectionObserver(([a])=>{if(a.isIntersecting){const r=n!=null;re("EchoActivity",o,t,"Impression",null,r?n:null);const c=ne(o,t,"Impression");r&&(c.refreshLevel=n),te("EchoActivity",c,"event"),xe(o,t),i.disconnect()}},{threshold:.5});i.observe(e)}catch(i){console.error("Error in trackOnView function",i)}}const ct=async(e,t,o)=>{try{const n=await mo(e,t,o);return n.success&&n.data.length>0?(b.dispatch({vendorName:n.data[0].vendorName,voucherCategory:n.data[0].voucherConfigDTO.voucherCategory}),n.data[0]):(console.error("Voucher details not found"),null)}catch(n){return console.error("Error fetching voucher details:",n),null}},_o=async(e,t)=>{var l,p,u,m,g;const o=(l=e[t])==null?void 0:l.cta;if(!o)return;const n=(y="")=>{let f=o.ctaMessage||"";y&&(f=f.replace("${ReqID}",y)),f=Se(f,e[t],!0);const k=encodeURIComponent(f),v=`https://api.whatsapp.com/send?phone=${o.ctaMobileNumber}&text=${k}`;setTimeout(()=>{window.location.href=v},500)};if(!((p=o.ctaMessage)!=null&&p.includes("${ReqID}"))){n();return}const i=S("_ht_clientid")||"",a=((u=o.ctaIsLoggedinFlow)==null?void 0:u.toLowerCase())==="true",c=`${Se(o.ctaFlow||"",e[t],!0)}`,s={loggedInFlow:a,requestType:o.ctaRequestType,clientId:a?i:"",htfpId:S("_ht_fp")||"",referrer:"LH",platform:e[t].platform,returnUrl:o.ctaReturnUrl,os:((m=b.get("clientHints"))==null?void 0:m.platform)||"Others",tokenExpiry:Date.now()+parseInt(o.ctaTokenExpiry||0)*60*60*1e3,destinationUrl:o.ctaDestinationUrl,xClient:"1029",funnelEntry:c};try{const y=await fetch(`${Dt}/getUserRequestIdInfo`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(y.ok){const f=await y.json();return n(((g=f==null?void 0:f.data)==null?void 0:g.reqId)||"LHE01"),f}}catch(y){console.log("Error calling WhatsApp API:",y.message)}n("LHE01")},Be=async(e,t,o=!1)=>{try{const n=await ho(e,t);return n.success?n.data.length>0?(b.dispatch({vendorName:n.data[0].vendorName,voucherCategory:n.data[0].voucherConfig.voucherCategory}),n.data[0]):(console.log("Voucher details not found, new user"),o?n:n.data[0]):(console.log("Voucher details not found, token invalid"),null)}catch(n){return console.error("Error fetching voucher details:",n),null}},wo=e=>{const t=new Date(e),o=new Date;return o.setHours(0,0,0,0),t>=o};async function vo(e,t,o=null){var c,s;const n=S("token")||"",i=t||"",a=(c=e==null?void 0:e[i])==null?void 0:c.campaign,r=(s=e==null?void 0:e[i])==null?void 0:s.benefit_id;if(i&&a&&r)try{let l=await ct(e,i,n)||await Be(r,n);if(l){const p=document.getElementById(o);p&&(p.style.display=""),await Me(e,i,l,()=>{})}else console.error("Voucher service failed")}catch(l){console.error("Error handling voucher click:",l)}}async function ko(e){try{const t=await fetch(e);if(!t.ok)throw new Error(`Error ${res.status}: ${res.statusText}`);return await t.text()}catch(t){console.error("Error fetching HTML content:",t)}}function Y(e,t,o,n=""){if(t.innerHTML="",o.innerHTML=e,t.append(o),o.querySelectorAll("script").forEach(i=>
2{const a=document.createElement("script");i.src?a.src=i.src:a.textContent=i.innerHTML,n?t.append(a):document.body.appendChild(a)}),n)return document.body.appendChild(t)}async function ue(e,t,o,n,i,a=""){try{const r=await ko(t);if(!r)return console.error("Template not found");if(a){const c=Y(r,o,n,a);return he(e,i),c}else Y(r,o,n),he(e,i)}catch(r){console.log("Template Processing Error:",r)}}function he(e,t){document.querySelectorAll('[id^="echosdk_click_"]').forEach(n=>{n.dataset.listenerAdded||(n.dataset.listenerAdded="true",n.addEventListener("click",i=>{const a=n.id||"";Q(e,t,a,"Click",i)}))})}const ce=(e,t,o,n,i)=>{var c,s;if(!o||!t)return null;const a=(c=Te())==null?void 0:c.isMobile,r=["endOfArticle","endofarticle","bottompopup","eoabanner","EOABanner","inline","hpMoa"].includes(t);return a&&r?e==="height"?n:i:(s=q(o==null?void 0:o[t]))==null?void 0:s[e==="height"?"widgetHeight":"widgetWidth"]},st=(e,t,o)=>["customHtml","templates"].includes(e)&&(t||o),lt=(e,t)=>e==="creativeImage"&&t,dt=(e,t)=>{re("EchoActivity",t,e,"Impression"),te("EchoActivity",ne(t,e,"Impression"),"event"),xe(t,e)};function Ce(e=15,t=1e3,o=1){var n;try{if(typeof oneTapInitialization>"u"){if(o>e){const i={type:"GOT Failed",url:window.location.href||"",networkType:((n=navigator==null?void 0:navigator.connection)==null?void 0:n.effectiveType)||"others",model:b.get("clientHints").model||"",platform:b.get("platform").toLowerCase()||"web"};te("EchoLog",i,"event"),console.log(`[Echo SDK] Google One Tap init failed after ${e} attempts`);return}setTimeout(()=>{Ce(e,t,o+1)},t)}else oneTapInitialization()}catch(i){console.log("Error in triggerGoogleOneTapWithRetry:",i)}}const pt=()=>{const e=S("Meta-Geo");if(!e||e==="null"||e==="undefined")return Ue;const t=e.split("--"),o=t&&t.length>=2&&t[1]&&t[1].trim();return o?ro[o]||o:Ue},So=(e,t)=>Array.isArray(e)?Array.isArray(t)?e.map(o=>{const n=t.some(i=>{var r,c;const a=((r=o==null?void 0:o.cta)==null?void 0:r.ctaType)==="VoucherSDK"?o.benefit_id:(c=o==null?void 0:o.cta)==null?void 0:c.ctaCampaignId;return String(i.campaignId)===String(a)});return{...o,isVoucherClaimed:n}}):e.map(o=>({...o,isVoucherClaimed:!1})):[],q=e=>{var o;const t=(o=e==null?void 0:e.platform)==null?void 0:o.toLowerCase();return e==null?void 0:e.widget[t]},me=e=>{if((e==null?void 0:e.actionType)==="intervention")return"";const t=(e==null?void 0:e.url2)||(e==null?void 0:e.url)||"";return co.some(o=>t.includes(o))?"":"nofollow sponsored"},To=e=>typeof e!="string"||!e.trim()||["null","undefined"].includes(e.trim().toLowerCase())?"not set":e.trim().toLowerCase(),T=new Map;function ae(e){const t=T.get(e);return(t==null?void 0:t.isInViewport)&&(t==null?void 0:t.isTabVisible)}function xo(e){var o,n;const t=T.get(e);if(t)try{const i=(n=(o=t.res)==null?void 0:o[t.type])==null?void 0:n.impressionTracker;if(!i)return;const a=JSON.parse(i).filter(Boolean);if(!a||a.length===0)return;console.log(`[Ad Refresh] Firing ${a.length} impression tracker URLs for ${t.type}`);const r=document.getElementById("impression-tracker-container");if(r){const c=r.querySelectorAll("img");if(a.forEach((s,l)=>{const p=Date.now(),u=`${s}${s.includes("?")?"&":"?"}t=${p}`;if(c[l])c[l].src=u;else{const m=document.createElement("img");m.src=u,m.alt="",m.width=1,m.height=1,m.style.display="none",r.appendChild(m)}}),c.length>a.length)for(let s=a.length;s<c.length;s++)c[s].remove()}else a.forEach(c=>{const s=new Image(1,1);s.src=`${c}${c.includes("?")?"&":"?"}t=${Date.now()}`,s.style.display="none",document.body.appendChild(s)})}catch(i){console.error("[Ad Refresh] Error firing impression trackers:",i)}}function Fe(e){const t=T.get(e);t!=null&&t.timerId&&(clearTimeout(t.timerId),t.timerId=null,T.set(e,t))}function Ae(e){var n,i;const t=T.get(e);if(!t)return;const o=t.refreshCount;t.refreshCount++,T.set(e,t),console.log(`[Ad Refresh] Firing impression ${t.refreshCount}/${t.maxRefreshes} for ${t.type} (refreshLevel: ${o})`),pe(t.target,t.type,t.res,o),o>0&&((i=(n=t.res)==null?void 0:n[t.type])!=null&&i.impressionTracker)&&xo(e),t.refreshCount<t.maxRefreshes?Co(e):(console.log(`[Ad Refresh] Reached max refreshes (${t.maxRefreshes}) for ${t.type}`),mt(e))}function Co(e){const t=T.get(e);if(!t)return;if(!ae(e)){console.log(`[Ad Refresh] Timer not started - conditions not met (inViewport: ${t.isInViewport}, tabVisible: ${t.isTabVisible})`);return}Fe(e),t.elapsedTime=0,t.lastTimestamp=Date.now(),T.set(e,t);const o=t.minRefreshInterval*1e3;t.timerId=setTimeout(()=>{const n=T.get(e);ae(e)&&(n==null?void 0:n.refreshCount)<(n==null?void 0:n.maxRefreshes)&&Ae(e)},o),T.set(e,t),console.log(`[Ad Refresh] Timer started for ${t.minRefreshInterval}s interval`)}function ut(e){const t=T.get(e);if(!t||!t.timerId||!t.lastTimestamp)return;const o=Date.now();t.elapsedTime+=o-t.lastTimestamp,T.set(e,t),console.log(`[Ad Refresh] Timer paused. Elapsed: ${Math.floor(t.elapsedTime/1e3)}s`),Fe(e)}function ht(e){const t=T.get(e);if(!t||t.refreshCount>=t.maxRefreshes)return;if(!ae(e)){console.log(`[Ad Refresh] Timer resume blocked - conditions not met (inViewport: ${t.isInViewport}, tabVisible: ${t.isTabVisible})`);return}const n=t.minRefreshInterval*1e3-t.elapsedTime;n>0?(console.log(`[Ad Refresh] Timer resumed. Remaining: ${Math.floor(n/1e3)}s`),t.lastTimestamp=Date.now(),t.timerId=setTimeout(()=>{const i=T.get(e);ae(e)&&(i==null?void 0:i.refreshCount)<(i==null?void 0:i.maxRefreshes)&&Ae(e)},n),T.set(e,t)):ae(e)&&Ae(e)}function Ao(e){const t=T.get(e);!t||t.isInViewport||(t.isInViewport=!0,T.set(e,t),console.log(`[Ad Refresh] ${t.type} entered viewport`),t.refreshCount===0?Ae(e):t.refreshCount<t.maxRefreshes&&ae(e)&&ht(e))}function Lo(e){const t=T.get(e);!t||!t.isInViewport||(t.isInViewport=!1,T.set(e,t),console.log(`[Ad Refresh] ${t.type} left viewport`),ut(e))}function Io(e){const t=T.get(e);t&&(t.isTabVisible=!1,T.set(e,t),console.log(`[Ad Refresh] Tab hidden - pausing timer for ${t.type}`),ut(e))}function Do(e){const t=T.get(e);t&&(t.isTabVisible=!0,T.set(e,t),console.log(`[Ad Refresh] Tab visible - checking if timer should resume for ${t.type}`),ae(e)&&t.refreshCount>0&&t.refreshCount<t.maxRefreshes&&ht(e))}function Eo(e,t){const o=new IntersectionObserver(([i])=>{i.isIntersecting?Ao(e):Lo(e)},{threshold:.5});o.observe(t);const n=T.get(e);n&&(n.observer=o,T.set(e,n))}function Ho(e){const t=()=>{document.hidden?Io(e):Do(e)};document.addEventListener("visibilitychange",t);const o=T.get(e);o&&(o.visibilityHandler=t,T.set(e,o))}function mt(e){const t=T.get(e);t&&(console.log(`[Ad Refresh] Cleaning up ad refresh manager for ${t.type}`),Fe(e),t.observer&&t.observer.disconnect(),t.visibilityHandler&&document.removeEventListener("visibilitychange",t.visibilityHandler),T.delete(e))}function Pe(e,t,o,n={}){if(!(n.enableAdRefresh==="true"||n.enableAdRefresh===!0))return pe(e,t,o),{stop:()=>{}};const a=performance!=null&&performance.now?performance.now():Date.now(),r=`${t}-${Date.now()}-${a.toString().replace(".","")}`,c={target:e,type:t,res:o,maxRefreshes:parseInt(n.maxRefreshes)||1,minRefreshInterval:parseInt(n.minRefreshInterval)||30,refreshCount:0,timerId:null,observer:null,isInViewport:!1,isTabVisible:!document.hidden,elapsedTime:0,lastTimestamp:null,visibilityHandler:null};
2return T.set(r,c),Eo(r,e),Ho(r),{stop:()=>mt(r)}}const Ro=(e,t)=>Array.from(e).filter(o=>o.getAttribute("data-carousel-data")===t),Oo=(e,t)=>({placementKey:e,response:{[e]:t}}),Uo=4e3,ft=500,$o=2e3,gt=.1,Ko=[0,.25,.5,.75,1],yt=(e,t,o,n=null,i=3e3)=>{const a=He(e),r=Re(a);e.actionType==="intervention"?(Q({[t]:e},t,"","Click"),Ve({[t]:e},t,"Click",n)):e.control_type==="customHtml"?he({[t]:e},t):(Q({[t]:e},t,"","Click"),Ne({[t]:e},t)),Oe(r,t,o,i)},bt=async(e,t,o,n)=>{function i(a,r,c,s){let l=0,p=null,u=!1,m=null;const g=a.getAttribute("data-carousel-id");n.has(g)||n.set(g,new Set);const y=n.get(g);function f(){const C=a.scrollLeft;return Math.round(C/window.innerWidth)}function k(){p||(l=f(),u=!0,p=setInterval(()=>{l=(l+1)%r.length;const C=l*window.innerWidth;u=!0,a.scrollTo({left:C,behavior:"smooth"}),setTimeout(()=>u=!1,ft)},Uo),setTimeout(()=>u=!1,ft))}function v(){p&&(clearInterval(p),p=null)}function A(){m=new window.IntersectionObserver(C=>{C.forEach(L=>{const D=L.target,I=Array.prototype.indexOf.call(r,D);if(L.isIntersecting&&L.intersectionRatio>=.5&&!y.has(I)&&(!D._lastIntersectionRatio||D._lastIntersectionRatio<.5)){const h=Oo(s,c[I]);pe(D,h.placementKey,h.response),y.add(I),m.unobserve(D)}D._lastIntersectionRatio=L.intersectionRatio})},{threshold:Ko}),r.forEach(C=>m.observe(C))}function H(){m&&(m.disconnect(),m=null)}let R;a.addEventListener("scroll",()=>{!u&&p&&(v(),clearTimeout(R),R=setTimeout(k,$o))});const M=new IntersectionObserver(C=>{C.forEach(L=>{L.isIntersecting?(k(),A()):(v(),H())})},{threshold:gt});M.observe(a),window.addEventListener("unload",()=>{v(),H(),M.disconnect()})}setTimeout(()=>{const a=Ro(document.querySelectorAll("[data-carousel-id]"),t),r=new window.IntersectionObserver((c,s)=>{c.forEach(l=>{if(l.isIntersecting){const p=l.target,u=p.getAttribute("data-carousel-id"),m=p.querySelectorAll("[data-slide-id]"),g=p.getAttribute("data-carousel-data"),y=t==="voucherMyhtCarousel"?e:e[g];o.has(u)||(i(p,m,y,g),o.add(u)),s.unobserve(p)}})},{threshold:gt});a.forEach(c=>{r.observe(c)})},100)},Mo=new Map,je=(e,t,o={},n="Standalone",i)=>{var C,L,D,I,h,Z,G,J;let a,r;if(n==="Standalone")a=e,r=e==null?void 0:e[t];else if(n==="Carousel"&&Array.isArray(e==null?void 0:e[t])){const U=(C=e==null?void 0:e[t])==null?void 0:C[0];a={[t]:U},r=U}const{control_type:c,HTMLFile:s,creativeURL:l,width:p,height:u,impressionTracker:m}=r,g=p||((L=q(r))==null?void 0:L.widgetWidth)||1,y=u||((D=q(r))==null?void 0:D.widgetHeight)||1,f=window.innerWidth*.95,k=f/(g/y),v=`parent${t.charAt(0).toUpperCase()+t.slice(1)}
2`,A=window.location.pathname,H=m?JSON.parse(m).filter(Boolean):[],{isMobile:R}=Te();we(a,t,v,a==null?void 0:a[t]);const M=U=>{if(!U||typeof U!="string")return"Nav";const K=U.match(/^BottomNav(\d+)of\d+$/);return K?`Nav${K[1]}`:"Nav"};if(R&&n==="Carousel"&&bt(e,t,i,Mo),c==="customHtml"&&s)return d("div",{id:v});if(c==="creativeImage"&&l&&n!=="Carousel"){const U=(h=(I=a==null?void 0:a[t])==null?void 0:I.widget)==null?void 0:h.widgetFEName,K=M(U);return d("div",{id:v,className:"echoSDK_center_align"},d("a",{"data-google-interstitial":"false",rel:me(e==null?void 0:e[t])},d("img",{height:ce("height",t,a,k,f),width:ce("width",t,a,k,f),src:l,alt:K}),["sidestickyopenapp","endofarticle","endOfArticle","eoabanner","EOABanner"].includes(t)&&H&&H.length>0?d("div",{id:"impression-tracker-container",style:{position:"absolute"}},H.map((P,j)=>d("img",{key:"image"+j,src:P,alt:"",width:"1",height:"1"}))):""))}else if(R&&n==="Carousel"){const U=performance!=null&&performance.now?performance.now():Date.now(),K=`${v}-${Date.now()}-${U.toString().replace(".","")}`;return d("div",{class:`slider-container slider-container-${K}`,id:`slider-${K}`,"data-carousel-id":K,"data-carousel-data":t,style:{width:f+"px"}},(Z=e[t])==null?void 0:Z.map((P,j)=>d("div",{class:`slide slide-${K} slide-${j}`,key:j,id:`${v}-${K}-${j}`,"data-slide-id":`${K}-${j}`,onclick:()=>yt(P,t,`slider-${K}`)},d("a",{class:"echoSDK_a","data-action":"click","data-google-interstitial":"false",rel:me(P)},d("img",{src:P==null?void 0:P.creativeURL,alt:"",height:ce("height",t,a,k,f),width:ce("width",t,a,k,f)})))))}else if(c==="iconAndName"){const U=(J=(G=o==null?void 0:o.name)==null?void 0:G.split(" "))==null?void 0:J[0];return d("div",{id:v,class:"echoSDK_outerDiv"},d("div",{class:`echoSDK_mainDiv ${A==="/my-vouchers"?"active":""}`},d("a",{href:"https://www.livehindustan.com/my-vouchers","data-google-interstitial":"false"},d("div",{class:"echoSDK_iconName"},d("img",{src:(o==null?void 0:o.userImage)||"https://www.hindustantimes.com/static-content/1y/ht/personalisation/r-name.png",alt:U||"user image"}),d("div",{class:"echoSDK_iconText"},U||"Reader")))))}else return d("div",{id:v})},Vo=async e=>{const{bottompopup1:t,bottompopup2:o}=e;if(!t&&!o)return null;const{control_type:n,HTMLFile:i,templateHTML:a,creativeURL:r,impressionTracker:c}=t,{control_type:s,HTMLFile:l,templateHTML:p,creativeURL:u,impressionTracker:m}=o,g=c?JSON.parse(c).filter(Boolean):[],y=m?JSON.parse(m).filter(
2Boolean):[],f="parentPopup1",k="parentPopup2",v="bottompopup1",A="bottompopup2",H="ECHO_LH_POPUP1",R="ECHO_LH_POPUP2";if(we(e,v,f,t),we(e,A,k,o),n!==s)return d("div",null);if(st(n,i,a)&&st(s,l,p)){const C=d("div",{id:f}),L=d("div",{id:k}),D=d("div",{id:H}),I=d("div",{id:R});return d("div",{class:"echoSDK_multiPopup",id:"echoSdk_signInPopUp"},d("div",{class:"imageContainer"},n==="customHtml"&&i?Y(i,D,C,"multiPopups"):await ue(e,a,D,C,v,"multiPopups"),s==="customHtml"&&l?Y(l,I,L,"multiPopups"):await ue(e,p,I,L,A,"multiPopups"),d("div",{class:"echoSdk_closeBox",onclick:()=>{ie("echoSdk_signInPopUp",e,v),ie("echoSdk_signInPopUp",e,A)}})))}if(lt(n,r)&&lt(s,u)){const C=L=>L&&L.length>0?d("div",{style:{position:"absolute"}},L.map((D,I)=>d("img",{key:"image"+I,src:D,alt:"",width:"1",height:"1"}))):"";return d("div",{class:"echoSdk_signinBox_creativeUrl",id:"echoSdk_signInPopUp"},d("div",{class:"imageContainer"},d("a",{"data-google-interstitial":"false",rel:me(e==null?void 0:e[v])},d("img",{id:f,style:{width:"100%",height:"69px"},src:r,alt:""})),C(g),d("a",{"data-google-interstitial":"false",rel:me(e==null?void 0:e[A])},d("img",{id:k,style:{width:"100%",height:"69px"},src:u,alt:""})),C(y),d("div",{class:"echoSdk_closeBox",onclick:()=>{ie("echoSdk_signInPopUp",e,v),ie("echoSdk_signInPopUp",e,A)}})))}return d("div",null)},_t=async(e,t,o,n,i)=>{try{Q(e,t,"","Click",o),await Me(e,t,n,i)}catch(a){console.error("Error:",a),i()}},No=async(e,t,o,n,i)=>{var a=await ct(e.afterArticleBanner.benefit_id,e.afterArticleBanner.campaign,e.afterArticleBanner.objective)||await Be(e.afterArticleBanner.benefit_id,t);a&&(b.dispatch({unlockContainer:!0}),await _t(e,"afterArticleBanner",o,a,()=>{}),setTimeout(()=>{i.innerHTML="",i.appendChild(vt(e,a,n));const r=ne(e,"afterArticleBanner","Impression");te("EchoActivity",r,"event")},50))},wt=(e,t,o)=>{let n=ne(e,t,"Click");const a=o.target.innerText||"";n.clickIdentifier=a;try{re("EchoActivity",e,t,"Click",a),te("EchoActivity",n,"event")}catch(r){console.error("Error in tracking:",r)}},vt=(e,t,o)=>{const{vendorLogo:n,description:i}=t.voucherConfig||t.voucherConfigDTO,{heading:a,subText:r,myHTLinkText:c="",url2:s}=e.afterArticleBanner,l=c.replace("(name)",o.charAt(0).toUpperCase()+o.slice(1));let p=!1;return d("div",null,d("div",{class:"LH_unlockSurprise"},d("div",{class:"echoSDK_dailySurprise"},d("div",{onclick:async m=>{const g=m.target;if(!p){p=!0,g.disabled=!0;try{await _t(e,"afterArticleBanner",m,t,()=>{console.log("Voucher callback function, button reset"),p=!1,g.disabled=!1})}catch(y){console.error("Error processing voucher:",y),p=!1,g.disabled=!1}}},class:"LH_surpriseCash",style:"display: block;"},d("h4",null,a),d("p",null,r),d("div",{class:"LH_offerBox"},d("div",{class:"LH_offerBrand"},d("img",{src:n,width:"66",height:"48",alt:""})),d("div",{class:"LH_offerTxt"}
2,d("h5",null,i),d("a",{class:"LH_cursor-pointer","data-google-interstitial":"false"},"View details")))))),d("div",{class:"LH_exploreUser"},d("a",{class:"LH_cursor-pointer",onclick:m=>wt(e,"afterArticleBanner",m),"data-google-interstitial":"false",href:s},d("img",{src:"https://www.hindustantimes.com/static-content/1y/ht/personalisation/explore-icon.png",width:"25",height:"34",alt:""}),d("span",null,l),d("i",null))))},Bo=(e,t,o,n)=>{const{headingBlack:i,headingBlue:a,subHeading:r,cta_or_ctatext:c,myHTLinkText:s="",url2:l}=e.afterArticleBanner,p=s.replace("(name)",t.charAt(0).toUpperCase()+t.slice(1));return d("div",null,d("div",{class:"LH_unlockSurprise"},d("div",{class:"LH_unlockDiv",style:"display: block;",onclick:u=>No(e,o,u,t,n)},d("h3",null,i," ",d("span",null,a)),d("div",{class:"LH_joined"},d("img",{src:"https://www.hindustantimes.com/static-content/1y/ht/personalisation/1.png"}),d("img",{src:"https://www.hindustantimes.com/static-content/1y/ht/personalisation/2.png"}),d("img",{src:"https://www.hindustantimes.com/static-content/1y/ht/personalisation/3.png"}),d("span",null,r)),d("button",{class:"LH_revealButton",style:{cursor:"pointer"}},c,d("img",{src:"https://www.hindustantimes.com/static-content/1y/ht/personalisation/reveal-icon.png",width:"18",height:"18"})))),d("div",{class:"LH_exploreUser"}
2,d("a",{class:"LH_cursor-pointer",onclick:u=>wt(e,"afterArticleBanner",u),"data-google-interstitial":"false",href:l},d("img",{src:"https://www.hindustantimes.com/static-content/1y/ht/personalisation/explore-icon.png",width:"25",height:"34",alt:""}),d("span",null,p),d("i",null))))},Fo=async(e,t)=>{const o=c=>{e.afterArticleBanner.actionType==="intervention"?(Q(e,"afterArticleBanner","","Click",c),Ve(e,"afterArticleBanner",c)):e.afterArticleBanner.control_type==="customHtml"?he(e,"afterArticleBanner"):(Q(e,"afterArticleBanner","","Click",c),Ne(e,"afterArticleBanner"))};setTimeout(()=>{const c=document.getElementById("parentAfterArticleBanner");c&&c.addEventListener("click",o,{capture:!0})},0);const n=S("name")&&S("name").toLowerCase()!=="undefined"&&S("name")!==""?S("name").split(" ")[0]:"Reader",i=S("token"),a=i&&i.trim()!==""&&!i.includes("amp-");let r=null;if(a){const c=e.afterArticleBanner.benefit_id;r=await Be(c,i,!0)}return r?wo(r.deliveredAt)?(b.dispatch({unlockContainer:!0}),vt(e,r,n)):(console.log("Voucher is expired"),Bo(e,n,i,t)):d("div",null)},Po=e=>{var a,r;const t=(a=e==null?void 0:e.popupGOT)==null?void 0:a.heading,o=(r=e==null?void 0:e.popupGOT)==null?void 0:r.benefits,n=(o==null?void 0:o.split(","))||[],i=(c,s)=>{let l=ne(c,"popupGOT","Click"),p=s==null?void 0:s.target,u=p==null?void 0:p.innerText;l.clickIdentifier=u;try{re("EchoActivity",c,"popupGOT","Click",u),te("EchoActivity",l,"event")}catch(m){console.error("Error in tracking:",m)}try{ssoGotPopUp()}catch(m){console.error("Error in setting funnel entry SDK:",m)}};return e.popupGOT.control_type==="customHtml"&&e.popupGOT.HTMLFile?d("div",null):e.popupGOT.creativeURL===""?d("div",null,d("a",{onclick:c=>i(e,c),class:"lh_echoSDK_gotPopup lh_echoSDK_gotAnimation","data-google-interstitial":"false"},d("img",{src:"https://images1.livehindustan.com/lh/cdp/staticImages/lh_get_pop_icon.png",class:"lh_echoSDK_handIcon",width:"88",height:"92",alt:""}),d("h3",null,t),d("ul",{style:"margin: 0px;"},n.map((c,s)=>d("li",{key:s},d("img",{src:"https://images1.livehindustan.com/lh/cdp/staticImages/lh_right_tick.png",width:"24",height:"24",alt:""})," ",c.trim())))),d("div",{class:"lh_echoSDK_gotPopup lh_echoSDK_profile_arrow"}),d("a",{class:"lh_echoSDK_gotAnimation","data-google-interstitial":"false"},d("div",{class:"lh_echoSDK_eg_profile_mb"},d("div",{class:"lh_echoSDK_profile_inner"},d("div",null,d("img",{src:"images/got/lh_user_logo.png"})),d("div",null,"Sign In")))),d("div",{class:"lh_echoSDK_gotOverlay"})):d("div",null,d("div",{class:"echoSDK_gotPopup echoSDK_gotAnimation"},d("img",{class:"echoSDK_w100",src:e.popupGOT.creativeURL,alt:""})),d("div",{class:"echoSDK_gotOverlay"}))},jo=new Map,Wo=(e,t="Standalone",o)=>{const n="parentVoucherMyhtCarousel",i="voucherMyhtCarousel",{isMobile:a}=Te();if(a&&t==="Carousel"&&bt(e,i,o,jo),a&&t==="Carousel"){const r=performance!=null&&performance.now?performance.now():Date.now(),c=`${n}-${Date.now()}-${r.toString().replace(".","")}`;return d("div",{class:`slider-container slider-container-${c}`,id:`slider-${c}`,"data-carousel-id":c,"data-carousel-data":i},e==null?void 0:e.map((s,l)=>d("div",{class:`slide slide-${c} slide-${l}`,key:l,id:`${n}-${c}-${l}`,"data-slide-id":`${c}-${l}`,onclick:()=>{yt(s,i,`slider-${c}`,`${n}-${c}claimedDiv-${l}`)}},d("a",{class:"echoSDK_a","data-action":"click","data-google-interstitial":"false"},d("div",{style:{position:"relative",display:"inline-block"}},d("div",{id:`${n}-${c}claimedDiv-${l}`,style:{display:s!=null&&s.isVoucherClaimed?"":"none"},class:"echoSDK_styledClaimed"},d("div",{class:"echoSDK_claimedIconDiv"},d("img",{src:"https://www.hindustantimes.com/static-content/1y/ht/personalisation/tick.png",alt:"Claimed tick"})),d("div",{class:"echoSDK_claimedTextDiv"},d("img",{src:"https://www.hindustantimes.com/static-content/1y/ht/personalisation/Claimed.png",alt:"Claimed"}))),d("img",{src:s==null?void 0:s.creativeURL,alt:"",class:"echoSDK_carouselImage"}))))))}else return d("div",{id:n})},qo=e=>{var t,o;return Array.isArray(e)&&e.length>1&&((o=(t=e[0])==null?void 0:t.inventoryType)==null?void 0:o.trim().toLowerCase())==="carousel"},Go=e=>Array.isArray(e)&&e.length===1?e[0]:e;class oe{constructor(t){this.label=t,this.startTime=null}start(){return this.startTime=performance.now(),this}stop(){if(!this.startTime)return 0;const t=performance.now()-this.startTime;return console.log(`[Echo SDK] ${this.label}: ${t.toFixed(2)}ms`),this.startTime=null,t}}const zo=new oe("Total Initialization").start();(function(e){const t=new oe("Queue Setup").start();var o=e.app||{},n=[];o.q&&Array.isArray(o.q)&&(n=o.q,n.length>0&&console.log(`[Echo SDK] Found ${n.length} queued commands before initialization`)),e.app={q:n,render:function(){return n.push(Array.from(arguments)),n.length>50&&console.warn(`[Echo SDK] Warning: Queue size has grown to ${n.length} items - possible implementation loading issue`),Promise.resolve()}},t.stop()})(window);const fe={render:async function(e,t=null){var U,K,P,j,We,se,kt,St,Tt,xt,Ct;const o=new oe("Render Execution").start(),{ssoTarget:n=document.getElementById("ssoSDKSignIn"),voucherTarget:i=document.getElementById("ssoSDKSignIn"),property:a,platform:r,language:c,isSubscribed:s,isLoggedin:l,pageType:p,contextualKeys:u,section:m,subsection:g,popupGOT:y,afterArticleBanner:f,isPremium:k,isAffiliate:v,performanceType:A,voucherMyhtC
2arousel:H=document.getElementById("ech_voucher_carousel_claim_more"),userSource:R}=e;b.dispatch({property:a,platform:r,language:c,ssoTarget:n||document.getElementById("ssoSDKSignIn"),voucherTarget:i||document.getElementById("ssoSDKSignIn"),isSubscribed:s,isLoggedin:l,contextualKeys:u,pageType:p,section:m,subsection:g,isPremium:k?String(k):"FALSE",isAffiliate:v?String(v):"FALSE",performanceType:A||"",promoSdkType:"confettiPopup",userSource:R}),Jo.stop();const M=new oe("API Request").start(),C=new Set,L=new Set,{isMobile:D}=Te();B(F);const I=await Xe();b.dispatch({clientHints:I});let h;if(t&&Object.keys(t).length>0?h=t:h=await ot(I),M.stop(),!h)return Ce(),o.stop(),console.log("No response from Benefit API");await Ft(h),Object.keys(h).forEach(w=>{h[w]=Go(h[w])});const Z=new oe("Widget Rendering").start();if(h.bottompopup&&D){const w=Array.isArray(h.bottompopup)?h.bottompopup:[h.bottompopup],x=w.length>1&&((K=(U=w[0])==null?void 0:U.cta)==null?void 0:K.ctaType)==="pollingVoucher",O=w.length===1&&((j=(P=w[0])==null?void 0:P.cta)==null?void 0:j.ctaType)==="pollingVoucher"&&((We=w[0])==null?void 0:We.control_type)==="sdkOnLoad";x||O?setTimeout(()=>uo(w),500):await tt({bottompopup:h.bottompopup})}if(!h.bottompopup&&h.bottompopup1&&h.bottompopup2){const{triggerCriteria:w,autoClose:x,delayBy:O,scrollPercentage:_}=h.bottompopup1||h.bottompopup2,$=document.createElement("div");$.id="ECHO_LH_POPUP",$.style.opacity="0",$.style.visibility="hidden",$.style.transition="opacity 0.01s ease-in-out";const z=async()=>{const E=await Vo(h);$.append(E),document.body.appendChild($),$.style.opacity="1",$.style.visibility="visible",dt("bottompopup1",h),dt("bottompopup2",h);const V=Number.parseInt(x);x&&!isNaN(V)&&V>0&&setTimeout(()=>{$.style.opacity="0",setTimeout(()=>$.style.visibility="hidden",500)},V*1e3)};et(w,_,O,()=>{z().catch(E=>console.error("Multi popup processing error:",E))})}if(!h.bottompopup&&!h.bottompopup1&&!h.bottompopup2&&Ce(),h.sidestickyopenapp){const{triggerCriteria:w,autoClose:x,delayBy:O,widgetCssSelector:_=q(h.sidestickyopenapp).widgetCssSelector,control_type:$,HTMLFile:z,templateHTML:E,scrollPercentage:V}=h.sidestickyopenapp;if(_){const Le=document.querySelectorAll(`#${_}`);if(!Le)console.log("No element found with selector:",_);else{let N=Le[Le.length-1];if(N)try{N.style.opacity="0",N.style.visibility="hidden",N.style.transition="opacity 0.01s ease-in-out";let W=je(h,"sidestickyopenapp");ke(N,w,V,async()=>{$==="customHtml"&&z?Y(z,N,W):$==="templates"&&E?await ue(h,E,N,W,"sidestickyopenapp"):(N.innerHTML="",N.appendChild(W))}),ke(N,w,V,()=>{const Ie=w==="add_some_delay"?Number.parseInt(O)*1e3:0;setTimeout(()=>{var ye,be,_e;N.style.opacity="1",N.style.visibility="visible";const ge={enableAdRefresh:(ye=h.sidestickyopenapp)==null?void 0:ye.enableAdRefresh,maxRefreshes:(be=h.sidestickyopenapp)==null?void 0:be.maxRefreshes,minRefreshInterval:(_e=h.sidestickyopenapp)==null?void 0:_e.minRefreshInterval};Pe(W,"sidestickyopenapp",h,ge)},Ie);const le=Number.parseInt(x);x&&!isNaN(le)&&le>0&&setTimeout(()=>{N.style.opacity="0",setTimeout(()=>N.style.visibility="hidden",500)},Ie+le*1e3)})}catch(W){console.error("Widget Processing Error:",W)}}}}if(h.popupGOT&&y){const{campaign:w,benefit_id:x,cohort:O,bucketNumber:_,control_type:$,HTMLFile:z}=h.popupGOT;localStorage.setItem("lh_cdp_echo",JSON.stringify({campaign_name:w,campaignId:x,cohort:O,bucket:_}));const E=new Date(new Date().setHours(24,0,0,0)-new Date().getTimezoneOffset()*6e4).toUTCString();X("lh_cdp_echo_campaignId",x,"expires="+E),X("lh_cdp_echo_campaignName",w,"expires="+E);const V=Po(h);$==="customHtml"&&z?Y(z,y,V):y.append(V),pe(V,"popupGOT",h)}if(h.afterArticleBanner&&f){const w=await Fo(h,f),{control_type:x,HTMLFile:O}=h.afterArticleBanner;x==="customHtml"&&O?Y(O,f,w):f.append(w),pe(w,"afterArticleBanner",h)}if(h.voucherMyhtCarousel&&H){const w=Array.isArray(h.voucherMyhtCarousel)?h.voucherMyhtCarousel:[h.voucherMyhtCarousel],x=await fo(),O=So(w,x);if(Array.isArray(O)){const _=Wo(O,"Carousel",L);H.append(_)}}const G=["bottompopup","sidestickyopenapp","voucherconfetti","voucherMyhtC
2arousel"],J=(St=(kt=(se=Object.entries(h))==null?void 0:se.map(([w,x])=>{if(!x)return null;if(Array.isArray(x)){const O=x.map(_=>({..._,key:w}));return{key:w,value:O}}return{key:w,value:{...x,key:w}}}))==null?void 0:kt.filter(w=>!G.includes(w.key)))==null?void 0:St.filter(w=>{var x,O;return w?Array.isArray(w.value)?w.value&&((x=w==null?void 0:w.value)==null?void 0:x.some(_=>q(_).widgetCssSelector!=="")):w.value&&((O=q(w.value))==null?void 0:O.widgetCssSelector)!=="":!1});for(const{key:w,value:x}of J){const{widgetCssSelector:O}=q(Array.isArray(x)?x[0]:x);let _=Array.isArray(x)?x[0]:x;const $=qo(x);if(_&&O){const z=document.querySelectorAll(`#${q(_).widgetCssSelector}`);if(!z){console.log("No element found with selector:",(Tt=q(_))==null?void 0:Tt.widgetCssSelector);continue}let E=z[z.length-1];if(E)try{let V={};((xt=h[_.key])==null?void 0:xt.control_type)==="iconAndName"&&(V=await $e());const N=(((Ct=_.widget)==null?void 0:Ct.widgetFEName)||"").startsWith("BottomNav");E.style.opacity="0",E.style.visibility="hidden",N||(E.style.transition="opacity 0.01s ease-in-out");const W=$?je(h,_.key,V,"Carousel",C):je(h,_.key,V);ke(E,_.triggerCriteria,_.scrollPercentage,async()=>{_.control_type==="customHtml"&&_.HTMLFile?Y(_.HTMLFile,E,W):_.control_type==="templates"&&_.templateHTML?await ue(h,_.templateHTML,E,W,_.key):(E.innerHTML="",E.appendChild(W))});const Ie=()=>{var ye,be,_e;const le=_.triggerCriteria==="add_some_delay"?Number.parseInt(_.delayBy)*1e3:0;if(_.triggerCriteria==="on_scroll"){if(!$){const De={enableAdRefresh:(ye=h[_.key])==null?void 0:ye.enableAdRefresh,maxRefreshes:(be=h[_.key])==null?void 0:be.maxRefreshes,minRefreshInterval:(_e=h[_.key])==null?void 0:_e.minRefreshInterval};Pe(W,_.key,h,De)}}else setTimeout(()=>{var De,At,Lt;if(E.style.opacity="1",E.style.visibility="visible",!$){const Qo={enableAdRefresh:(De=h[_.key])==null?void 0:De.enableAdRefresh,maxRefreshes:(At=h[_.key])==null?void 0:At.maxRefreshes,minRefreshInterval:(Lt=h[_.key])==null?void 0:Lt.minRefreshInterval};Pe(W,_.key,h,Qo)}},le);const ge=Number.parseInt(_.autoClose);_.autoClose&&!isNaN(ge)&&ge>0&&setTimeout(()=>{E.style.opacity="0",setTimeout(()=>E.style.visibility="hidden",500)},le+ge*1e3)};ke(E,_.triggerCriteria,_.scrollPercentage,Ie)}catch(V){console.log("Widget Processing Error:",V)}}}Z.stop(),o.stop()}};window.registerApp?window.registerApp(fe):window.app=fe,function(e,t){const o=new oe("Queue Processing").start();var n=e.app.q||[];n.length>0&&console.log(`[Echo SDK] Processing ${n.length} queued commands`);for(let i=0;i<n.length;i++){const a=new oe(`Queue Command #${i+1}`).start(),r=n[i];if(r&&r.length)try{t.render.apply(t,r)}catch(c){console.error(`[Echo SDK] Failed to process queued command #${i+1}:`,c)}else console.warn(`[Echo SDK] Invalid queued command at position ${i+1}`);a.stop()}o.stop(),e.app=t}(window,fe),zo.stop();const Jo=new oe("App Render").start();return fe});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.